Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There is are 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.

  • All existing free text drug order dose units and frequencies have been mapped to concept ids via the order_entry_upgrade_settings.txt file, you can use the Prepare For Upgrade To 1.10 Module to set the mappings.
  • All orders have start_date and encounter_id column values set
  • All drugs with a dose_strength specified have the units field set too.
  • If there any other any order types other than drug order, the order_type table is up to date i.e has the new columns java_class_name(required) and parent(optional), we will see later how to manually update the order type manually if there are other order types.
  • All discontinued orders should have the discontinued_date and discontinued_by fields set.
  • All users that created orders(orders.orderer) have provider accounts
  • If there any orders with no orderers, you are required to create a provider whose name is 'Unknown Provider' i.e provider.name column is set to Unknown Provider and not the name of the linked person record so that it is set as the default orderer a provider to serve as the "Unknown Provider" and set the global property "provider.unknownProviderUuid" to the uuid of this provider. (You will most likely need to create this global property, since it isn't added until 1.10.x)If you don't want it to default to Unknown Provider, you can manually set the values prior to the upgrade.

...

  • 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
    languagesql
    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:
    1. Using the 1.10 upgrade helper module
    1. Manually create the mapping file
      1. Create a file in the application data directory named order_entry_upgrade_settings.txt
      2. Get all the existing frequencies and dosing units for existing drug orders in the database using the SQL queries below:

        Code Block
        languagesql
        titleGet all free text dose units
        SELECT DISTINCT units FROM drug_order WHERE units IS NOT NULL


        Code Block
        languagesql
        titleGet all free text frequencies
        SELECT DISTINCT frequency FROM drug_order WHERE frequency IS NOT NULL


      3. 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
        titleExample
        mg=13
        ounces=46
        once\ a\ day=65


...