# Example Logic Library - Module Definition Direct Reference - Quality Measure Implementation Guide v2.0.0-ballot

## Library: Example Logic Library - Module Definition Direct Reference (Experimental) 

 
This library is used as an example module definition in the FHIR Quality Measure Implementation Guide 

* Metadata: Title
  * ?: Example Logic Library - Module Definition Direct Reference
* Metadata: Version
  * ?: 1.0.0
* Metadata: Identifier
  * ?: EXMLogic-ModuleDefinitionDirectReference
* Metadata: Identifier
  * ?: urn:oid:2.16.840.1.113883.4.642.40.61.28.19
* Metadata: Experimental
  * ?: true
* Metadata: Jurisdiction
  * ?: 001 from[http://unstats.un.org/unsd/methods/m49/m49.htm](http://unstats.un.org/unsd/methods/m49/m49.htm)
* Metadata: Steward (Publisher)
  * ?: HL7 International / Clinical Quality Information
* Metadata: Description
  * ?: This library is used as an example module definition in the FHIR Quality Measure Implementation Guide
* Metadata: Type
  * ?: module-definition from[http://terminology.hl7.org/CodeSystem/library-type](http://terminology.hl7.org/7.1.0/CodeSystem-library-type.html)
* Metadata: Dependency
  * ?: **Description**: FHIR model information**Resource**:[http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1](http://hl7.org/fhir/uv/cql/STU2/Library-FHIR-ModelInfo.html)**Canonical URL**:http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1
* Metadata: Dependency
  * ?: **Description**: Library FHIRHelpers**Resource**:[http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1](http://hl7.org/fhir/uv/cql/STU2/Library-FHIRHelpers.html)**Canonical URL**:http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
* Metadata: Dependency
  * ?: **Description**: Code system Diagnosis Role**Resource**:[Diagnosis Role](http://terminology.hl7.org/7.1.0/CodeSystem-diagnosis-role.html)**Canonical URL**:http://terminology.hl7.org/CodeSystem/diagnosis-role
* Metadata: Dependency
  * ?: **Description**: Value set Emergency Department Visit**Resource**:[Emergency Department Visit](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion)**Canonical URL**:http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
* Metadata: Dependency
  * ?: **Description**: Value set Psychiatric/Mental Health Patient**Resource**:[Psychiatric/Mental Health Diagnosis](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.299/expansion)**Canonical URL**:http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299
* Metadata: Dependency
  * ?: **Description**: Value set Hospital Settings**Resource**:[Hospital Settings](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.126/expansion)**Canonical URL**:http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126
* Metadata: Dependency
  * ?: **Description**: Value set Chronic Liver Disease Legacy Example**Resource**:[Chronic Liver Disease Legacy Example](ValueSet-chronic-liver-disease-legacy-example.md)**Canonical URL**:http://hl7.org/fhir/uv/cqm/ValueSet/chronic-liver-disease-legacy-example
* Metadata: Dependency
  * ?: **Description**: Value set ONC Administrative Sex**Resource**:[ONC Administrative Sex](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1/expansion)**Canonical URL**:http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1
* Metadata: Dependency
  * ?: **Description**: Value set Race**Resource**:[Race](https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.836/expansion)**Canonical URL**:http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836
* Metadata: Dependency
  * ?: **Description**: Value set Ethnicity**Resource**:[Ethnicity](https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.837/expansion)**Canonical URL**:http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837
* Metadata: Dependency
  * ?: **Description**: Value set Payer**Resource**:[Payer Type](https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion)**Canonical URL**:http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
* Metadata: Data Requirement
  * ?: **Type**: Patient**Profile(s)**:[Patient](http://hl7.org/fhir/R4/patient.html)
* Metadata: Data Requirement
  * ?: **Type**: Encounter**Profile(s)**:[Encounter](http://hl7.org/fhir/R4/encounter.html)**Must Support Elements**: type, status, period**Code Filter(s)**:**Path**: type**ValueSet**:[Emergency Department Visit](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion)
* Metadata: Data Requirement
  * ?: **Type**: Condition**Profile(s)**:[Condition](http://hl7.org/fhir/R4/condition.html)**Must Support Elements**: id**Code Filter(s)**:**Path**: id
* Metadata: Data Requirement
  * ?: **Type**: Coverage**Profile(s)**:[Coverage](http://hl7.org/fhir/R4/coverage.html)**Must Support Elements**: type, period**Code Filter(s)**:**Path**: type**ValueSet**:[Payer Type](https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion)
* Metadata: Data Requirement
  * ?: **Type**: Patient**Profile(s)**:[Patient](http://hl7.org/fhir/R4/patient.html)**Must Support Elements**: url, extension, value
* Metadata: Data Requirement
  * ?: **Type**: Encounter**Profile(s)**:[Encounter](http://hl7.org/fhir/R4/encounter.html)**Must Support Elements**: period
* Metadata:  Parameters
* Metadata: 
  * ?: 
| | | | | |
| :--- | :--- | :--- | :--- | :--- |
| **Name** | **Use** | **Card.** | **Type** | **Documentation** |
| Measurement Period | In | 0..1 | Period |  |
| Patient | Out | 0..1 | Patient |  |
| Inpatient Encounter | Out | 0..* | Encounter |  |
| Initial Population | Out | 0..* | Encounter |  |
| Measure Population | Out | 0..* | Encounter |  |
| Stratifier 1 | Out | 0..* | Encounter |  |
| Stratifier 2 | Out | 0..* | Encounter |  |
| Stratifier 3 | Out | 0..* | Encounter |  |
| Stratifier 4 | Out | 0..* | Encounter |  |
| SDE Ethnicity | Out | 0..* | Coding |  |
| SDE Payer | Out | 0..* | Resource |  |
| SDE Race | Out | 0..* | Coding |  |
| SDE Sex | Out | 0..1 | Coding |  |

* Metadata: Generated using version 0.5.4 of the sample-content-ig Liquid templates



## Resource Content

```json
{
  "resourceType" : "Library",
  "id" : "EXMLogic-ModuleDefinitionDirectReference",
  "meta" : {
    "profile" : ["http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-moduledefinitionlibrary"]
  },
  "extension" : [{
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
    "valueCoding" : {
      "system" : "http://terminology.hl7.org/CodeSystem/diagnosis-role",
      "code" : "billing",
      "display" : "Billing"
    }
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "Inpatient Encounter"
    },
    {
      "url" : "statement",
      "valueString" : "define \"Inpatient Encounter\" :\n  [\"Encounter\"] Encounter\n    where LengthInDays(Encounter.period) <= 120\n      and Encounter.period ends during \"Measurement Period\""
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 0
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "Initial Population"
    },
    {
      "url" : "statement",
      "valueString" : "define \"Initial Population\" :\n  \"Inpatient Encounter\" Encounter"
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 1
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "Measure Population"
    },
    {
      "url" : "statement",
      "valueString" : "define \"Measure Population\" :\n  \"Initial Population\""
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 2
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "Stratifier 1"
    },
    {
      "url" : "statement",
      "valueString" : "define \"Stratifier 1\" :\n  \"Inpatient Encounter\" Encounter\n    where not (PrincipalDiagnosis(Encounter).code in \"Psychiatric/Mental Health Patient\")"
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 3
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "Stratifier 2"
    },
    {
      "url" : "statement",
      "valueString" : "define \"Stratifier 2\" :\n  \"Inpatient Encounter\" Encounter\n    where PrincipalDiagnosis(Encounter).code in \"Psychiatric/Mental Health Patient\""
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 4
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "Stratifier 3"
    },
    {
      "url" : "statement",
      "valueString" : "define \"Stratifier 3\" :\n  \"Inpatient Encounter\" Encounter\n    where PrincipalDiagnosis(Encounter) is null"
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 5
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "Stratifier 4"
    },
    {
      "url" : "statement",
      "valueString" : "define \"Stratifier 4\" :\n  \"Inpatient Encounter\" Encounter\n    where PrincipalDiagnosis(Encounter) is null"
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 6
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "SDE Ethnicity"
    },
    {
      "url" : "statement",
      "valueString" : "define \"SDE Ethnicity\":\n  (flatten (\n    Patient.extension Extension\n      where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'\n        return Extension.extension\n  )) E\n    where E.url = 'ombCategory'\n      or E.url = 'detailed'\n    return E.value as Coding"
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 7
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "SDE Payer"
    },
    {
      "url" : "statement",
      "valueString" : "define \"SDE Payer\":\n    [Coverage: type in \"Payer\"] Payer\n      return {\n        code: Payer.type,\n        period: Payer.period\n      }"
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 8
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "SDE Race"
    },
    {
      "url" : "statement",
      "valueString" : "define \"SDE Race\":\n  (flatten (\n    Patient.extension Extension\n      where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'\n        return Extension.extension\n  )) E\n    where E.url = 'ombCategory'\n      or E.url = 'detailed'\n    return E.value as Coding"
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 9
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "extension" : [{
      "url" : "libraryName",
      "valueString" : "EXMLogic"
    },
    {
      "url" : "name",
      "valueString" : "SDE Sex"
    },
    {
      "url" : "statement",
      "valueString" : "define \"SDE Sex\":\n  case\n    when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }\n    when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }\n    else null\n  end"
    },
    {
      "url" : "displaySequence",
      "valueInteger" : 10
    }],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
    "valueCode" : "cqi"
  }],
  "url" : "http://hl7.org/fhir/uv/cqm/Library/EXMLogic-ModuleDefinitionDirectReference",
  "identifier" : [{
    "use" : "official",
    "system" : "http://example.org/fhir/cqi/ecqm/Library/Identifier",
    "value" : "EXMLogic-ModuleDefinitionDirectReference"
  },
  {
    "system" : "urn:ietf:rfc:3986",
    "value" : "urn:oid:2.16.840.1.113883.4.642.40.61.28.19"
  }],
  "version" : "1.0.0",
  "name" : "EXMLogicModuleDefinitionDirectReference",
  "title" : "Example Logic Library - Module Definition Direct Reference",
  "status" : "active",
  "experimental" : true,
  "type" : {
    "coding" : [{
      "system" : "http://terminology.hl7.org/CodeSystem/library-type",
      "code" : "module-definition"
    }]
  },
  "date" : "2019-09-03",
  "publisher" : "HL7 International / Clinical Quality Information",
  "contact" : [{
    "telecom" : [{
      "system" : "url",
      "value" : "http://www.hl7.org/Special/committees/cqi"
    }]
  }],
  "description" : "This library is used as an example module definition in the FHIR Quality Measure Implementation Guide",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
      "code" : "001"
    }]
  }],
  "relatedArtifact" : [{
    "type" : "depends-on",
    "display" : "FHIR model information",
    "resource" : "http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1"
  },
  {
    "type" : "depends-on",
    "display" : "Library FHIRHelpers",
    "resource" : "http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"
  },
  {
    "type" : "depends-on",
    "display" : "Code system Diagnosis Role",
    "resource" : "http://terminology.hl7.org/CodeSystem/diagnosis-role"
  },
  {
    "type" : "depends-on",
    "display" : "Value set Emergency Department Visit",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
  },
  {
    "type" : "depends-on",
    "display" : "Value set Psychiatric/Mental Health Patient",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299"
  },
  {
    "type" : "depends-on",
    "display" : "Value set Hospital Settings",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126"
  },
  {
    "type" : "depends-on",
    "display" : "Value set Chronic Liver Disease Legacy Example",
    "resource" : "http://hl7.org/fhir/uv/cqm/ValueSet/chronic-liver-disease-legacy-example"
  },
  {
    "type" : "depends-on",
    "display" : "Value set ONC Administrative Sex",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1"
  },
  {
    "type" : "depends-on",
    "display" : "Value set Race",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836"
  },
  {
    "type" : "depends-on",
    "display" : "Value set Ethnicity",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837"
  },
  {
    "type" : "depends-on",
    "display" : "Value set Payer",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
  }],
  "parameter" : [{
    "name" : "Measurement Period",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "type" : "Period"
  },
  {
    "name" : "Patient",
    "use" : "out",
    "min" : 0,
    "max" : "1",
    "type" : "Patient"
  },
  {
    "name" : "Inpatient Encounter",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Initial Population",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Measure Population",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Stratifier 1",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Stratifier 2",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Stratifier 3",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Stratifier 4",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "SDE Ethnicity",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Coding"
  },
  {
    "name" : "SDE Payer",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Resource"
  },
  {
    "name" : "SDE Race",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Coding"
  },
  {
    "name" : "SDE Sex",
    "use" : "out",
    "min" : 0,
    "max" : "1",
    "type" : "Coding"
  }],
  "dataRequirement" : [{
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Patient?_id={{context.patientId}}"
    }],
    "type" : "Patient",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Patient"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Encounter?subject=Patient/{{context.patientId}}"
    }],
    "type" : "Encounter",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Encounter"],
    "mustSupport" : ["period"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Encounter?subject=Patient/{{context.patientId}}"
    }],
    "type" : "Encounter",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Encounter"],
    "mustSupport" : ["period"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Encounter?subject=Patient/{{context.patientId}}&type:in=http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
    }],
    "type" : "Encounter",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Encounter"],
    "mustSupport" : ["type", "status", "period"],
    "codeFilter" : [{
      "path" : "type",
      "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
    }]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Condition?subject=Patient/{{context.patientId}}"
    }],
    "type" : "Condition",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Condition"],
    "mustSupport" : ["id"],
    "codeFilter" : [{
      "path" : "id"
    }]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Encounter?subject=Patient/{{context.patientId}}"
    }],
    "type" : "Encounter",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Encounter"],
    "mustSupport" : ["period"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Encounter?subject=Patient/{{context.patientId}}"
    }],
    "type" : "Encounter",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Encounter"],
    "mustSupport" : ["period"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Encounter?subject=Patient/{{context.patientId}}"
    }],
    "type" : "Encounter",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Encounter"],
    "mustSupport" : ["period"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Encounter?subject=Patient/{{context.patientId}}"
    }],
    "type" : "Encounter",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Encounter"],
    "mustSupport" : ["period"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Patient?_id={{context.patientId}}"
    }],
    "type" : "Patient",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Patient"],
    "mustSupport" : ["url", "extension", "value"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Patient?_id={{context.patientId}}"
    }],
    "type" : "Patient",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Patient"],
    "mustSupport" : ["url", "extension", "value"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Coverage?beneficiary=Patient/{{context.patientId}}&type:in=http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
    }],
    "type" : "Coverage",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Coverage"],
    "mustSupport" : ["type", "period"],
    "codeFilter" : [{
      "path" : "type",
      "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
    }]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Patient?_id={{context.patientId}}"
    }],
    "type" : "Patient",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Patient"],
    "mustSupport" : ["url", "extension", "value"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Patient?_id={{context.patientId}}"
    }],
    "type" : "Patient",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Patient"],
    "mustSupport" : ["url", "extension", "value"]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Encounter?subject=Patient/{{context.patientId}}"
    }],
    "type" : "Encounter",
    "profile" : ["http://hl7.org/fhir/StructureDefinition/Encounter"],
    "mustSupport" : ["period"]
  }]
}

```
