Using CQL with FHIR
2.0.0-ballot - STU2Ballot International flag

Using CQL with FHIR, published by HL7 International / Clinical Decision Support. This guide is not an authorized publication; it is the continuous build for version 2.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/cql-ig/ and changes regularly. 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" : "extensions",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n<div>\n    <table class=\"grid dict\">\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Title: </b></th>\n            <td style=\"padding-left: 4px;\">Example Logic Library - Module Definition</td>\n        </tr>\n        \n\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Id: </b></th>\n            <td style=\"padding-left: 4px;\">module-example</td>\n        </tr>\n        \n\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Version: </b></th>\n            <td style=\"padding-left: 4px;\">2.0.0-ballot</td>\n        </tr>\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Url: </b></th>\n            <td style=\"padding-left: 4px;\"><a href=\"Library-module-example.html\">Example Logic Library - Module Definition</a></td>\n        </tr>\n        \n\n        \n        <tr>\n            <th scope=\"row\">\n                <b>\n                    \n                        Official\n                    \n                </b>\n            </th>\n            <td style=\"padding-left: 4px;\">\n                \n                <p style=\"margin-bottom: 5px;\">\n                    <span>EXMLogic</span>\n                </p>\n                \n            </td>\n        </tr>\n        \n        <tr>\n            <th scope=\"row\">\n                <b>\n                    \n                        \n                    \n                </b>\n            </th>\n            <td style=\"padding-left: 4px;\">\n                \n                <p style=\"margin-bottom: 5px;\">\n                    <span>urn:oid:2.16.840.1.113883.4.642.40.37.28.8</span>\n                </p>\n                \n            </td>\n        </tr>\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Experimental: </b></th>\n            <td style=\"padding-left: 4px;\">true</td>\n        </tr>\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Type: </b></th>\n            <td style=\"padding-left: 4px;\">\n                \n                    \n                        \n                        <p style=\"margin-bottom: 5px;\">\n                            <b>system: </b> <span><a href=\"http://terminology.hl7.org/6.1.0/CodeSystem-library-type.html\">http://terminology.hl7.org/CodeSystem/library-type</a></span>\n                        </p>\n                        \n                        \n                        <p style=\"margin-bottom: 5px;\">\n                            <b>code: </b> <span>module-definition</span>\n                        </p>\n                        \n                        \n                    \n                \n                \n            </td>\n        </tr>\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Date: </b></th>\n            <td style=\"padding-left: 4px;\">2019-09-03</td>\n        </tr>\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Publisher: </b></th>\n            <td style=\"padding-left: 4px;\">HL7 International / Clinical Decision Support</td>\n        </tr>\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Description: </b></th>\n            <td style=\"padding-left: 4px;\"><div><p>This library is used as an example module definition in the Using FHIR with CQL Implementation Guide</p>\n</div></td>\n        </tr>\n        \n\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Jurisdiction: </b></th>\n            <td style=\"padding-left: 4px;\">001</td>\n        </tr>\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Related Artifacts: </b></th>\n            <td style=\"padding-left: 4px;\">\n                \n                \n                \n                <p><b>Dependencies</b></p>\n                <ul>\n                  \n                    <li><code>http://example.org/fhir/us/qicore/Library/QICore-ModelInfo|4.1.1</code></li>\n                  \n                    <li><code>http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1</code></li>\n                  \n                    <li><a href=\"http://terminology.hl7.org/6.1.0/CodeSystem-diagnosis-role.html\">Diagnosis Role</a></li>\n                  \n                    <li><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</code></li>\n                  \n                    <li><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299</code></li>\n                  \n                    <li><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126</code></li>\n                  \n                    <li><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1</code></li>\n                  \n                    <li><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836</code></li>\n                  \n                    <li><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837</code></li>\n                  \n                    <li><code>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</code></li>\n                  \n                </ul>\n                \n                \n                \n                \n                \n            </td>\n        </tr>\n        \n\n        \n        <tr>\n          <th scope=\"row\"><b>Parameters: </b></th>\n          <td style=\"padding-left: 4px;\">\n            <table class=\"grid-dict\">\n              <tr><th><b>Name</b></th><th><b>Type</b></th><th><b>Min</b></th><th><b>Max</b></th><th><b>In/Out</b></th></tr>\n              \n                <tr><th>Measurement Period</th><th>Period</th><th>0</th><th>1</th><th>In</th></tr>\n              \n                <tr><th>Patient</th><th>Patient</th><th>0</th><th>1</th><th>Out</th></tr>\n              \n                <tr><th>Inpatient Encounter</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Initial Population</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Measure Population</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Stratifier 1</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Stratifier 2</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Stratifier 3</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Stratifier 4</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Ethnicity</th><th>Coding</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Payer</th><th>Resource</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Race</th><th>Coding</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Sex</th><th>Coding</th><th>0</th><th>1</th><th>Out</th></tr>\n              \n            </table>\n          </td>\n        </tr>\n        \n\n        \n        <tr>\n          <th scope=\"row\"><b>Data Requirements:</b></th>\n          <td style=\"padding-left: 4px;\">\n            <table class=\"grid-dict\">\n              <tr><th><b>Type</b></th><th><b>Profile</b></th><th><b>MS</b></th><th><b>Code Filter</b></th></tr>\n              \n                <tr>\n                  <th>Patient</th>\n                  <th>http://example.org/fhir/us/qicore/StructureDefinition/qicore-patient</th>\n                  <th>;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Encounter</th>\n                  <th>http://example.org/fhir/us/qicore/StructureDefinition/qicore-encounter</th>\n                  <th/>\n                  <th>\n                    \n                      <b>code filter: </b>\n                      \n                      <br/>\n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>path: </b><span>type</span>\n                      </span>\n                      \n                      <br/>\n                      \n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</span>\n                      </span>\n                      \n                      \n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Condition</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Condition</th>\n                  <th/>\n                  <th>\n                    \n                      <b>code filter: </b>\n                      \n                      <br/>\n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>path: </b><span>id</span>\n                      </span>\n                      \n                      \n                      \n                      \n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Coverage</th>\n                  <th>http://example.org/fhir/us/qicore/StructureDefinition/qicore-coverage</th>\n                  <th/>\n                  <th>\n                    \n                      <b>code filter: </b>\n                      \n                      <br/>\n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>path: </b><span>type</span>\n                      </span>\n                      \n                      <br/>\n                      \n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</span>\n                      </span>\n                      \n                      \n                    \n                  </th>\n                </tr>\n              \n            </table>\n          </td>\n        </tr>\n        \n\n        \n    </table>\n</div>\n</div>"
  },
  "url" : "http://hl7.org/fhir/uv/cql/Library/module-example",
  "identifier" : [
    {
      "use" : "official",
      "system" : "http://example.org/fhir/cqi/ecqm/Library/Identifier",
      "value" : "EXMLogic"
    },
    {
      "system" : "urn:ietf:rfc:3986",
      "value" : "urn:oid:2.16.840.1.113883.4.642.40.37.28.8"
    }
  ],
  "version" : "2.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" : "QICore model information",
      "resource" : "http://example.org/fhir/us/qicore/Library/QICore-ModelInfo|4.1.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}}"
        }
      ],
      "type" : "Patient",
      "profile" : [
        "http://example.org/fhir/us/qicore/StructureDefinition/qicore-patient"
      ],
      "mustSupport" : [
        "extension('http://example.org/fhir/us/core/StructureDefinition/us-core-ethnicity')"
      ],
      "_mustSupport" : [
        {
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/StructureDefinition/rendered-value",
              "valueString" : "ethnicity"
            }
          ]
        }
      ]
    },
    {
      "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
        },
        {
          "extension" : [
            {
              "url" : "path",
              "valueString" : "status"
            },
            {
              "url" : "comparator",
              "valueCode" : "eq"
            },
            {
              "url" : "value",
              "valueString" : "finished"
            }
          ],
          "url" : "http://hl7.org/fhir/StructureDefinition/cqf-valueFilter"
        }
      ],
      "type" : "Encounter",
      "profile" : [
        "http://example.org/fhir/us/qicore/StructureDefinition/qicore-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://example.org/fhir/us/qicore/StructureDefinition/qicore-coverage"
      ],
      "codeFilter" : [
        {
          "path" : "type",
          "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
        }
      ]
    }
  ]
}