Sunday, August 27, 2017

DHISReport Reporting Enhancements - GSoC 2017

Pull Request : https://github.com/openmrs/openmrs-module-dhisreport/pull/64

Alternative link to complete project
Drive Link : https://drive.google.com/drive/folders/0B8DTz54Fb0v5WV83RUFrRTdHcWs?usp=sharing

Commits (Not the complete projects) : https://github.com/Choxmi/openmrs-module-dhisreport/commits/master?author=choxmi

Other Pull Requests :
PR for DRM-28 : https://github.com/openmrs/openmrs-module-dhisreport/pull/62
PR for DRM-09 : https://github.com/openmrs/openmrs-module-dhisreport/pull/61

Issues created : AC-395, AC-399, REPORT-812, REPORT-828

Documentation : https://wiki.openmrs.org/display/docs/DHIS+Report+Module#DHISReportModule-3.4ReportMapping

Demonstration :


Summary of the work completed

Primary objective of my project was to map reporting module report indicators with DHIS data elements. Following post is to showcase the work I completed during during my GSoC period.

Primary Objectives
List of report indicators - Added all report indicators of the reporting module report which is going to map with the DHIS report as a drop down list and a map button to each Data element of the report.
Map with SQL Cohort indicators - SQL Cohort reports can be mapped with the data elements and those queries _can be customized directly_ from DHISReporting module.
Map with other indicators - Other report indicators also can be mapped with data elements but it will not allow to edit the query. Instead, it will disable the editing funtionality.
Generate mapped report - The report get generated with the result of mapped indicators. In case if the report contains the queries retrieved from the DHIS instance instead of mapping with any indicator, that particular data element will use that query to generate result.

Other/Extra Objectives
Revert back to DHISQuery - This allows to revert back to the first query which retrieved from DHIS instance. If the query doesn't exist, it will revert back to the first sql query mapped with that data element.
Display mapping - Mapping will we displayed on mapping section, query editing section and will be displayed on report request page as well.
Adding to reporting module history - While a mapped DHISReport execute, reporting module report also get executed in order to get results. It creates a record in reporting module which will help to identify the time it generated and more details about the report.
Link report history to generated report - Added the link of the report history to the generated report.
Generate by preference - As described earlier, a report can be mapped with a SQL Cohort report. In that case, user can edit the SQL query as well. Then there will be _two mappings at the same time_. One is the SQLCohort mapping exactly same as the reporting module. And the other one is the edited sql query. In that case with this functionality, the user can render the report by giving priority to any section. If it renders with the priority to report module mappings, it will give the result of original SQLCohort or if the priority is sql, it will render the report with priority to sql and will give the result of edited sql query.
Delete report queries and remove mapping - This allows the user to delete sql queries directly from the sql editing interface. It will remove the mapping and the query both.
Handle un-mapped definitions - There are two possible cases to cause un-mapped definitions. Some data elements may not have sql queries at the time they get imported or user may have deleted the query. To avoid crashes, those un-mapped reports are now handled properly. All of them will be indicated in red and it won't allow to generate the report and will show those data elements. Those will be indicated clearly on mapping section as well.


Weekly Blog Posts :
Week1 , Week2 , Week3 , Week4 , Week5 , Week6 , Week7 , Week8 , Week9 , Week10 , Week11 , Week12