Patient List Grid

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).

@burke @ibacher @dkayiwa @eudson @mseaton @corneliouzbett

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.

Cc @ibacher @mksrom

On our yesterday’s platform call, @ibacher said that this already exists in the fhir module.

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.:$lastn?max=3&patient=23d12ac3-f3a9-4f46-8341-15f0de3d8476,f4d2d9e4-b6a4-426e-b6be-92a9b61faf8a&code=5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&_summary=data

This doesn’t appear to work on, but I’m guessing that the FHIR module there is out of data.