GSoC 2021: Export & import feature for the OMRS Reporting module

 

Primary mentor

@Kaweesi Joseph

Backup mentor

@Daniel Kayiwa

Assigned to

@Heshan Andrews

Abstract

DHIS mappings are created in OpenMRS instances to keep information about how period indicator reports are mapped with DHIS data elements. Previously the DHIS connector module had the functionality to export these mapping files but they were not usable in different OpenMRS instances because the mapped period indicator reports are required to be present in the system. Thus this project was proposed to introduce a new feature to bundle up period indicator reports and other underlying reporting metadata with the DHIS mappings on the mapping export and import the same type of bundles back in.

Main objectives

  • Improve export DHIS mappings function to include period indicator reports with other related reporting metadata.

  • Improve import DHIS mappings function to persist period indicator reports and other underlying reporting metadata.

Additional objectives

  • Simplify the user experience by improving manage mappings user interface to handle every DHIS mapping-related function.

  • Handle metadata UUID conflicts by letting the users pick the action for such cases.

  • Improve the export function to have the option to export mappings without period indicator reports.

Technical details

The metadata that is exported with the mappings include, 

  • Period Indicator Reports

  • Indicators 

  • Dimensions 

  • Cohort Queries

The cohort queries may belong to the indicator or the dimension or the period indicator report itself if that report indicator is made with a cohort query. 

These reporting metadata are ultimately stored inside OpenMRS as serialized objects in the SerializedObjects database table. To provide a solution for the exporting objective, the serialized objects table was queried by making a function in the hibernate implementation file and the content was written into XML files in order for them to be able to be downloadable files. 

Another function was written to get the imported XML files as a multipart file and extract it and then convert the XML files into serialized object java data types and pass down to the DAO layer, where another hibernate function has been implemented to save the serialized objects into the corresponding table.

https://github.com/openmrs/openmrs-module-dhisconnector/blob/0c5253553fd7c472c8da74a0cb1edb37b441eb52/api/src/main/java/org/openmrs/module/dhisconnector/api/impl/DHISConnectorServiceImpl.java#L840-L948

Project Champions

  • @Kaweesi Joseph @Mike Seaton,  @Jayasanka Weerasinghe@Grace Potma

Requirements

  • Programming fundamentals

  • Java

  • SQL

  • OpenMRS data model & API

  • OpenMRS DHIS connector module

  • OpenMRS reporting module

Resources