Coding week 11: GSoC 2022 with OpenMRS

Anjula Shanaka
3 min readAug 30, 2022

We are at the eleventh week out of twelve weeks of coding. After this week I have only one week to complete the project. Since this is a series, you can read last week's update from here.

Cohort API

Last week I talked about the issue with the cohort API. The issue was cohort members were not saving. I was able to fix that issue and the PR is linked below. But you’ll see that PR is closed. It’s because memberIds field is deprecated. I came to know this after presenting this issue on the weekly O3 call. Ian Bacher provided me with an explanation of this.

Cohorts in OMRS 2.0 and below (and the reporting module) are just sets of patientIds, which are, in fact, just the database primary key, so even if we exposed the memberIds property, you still wouldn’t be able to get from those to patients (the memberIds property is marked as deprecated and only there to not break things; it will likely be removed in the future).

But in OMRS 2.1++ the Cohort domain is modelled as a Cohort which has a list of CohortMemberships. These CohortMemberships are link records between a Cohort and its members, with some additional properties.

So I should create CohortMemberships when saving a cohort. But the cohort API doesn’t support creating CohortMemberships at the creation. Because of that, the next step is updating the Cohort create request to also handle the memberships property would be the solution. For more updates, you can follow this thread.

CSS overriding issue

When matching the design of the cohort builder, I had to override some carbon styles globally. But this led to an issue that overrides the styles across the other OMRS modules. As the solution, I scoped this by adding a custom class on top of the :global( selector so it doesn’t infect other parts of the app.

Documentation

As for the plan I need to start documenting the project by now. Actually, I started this long before but still, there are some details I need to add. For documenting I will be using the OMRS wiki and also in Github. Here’s the wiki link and the GitHub link,

What’s next

In the final week of the GSoC program, I will continue preparing for the final submission with documentation and testing the project for bugs and also I need to prepare for the final presentation of the project as well.

Final submission reminder from google

Just like that, the eleventh week came to an end. I’m looking forward to finishing the project by next week. Don’t forget to check out my other articles as well. See you guys at the next one. Until then stay safe! ✌️

Wanna get connected?
Linkedin: https://www.linkedin.com/in/anjula-sack/
Facebook: https://www.facebook.com/anjula.shanaka/
Github: https://github.com/anjula-sack

--

--

Anjula Shanaka

GSoC ’22 @openMRS | CTO @SEF | Developer @promiseQ | Undergraduate @USJ