Improved Built-in Reports module — GSoC 2018 with OpenMRS

Google Summer of Code final report

Project : Improved Built-in Reports Module

  • Primary Mentor — Rafal Korytkowski
  • Backup Mentor — Joseph Kaweesi
  • Student — Jeyasumangala Rasanayagam

Introduction

The concept of the Built In Reports for OpenMRS Reference applications was initiated during the Google Summer of Code last year(2017) . The objectives achieved in Google summer of code 2017 were,

  • Reach out to implementations to determine the most useful reports to include in the module
  • Implement various reports using the Reporting module API
  • Access those reports through Reporting REST API
  • Create a new Basic Reports Open Web App UI
  • Add charts to visualize data for some of the implemented reports

Now it is the time to extend the features and improve the usability of this project. We need to improve the existing view of the reports and to add more new reports to this module which are crucial for administrative decisions within a clinical environment. There are some new objectives mentioned in the project scope which are completed during this summer period.

The objectives of this project(Google Summer of Code 2018) are:

  • Improve the existing Built In Report OWA issues and fix it to work properly (Headers, Breadcrumbs, and Routers)
  • Implement a new view which shows a very detailed view of a patient.
  • Add more information to improve the List of providers report. It should able to show the patients who worked with that providers also
  • Add improvements to the List of diagnosis report. It should also able to show the patients who affected by the respected diagnosis
  • Add improvements to the Number of Patient registrations.
  • Add improvements to the Number of Admissions reports.
  • Add improvements to the Number of Discharges reports.
  • Add improvements to the Number of Transfers reports.
  • Add improvements to the Number of Visits reports.
  • Add improvements to the Number of Visit notes reports.

I spent time to analyze the existing reports in the Built In reports, and prepared some ideas to improve those reports with some more information. I have added some of those ideas into my project proposal, and I was able to figureout some more ideas during the actual development time.

I am very happy to say. I was able to complete about the 95% of the objectives during the Google Summer of Code — 12 weeks of time.

Demo presentation for the Mid term

This was demonstrated by me for the OpenMRS mid term presentations, and hosted in the You Tube. You can see some of the work which I have completed during the second evaluations in this video presentation.


Implementation

Fix the issues in the Built In Reports OWA to work properly

The existing OWA was implemented with some issues in the headers, breadcrumbs, and the routings. So I have added the following fixes to the OWA,

  1. Added logout functionality through the OpenMRS REST services to the logout in the OWA.
  2. Added redirection from the My Account label to the OpenMRS account page.
  3. Added location switcher functionalities through the OpenMRS REST services to the OWA header. So users will able to switch the location through this OWA also.
  4. Added fix to fetch the default active session information from the appui/session to show the active location.
  5. Removed the hashRouter from the existing OWA, and replaced with the browserRouter to improve the routing functionalities.

Improvement to the List of Diagnosis report.

The List of Diagnosis report only shows the diagnosis name and the counts of the encounters in the view. So I was assigned to create, once a table row is being clicked, it should redirect to a new view which shows the patients who was recorded as this disease was affected. I have added following changes to this report,

  1. Added more information to the List of Diagnosis report(included diagnosis id and Uuid) which wanted to track the respected diagnosis.
  2. Added new report called “List of Patients for Diagnosis” which will show the patients who affected by the respected diagnosis.
  3. Changed the module — ReportAsTableView component to support the row clicks and auto redirections to the respected pages. So any of the reports in this module can use this customized component for the row click and redirections.
  4. Added redirections from the List of Patients for Diagnosis report to the patient dashboard. So the users can easily click on the patient name to go to the patient dashboard which will show more detail about the patient.
View of the improved List of Diagnosis report
View of the new List of patients affected by the diagnosis report

Improvements to the Number of Visits Report

The existing number of Visit reports was implemented to show only the total count of visits for the given date period. Actually this report did not contain the sufficient information to achieve the target of this module. So I decided to add more improvements as follows,

  1. The report table is customized to show the total number of visits grouped by visit types against the total counts.
  2. Location selector is added to this report. So the users can select the location to get the visits respected for that location.
  3. Pi chart was added into the bottom of the report to illustrate the table view as the Graph view to the user.
  4. Added Active visit switcher support to include the active visits or exclude the active visits into the report. So users can include the active visits which doesn’t have the end date up to the selected date to this report.
  5. Fixed the end date selection problem to support up to the end of the current day
Improved List of Visits report without Active visits
Improved List of Visits report with Active Visits

Improvement to the Number of visit notes

The number of visit notes report was implemented to show only the total number of visit notes for the given date period. It also not contains the sufficient information for a report. So I have added these following improvements to this report,

  1. The report table is customized to show the total number of visit notes grouped by visit types against the total counts.
  2. Location selector is added to this report. So the users can select the location to get the visit notes respected for that location.
  3. Pi chart was added into the bottom of the report to illustrate the table view as the Graph view to the user.
  4. Added Active visit switcher support to include the active visit notes or exclude the active visit notes into the report.
Before without any improvements
After including improvements
After including improvements

Improvement in the List of providers report

The List of Providers reports was implemented to show the table with Provider and the creation date to the users. It also does not contain the sufficient information for a report and I have decided to add these following new features to this report,

  1. Added more fields to the Provider’s report such as Demographics(Family Name, Given Name), Provider Information and Role Name, and Uuid.
  2. Added new report called “List of Patients worked with Provider” which can show the top 10 number of patients with their information who recently worked with that provider.
  3. Added tabled row hyper links from the List Of provider to the List of Patients worked with Provider report. So users can simply click on the provider name to get the patient list who recently worked with that provider.
  4. Added redirections from the List of Patients worked with Provider to the patient dashboard. So the users can easily click on the patient name to go to the patient dashboard which will show more detail about the patient.

Improvements in the Number of Admission report

The Number of Admissions report was implemented to show only the total count of the Admissions on that day. It is also doesn’t contain the sufficient information about the admissions. So I have added these following improvements to this report,

  1. The report is restructured to show the total count of the admissions against the locations in the system. So users can able to get the admission’s count with the locations.
  2. Added total count of the admissions to the bottom of the table.
  3. Pi chart was added into the bottom of the report to illustrate the table view as the Graph view to the user.

Improvement in the Number of Discharges report

The Number of Discharges report was implemented to show only the total count of the Discharges on that day. It is also doesn’t contain the sufficient information about the discharges. So I have added these following improvements to this report,

  1. The report is restructured to show the total count of the discharges against the locations in the system. So users can able to get the discharge count with the locations.
  2. Added total count of the discharges to the bottom of the table.
  3. Pi chart was added into the bottom of the report to illustrate the table view as the Graph view to the user.

Improvement in the Number of Transfers report

The Number of Transfers report was implemented to show only the total count of the Transfers on that day. It is also doesn’t contain the sufficient information about the transfers. So I have added these following improvements to this report,

  1. The report is restructured to show the total count of the transfers against the locations in the system. So users can able to get the transfer’s count with the locations.
  2. Added total count of the discharges to the bottom of the table.
  3. Pi chart was added into the bottom of the report to illustrate the table view as the Graph view to the user.

OpenMRS JIRA Tickets Information

I wanted to work on the two projects which are interconnected to produce the reports. Those are,

  1. ReferenceMetaData Module — The report generation module in the OpenMRS back end based on Java.
  2. Build In Reports Module — The customized view of the reports based on the React

I have created these following tickets and worked during this project time. All of these tickets are completed by now and the next release is planned to soon after this week. You can find the JIRA project for this module here.

  1. BIR-1 — Improve the Diagnosis Report in the Built-in-Reports module
    Pull Request : #2
  2. BIR-2 — Change the ReportAsTableclass to support the hyper link for required reports. Built-in-reports module uses the react-data-grid to show the reports as the tables.All reports use a common table class called as ReportAsTable. So it is modified to support with hyper links for some required reports.
    Pull Request : #1
  3. BIR-3 — Browser router failed to redirect while refreshing the pages.
     (Built-in-reports module uses Browser Router for the routing. It’s fail while refreshing the web page or pressing back button in the browser. It should be fixed with Hash Router to resolve this issue while we are using the React Router V4.
    Pull Request : #3
  4. BIR — 4 -Added More Improvements to the Number of Admissions report.
    Pull Request : #8
  5. BIR-5— Change the view of New patient Registrations view and Number of patient registrations bar chart.
    Pull Request : #5
  6. BIR-7— Add Number of Discharges for all Locations Reports to the Module.
    Pull Request : #12
  7. BIR — 8 — Add Number of Transfers Report for all Locations to the Module.
    Pull Request : #13
  8. BIR — 9 — Improve Number of Visits with visit type for given location and date report.
    Pull Request : #9
  9. BIR — 10— Improve Number of Visit Notes with visit type for given location and date report
     Pull Request: #10
  10. BIR-11 — Improve the List of Providers Report in the Built-in-Reports module.
    ( Once the user clicks on a row in the table of List of Providers report, user should be able to see more detailed page about the provider.) 
    Pull Request: #11
  11. BIR-13 — Need to add location switcher to the buildin reports OWA header
    Pull Request : #commit
  12. RA-1499 — Create Patients affected by Diagnosis report for given Diagnosis ID. It display the information about patients affected by given diagnosis UUID.
    Pull Request : #30
  13. RA-1500 — Remove the duplicate data from the List of New Patient Registrations
    (List of New Patient Registrations report shows some duplicate rows in the table view. The SQL query which is used to fetch the data from the database should be attached with grouping query to avoid this issue.)
    Pull Request : #31
  14. RA-1501 — Create Number of Registrations for all locations Report.
    Pull Request : #32
  15. RA-1505— Create Number of Discharges for all locations Report.
    Pull Request : #33
  16. RA-1506 — Create Number of Transfers for all locations Report.
    Pull Request : #34
  17. RA-1508 — Create Number of Visits with visit type for given location and date report.
    Pull Request : #35
  18. RA-1509 — Improve Number of Visit Notes with visit type for given location and date report.
    Pull Request : #36
  19. RA-1514 — Create List of Patients Report who worked with given Provider. 
    ( Create a new report to display the information about the patients who worked with the given provider. It should contain these information)
    Pull Request : #37

Release — Version 1.0.0

The last recent release of the Built-In report module was 0.94 which was considered as the unstable distribution of the module under the development. So we have decided to release the v1.0.0 of the Built-In reports module after the improvements during the GSoC 2018 period.

Now is the time to release the v1.0.0. So I have discussed with my mentors and decided to release on time. The beta version of this release can be found here.

Prepared for the release of v1.0.0


Experience

Yes!, This is the first time for getting involved into the Google Summer of Code project. I was able to learn much from this amazing program and I was able to improve my potential about the industries. I have worked on React, Java, REST Services, HTML, and CSS for this projects. The learned techniques and the experience are very very helpful for my future.

I feel very excited and I am happy that I was able to travel through the last 3 months without any major issues. Yahh!! I successfully completed my tasks and the major part of the project. My mentor Rafal Korytkowski gave me the feedbacks and reviews quickly and help me to clear my issues regarding this project and other community members in the OpenMRS helped me from the beginning of the GSoC and they helped a lot to complete this project.

I wish thank to all for their wonderful helps and time, specially thanks to my mentor Rafal Korytkowski who gave me this great opportunity and for his guidance and the support and I wish to say a special thanks to Suthagar Kailayapathy who gave me the support and encourage me to achieve this goal for this Project.