GSoC Week 04: Coding period started

3 min readMay 31, 2024



I’m Mnaoj Rathnapriya, contributing to GSoC 2024 with OpenMRS. The official coding period started on May 27th, and I’m excited to share my progress and experiences in this week 04 update. Last week marked the end of the community bonding period. Here is the blog I wrote during that time. This blog will detail my achievements, challenges, and learning experiences as I work on enhancing the OpenMRS flag module.

This week marked the official start of the coding period, but I had already begun coding for my project. In week 03, I raised a pull request, which was reviewed by my mentor. During the review, he advised me to follow the OpenMRS pull request rules and tips, emphasizing the importance of keeping each pull request focused on a single task. In my initial pull request, I refactored some processes to be handled in parallel and upgraded the project from Java 6 to Java 8. Following my mentor’s guidance, I created a new JIRA ticket specifically for the Java 8 upgrade and raised a separate pull request for it. During the week 03, while refactoring the getFlaggedPatients() method to operate in parallel, I encountered a privilege issue. Despite the challenge, I successfully resolved it by passing the current user session to each thread context. However, this new implementation showed lower performance compared to the existing module. However, this new approach showed lower performance compared to the existing module. Hence, we decided to retain the getFlaggedPatient() method in its current module as it is.

While waiting for the PR review, I began tackling other project objectives. Within the current module, I noticed certain methods making multiple individual database calls. When multiple individual database calls are made within a method, especially inside a loop, it can significantly increase the overall execution time and resource consumption due to repeated connections and queries, potentially leading to low down the module performance . therefore I made these multiple database call as a batch to improve efficiency and reduce overhead.

This module is been using for many years and it was build with java 6. To modernize the code-base, I introduced lambda expressions and the Stream API, which simplify operations on collections and contribute to cleaner, more efficient code.

During GSoC Week 04, I made significant progress in refactoring the OpenMRS module. Despite facing challenges, I stayed resilient and proactive in solving them. Looking ahead, I’m dedicated to further enhancing the OpenMRS patient flag module and contributing to its development.

Week 05 plan

  1. Update the code base to align with current openMRS version
  2. Add Java 17 support without removing java 8 support

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 :