GSoC 2022: Redo Legacy UI Cohort Builder - Project Updates

Hello everyone :raised_hands:! I will be working on the project “Redo Legacy UI Cohort Builder” for GSoC 2022. In this project, Cohort Builder will be rebuilt for OpenMRS 3.0 as a micro frontend module.

The Cohort Builder is a tool in OpenMRS 1.0 in the Reporting Compatibility module (included with most OpenMRS installations) that lets the user perform ad-hoc queries for patients with defined characteristics, and combines multiple queries into more complex ones.

Primary mentor: @bistenes Secondary mentor: @jayasanka

Follow this link for more details on the project.

5 Likes

Thanks for initiating the thread, @anjisvj !

2 Likes

Great to have you working on this project Anjula!!

FWIW, I connected w/ @jdick on Friday, and he confirmed that rebuilding the Cohort Builder as a react, carbon microfrontend is exactly what he had envisioned. I’m sorry as I think I may have previously introduced confusion in that regard.

Apparently though one of the needs has been that there is no REST API to support the Cohort Builder (if I understand correctly). But adding this REST support would require some Java work specifically. @bistenes or @jayasanka or @ibacher or @dkayiwa do you know if there is a plan for this?

The thing JJ had been hoping we could accomplish one day (which is probably outside the scope of this GSOC project) is to use the Cohort Builder to build patient lists which self-update. So you’re not just saving the SQL, nor are you saving a list of specific patients from one-point-in-time, but you could also save a dynamic query that will update itself when a new patient appears who matches the original criteria. E.g. this would be useful for dynamically generating patients meeting “Lost to Follow Up” criteria, for example. This would then be connected to the O3 Patient Lists functionality, so a non-admin user could just click “show me all pts who meet LTFU criteria” and it would magically work. (@slubwama I wrote a note to myself that you may have thoughts on this, though I can’t remember why…?)

CCing as well @mseaton who was originally involved in writing this module.

2 Likes

Thanks a lot @grace!

Regarding the REST API, we could leverage the ‘Adhoc API’ for the initial version. But we might need to write some minor endpoints to achieve some tasks, ex: to save a search. @anjisvj Correct me if I’m wrong.

I think you already proposed a plan for this right?

P.S. Link to @anjisvj 's proposal: Redo Legacy UI Cohort Builder - Google Docs

1 Like

Thank you @grace for the clarification. According to my project proposal, there is a feature called “Cohort Run Scheduler” to schedule run the cohorts. Which is similar to the schedule task runner.

1 Like

yes, you are correct @jayasanka, I’m planning to use the “Adhoc API” for this version and planning to create APIs as an improvement.

1 Like

Do you mean the one that @darius built as a replacement for the cohort builder? https://wiki.openmrs.org/pages/viewpage.action?pageId=60067041

I’m going to use the reportingrest module’s Adhoc API. Which is already being used by the OWA Cohort Builder.

1 Like

@anjisvj I created a new repo for your project :innocent:

@bistenes I’m not sure about the repo naming convention. Could you please check it? I named it after /openmrs/openmrs-owa-cohortbuilder and /openmrs/openmrs-module-cohortbuilder

3 Likes

Thank you! @jayasanka So how are we going to move the existing code base? Can we transfer the repo? I’m currently working on this ticket on a separate branch.

You can send the initial version as a PR. Then we can continue working on it iteratively. Feel free to suggest an easy way for you. :blush:

1 Like

I made the initial PR and it’s ready for review. cc: @jayasanka @bistenes

1 Like

Merged! Good job @anjisvj !

1 Like

Hello guys :raised_hands:, I made the second PR. Which is going to give the user the ability to search for patients based on the concepts and observations.

I will create smaller PRs moving forward to make it easier for the reviewers.

Demo:

Kapture 2022-06-23 at 12.19.01

After this, I will start working on the search history component.

cc: @bistenes @jayasanka

3 Likes

I love the gif/demo video! Very helpful way to see the progress. Thank you for these updates Anjula!

1 Like