Spreadsheet Import Module Version 2

Several changes have been made to this module in this version.

  1. The module works only with OpenMRS 1.9.0, no other version because this module inserts directly into the database
  2. The module now provides an option to create an encounter for each import
  3. You can now import coded concepts
  4. There is validation of all values of excel before any importing is done
  5. You can create an import template from a form in OpenMRS
  6. You can update an encounter previously entered by using the output excel file and entering new data into it

The version of the spreadsheet import module which works with previous version of OpenMRS is a child page to this one


  1. For dates, the excel spreadsheet must be formatted to datetime (The module uses apache poi acl library to detect the format to the date)
  2. You must have a patient identifier, as well as date of birth or gender in each import to be able to create a new patient if they don't exist
  3. If you're importing creating an encounter, then one of the columns of the import and excel must be Encounter ID

Things to know

  1. When selecting the concept name for which to import, all concepts in the different languages will be displayed and you will need to choose from those names
  2. All column names in the import module must match exactly those in the excel
  3. The encounter_datetime entered is the earliest of all obs_datetimes. If no obs_datetime is entered, then it uses the current datetime


  1. Create a new import by either checking the Create an encounter for every imported line, selecting the form, then click Create Template from Form
    1. For every observation, it will automatically insert an obs datetime column, which you can delete if you won't be inserting an obs datetime
  2. Place the name of the column, the type of data and the dataset index for each column.
    1. If you import encounter, then each obs needs to have a unique Dataset Index (See Image for Step 1)
    2. If you don't import an encounter then the Dataset Index will only be used if you have multiple observations for a single concept e.g. weight 1, weight 2, and weight 3.
  3. Click on Next Step to go to Step 2
  4. Select the location and other parameters from the form. If you see that a single line has more than one concept, then you need to go back to Step 1 and set the Dataset Index to a different number between the two concepts

Step 1

Step 2

To create a new patient or place data in a current patient the module, it uses the patient identifier to search for existing patient.

  1. If it finds that patient ID it uses that person.
  2. If it doesn't t find that patient id, it searches given name, family name, middle name, birthdate, gender, if matches then create a new patient identifier for that patient and import data
  3. If it doesn't match in all those things, then it creates a new patient with ID