The obsTree has been created and provides a wonderful functionality (thanks @dkayiwa !)
A very common use case is a patient list grid where the row is the patient and the columns are obs. I would like to propose an additional new endpoint: the ability to provide a set of patient uuids and a set of obs uuids and to get back a grid where each row is the patient, each column is the concept and each cell contains the most recent value (if any) for that obs.
I could also see being able to provide additional parameters (least recent obs, perhaps n number of obs from most recent to oldest).
That sounds great and I would even add that we will quickly need something more generic, like patient UUID + a set of profiles. Where a profile can define the way to retrieve a set of obs, or the way to retrieve a set of encounters, or the way to retrieve a set of patient-level info (person attributes, etc), …
Actually the end point might even rater be patient list + profiles.
The reason I’m saying all the above is because of the ‘Group Sessions / Group Visit Management’ feature being designed & developed for the ICRC.
What we have is the FHIR $lastn operation that allows you to provide a list of concepts (via the code parameter) and a number of obs and get back those obs results.
Looking at the code, it might be necessary to make some small changes to get things to work with multiple patients, but that shouldn’t be too hard.
The operation can be access at /openmrs/ws/fhir2/R4/Observation/$lastn, e.g.: