GSoC’24 Week 03: Updates from My GSoC Journey

4 min readMay 26, 2024


Hello everyone!

Welcome to my blog following my Google Summer of Code journey. I am Manoj Rathnapriya, contributing to OpenMRS on the project focusing on validation and rewriting the patient flags module. The goal of my project is to enhance the performance of this module. This is my third blog post, where I will discuss how week 03 went, the work I did, and the issues I faced.

Week 03 Highlights

Code Refactoring:

I spent considerable time refactoring the existing code to make it more efficient and maintainable. Specifically, I refactored the methods used to evaluate flags. I restructured methods such as generatePatientFlagsForPatient, getFlaggedPatients, and evaluateAllFlags. The main improvement was parallelizing the evaluation process. generatePatientFlagsForPatient and getFlaggedPatients methods, I used the ExecutorService to run these methods in parallel, which significantly improved their performance. evaluateAllFlags method was set to run in a daemon threads because it needs continuous access to the database. Running it in a daemon thread ensures it can operate in the background without blocking other processes.

I raised a draft pull request for my work to get feedback from my mentor while I am working. This allows me to make necessary adjustments based on the review comments and ensure the final implementation meets the project’s standards.

Testing & Results:

As I mentioned in my blog post for week 02, I am evaluating performance by measuring method execution time in milliseconds. Here are the testing results for the generatePatientFlagsForPatient and evaluateAllFlags methods.

Generate patient flags for Patient Test Results:

Flags count < 5 : Current module perform better that my implementation, Flags count < 10 : both show similar performance , Flags > 15 (I tested with 17 flags) : My implementation show better performance that current module.

I noticed when the flags count inferences my implementation shows better performances.

All flag evaluation :

current module for 17 flags -> 203, 202, 205 ,216, 185, 215
This implementation for 17 flags -> 37, 38, 22 ,23, 20 ,27,26 ,32

According to the current test results, my implementation shows better performance than the existing module. The parallel execution significantly reduced the method’s execution time, improving the overall performance of the module.

testing outcomes

Challenges Faced:

One of the biggest issues I faced was working with the OpenMRS context. The context handling in OpenMRS is slightly different, and when working with multiple threads, I needed to share the user session with the threads. This was particularly problematic during the execution of getFlaggedPatients, where I encountered an error stating "privileges required: get patient list." This is still an ongoing challenge, and I am working on a solution to share the user session across threads properly.

error I got

Recap on community bonding period

My Google Summer of Code journey kicked off with an amazing orientation session led by the OpenMRS community. It was an engaging opportunity where contributors, mentors, and organization admins introduced themselves, sharing fun facts and project insights. This session provided invaluable guidance, essential tips, and strategies for navigating the GSoC program successfully. Additionally, I established communication channels with my mentors, laying the groundwork for collaboration throughout the project.

During the second week, my focus shifted to a crucial task: finding a method to evaluate the performance of my implementations against the existing OpenMRS patient flag module. After exploring various approaches, I settled on measuring method execution time. And also I began coding before the conclusion of the community bonding period.

This marked the ending of community bonding period, which was largely productive. Below, you’ll find links to the previous blogs I wrote during this period.

Week 04 plan

  1. Solve the error that thrown in getFalggerPatient method
  2. ready the PR for review
  3. Refactor the code to save patient flags as batch
  4. Starting the make the code align with openmrs standards

Stay tuned — I’ll be sharing everything I’m doing on this project in my weekly blog updates.

Thank you for the reading, Join me on this tech adventure! Follow my profile to stay updated on the cool world of technology and innovation. Your support means a lot, and I can’t wait to share more exciting stuff with you. Let’s stay connected for more insights and fun discoveries ahead!


LinkedIn :