Google Summer of Code 2018 with OpenMRS

9th week of Coding

The 9th week of the program was really important as the 2nd evaluation was scheduled. I engaged in improving the scheduled task in muzimacore module which creates summary reports for each patient in a cohort.

I installed reporting compatibility module so that cohorts could be built. Next I had to add a concept dictionary so that I could add Obs for a patient.


Once a report configuration is created by the user(i.e-mapping a cohort with report definition) the scheduled task of creating patient reports take over.

Introduction to the Report Generation Task

  1. The process is started everyday at 00:00 hrs, and it first gets all the report configurations from the database and loops through each one of them.
  2. It loops through each patient belonging to the cohort of the report configuration.
  3. The task then checks for any in-completed reports belonging to that particular patient in the generated reports table. If any are found, the report is generated and saved as a “completed” report(setting the status column to “complete”)
  4. The task next checks for new Obs for that patient since 00:00 hrs last day and generates a new report only if any are added.
  5. If no previous reports of that patient are found, the task creates a new report (This would happen for the very first run of the task).

Currently I am engaging in testing the scheduled task. I hope to configure the muzima android app so it could consume these reports and render it to the mobile user 😃.

Like what you read? Give Dileka Madushan a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.