Affects Version/s: None
Fix Version/s: None
Epic Name:PLIR: Support for $collect-data
The FHIR spec defines an operation called $collect-data which takes a FHIR Measure resource and produces the data that would be used for that Measure. Since this is part of the PLIR work, the only data we care about are those that are useful in calculating TX_PVLS.
The Measure resource we will use for this is this:
Most of this resource is ceremony. The heart of this is the group.population.criteria.expression value, that is this:
This is a FHIR search query that will return all Observations that are either CIEL 856 (quantitative VL) or CIEL 1305 (qualitative VL) and the set of patients linked to those observations.
We need to implement enough of the $collect-data operation to select that data and return it in the specified format (which is represented in HAPI as a org.hl7.fhir.r4.model.Parameters object).
We only need to add support for the periodStart and periodEnd parameters of the operation. These should be appended to the search parameters, e.g., restricting the set of observations returned to just those that occurred within the specified period (this can be done by appending &date=geXXXX&date=leYYY where XXX is the period start specified and YYY is the period end specified).
The expected incoming request will look like this (assuming the above measure has been loaded into the HAPI FHIR instance:
This should return something like:
HAPI's documentation on implementing operations can be found here.
Git hub Repo : https://github.com/openmrs/openmrs-contrib-plm-fhir-server