Google Summer of Code with OpenMRS — Final Report
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.

Project:
Built-in reports for Reference Application
Overview:
- Primary Mentor: Rafal Korytkowski
- Backup Mentor: Stephen Senkomago Musoke
- Student: Jude Niroshan
Final Presentation (OpenMRS talk thread post):
Project Goals:
- Define reports inside the OpenMRS server
- Access those reports through Reporting REST API
- Create a new Open Web App
- Visualize Data through charts
Basic Reports
- 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:
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.
Mid-term presentation
Basic Reports:
These are the report interfaces which are implemented inside the openmrs-owa-built-in-reports




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.
