Uploaded image for project: 'FHIR Module v2'
  1. FHIR Module v2
  2. FM2-330

Add support for the $collect-data operation in HAPI FHIR

    XMLWordPrintable

    Details

    • Type: Epic
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Complexity:
      High
    • Epic Name:
      PLIR: Support for $collect-data
    • Epic Status:
      Done

      Description

      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:

      {
      	"resourceType": "Measure",
      	"id": "TX-PVLS",
      	"identifier": [{
      		"use": "official",
      		"value": "TX_PVLS"
      	}],
      	"version": "0.0.1",
      	"title": "Sample TX_PVLS population selection criteria",
      	"status": "draft",
      	"experimental": true,
      	"group": [{
      		"id": "population",
      		"population": [{
      			"code": {
      				"coding": [{
      					"code": "initial-population"
      				}]
      			},
      			"criteria": {
      				"language": "application/x-fhir-query",
      				"expression": "Observation?code=856AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,1305AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&_include=Observation:patient"
      			}
      		}]
      	}]
      }
      

      Most of this resource is ceremony. The heart of this is the group.population.criteria.expression value, that is this:

      Observation?code=856AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,1305AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&_include=Observation:patient
      

      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:

      GET [base]/Measure/TX-PVLS/$collect-data?periodStart=2020-01-01&periodEnd=2020-12-31
      

      This should return something like:

      {
      	"resourceType": "Parameters",
      	"parameter": [{
      		"name": "measureReport",
      		"resource": {
      			"resourceType": "MeasureReport",
      			"status": "complete",
      			"type": "data-collection",
      			"measure": "Measure/TX_PVLS",
      			"evaluatedResource": [{
      				// References to observation resources go here
      			}]
      		}
      	}, {
      		"name": "resource",
      		"resource": {
      			// this is the data-only Observation resource
      		}
      	}]
      }
      

      HAPI's documentation on implementing operations can be found here.

       

      Git hub Repo : https://github.com/openmrs/openmrs-contrib-plm-fhir-server

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              mozzy Moses Mutesasira
              Reporter:
              ibacher Ian Bacher
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: