Adding Cohort member through FHIR API.

Is it possible to add a Patient to “Patient List” using FHIR API.

Similar to how it’s done using this REST endpoint: “POST: https://dev3.openmrs.org/openmrs/ws/rest/v1/cohortm/cohortmember

Our usecase is to enable the “OpenMRS integrated FHIR compliant android app” to add the offline created patients to a patient list.

cc: @jofrancisco

Always nice to hear from you @parthfloyd !

Tagging @ibacher for his thoughts. In the meantime: Parth it would be very helpful if you can add some more detail or links to how the HL7 FHIR ecosystem would typically handle this? (E.g. how would you like to model this in the FHIR api?)

This is what Ljubo had to add:

This feature is intended to enable adding a CohortMember to a Cohort (ie, adding a patient to a Patient List) via the FHIR API. Currently, this is only possible through the REST endpoint POST /ws/rest/v1/cohortm/cohortmember. To support FHIR-compliant, offline-capable OpenMRS-integrated Android clients, we want to implement equivalent functionality in the FHIR layer, allowing locally created patients to be added to Cohorts once synced.

1 Like

We had some discussion of an implementation here, but it was never actually built. We’d need to add the FHIR API to the Cohort module itself.

1 Like

Thanks Grace! I’ll look into how it would be typically handled by HL7 FHIR ecosystem.

However, currently we were using the “Group” FHIR API to fetch the Patient lists. “https://dev3.openmrs.org/openmrs/ws/fhir2/R4/Group

@ibacher would it make sense to support a PATCH request to add/delete a member? (can be added to either FHIR2 module or Cohort module itself)

cc: @mherman22 lmk if you’ve any input from experience on adding PATCH request to other models.

The Group implementation in the FHIR2 module is non-functional; this would need to be implemented in the Cohort module.

2 Likes