# Care Gaps Operation - Data Exchange For Quality Measures Implementation Guide v1.0.0-ballot

## OperationDefinition: Care Gaps Operation 

 
The care-gaps operation is used to determine gaps in care for a specified gaps through period based on the results of quality measures. 
It is often the case that the operation should not be performed from the server's timezone, rather the client's timezone is typically a more correct option. Note that even this isn't always correct because the evaluation may be running over data from multiple sources in different timezones. Providing guidance to the measure evaluator with the timezone header can facilitate consistent behavior. 

Conformance Requirement 1: 
 In addition to the required parameters, a caller of the $care-gaps operation SHALL provide subject|practitioner|organization, which could be one of the following:

* A $care-gaps operation SHALL provide a subject; OR
* A $care-gaps operation SHALL provide an organization; OR
* A $care-gaps operation SHALL provide a practitioner and an organization

### Notes:

Examples:

Request:

* Request evaluation of the CMS130 measure (with measureId EXM130-7.3.000) over a gaps through period of the first 3 months of 2014, with open gaps, for patient 124.

```
GET [base]/Measure/$care-gaps?measureId=EXM130-7.3.000&periodStart=2014-01&periodEnd=2014-03&status=open-gap&subject=Patient/124

```

Request:

* Request the first example with a topic of 57024-2.
* Request the first example with a topic of the code "treatment" in the valueset "definition-topic".

```
GET [base]/Measure/$care-gaps?measureId=EXM130-7.3.000&periodStart=2014-01&periodEnd=2014-03&status=open-gap&subject=Patient/124&topic=57024-2

GET [base]/Measure/$care-gaps?measureId=EXM130-7.3.000&periodStart=2014-01&periodEnd=2014-03&status=open-gap&subject=Patient/124&topic=http://hl7.org/fhir/ValueSet/definition-topic|treatment

```

Request:

* Request the first example with a subject of group 124.

```
GET [base]/Measure/$care-gaps?measureId=EXM130-7.3.000&periodStart=2014-01&periodEnd=2014-03&status=open-gap&subject=Group/124

```

Request:

* Request evaluation with a status of open gap.
* Request evaluation with a status of closed gap.
* Request evaluation with a status of open or closed gap.
* Request evaluation with a status of open, closed, or prospective gap.

```
GET [base]/Measure/$care-gaps?measureId=EXM130-7.3.000&periodStart=2014-01&periodEnd=2014-03&subject=Patient/124&status=open-gap
GET [base]/Measure/$care-gaps?measureId=EXM130-7.3.000&periodStart=2014-01&periodEnd=2014-03&subject=Patient/124&status=closed-gap
GET [base]/Measure/$care-gaps?measureId=EXM130-7.3.000&periodStart=2014-01&periodEnd=2014-03&subject=Patient/124&status=open-gap&status=closed-gap
GET [base]/Measure/$care-gaps?measureId=EXM130-7.3.000&periodStart=2014-01&periodEnd=2014-03&subject=Patient/124&status=open-gap&status=closed-gap&status=prospective-gap

```

Request:

* Request the first example with a measureIdentifier.
* Request the first example with a measureUrl.

```
GET [base]/Measure/$care-gaps?measureIdentifier=http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/cms|130&periodStart=2014-01&periodEnd=2014-03&status=open-gap&subject=Patient/124
GET [base]/Measure/$care-gaps?measureUrl=http://hl7.org/fhir/uv/cqm/Measure/EXM130|7.3.000&periodStart=2014-01&periodEnd=2014-03&status=open-gap&subject=Patient/124

```

Request:

* Request the first example with an organization instead of a subject.
* Request the first example with a practitioner and an organization instead of a subject.

```
GET [base]/Measure/$care-gaps?measureIdentifier=http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/cms|130&periodStart=2014-01&periodEnd=2014-03&status=open-gap&organization=Organization/124
GET [base]/Measure/$care-gaps?measureUrl=http://hl7.org/fhir/uv/cqm/Measure/EXM130|7.3.000&periodStart=2014-01&periodEnd=2014-03&status=open-gap&&organization=Organization/124&practitioner=Practitioner/124

```



## Resource Content

```json
{
  "resourceType" : "OperationDefinition",
  "id" : "care-gaps",
  "extension" : [{
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
    "valueCode" : "cqi"
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
    "valueInteger" : 4,
    "_valueInteger" : {
      "extension" : [{
        "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
        "valueCanonical" : "http://hl7.org/fhir/uv/deqm/ImplementationGuide/hl7.fhir.uv.deqm"
      }]
    }
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
    "valueCode" : "trial-use",
    "_valueCode" : {
      "extension" : [{
        "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
        "valueCanonical" : "http://hl7.org/fhir/uv/deqm/ImplementationGuide/hl7.fhir.uv.deqm"
      }]
    }
  }],
  "url" : "http://hl7.org/fhir/uv/deqm/OperationDefinition/care-gaps",
  "version" : "1.0.0-ballot",
  "name" : "CareGaps",
  "title" : "Care Gaps Operation",
  "status" : "active",
  "kind" : "operation",
  "date" : "2021-04-23",
  "publisher" : "HL7 International / Clinical Quality Information",
  "contact" : [{
    "telecom" : [{
      "system" : "url",
      "value" : "http://www.hl7.org/Special/committees/cqi"
    }]
  }],
  "description" : "The care-gaps operation is used to determine gaps in care for a specified gaps through period based on the results of quality measures.\n\nIt is often the case that the operation should not be performed from the server's timezone, rather the client's timezone is typically a more correct option. Note that even this isn't always correct because the evaluation may be running over data from multiple sources in different timezones. Providing guidance to the measure evaluator with the timezone header can facilitate consistent behavior.",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
      "code" : "001",
      "display" : "World"
    }]
  }],
  "code" : "care-gaps",
  "comment" : "The effect of invoking this operation is to calculate a measure or a set of measures based on the In Parameters provided and to return Parameters resource containing one or more document bundles describing the gaps in care results         of each measure, for the specified gaps through period and for the given subject (a patient or a group of patients). Because more than one bundle may be returned, the operation parameter must always be returned.  Note that it is up to the Server to determine whether         or not the generated gaps in care report is persisted. If the Server does not persist the results, the operation does not affect state and can be invoked with a GET. Note that this operation is intended to replace the existing base Measure $care-gaps operation in FHIR R5.",
  "base" : "http://hl7.org/fhir/OperationDefinition/Measure-care-gaps",
  "resource" : ["Measure"],
  "system" : false,
  "type" : true,
  "instance" : false,
  "parameter" : [{
    "name" : "measureUrl",
    "use" : "in",
    "min" : 1,
    "max" : "*",
    "documentation" : "The URL of a measure for which the gaps in care report will be created. A measure URL is specified in the [url](https://www.hl7.org/fhir/measure-definitions.html#Measure.url) element of the Measure resource. The measure URL remains the same when the measure is stored on different servers.",
    "type" : "canonical",
    "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Measure"]
  },
  {
    "name" : "periodStart",
    "use" : "in",
    "min" : 1,
    "max" : "1",
    "documentation" : "The start of a [gaps through period](glossary.html). This may be the start of the measurement period defined by a measure, or a customized desired performance period start date determined by a payer, a provider, a measure program, and etc.",
    "type" : "date"
  },
  {
    "name" : "periodEnd",
    "use" : "in",
    "min" : 1,
    "max" : "1",
    "documentation" : "The end of a [gaps through period](glossary.html) (the gaps through date). The gaps through date could be a past date or a future date.  For example, today's date is 2020-06-18, 1) if periodEnd date is 2020-09-30, it returns gaps through 2020-09-30, and 2) if the periodEnd date is 2020-05-31, it returns gaps through 2020-05-31.",
    "type" : "date"
  },
  {
    "name" : "subject",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "Subject SHALL be a reference to either a Patient or Group (e.g. Patient/123 or Group/123) Note this is a reference, providing only an id (such as 123) will not be resolvable.",
    "type" : "Reference",
    "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Patient",
    "http://hl7.org/fhir/StructureDefinition/Group"]
  },
  {
    "name" : "subjectGroup",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "Subject for which the gaps in care report will be created is provided as a Group resource.",
    "type" : "Group"
  },
  {
    "name" : "reporter",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The provider for which the report will be run. This may be a reference to a Practitioner,             PractitionerRole, or Organization. If specified, systems MAY use this information             to determine subjects for which the measure will be calculated, but how subjects             are determined is implementation-specific. This parameter is reflected in the reporter             element of the resulting MeasureReport(s). This parameter cannot be used with the             reporterResource parameter.",
    "type" : "Reference",
    "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Practitioner",
    "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
    "http://hl7.org/fhir/StructureDefinition/Organization"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type",
      "valueUri" : "Practitioner"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type",
      "valueUri" : "PractitionerRole"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/operationdefinition-allowed-type",
      "valueUri" : "Organization"
    }],
    "name" : "reporterResource",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The provider for which the report will be run, provided as a Practitioner,         PractitionerRole, or Organization resource.             This is intended to support the use case in which the organization information             is not on the server performing the evaluation, for example an [ad-hoc group of             practitioners](guidance.html#ad-hoc-organizations-for-deqm-operations) that             are part of a provider group. This parameter is reflected in the reporter element             of the resulting MeasureReport(s). This parameter cannot be used with the reporter             parameter.",
    "type" : "DomainResource"
  },
  {
    "name" : "location",
    "use" : "in",
    "min" : 0,
    "max" : "*",
    "documentation" : "The location(s) for which the gaps in care report will be run. This parameter is             reflected in the location element of the resulting MeasureReport(s).",
    "type" : "Reference",
    "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Location"]
  },
  {
    "name" : "status",
    "use" : "in",
    "min" : 1,
    "max" : "*",
    "documentation" : "Indicates status of a care gap. For all [open, closed, and prospective gaps], three seperate status parameters must be provided. For a positive proportion measure, gap means the patient is not in the numerator. For an inverse (negative) proportion measure (e.g., Diabetes: Hemoglobin A1c (HbA1c) Poor Control (> 9%)), gap means the patient is in the numerator.",
    "type" : "code",
    "binding" : {
      "strength" : "extensible",
      "valueSet" : "http://hl7.org/fhir/uv/deqm/ValueSet/deqm-gaps-status"
    }
  },
  {
    "name" : "parameters",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "Any input parameters for the Measure evaluation. If the measure uses CQL, the parameter types are mapped to CQL as specified in the Parameters and Data Requirements section of the Using CQL with FHIR Implementation Guide. Any parameters defined in this input will be bound by name to parameters defined in the logic library referenced from library element of the Measure. If a parameter appears more than once in the input Parameters resource, it is represented with a List in the input CQL. If a parameter has parts, it is represented as a Tuple in the input CQL.",
    "type" : "Parameters"
  },
  {
    "name" : "manifest",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "Specifies an asset-collection library that provides dependency version resolution and expansion rules for the operation. See the description of manifest in the Canonical Resource Management Infrastructure IG for a complete description of how manifest values are used to provide defaults for dependency version resolution and expansion parameters. Parameters specified directly in the operation override behaviors specified by the manifest parameter. In general, if this parameter is supplied, it is expected to be used in nested operation calls. For example, in evaluating a measure, if the expansion of a value set is required, this parameter SHALL be supplied to that expansion.",
    "type" : "canonical"
  },
  {
    "name" : "isDocument",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The isDocument parameter controls whether a Gaps in Care Composition is returned in the Bundle (i.e. if the Bundle is of type 'Document'). When 'true,' the returned Bundles contain the Gaps in Care Composition. This parameter defaults to 'true.'",
    "type" : "boolean"
  },
  {
    "name" : "return",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "documentation" : "The $care-gaps operation returns [Parameters](https://www.hl7.org/fhir/parameters.html) resource, containing zero or more document bundles that conform to the [DEQM Gaps In Care Bundle Profile](StructureDefinition-deqm-gapsincarebundle.html). Note that the result of the $care-gaps operation must be returned using the Parameters resource, even when the result contains only one bundle, because the cardinality of the return parameter is specified as 0..*. When these Bundles optionally contain [DEQM Gaps In Care Composition Profile](StructureDefinition-deqm-gapsincarecomposition.html), then they are limited to a single subject. If these Bundles do not contain the Composition Profile, they SHOULD be for a single subject. See the [guidance on Bundle structure](guidance.html#deqm-operation-bundles-organized-by-subject) for discussion about the Bundle content and organization.",
    "type" : "Bundle"
  }]
}

```
