Skip to content
Matias Tudurí edited this page Oct 12, 2017 · 7 revisions

A Tu Servicio

System of data visualization of the National Integrated Health System developed by DATA in agreement with the DGSNIS of the Ministry of Public Health with the support of the Latin American Initiative for Open Data ILDA.

REQUIREMENTS

  1. Postgresql
  2. Ruby 2.2.4
  3. Bundle
    • $gem install bundler --conservative
  4. NodeJS
    • $apt get install -y nodejs npm

INSTALLATION

  1. $git clone https://github.com/idatosabiertos/ATuServicio.git
  2. $cd ATuServicio
  3. $bundle install
  4. $rake db:create db:migrate importer:all[year]
  5. $bundle exec puma -C config/puma.rb
  6. Navigate to http://localhost:3000

Vagrant /vagrant

REQUIREMENTS: Vagrant && VirtualBox

  1. $git clone https://github.com/idatosabiertos/ATuServicio.git
  2. $cd ATuServicio/vagrant
  3. $vagrant up
  4. Navigate to http://localhost:8080

Environment Variables

PUMA server, more info

  • PORT - default value is 3000.
  • WEB_CONCURRENCY - default value is 2.
  • MAX_THREADS - default value is 5.

RACK_ENV = production (default value is development)

  • ATUSERVICIO_DB - name of the database.
  • ATUSERVICIO_DB_USER - user name of the database server.
  • ATUSERVICIO_DB_PASSWORD - password of the database server.
  • ATUSERVICIO_DB_HOST - name or IP of the host where the database server is located.

Database Diagram /db/schema.rb

alt text

### Provider
Refers to the Health Service Provider (eg ASSE, Spanish, Casmu, etc.).

### Sites
Contains the sites of each health care provider.

### States
Contains the departments of Uruguay, which correspond to the location of each site.

## Provider Maximus 
Maximum values ​​of each provider for comparison on the homepage.

DATA

The data used is extracted annually from the open data catalog of Uruguay.
For more information about the meaning of each indicator, review the methodological guide.

CSV Files

  1. structure.csv Supplier structure data. Used to import providers (ASSE, Espanola, Casmu, etc.), maped to object Provider.
  2. host.csv Host data (id, address, department, locality, level, services), Data maped to object Site.
  3. goals.csv Assistance goals (percentage of affiliates, etc.). Data maped to object Provider.
  4. prices.csv Tickets prices for medicines, consultations, others. Data maped to object Provider.
  5. wait_times.csv Wait times. Maped object Provider.
  6. satisfaccion_derechos.csv Satisfaction of user rights (conformity with availability, evaluation of waiting times, etc.). Data maped to object Provider.
  7. rrhh.csv Human resources, general practitioners, family, etc. Data maped to object Provider.
  8. request_consultations.csv Request for consultations (reservation face-to-face, telephone, web). Data maped to object Provider.

Mapping CSV - Database

Under /config/metadata.yml we find the mapping of the columns of each CSV to its corresponding table in the database, where for each file you have:

   * title - CSV file name (Example:" Structure "," Assistance Goals ").
   * description - Name of the column in the CSV.
   * columns - Name of the column in the object (and the DB).
   * definition - The types of each column (text, boolean, decimal, etc).

Importing Data

Under lib / directory, there is a script convert.sh that converts all CSV files from your encoding to an utf-8 encoding for Ruby. It is important to be careful with commas and / or semicolons that are used especially in column separators and decimals.

Data migration

The CSV files used for each year are stored in /db/data, as well as the migration scripts used to contemplate the changes in that data for each year are in /db/migrate.

Logos for each health care provider

Logos must be stored into app/assets/images/logos directory in the following format:

"# {provider.id} -only-lower-letters.png"  

PNG files name only letters (without accents or symbols) and separated from the provider ID (for convenience).
Eg .: 1062-Circulo-Catolico.png

Dependencies

ATuServicio uses source code from the following projects:

jQuery JavaScript Library

http://jquery.com/

Includes Sizzle.js
http://sizzlejs.com/

Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
Released under the MIT license
http://jquery.org/license

jQuery UI Core

http://jqueryui.com

Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license

http://api.jqueryui.com/category/ui-core/

jQuery UI Widget

Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license

http://api.jqueryui.com/jQuery.widget/

jQuery UI Position

http://jqueryui.com

Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license

http://api.jqueryui.com/position/

jQuery UI Menu

http://jqueryui.com

Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license

http://api.jqueryui.com/menu/

jQuery UI Autocomplete

http://jqueryui.com

Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license

http://api.jqueryui.com/autocomplete/

Intro.js

https://github.com/usablica/intro.js

MIT licensed

Copyright (C) 2013 usabli.ca - A weekend project by Afshin Mehrabani (@afshinmeh)

Bootstrap v3.3.6

http://getbootstrap.com

Copyright 2011-2015 Twitter, Inc.
Licensed under the MIT license

Sizzle CSS Selector Engine

http://sizzlejs.com/

Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
Released under the MIT license
http://jquery.org/license

Continuous Integration

ATuServicio uses Travis CI, continuous integration to corroborate that the project is constructed correctly in each push.