GSoC 2022: Rebuild OpenMRS Cohort Builder
- Project Title: Rebuild OpenMRS Cohort Builder
- Primary mentor: Brandon Istenes @bistenes
- Backup mentor: Jayasanka Weerasinghe @jayasanka
- Student: Anjula Samarasinghe
- Project Link: GSoC 2022: Redo Legacy UI Cohort Builder
Overview
- The Cohort Builder is a tool in OpenMRS 1.0 in the Reporting Compatibility module that lets the user perform ad-hoc queries for patients with defined characteristics, and combines multiple queries into more complex ones
Objective
Rebuild the same functionality in OpenMRS 1.0 Cohort Builder in OpenMR 3.0 which includes the following,
- Searching by Observations/Concepts

- Searching by demographics

- Searching by encounters

- Searching by location

- Searching by program enrollments

- Searching by Drug Order

- Combining searches

Apart from this, a save search feature is required ![]()
Contributions
I’ve worked on three OpenMRS repositories:
- GitHub - openmrs/openmrs-esm-cohortbuilder: The Cohort Builder is a tool in OpenMRS 3.0 in the Reporting Compatibility module that lets the user perform ad-hoc queries for patients with defined characteristics, and combines multiple queries into more complex ones.
- GitHub - openmrs/openmrs-module-reporting: Reporting module in openmrs
- GitHub - openmrs/openmrs-module-webservices.rest: Provides RESTful web services for OpenMRS (REST API)
Tickets
| Issue Number | Issue Link | Pull Request | Status |
|---|---|---|---|
| O3-1311 | Jira | O3-1311: Initial setup of the project | Merged |
| O3-1300 | Jira | O3-1300: Implement search by concept component | Merged |
| O3-1385 | Jira | O3-1385: Write unit tests to test the components | Merged |
| O3-1302 | Jira | O3-1302: Implement the Search History component | Merged |
| O3-1394 | Jira | O3-1394: Update the UI according to the new design | Merged |
| O3-1303 | Jira | O3-1303: Implement the search by demographics and person attributes feature | Merged |
| O3-1304 | Jira | O3-1304: Implement the search by encounters and search by location feature | Merged |
| O3-1417 | Jira | O3-1417: Use SWR for data fetching | Merged |
| O3-1305 | Jira | O3-1305: Implement the search by enrollments feature | Merged |
| O3-1427 | Jira | O3-1427: Add the deploy job to the workflow | Merged |
| REPORT-890 | Jira | REPORT-890: Add the missing api module dependency | Merged |
| O3-1309 | Jira | O3-1309: Implement the search definitions feature | Merged |
| O3-1443 | Jira | O3-1443: Improve the tablet and small desktop layout | Merged |
| O3-1306 | Jira | O3-1306: Implement the search by drug order feature | Merged |
| O3-1445 | Jira | O3-1445: Add search composition feature | Merged |
| O3-1471 | Jira | O3-1471: Add css to fix the broken UI layout | Merged |
| O3-1472 | Jira | O3-1472: Fix the tests that were skipped due to the migration | Merged |
| O3-1482 | Jira | O3-1482: Wrap the global selectors with a custom class | Merged |
| REPORT-890 | Jira | REPORT-890: Update the openMRS version for the api 1.10 | Merged |
Weekly Blog Posts
Video Presentation
GSoC 2022 - Rebuild OpenMRS Cohort Builder - Final Presentation
Resources
Future Works
The main requirement of this project is covered. Cohort Builder search criteria can be extended more for example Search by allergies, extending these search criteria gives more options to the user when it comes to creating cohorts.
The code base also can have more test coverage specially E2E testing can be added. Currently, there are only unit and integration tests. I’m looking forward create E2E tests as well.
Thoughts on GSoC
The last 12 weeks were life-changing for me. It was such a great opportunity to work with OpenMRS where I can leave a positive impact on the world. I really liked the architecture of OpenMRS 3.0 and it’s really easy to get started on. The OpenMRS community is also very supportive which includes different people from different parts of the world.
I would like to thank my mentors: Jayasanka Weerasinghe and Brandon Istenenes, who helped me to overcome the blockers I had and reviewed my pull requests on time. Once again I would like to thank OpenMRS and Google for giving me this opportunity. This is a dream come true. Also special thanks to Jayasanka Weerasinghe for supporting me from the very beginning to getting selected and also throughout the project. I’m looking forward to continuing my contributions to OpenMRS.