Updating the OpenMRS concept dictionary

Getting the concept dictionary

Andy Kanter will announce new concept dictionary releases, detailing the changes that the new release has, here. The file (a .sql zip file) will be dropped on a shared dropbox folder, called OpenMRS (to get access to it, email andrew.kanter@dbmi.columbia.edu - see more details on this process here).

Once you have access to the dropbox folder, you’ll see a number of zip files within the folder entitled openmrs_concepts_x.xx.x_yyyymmdd.sql.zip, where x.xx.x indicates the version number of OpenMRS you are using and the date matches the date of the dictionary release. You can use the 1.9.x version for all OpenMRS versions of 1.9. The same is true for 1.11, with 1.11.x covering 1.11.5, which is the version of OpenMRS that we use for OpenSRP demo server. Download the version that matches your OpenMRS instance and then unzip the file.

Updating the concept dictionary

First, you will need to copy this file to the server, using command: 

scp openmrs_concepts_x.xx.x_yyyymmdd.sql root@46.101.51.199:/root

NB: This command dumps the file in the root folder, but this can change as you wish, just note that once you copy it, you will need to know where it is, so you can access it later. Make sure to replace x.xx.x and yyyymmdd with the version number and date of the file you downloaded from the dropbox folder. Replace the root url with the url of your OpenMRS server instance. These apply for all commands below as well.

Once you copy the file to the server, log in to the server, using command:

ssh root@46.101.51.199

Remember, your PC’s ssh keys should have been added to the list of PCs that can access the server in order for you to have access to the server through ssh. If you need this done on the Ona server, email: jmaina@ona.io.

Once logged in to the server, make sure to do a backup of the mysql database:

mysqldump -u root -p openmrs > openmrsconceptsupdate17July2015.sql

You will be requested to provide the mysql password to be able to backup the database.

NB: Update the date of the backup with the current date.

Once you get the dump file, you can move it to the backups folder, using command:

mv openmrsconceptsupdate17July2015.sql backups/

NB: On both commands above you will need to update the dates to the date of updates.

We can now update the dictionary .sql file (remember we can always revert back to the previous database state, because we made a backup).

To update the database with the new dictionary, use command:

mysql -u root -p openmrs < openmrs_concepts_x.xx.x_yyyymmdd.sql

You will be requested to provide the mysql password again.

If you log in to your OpenMRS instance, under the Dictionary tab, you can search for the new concepts to confirm that the changes reflect as expected.

NB: In some cases you might need to restart tomcat to see the changes, using the command:

sudo service tomcat6 restart

Adding additional languages to the concept dictionary

If your team has provided translations for new concepts in the local language that were added to the dictionary, you will need to add this language to the OpenMRS global properties list before you can see the language in the dictionary tab. Check out this article on the OpenMRS wiki (see section Setting the available locales) for instructions on how to do this: https://wiki.openmrs.org/display/docs/Localization+and+Languages.