There is several database changes that are likely to fail while attempting to upgrade from a pre 1.10 to a 1.10 or later version if an implementation has orders stored in the database. Below are some key conditions that need to be satisfied before attempting an upgrade because they are guaranteed to halt the upgrade if they are not.
Preparing for the upgrade
Add global property for drug dosing units with name order.drugDosingUnitsConceptUuid and the value should be the uuid of the concept set where its members represent the possible drug dosing units. In CIEL version 1.9.7_20140608 the concept id is: 162384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA (Dose unit). It is used too validate the dose units mappings made via the order_entry_upgrade_settings.txt file.
If you have other order type row entries in the order_type table other than the one for Drug orders, then add the java_class_name and parent columns using the sql below:
ALTER TABLE `order_type` ADD COLUMN `java_class_name` VARCHAR(255) DEFAULT NULL, ADD COLUMN `parent` INT(11) DEFAULT NULL;
The java_class_name column is required, the upgrade scripts will set a not null constraint on the column and will set the java_class_name column for the drug order type row as long as its uuid has never been changed from 131168f4-15f5-102d-96e4-000c29c2a5d7.
The scripts will also add a foreign key constraint on order_type.parent column which references the order_id column
For all order types that are not Drug order, set their java_class_name column values, the values should match a valid fully qualified java class name which must be available at runtime, see an example SQL script below for how to set it for each row:
Code Block language sql
UPDATE `order_type` SET `java_class_name` = 'org.openmrs.TestOrder' WHERE name ='Lab test';
- Create the mappings file to concepts for all existing free text frequencies and dose units, this can be done via either of the options below:
- Using the 1.10 upgrade helper module
- Manually create the mapping file
- Create a file in the application data directory named order_entry_upgrade_settings.txt
Get all the existing frequencies and dosing units for existing drug orders in the database using the SQL queries below:
Code Block language sql title Get all free text dose units
SELECT DISTINCT units FROM drug_order WHERE units IS NOT NULL
Code Block language sql title Get all free text frequencies
SELECT DISTINCT frequency FROM drug_order WHERE frequency IS NOT NULL
Set the contents of the file in a properties file format as shown below and save the changes. You might want to leave no trailing white space characters at the end of each line and also to escape white spaces in the frequencies as shown below.
Code Block title Example
mg=13 ounces=46 once\ a\ day=65
Upgrading from an earlier platform like 1.6.x
The above guide may demand either upgrading from an earlier version such as 1.6.6 to 1.9.x (which creates the providers table) and then from 1.9.x to 1.10.x or 1.11.x
The MoH Rwanda upgrade lead has written a module that handles all these requirements/steps so that the user only has to install it before upgrading and do nothing else as suggested by this page but go straight to the upgrade steps.
This module supports upgrading from 1.6.x on which it has been tested to 1.11.x
- Ensure that you are running Java 8
- If upgrading from 1.9, first go through the steps at https://wiki.openmrs.org/x/OALpAw
- If you plan to use the legacy user interface, put the legacyui module in your modules folder.