Skip to content
jeffrafter edited this page Sep 14, 2010 · 12 revisions

Mateme is a simple patient registration application written in Ruby on Rails and is intended as a web front end for OpenMRS.

OpenMRS® is a community-developed, open-source, enterprise electronic medical record system framework. We’ve come together to specifically respond to those actively building and managing health systems in the developing world, where AIDS, tuberculosis, and malaria afflict the lives of millions. Our mission is to foster self-sustaining health information technology implementations in these environments through peer mentorship, proactive collaboration, and a code base that equals or surpasses proprietary equivalents. You are welcome to come participate in the community, whether by implementing our software, or contributing your efforts to our mission!

Mateme was built by Baobab Health and Partners in Health in Malawi, Africa. It is licensed under the Mozilla Public License.

Getting Started

First you will want to download the latest version of the code. This is typically done with git, but you can also download the tarball or zip.

mkdir /var/www/mateme cd /var/www/mateme git clone git://github.com/baobab/mateme.git

Next you will need to setup the database. If you do not have a database for OpenMRS yet, you will need to download the latest version of the schema and upgrade script. You can download this from the OpenMRS website. Be careful with this script though, if you have an existing openmrs database it will delete it and re-create it. Once you have that you will need to upgrade to the latest version of OpenMRS using the file update-to-latest-db.mysqldiff.sql which is also available on the OpenMRS website.

Once you have the openmrs database created you will need to add some Mateme specific changes:

mysql -u root openmrs < db/migrate/alter_global_property.sql mysql -u root openmrs < db/migrate/create_sessions.sql mysql -u root openmrs < db/migrate/create_weight_for_heights.sql mysql -u root openmrs < db/migrate/create_weight_height_for_ages.sql mysql -u root openmrs < db/migrate/create_person_name_code.sql mysql -u root openmrs < db/migrate/alter_drug_and_drug_ingredient.sql mysql -u root openmrs < db/migrate/alter_observation_to_add_value_location.sql

These changes are all non-destructive for your existing OpenMRS installation.

If you are developing Mateme, you will want to create a scratch database for testing and development:

echo “DROP DATABASE IF EXISTS openmrs_test;” | mysql -u root echo “DROP DATABASE IF EXISTS openmrs_development;” | mysql -u root echo “CREATE DATABASE openmrs_test;” | mysql -u root echo “CREATE DATABASE openmrs_development;” | mysql -u root

Next you will want to dump the schema from your primary OpenMRS database and load it into your development and testing databases:

mysqldump -u root openmrs —no-data > db/schema.sql mysql -u root openmrs_test < db/schema.sql mysql -u root openmrs_development < db/schema.sql

Finally you will want to copy the example database settings as your configuration:

cp config/database.yml.example config/database.yml

Bootstrapping

You will want to load defaults for locations and sample weight and height data into the development database:

rake openmrs:bootstrap:load:defaults RAILS_ENV=development rake openmrs:bootstrap:load:site SITE=nno RAILS_ENV=development rake db:fixtures:load RAILS_ENV=development

Running

To run the application you can go to the main folder and run:

script/server

At that point the default server will be installed and you can point your browser to http://localhost:3000.

Logging in

By default you should be able to login with the user name mikmck and the password mike and the location 7 (the registration desk).

Clone this wiki locally