Using CQL with FHIR
1.0.0-ballot - Ballot International flag

This page is part of the Using CQL with FHIR Implementation Guide (v1.0.0-ballot: STU1 Ballot 1) based on FHIR (HL7® FHIR® Standard) R4. . For a full list of available versions, see the Directory of published versions

: Example Logic Library - Module Definition - JSON Representation

Active as of 2019-09-03

Raw json | Download


{
  "resourceType" : "Library",
  "id" : "module-example",
  "meta" : {
    "profile" : [
      🔗 "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-module"
    ]
  },
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Related Artifacts</h2><table class=\"grid\"><tr><td>depends-on</td><td>FHIR model information</td><td><code>http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1</code></td></tr><tr><td>depends-on</td><td>Library FHIRHelpers</td><td><code>http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1</code></td></tr><tr><td>depends-on</td><td>Code system Diagnosis Role</td><td><a href=\"http://terminology.hl7.org/5.3.0/CodeSystem-diagnosis-role.html\">Diagnosis Role</a></td></tr><tr><td>depends-on</td><td>Value set Emergency Department Visit</td><td><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</code></td></tr><tr><td>depends-on</td><td>Value set Psychiatric/Mental Health Patient</td><td><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299</code></td></tr><tr><td>depends-on</td><td>Value set Hospital Settings</td><td><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126</code></td></tr><tr><td>depends-on</td><td>Value set ONC Administrative Sex</td><td><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1</code></td></tr><tr><td>depends-on</td><td>Value set Race</td><td><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836</code></td></tr><tr><td>depends-on</td><td>Value set Ethnicity</td><td><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837</code></td></tr><tr><td>depends-on</td><td>Value set Payer</td><td><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</code></td></tr></table><h2>Parameters</h2><table class=\"grid\"><tr><td>Measurement Period</td><td>in</td><td>0</td><td>1</td><td>Period</td></tr><tr><td>Patient</td><td>out</td><td>0</td><td>1</td><td>Patient</td></tr><tr><td>Inpatient Encounter</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Initial Population</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Measure Population</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Stratifier 1</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Stratifier 2</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Stratifier 3</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Stratifier 4</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>SDE Ethnicity</td><td>out</td><td>0</td><td>*</td><td>Coding</td></tr><tr><td>SDE Payer</td><td>out</td><td>0</td><td>*</td><td>Resource</td></tr><tr><td>SDE Race</td><td>out</td><td>0</td><td>*</td><td>Coding</td></tr><tr><td>SDE Sex</td><td>out</td><td>0</td><td>1</td><td>Coding</td></tr></table><h2>Data Requirements</h2><table class=\"grid\"><tr><td colspan=\"2\"><b>Type</b>: <a href=\"http://hl7.org/fhir/R4/patient.html\">Patient</a> (<a href=\"http://hl7.org/fhir/R4/patient.html\">Patient</a>)</td></tr></table><table class=\"grid\"><tr><td colspan=\"2\"><b>Type</b>: <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a> (<a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>)</td></tr><tr style=\"background-color: #efefef\"><td>Filter</td><td>Value</td></tr><tr><td>type</td><td>In ValueSet <a href=\"http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292\">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</a></td></tr></table><table class=\"grid\"><tr><td colspan=\"2\"><b>Type</b>: <a href=\"http://hl7.org/fhir/R4/condition.html\">Condition</a> (<a href=\"http://hl7.org/fhir/R4/condition.html\">Condition</a>)</td></tr><tr style=\"background-color: #efefef\"><td>Filter</td><td>Value</td></tr><tr><td>id</td><td>One of these codes: </td></tr></table><table class=\"grid\"><tr><td colspan=\"2\"><b>Type</b>: <a href=\"http://hl7.org/fhir/R4/coverage.html\">Coverage</a> (<a href=\"http://hl7.org/fhir/R4/coverage.html\">Coverage</a>)</td></tr><tr style=\"background-color: #efefef\"><td>Filter</td><td>Value</td></tr><tr><td>type</td><td>In ValueSet <a href=\"http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591\">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</a></td></tr></table><h2>Contents</h2></div>"
  },
  "extension" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode" : "cds"
    }
  ],
  "url" : "http://hl7.org/fhir/uv/cql/Library/module-example",
  "identifier" : [
    {
      "use" : "official",
      "system" : "http://example.org/fhir/cqi/ecqm/Library/Identifier",
      "value" : "EXMLogic"
    }
  ],
  "version" : "1.0.0-ballot",
  "name" : "EXMLogicModuleDefinition",
  "title" : "Example Logic Library - Module Definition",
  "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 Decision Support",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.hl7.org/Special/committees/dss"
        }
      ]
    }
  ],
  "description" : "This library is used as an example module definition in the Using FHIR with CQL Implementation Guide",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code" : "001",
          "display" : "World"
        }
      ]
    }
  ],
  "relatedArtifact" : [
    {
      "type" : "depends-on",
      "display" : "FHIR model information",
      "resource" : "http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1"
    },
    {
      "type" : "depends-on",
      "display" : "Library FHIRHelpers",
      "resource" : "http://fhir.org/guides/cqf/common/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 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}}"
        },
        {
          "extension" : [
            {
              "url" : "path",
              "valueString" : "url"
            },
            {
              "url" : "comparator",
              "valueCode" : "eq"
            },
            {
              "url" : "value",
              "valueString" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"
            }
          ],
          "url" : "http://hl7.org/fhir/StructureDefinition/cqf-valueFilter"
        }
      ],
      "type" : "Patient",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Patient"
      ]
    },
    {
      "extension" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
          "valueString" : "Encounter?status=finished&subject=Patient/{{context.patientId}}&type:in=http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/cqf-isSelective",
          "valueBoolean" : true
        }
      ],
      "type" : "Encounter",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
      ],
      "codeFilter" : [
        {
          "path" : "type",
          "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
        }
      ]
    },
    {
      "type" : "Condition",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Condition"
      ],
      "codeFilter" : [
        {
          "path" : "id"
        }
      ]
    },
    {
      "extension" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
          "valueString" : "Coverage?policy-holder=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"
      ],
      "codeFilter" : [
        {
          "path" : "type",
          "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
        }
      ]
    }
  ]
}