OpenMRS is an open source community driven software which can be used in clinical environments(specially for resource constrained). It has many functionalities and it is widely used across millions of users. As there are many users, product has different variants for different use cases. Typically those are known as distributions. OpenMRS keeps a general purpose distribution called Reference Application. This distribution comes with a modern UIs and most essential modules which needs to have for any clinic to manage the work.
It was suggested that to include reports which are out of the box for Reference Application which gives a better picture about the system data. So, this idea has turned out to be a Google Summer of Code project in 2017.
Built-in reports for Reference Application
- Define reports inside the OpenMRS server
- Access those reports through Reporting REST API
- Create a new Open Web App
- Visualize Data through charts
- Number or Visits
- Number of Patient Registrations
- Number of Admissions/Transfers/Discharges per service area
- Number of Visit Notes
- List of Diagnosis’s made and quantity
- List of Providers (grouped by active/retired)
- List of Users (grouped by active/retired)
- List of new Patient Registrations
- Patient Visit Report
Implementation in brief
Before starting any work, knowledge about the reporting module is essential to this project. The best time for this was the Community Bonding period. Within this period, basic reports were created by simply using the reporting module. This is purely a functional task which involved no coding work. This led the developer to get a clear picture of the existing module functionalities and how it should be used in order to achieve the project goals.
This was communicated in the first meeting with the mentors.
Defining reports inside the server would give a clear idea on what needs to be achieved. Therefore, development work was started by defining the reports inside reference application module. Once the module has deployed into a OpenMRS server, those defined reports has to be created automatically. It was realized that those report definitions actually needs to resides within the Reference MetaData module rather than Reference Application module. So, those developments were moved to this module.
Server side commits — ReferenceMetaData module:
- - Built-in reports for reference application · openmrs/openmrs-module-referencemetadata@78527d2
- built-in reports multiple rows reports test coverage · openmrs/openmrs-module-referencemetadata@625285e
- [RA-1386] Fixed the duplicate uuid for built-in reports excel report ... · openmrs/openmrs-module-referencemetadata@f4f7c7e
- Renamed the report column names and modified the tests accordingly · openmrs/openmrs-module-referencemetadata@5f9c68c
Client side — Open Web App:
Once this has completed, it was time to create a new Open Web App to access those reports and display them with rich graphical interface. This new web app makes calls through reporting REST API in the OpenMRS server.
Problems faced while development:
There was a build problem I was facing while implementing the unit tests.
I have spent some weeks struggling on getting the created_date into a cohort definition. Finally with the help from Mike Seaton I was able to find a solution.
When I was fetching the report data through Reporting REST API, I was facing some other problems to get the proper report data.
Passing Location as a parameter to some of my reports through Reporting REST had an issue. My mentor Rafal helped me to get through this problem.
These are the report interfaces which are implemented inside the openmrs-owa-built-in-reports
<<report screenshots will be attached here>>
Weekly blog posts:
- Week 1 — Implement reports inside reference application module
- Week 2 — Integration of Cohorts into reports
- Week 3 — Unit tests coverage for reports
- Week 4 — Create the Open Web App skeleton in ReactJS
- Week 5 — Fetch report data through Reporting REST API
- Week 6 — Issue in fetching report data in Reporting REST API
- Week 7 — Move server development to Reference MetaData module
- Week 8 — Create specialized React components for reports
- Week 9 — More React components
- Week 10 — React component unit test coverage
- Week 11 — CSS style modifications, improve code quality
- Week 12 — Improve code quality, write documentation
OpenMRS talk thread:
Since the day I decided to work on this project and being selected for Google Summer of Code 2017, all things can be tracked down in this thread post:
I would like to take this moment for say a big thanks to my mentor Rafal Korytkowski who gave me this wonderful opportunity to become a GSoC student and work on this cool project.
Also special thanks goes out to Akshika Wijesundara who supported me in lot of ways to get into this position. Without him, I wouldn’t have the privilege of becoming a GSoC student.