Primary mentor

 Brandon Istenes                       

Backup mentor

Assigned to

Anjula Samarasinghe 

Abstract

Re-do legacy UI cohort builder in 3. x. In addition to supporting all current functionality, would also like to be able to save search history.


Required Skills

React

JavaScript

Typescript

Jest

Project Rating and length

Medium

175 hours

Objectives

Documentation

Detailed Project Report

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. The Cohort Builder 3.0 have the following features.

Searching by observations gives the user the option to search via concepts or observations existing in the system. This component has an input to search and a to search including verbose or without verbose.

This is where a history of executed searches is saved and displayed to the user, each search can be saved either as a cohort or as a definition. There are 4 fields under this component, namely

  1. Query: This is where the name or description of the query is displayed
  2. Query Definition Options
    1. Save: This saves a definition to the database
    2. Delete: This removes a definition from the search history
  3. Results: This contains a list of all the patients contained in the search result
  4. Query Definition Options
    1. Save: This saves a cohort to the database
    2. Delete: This removes a definition from the search history

Searching by demographics is where the user can create cohorts using the demographics and patient attributes.

There are 5 demographic search options namely:

  1. Gender - Search by gender option
  2. Age - Filter patient search results by age range i.e. 0-14
  3. Birthdate - Filter patient search results by birthdate range ie 20 Feb 1988 - 03 May 2006
  4. Alive - Search only for patients who are alive.
  5. Dead - Search for deceased patients.



    Search for patients using personal attributes

There are 10 person attributes search options:

  1. Birthplace filter by place of birth
  2. Citizenship - Filter patient results by specifying their country of origin
  3. Civil Status
  4. Health Center - Filter by details of health centre attended by patients
  5. Health District allows you to filter by similar health districts
  6. Mother’s Name - Filter by similar mother’s name
  7. Race - Filter results by the patient's racial background
  8. Telephone number - Filter by similar phone numbers
  9.  Unknown patient
  10. Test patient

This allows the user to search for patients with specific information that further describes them.



Search by Encounter uses to search patients with a specific type of activity or encounter. For example, check-in, check-out, transfer, admission etc.

There are 5 search options namely: -

  1. Of Type allows you to filter by the type of the encounter
  2. The location allows you to filter by the location of the encounter
  3. At least this many allows you to filter by the minimum encounter count
  4. Up to this many allows you to filter by the maximum encounter type
  5. From - To allows you to filter by the date range in which the encounter(s) occurred.


Search by location allows the user to search for patients by the encounter location. Ex: Amani hospital, inpatient ward, isolation ward etc.

Here the filters will be applied according to the following:-

Patients belonging to a group of encounters from a specific location.

According to the timeline of the encounter



Searching by program enrollments has the following fields required by the user to perform the search.

Program:

Date Ranges for the following

In The Program

Enrolled in the program

Completed the program



Saved definitions search gives the user the option to search for a saved cohort or definition, it has two fields,

  1. Search Saved Definitions allows the user to search for a saved definition by its name
  2. Search Saved Cohort allows the user to search for a saved cohort by its name

Search for patients taking specific drugs

  1. Drugs
  2. Care setting
  3. When

Weekly Reports

Issues

Issue NumberIssue LinkPull RequestStatus
O3-1311https://issues.openmrs.org/browse/O3-1311O3-1311: Initial setup of the projectMerged
O3-1300https://issues.openmrs.org/browse/O3-1028O3-1300: Implement search by concept componentMerged
O3-1385https://issues.openmrs.org/browse/O3-1385O3-1385: Write unit tests to test the componentsMerged
O3-1302https://issues.openmrs.org/browse/O3-1302O3-1302: Implement the Search History componentMerged
O3-1394https://issues.openmrs.org/browse/O3-1394O3-1394: Update the UI according to the new designMerged
O3-1303https://issues.openmrs.org/browse/O3-1303O3-1303: Implement the search by demographics and person attributes featureMerged
O3-1304https://issues.openmrs.org/browse/O3-1304O3-1304: Implement the search by encounters and search by location featureMerged
O3-1417https://issues.openmrs.org/browse/O3-1417O3-1417: Use SWR for data fetchingMerged
O3-1305https://issues.openmrs.org/browse/O3-1305O3-1305: Implement the search by enrollments featureMerged
O3-1427https://issues.openmrs.org/browse/O3-1427O3-1427: Add the deploy job to the workflowMerged
REPORT-890https://issues.openmrs.org/browse/REPORT-890REPORT-890: Add the missing api module dependencyMerged
O3-1309https://issues.openmrs.org/browse/O3-1309O3-1309: Implement the search definitions featureMerged
O3-1443https://issues.openmrs.org/browse/O3-1443O3-1443: Improve the tablet and small desktop layoutMerged
O3-1306https://issues.openmrs.org/browse/O3-1306O3-1306: Implement the search by drug order featureMerged
O3-1445https://issues.openmrs.org/browse/O3-1445O3-1445: Add search composition featureMerged
O3-1471https://issues.openmrs.org/browse/O3-1471O3-1471: Add css to fix the broken UI layoutMerged
O3-1472https://issues.openmrs.org/browse/O3-1472O3-1472: Fix the tests that were skipped due to the migrationMerged
O3-1482https://issues.openmrs.org/browse/O3-1482O3-1482: Wrap the global selectors with a custom classMerged

Medium Articles

WeekArticle Link
Week 0https://medium.com/nerd-for-tech/community-bonding-gsoc-2022-with-openmrs-8c8cd17353af
Week 1https://anjulashanaka.medium.com/coding-week-01-gsoc-2022-with-openmrs-ba85dc087f6c
Week 2https://anjulashanaka.medium.com/coding-week-02-gsoc-2022-with-openmrs-fc66cc0f9990
Week 3https://anjulashanaka.medium.com/coding-week-03-gsoc-2022-with-openmrs-f7d674ff572c
Week 4https://anjulashanaka.medium.com/coding-week-04-gsoc-2022-with-openmrs-a38a002b4bf5
Week 5https://anjulashanaka.medium.com/coding-week-05-gsoc-2022-with-openmrs-85c440a9be87
Week 6https://anjulashanaka.medium.com/coding-week-06-gsoc-2022-with-openmrs-c7930428e6d2
Week 7https://anjulashanaka.medium.com/coding-week-07-gsoc-2022-with-openmrs-79e503231767
Week 8https://anjulashanaka.medium.com/coding-week-08-gsoc-2022-with-openmrs-165f88c13a97
Week 9https://anjulashanaka.medium.com/coding-week-09-gsoc-2022-with-openmrs-e8bb1b5d5357
Week 10https://anjulashanaka.medium.com/coding-week-10-gsoc-2022-with-openmrs-2277ba6f2e45
Week 11https://anjulashanaka.medium.com/coding-week-11-gsoc-2022-with-openmrs-5ca7f2503d82
Week 12https://anjulashanaka.medium.com/coding-week-12-gsoc-2022-with-openmrs-6e3ee5f8d7cf

Meeting Notes

24th of August 2022
Previous week:

Next week:


17th of August 2022
Previous week:

Next week:


10th of August 2022
Previous week:

 Next week:


3rd of August 2022
Previous week:

 Next week:


20th of July 2022
Previous week:

Next week:


13th of July 2022
Previous week:

Next week:


06th of July 2022
Previous week:

Next week:

29th of June 2022
Previous week:

Next week:


22nd of June 2022
Previous week:

Next week:


15th of June 2022
Previous week:

Next week:


08th of June 2022
Previous week:

Next week:


01st of June 2022
Previous week:

Next week:


Final Presentation

Resources

Github Repository

https://guide.openmrs.org/en/Using%20Data/cohort-builder.html

OpenMRS 3.0: A Frontend Framework that enables collaboration and better User Experience

OpenMRS 3.0 Micro Frontend Demo Page