Quality Measure Implementation Guide, published by HL7 International / Clinical Quality Information. This guide is not an authorized publication; it is the continuous build for version 2.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cqm/ and changes regularly. See the Directory of published versions
| Page standards status: Informative |
{
"resourceType" : "Measure",
"id" : "EXM55-FHIR",
"meta" : {
"profile" : [
🔗 "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-cvmeasure"🔗 ,
"http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-computablemeasure"🔗 ,
"http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablemeasure"
]
},
"language" : "en",
"text" : {
"status" : "extensions",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <table class=\"narrative-table\">\n <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"metadata\"> </a>Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">EXM55 - Median Emergency Department Visit Duration</td>\n\n\n</tr>\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">2.0.0</td>\n\n\n</tr>\n\n\n\n\n\n\n\n \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n\n<td class=\"content-container\">55</td>\n\n\n</tr>\n\n\n \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n\n<td class=\"content-container\">urn:oid:2.16.840.1.113883.4.642.40.61.29.8</td>\n\n\n</tr>\n\n\n\n \n \n \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Effective Period</th>\n\n\n\n<td class=\"content-container\">2018-01-01 through 2018-12-31</td>\n\n\n</tr>\n\n \n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Approval Date</th>\n\n\n\n<td class=\"content-container\">2019-03-08</td>\n\n\n</tr>\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Last Review Date</th>\n\n\n\n<td class=\"content-container\">2019-03-08</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n\n\n<td class=\"content-container\">true</td>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Use Context</th>\n\n\n\n<td class=\"content-container\">\n Clinical Venue\n\n = \n EH\n\n\n</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Jurisdiction</th>\n\n\n\n<td class=\"content-container\">\n <a href=\"http://unstats.un.org/unsd/methods/m49/m49.htm\">http://unstats.un.org/unsd/methods/m49/m49.htm</a>#001\n\n\n</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Topic</th>\n\n\n\n<td class=\"content-container\">\n Health Quality Measure Document\n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n\n<td class=\"content-container\">HL7 International / Clinical Quality Information</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n\n<td class=\"content-container\"><div><p>This example illustrates a continuous variable measure represented as a FHIR eCQM</p>\n</div></td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Measure Basis</th>\n\n\n\n<td class=\"content-container\">Encounter</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Measure Scoring</th>\n\n\n\n<td class=\"content-container\">\n Continuous Variable\n\n\n</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Improvement Notation</th>\n\n\n\n<td class=\"content-container\">\n Decreased score indicates improvement\n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Measure Type</th>\n\n\n\n<td class=\"content-container\">\n <a href=\"http://terminology.hl7.org/7.3.0/CodeSystem-measure-type.html\">http://terminology.hl7.org/CodeSystem/measure-type</a>#process\n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n <th scope=\"row\" class=\"row-header\"><a name=\"contents\"> </a>Contents</th>\n <td class=\"content-container\">\n <em><a href=\"#metadata\">Metadata</a></em>\n <br/>\n <em><a href=\"#contents\">Contents</a></em>\n <br/>\n <em><a href=\"#measure-rates\">Measure Rates (Groups)</a></em>\n <br/>\n <em><a href=\"#supplemental-data\">Supplemental Data</a></em>\n <br/>\n \n <em><a href=\"#measure-logic\">Measure Logic</a></em>\n <br/>\n \n \n <em><a href=\"#population-criteria\">Population Criteria</a></em>\n <br/>\n <em><a href=\"#definitions\">Logic Definitions</a></em>\n <br/>\n <em><a href=\"#terminology\">Terminology</a></em>\n <br/>\n <em><a href=\"#dependencies\">Dependencies</a></em>\n <br/>\n <em><a href=\"#data-requirements\">Data Requirements</a></em>\n <br/>\n \n \n \n </td>\n</tr>\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"measure-rates\"> </a>Measure Rates (Groups)</th>\n\n\n</tr>\n\n \n \n \n \n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Rate (Group) (ID: primary)</th>\n\n\n</tr>\n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n \n \n\n \n \n \n \n \n \n <tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n \n <td class=\"content-container\">\n \n <em>ID</em>: primary-exm55-initial-population\n <br/>\n \n \n \n \n \n \n \n \n <em>Criteria</em>: <a href=\"#primary-primary-exm55-initial-population\">Initial Population</a> \n \n \n \n \n \n \n </td>\n </tr>\n \n\n \n \n\n \n \n \n \n \n \n <tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Measure Population</th>\n\n\n \n <td class=\"content-container\">\n \n <em>ID</em>: primary-exm55-measure-population\n <br/>\n \n \n \n \n \n \n \n \n <em>Criteria</em>: <a href=\"#primary-primary-exm55-measure-population\">Measure Population</a> \n \n \n \n \n \n \n </td>\n </tr>\n \n\n \n \n\n \n \n \n \n \n \n <tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Measure Population Exclusion</th>\n\n\n \n <td class=\"content-container\">\n \n <em>ID</em>: primary-exm55-measure-population-exclusion\n <br/>\n \n \n \n \n \n \n \n \n <em>Criteria</em>: <a href=\"#primary-primary-exm55-measure-population-exclusion\">Measure Population Exclusion</a> \n \n \n \n \n \n \n </td>\n </tr>\n \n\n \n \n\n \n \n \n \n \n \n <tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n \n <td class=\"content-container\">\n \n <em>ID</em>: primary-exm55-measure-population-identifier\n <br/>\n \n \n \n \n \n \n \n \n <em>Criteria</em>: <a href=\"#primary-primary-exm55-measure-population-identifier\">Measure Observation</a> \n \n \n \n \n \n <br/><em>Input population</em>: measure-population-identifier\n \n \n <em>Aggregate method</em>: median\n \n </td>\n </tr>\n \n\n \n \n\n \n\n\n \n\n<tr>\n \n\n<th scope=\"row\" class=\"row-header\">Stratifier</th>\n\n\n <td class=\"content-container\">\n \n \n \n <em>Code</em>: Stratification 1\n \n \n \n \n \n <br/>\n <em>Applies to</em>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-population initial-population}\">Initial Population</span>\n \n </td>\n</tr>\n\n<tr>\n \n\n<th scope=\"row\" class=\"row-header\">Stratifier</th>\n\n\n <td class=\"content-container\">\n \n \n \n <em>Code</em>: Stratification 2\n \n \n \n \n \n <br/>\n <em>Applies to</em>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-population initial-population}\">Initial Population</span>\n \n </td>\n</tr>\n\n<tr>\n \n\n<th scope=\"row\" class=\"row-header\">Stratifier</th>\n\n\n <td class=\"content-container\">\n \n \n \n <em>Code</em>: Stratification 3\n \n \n \n \n \n <br/>\n <em>Applies to</em>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/measure-population initial-population}\">Initial Population</span>\n \n </td>\n</tr>\n\n\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"supplemental-data\"> </a>Supplemental Data Elements</th>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"measure-logic\"> </a>Measure Logic</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Primary Library</th>\n\n\n\n<td class=\"content-container\"><a href=\"Library-EXM55.html\">EXM55 - Median Emergency Department Visit Duration Library (Example Continuous Variable Measure Library)</a></td>\n\n\n</tr>\n\n\n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"population-criteria\"> </a>Population Criteria</th>\n\n\n</tr>\n \n \n \n\n \n \n \n \n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Rate (Group) (ID: primary)</th>\n\n\n</tr>\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Initial Population\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n \n <a name=\"primary-primary-exm55-initial-population\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Initial Population" :\n "Inpatient Encounter" Encounter\n with ["Encounter" : "Emergency Department Visit"] ED\n such that ED.status = 'finished'\n and ED.period ends 1 hour or less before start of Encounter.period</code></pre>\n \n \n <a href=\"#exm55-initial-population\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Measure Population\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n \n <a name=\"primary-primary-exm55-measure-population\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Measure Population" :\n "Initial Population"</code></pre>\n \n \n <a href=\"#exm55-measure-population\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Measure Population Exclusion\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n \n <a name=\"primary-primary-exm55-measure-population-exclusion\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Measure Population Exclusion" :\n "Inpatient Encounter" Encounter\n with ["Encounter" : "Emergency Department Visit"] ED\n such that ED.period ends 1 hour or less before start of Encounter.period\n and ED.status = 'finished'\n and ED.hospitalization.admitSource in "Hospital Settings"</code></pre>\n \n \n <a href=\"#exm55-measure-population-exclusion\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Measure Observation\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n \n <a name=\"primary-primary-exm55-measure-population-identifier\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function "Measure Observation"(Encounter "Encounter") :\n duration in minutes of "Related ED Visit"(Encounter).period</code></pre>\n \n \n <a href=\"#exm55-measure-observation\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n\n \n \n\n \n\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Stratifier\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Stratification 1" :\n "Inpatient Encounter" Encounter\n where not (Encounter.principalDiagnosis().diagnosis in "Psychiatric/Mental Health Patient")</code></pre>\n \n \n <a href=\"#exm55-stratification-1\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Stratifier\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Stratification 2" :\n "Inpatient Encounter" Encounter\n where Encounter.principalDiagnosis().diagnosis in "Psychiatric/Mental Health Patient"</code></pre>\n \n \n <a href=\"#exm55-stratification-2\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Stratifier\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Stratification 3" :\n "Inpatient Encounter" Encounter\n where Encounter.principalDiagnosis().diagnosis is null</code></pre>\n \n \n <a href=\"#exm55-stratification-3\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n\n \n \n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"definitions\"> </a>Logic Definitions</th>\n\n\n</tr>\n \n \n \n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXMCommon</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exmcommon-lengthindays\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define fluent function lengthInDays(Value Interval<DateTime> ):\n difference in days between start of Value and end of Value</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXMCommon</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exmcommon-principaldiagnosis\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define fluent function principalDiagnosis(encounter Encounter):\n singleton from (\n (encounter.claimDiagnosis()) CD\n where CD.type.includesCode("Principal Diagnosis")\n )</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXMCommon</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exmcommon-claimdiagnosis\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define fluent function claimDiagnosis(encounter Encounter):\n encounter E\n let \n claim: ([Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E))),\n claimItem: (claim.item I where I.encounter.references(E))\n return claim.diagnosis D where D.sequence in claimItem.diagnosisSequence</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n\n \n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRCommon</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhircommon-references\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Returns true if any of the given references are to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(references List<FHIR.Reference>, resource FHIR.Resource):\n exists (references R where R.references(resource))</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRCommon</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhircommon-references\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Returns true if the given reference is to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(reference FHIR.Reference, resource FHIR.Resource):\n resource.id = Last(Split(reference.reference, '/'))</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRCommon</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhircommon-includescode\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Returns true if the given code is in the given codeList\n@comment: Returns true if the `code` is equivalent to any of the codes in the given `codeList`, false otherwise.\n*/\ndefine fluent function includesCode(codeList List<CodeableConcept>, code Concept):\n exists (codeList C where C ~ code)</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n\n \n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-tointerval\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)\nvalue to a CQL DateTime Interval\n@comment: If the start value of the given period is unspecified, the starting\nboundary of the resulting interval will be open (meaning the start of the interval\nis unknown, as opposed to interpreted as the beginning of time).\n*/\ndefine function ToInterval(period FHIR.Period):\n if period is null then\n null\n else\n if period."start" is null then\n Interval(period."start".value, period."end".value]\n else\n Interval[period."start".value, period."end".value]</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-tostring\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value ClaimStatus): value.value</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-tostring\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value Use): value.value</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-tostring\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value string): value.value</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-toconcept\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.\n*/\ndefine function ToConcept(concept FHIR.CodeableConcept):\n if concept is null then\n null\n else\n System.Concept {\n codes: concept.coding C return ToCode(C),\n display: concept.text.value\n }</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-tocode\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.\n*/\ndefine function ToCode(coding FHIR.Coding):\n if coding is null then\n null\n else\n System.Code {\n code: coding.code.value,\n system: coding.system.value,\n version: coding.version.value,\n display: coding.display.value\n }</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-tostring\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value EncounterStatus): value.value</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n\n\n \n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXM55</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exm55-inpatient-encounter\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Inpatient Encounter" :\n ["Encounter"] Encounter\n where Encounter.period.lengthInDays() <= 120\n and Encounter.period ends during "Measurement Period"</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXM55</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exm55-stratification-3\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Stratification 3" :\n "Inpatient Encounter" Encounter\n where Encounter.principalDiagnosis().diagnosis is null</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXM55</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exm55-stratification-2\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Stratification 2" :\n "Inpatient Encounter" Encounter\n where Encounter.principalDiagnosis().diagnosis in "Psychiatric/Mental Health Patient"</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXM55</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exm55-measure-population-exclusion\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Measure Population Exclusion" :\n "Inpatient Encounter" Encounter\n with ["Encounter" : "Emergency Department Visit"] ED\n such that ED.period ends 1 hour or less before start of Encounter.period\n and ED.status = 'finished'\n and ED.hospitalization.admitSource in "Hospital Settings"</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXM55</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exm55-stratification-1\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Stratification 1" :\n "Inpatient Encounter" Encounter\n where not (Encounter.principalDiagnosis().diagnosis in "Psychiatric/Mental Health Patient")</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXM55</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exm55-initial-population\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Initial Population" :\n "Inpatient Encounter" Encounter\n with ["Encounter" : "Emergency Department Visit"] ED\n such that ED.status = 'finished'\n and ED.period ends 1 hour or less before start of Encounter.period</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXM55</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exm55-measure-population\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Measure Population" :\n "Initial Population"</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXM55</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exm55-measure-observation\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function "Measure Observation"(Encounter "Encounter") :\n duration in minutes of "Related ED Visit"(Encounter).period</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> EXM55</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"exm55-related-ed-visit\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">//Measure Observation\ndefine function "Related ED Visit"(Encounter "Encounter") :\n Last(["Encounter" : "Emergency Department Visit"] ED\n where ED.status = 'finished'\n and ED.period ends 1 hour or less before start of Encounter.period\n sort by start of period )</code></pre>\n </td>\n\n</tr>\n\n\n\n\n\n \n \n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"terminology\"> </a>Terminology</th>\n\n\n</tr>\n \n \n \n\n \n\n \n\n \n\n \n\n\n<tr>\n \n \n \n\n<th scope=\"row\" class=\"row-header\">Code System</th>\n\n\n \n <td class=\"content-container\">\n \n <em>Description</em>: Code system Diagnosis Type\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.3.0/CodeSystem-ex-diagnosistype.html\">Example Diagnosis Type Codes</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/ex-diagnosistype</tt>\n \n </td>\n</tr>\n \n\n\n<tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n \n \n <td class=\"content-container\">\n \n <em>Description</em>: Value set Psychiatric/Mental Health Patient\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.299/expansion\">Psychiatric/Mental Health Diagnosis</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299</tt>\n \n </td>\n</tr>\n \n\n\n<tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n \n \n <td class=\"content-container\">\n \n <em>Description</em>: Value set Emergency Department Visit\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion\">Emergency Department Visit</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</tt>\n \n </td>\n</tr>\n \n\n\n<tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n \n \n <td class=\"content-container\">\n \n <em>Description</em>: Value set Hospital Settings\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.126/expansion\">Hospital Settings</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126</tt>\n \n </td>\n</tr>\n \n\n\n \n <tr>\n <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n <td class=\"content-container\">\n \n <em>Display</em>: Principal Diagnosis\n <br/>\n \n <em>Code</em>: principal\n <br/>\n <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/ex-diagnosistype</tt>\n </td>\n </tr>\n\n \n \n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"dependencies\"> </a>Dependencies</th>\n\n\n</tr>\n \n \n \n\n\n<tr>\n \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n <td class=\"content-container\">\n \n <em>Description</em>: FHIR model information\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"http://hl7.org/fhir/uv/cql/STU2/Library-FHIR-ModelInfo.html\">http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</tt>\n \n </td>\n</tr>\n \n\n\n<tr>\n \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n <td class=\"content-container\">\n \n <em>Description</em>: Library EXMCommon\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"Library-EXMCommon.html\">EXMCommon</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cqm/Library/EXMCommon</tt>\n \n </td>\n</tr>\n \n\n\n<tr>\n \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n <td class=\"content-container\">\n \n <em>Description</em>: Library FHIRHelpers\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"http://hl7.org/fhir/uv/cql/STU2/Library-FHIRHelpers.html\">http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</tt>\n \n </td>\n</tr>\n \n\n\n<tr>\n \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n <td class=\"content-container\">\n \n <em>Description</em>: Library FHIRCommon\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"http://hl7.org/fhir/uv/cql/STU2/Library-FHIRCommon.html\">http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</tt>\n \n </td>\n</tr>\n \n\n \n\n \n\n \n\n \n\n\n \n \n\n\n\n\n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"data-requirements\"> </a>Data Requirements</th>\n\n\n</tr>\n \n \n \n<tr>\n <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n <td class=\"content-container\">\n <em>Type</em>: Encounter\n <br/>\n \n <em>Profile(s)</em>: \n \n <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n <br/> \n \n \n \n <em>Must Support Elements</em>: period, type\n <br/>\n \n \n </td>\n</tr>\n\n<tr>\n <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n <td class=\"content-container\">\n <em>Type</em>: Encounter\n <br/>\n \n <em>Profile(s)</em>: \n \n <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n <br/> \n \n \n \n <em>Must Support Elements</em>: type, period, status, hospitalization, hospitalization.admitSource\n <br/>\n \n \n <em>Code Filter(s)</em>: \n <br/>\n \n \n <span class=\"tab-one\"><em>Path</em>: type</span>\n <br/>\n \n \n \n <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion\">Emergency Department Visit</a>\n <br/> \n \n \n \n \n </td>\n</tr>\n\n<tr>\n <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n <td class=\"content-container\">\n <em>Type</em>: Claim\n <br/>\n \n <em>Profile(s)</em>: \n \n <a href=\"http://hl7.org/fhir/R4/claim.html\">Claim</a>\n <br/> \n \n \n \n <em>Must Support Elements</em>: status, use, item\n <br/>\n \n \n </td>\n</tr>\n\n \n \n\n\n\n\n<tr>\n <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.6 of the sample-content-ig Liquid templates</th>\n</tr>\n\n </tbody>\n </table>\n</div>"
},
"contained" : [
{
"resourceType" : "Library",
"id" : "effective-data-requirements",
"extension" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode",
"valueCoding" : {
"system" : "http://terminology.hl7.org/CodeSystem/ex-diagnosistype",
"code" : "principal",
"display" : "Principal Diagnosis"
}
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXM55"
},
{
"url" : "name",
"valueString" : "Inpatient Encounter"
},
{
"url" : "statement",
"valueString" : "define \"Inpatient Encounter\" :\n [\"Encounter\"] Encounter\n where Encounter.period.lengthInDays() <= 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" : "EXM55"
},
{
"url" : "name",
"valueString" : "Stratification 3"
},
{
"url" : "statement",
"valueString" : "define \"Stratification 3\" :\n \"Inpatient Encounter\" Encounter\n where Encounter.principalDiagnosis().diagnosis is null"
},
{
"url" : "displaySequence",
"valueInteger" : 1
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXM55"
},
{
"url" : "name",
"valueString" : "Stratification 2"
},
{
"url" : "statement",
"valueString" : "define \"Stratification 2\" :\n \"Inpatient Encounter\" Encounter\n where Encounter.principalDiagnosis().diagnosis in \"Psychiatric/Mental Health Patient\""
},
{
"url" : "displaySequence",
"valueInteger" : 2
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXM55"
},
{
"url" : "name",
"valueString" : "Measure Population Exclusion"
},
{
"url" : "statement",
"valueString" : "define \"Measure Population Exclusion\" :\n \"Inpatient Encounter\" Encounter\n with [\"Encounter\" : \"Emergency Department Visit\"] ED\n such that ED.period ends 1 hour or less before start of Encounter.period\n and ED.status = 'finished'\n and ED.hospitalization.admitSource in \"Hospital Settings\""
},
{
"url" : "displaySequence",
"valueInteger" : 3
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXM55"
},
{
"url" : "name",
"valueString" : "Stratification 1"
},
{
"url" : "statement",
"valueString" : "define \"Stratification 1\" :\n \"Inpatient Encounter\" Encounter\n where not (Encounter.principalDiagnosis().diagnosis in \"Psychiatric/Mental Health Patient\")"
},
{
"url" : "displaySequence",
"valueInteger" : 4
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXM55"
},
{
"url" : "name",
"valueString" : "Initial Population"
},
{
"url" : "statement",
"valueString" : "define \"Initial Population\" :\n \"Inpatient Encounter\" Encounter\n with [\"Encounter\" : \"Emergency Department Visit\"] ED\n such that ED.status = 'finished'\n and ED.period ends 1 hour or less before start of Encounter.period"
},
{
"url" : "displaySequence",
"valueInteger" : 5
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXM55"
},
{
"url" : "name",
"valueString" : "Measure Population"
},
{
"url" : "statement",
"valueString" : "define \"Measure Population\" :\n \"Initial Population\""
},
{
"url" : "displaySequence",
"valueInteger" : 6
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXMCommon"
},
{
"url" : "name",
"valueString" : "lengthInDays"
},
{
"url" : "statement",
"valueString" : "define fluent function lengthInDays(Value Interval<DateTime> ):\n difference in days between start of Value and end of Value"
},
{
"url" : "displaySequence",
"valueInteger" : 7
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToInterval"
},
{
"url" : "statement",
"valueString" : "/*\n@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)\nvalue to a CQL DateTime Interval\n@comment: If the start value of the given period is unspecified, the starting\nboundary of the resulting interval will be open (meaning the start of the interval\nis unknown, as opposed to interpreted as the beginning of time).\n*/\ndefine function ToInterval(period FHIR.Period):\n if period is null then\n null\n else\n if period.\"start\" is null then\n Interval(period.\"start\".value, period.\"end\".value]\n else\n Interval[period.\"start\".value, period.\"end\".value]"
},
{
"url" : "displaySequence",
"valueInteger" : 8
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXMCommon"
},
{
"url" : "name",
"valueString" : "principalDiagnosis"
},
{
"url" : "statement",
"valueString" : "define fluent function principalDiagnosis(encounter Encounter):\n singleton from (\n (encounter.claimDiagnosis()) CD\n where CD.type.includesCode(\"Principal Diagnosis\")\n )"
},
{
"url" : "displaySequence",
"valueInteger" : 9
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXMCommon"
},
{
"url" : "name",
"valueString" : "claimDiagnosis"
},
{
"url" : "statement",
"valueString" : "define fluent function claimDiagnosis(encounter Encounter):\n encounter E\n let \n claim: ([Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E))),\n claimItem: (claim.item I where I.encounter.references(E))\n return claim.diagnosis D where D.sequence in claimItem.diagnosisSequence"
},
{
"url" : "displaySequence",
"valueInteger" : 10
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToString"
},
{
"url" : "statement",
"valueString" : "define function ToString(value ClaimStatus): value.value"
},
{
"url" : "displaySequence",
"valueInteger" : 11
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToString"
},
{
"url" : "statement",
"valueString" : "define function ToString(value Use): value.value"
},
{
"url" : "displaySequence",
"valueInteger" : 12
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRCommon"
},
{
"url" : "name",
"valueString" : "references"
},
{
"url" : "statement",
"valueString" : "/*\n@description: Returns true if any of the given references are to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(references List<FHIR.Reference>, resource FHIR.Resource):\n exists (references R where R.references(resource))"
},
{
"url" : "displaySequence",
"valueInteger" : 13
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRCommon"
},
{
"url" : "name",
"valueString" : "references"
},
{
"url" : "statement",
"valueString" : "/*\n@description: Returns true if the given reference is to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(reference FHIR.Reference, resource FHIR.Resource):\n resource.id = Last(Split(reference.reference, '/'))"
},
{
"url" : "displaySequence",
"valueInteger" : 14
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToString"
},
{
"url" : "statement",
"valueString" : "define function ToString(value string): value.value"
},
{
"url" : "displaySequence",
"valueInteger" : 15
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRCommon"
},
{
"url" : "name",
"valueString" : "includesCode"
},
{
"url" : "statement",
"valueString" : "/*\n@description: Returns true if the given code is in the given codeList\n@comment: Returns true if the `code` is equivalent to any of the codes in the given `codeList`, false otherwise.\n*/\ndefine fluent function includesCode(codeList List<CodeableConcept>, code Concept):\n exists (codeList C where C ~ code)"
},
{
"url" : "displaySequence",
"valueInteger" : 16
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToConcept"
},
{
"url" : "statement",
"valueString" : "/*\n@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.\n*/\ndefine function ToConcept(concept FHIR.CodeableConcept):\n if concept is null then\n null\n else\n System.Concept {\n codes: concept.coding C return ToCode(C),\n display: concept.text.value\n }"
},
{
"url" : "displaySequence",
"valueInteger" : 17
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToCode"
},
{
"url" : "statement",
"valueString" : "/*\n@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.\n*/\ndefine function ToCode(coding FHIR.Coding):\n if coding is null then\n null\n else\n System.Code {\n code: coding.code.value,\n system: coding.system.value,\n version: coding.version.value,\n display: coding.display.value\n }"
},
{
"url" : "displaySequence",
"valueInteger" : 18
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToString"
},
{
"url" : "statement",
"valueString" : "define function ToString(value EncounterStatus): value.value"
},
{
"url" : "displaySequence",
"valueInteger" : 19
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXM55"
},
{
"url" : "name",
"valueString" : "Measure Observation"
},
{
"url" : "statement",
"valueString" : "define function \"Measure Observation\"(Encounter \"Encounter\") :\n duration in minutes of \"Related ED Visit\"(Encounter).period"
},
{
"url" : "displaySequence",
"valueInteger" : 20
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "EXM55"
},
{
"url" : "name",
"valueString" : "Related ED Visit"
},
{
"url" : "statement",
"valueString" : "//Measure Observation\ndefine function \"Related ED Visit\"(Encounter \"Encounter\") :\n Last([\"Encounter\" : \"Emergency Department Visit\"] ED\n where ED.status = 'finished'\n and ED.period ends 1 hour or less before start of Encounter.period\n sort by start of period )"
},
{
"url" : "displaySequence",
"valueInteger" : 21
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
}
],
"name" : "EffectiveDataRequirements",
"status" : "active",
"type" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/library-type",
"code" : "module-definition"
}
]
},
"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 EXMCommon",
"resource" : "http://hl7.org/fhir/uv/cqm/Library/EXMCommon"
},
{
"type" : "depends-on",
"display" : "Library FHIRHelpers",
"resource" : "http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"
},
{
"type" : "depends-on",
"display" : "Library FHIRCommon",
"resource" : "http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0"
},
{
"type" : "depends-on",
"display" : "Code system Diagnosis Type",
"resource" : "http://terminology.hl7.org/CodeSystem/ex-diagnosistype"
},
{
"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 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 Hospital Settings",
"resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126"
}
],
"parameter" : [
{
"name" : "Measurement Period",
"use" : "in",
"min" : 0,
"max" : "1",
"type" : "Period"
},
{
"name" : "Stratification 3",
"use" : "out",
"min" : 0,
"max" : "*",
"type" : "Encounter"
},
{
"name" : "Stratification 2",
"use" : "out",
"min" : 0,
"max" : "*",
"type" : "Encounter"
},
{
"name" : "Measure Population Exclusion",
"use" : "out",
"min" : 0,
"max" : "*",
"type" : "Encounter"
},
{
"name" : "Stratification 1",
"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"
}
],
"dataRequirement" : [
{
"type" : "Encounter",
"profile" : [
🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
],
"mustSupport" : [
"period",
"type"
]
},
{
"type" : "Encounter",
"profile" : [
🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
],
"mustSupport" : [
"type",
"period",
"status",
"hospitalization",
"hospitalization.admitSource"
],
"codeFilter" : [
{
"path" : "type",
"valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
}
]
},
{
"type" : "Claim",
"profile" : [
🔗 "http://hl7.org/fhir/StructureDefinition/Claim"
],
"mustSupport" : [
"status",
"use",
"item"
]
}
]
}
],
"extension" : [
{
"url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-populationBasis",
"valueCode" : "Encounter"
},
{
"url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem",
"valueReference" : {
🔗 "reference" : "Device/software-system-example"
}
},
{
"url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements",
"valueCanonical" : "#effective-data-requirements"
}
],
"url" : "http://hl7.org/fhir/uv/cqm/Measure/EXM55-FHIR",
"identifier" : [
{
"use" : "official",
"system" : "http://example.org/fhir/cqi/ecqm/Measure/Identifier/exm",
"value" : "55"
},
{
"system" : "urn:ietf:rfc:3986",
"value" : "urn:oid:2.16.840.1.113883.4.642.40.61.29.8"
}
],
"version" : "2.0.0",
"name" : "EXM55",
"title" : "EXM55 - Median Emergency Department Visit Duration",
"status" : "active",
"experimental" : true,
"date" : "2025-08-13",
"publisher" : "HL7 International / Clinical Quality Information",
"contact" : [
{
"telecom" : [
{
"system" : "url",
"value" : "http://www.hl7.org/Special/committees/cqi"
}
]
}
],
"description" : "This example illustrates a continuous variable measure represented as a FHIR eCQM",
"useContext" : [
{
"code" : {
"system" : "http://terminology.hl7.org/CodeSystem/usage-context-type",
"code" : "venue",
"display" : "Clinical Venue"
},
"valueCodeableConcept" : {
"coding" : [
{
"system" : "http://hl7.org/fhir/uv/cqm/CodeSystem/intended-venue-codes",
"code" : "eh",
"display" : "EH"
}
]
}
}
],
"jurisdiction" : [
{
"coding" : [
{
"system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
"code" : "001"
}
]
}
],
"approvalDate" : "2019-03-08",
"lastReviewDate" : "2019-03-08",
"effectivePeriod" : {
"start" : "2018-01-01",
"end" : "2018-12-31"
},
"topic" : [
{
"coding" : [
{
"system" : "http://loinc.org",
"code" : "57024-2",
"display" : "Health Quality Measure Document"
}
]
}
],
"library" : [
🔗 "http://hl7.org/fhir/uv/cqm/Library/EXM55"
],
"scoring" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-scoring",
"code" : "continuous-variable",
"display" : "Continuous Variable"
}
]
},
"type" : [
{
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-type",
"code" : "process"
}
]
}
],
"improvementNotation" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
"code" : "decrease",
"display" : "Decreased score indicates improvement"
}
]
},
"group" : [
{
"id" : "group-1",
"extension" : [
{
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.linkId",
"valueString" : "primary"
}
],
"population" : [
{
"extension" : [
{
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
"valueString" : "primary-exm55-initial-population"
}
],
"code" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "initial-population",
"display" : "Initial Population"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "Initial Population"
}
},
{
"extension" : [
{
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
"valueString" : "primary-exm55-measure-population"
}
],
"code" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "measure-population",
"display" : "Measure Population"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "Measure Population"
}
},
{
"extension" : [
{
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
"valueString" : "primary-exm55-measure-population-exclusion"
}
],
"code" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "measure-population-exclusion",
"display" : "Measure Population Exclusion"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "Measure Population Exclusion"
}
},
{
"extension" : [
{
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
"valueString" : "primary-exm55-measure-population-identifier"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/cqf-criteriaReference",
"valueString" : "measure-population-identifier"
},
{
"url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-aggregateMethod",
"valueCode" : "median"
}
],
"code" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "measure-observation",
"display" : "Measure Observation"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "Measure Observation"
}
}
],
"stratifier" : [
{
"extension" : [
{
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.stratifier.linkId",
"valueString" : "primary-exm55-stratification-1"
},
{
"url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-appliesTo",
"valueCodeableConcept" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "initial-population",
"display" : "Initial Population"
}
]
}
}
],
"code" : {
"coding" : [
{
"system" : "http://example.org/stratification",
"code" : "Stratification 1",
"display" : "Stratification 1"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "Stratification 1"
}
},
{
"extension" : [
{
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.stratifier.linkId",
"valueString" : "primary-exm55-stratificatio-2"
},
{
"url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-appliesTo",
"valueCodeableConcept" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "initial-population",
"display" : "Initial Population"
}
]
}
}
],
"code" : {
"coding" : [
{
"system" : "http://example.org/stratification",
"code" : "Stratification 2",
"display" : "Stratification 2"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "Stratification 2"
}
},
{
"extension" : [
{
"url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.stratifier.linkId",
"valueString" : "primary-exm55-stratification-3"
},
{
"url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-appliesTo",
"valueCodeableConcept" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "initial-population",
"display" : "Initial Population"
}
]
}
}
],
"code" : {
"coding" : [
{
"system" : "http://example.org/stratification",
"code" : "Stratification 3",
"display" : "Stratification 3"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "Stratification 3"
}
}
]
}
]
}