Common CQL Artifacts for FHIR (US-Based)
1.0.0-ballot - STU 1 Ballot United States of America flag

Common CQL Artifacts for FHIR (US-Based), published by HL7 International / Clinical Decision Support. This guide is not an authorized publication; it is the continuous build for version 1.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/us-cql-ig/ and changes regularly. See the Directory of published versions

: Expression Library for the Medical Necessity For Authorization Of Catheters Example - JSON Representation

Page standards status: Informative Maturity Level: 3

Raw json | Download

{
  "resourceType" : "Library",
  "id" : "MNACInitialExpressions",
  "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;\">Expression Library for the Medical Necessity For Authorization Of Catheters Example</td>\n        </tr>\n        \n\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Id: </b></th>\n            <td style=\"padding-left: 4px;\">MNACInitialExpressions</td>\n        </tr>\n        \n\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Version: </b></th>\n            <td style=\"padding-left: 4px;\">1.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-MNACInitialExpressions.html\">Expression Library for the Medical Necessity For Authorization Of Catheters Example</a></td>\n        </tr>\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Status: </b></th>\n            <td style=\"padding-left: 4px;\">draft</td>\n        </tr>\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.5.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>logic-library</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;\">2025-09-10 20:00:05+0000</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 defines initial expressions for use in populating answers to questions in the Medical Necessity For Authorization Of Catheters example questionnaire.</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;\">US</td>\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        <tr>\n          <td colspan=\"2\">\n            <table>\n              <tr><th><a id=\"cql-content\"><b>Content: </b></a> text/cql</th></tr>\n              <tr><td><pre><code class=\"language-cql\">library MNACInitialExpressions\n\nusing USCore version '7.0.0'\nusing FHIR version '4.0.1'\n\ninclude hl7.fhir.uv.cql.FHIRHelpers version '4.0.1'\ninclude USCoreCommon called UC\ninclude USCoreElements called UCE\n\ncodesystem &quot;Identifier Type&quot;: 'http://terminology.hl7.org/CodeSystem/v2-0203'\ncodesystem &quot;ICD10&quot;: 'http://hl7.org/fhir/sid/icd-10-cm'\ncodesystem &quot;SNOMED CT&quot;: 'http://snomed.info/sct'\n\ncode &quot;Member Number&quot;: 'MB' from &quot;Identifier Type&quot;\ncode &quot;UTI&quot;: 'T83.5' from &quot;ICD10&quot;\ncode &quot;Abnormal Urine Finding&quot;: '102866000' from &quot;SNOMED CT&quot;\n\nparameter &quot;ServiceRequest&quot; FHIR.ServiceRequest\n\ncontext Patient\n\ndefine &quot;Retrieve Service Request test parameter&quot;:\n  // The VSCode extension doesn't support parameters\n  // When executing CQL with the VSCode extension retrieve the resource specific for the test case\n  //   the list of resource ids match the resources from the test case folders\n  singleton from ([FHIR.ServiceRequest] SR where SR.id in { \n    'service-request-example'})\n\ndefine &quot;Service Request&quot;:\n  Coalesce(\n    ServiceRequest,\n    &quot;Retrieve Service Request test parameter&quot;\n  )\n\ndefine &quot;Date of Request&quot;:\n  &quot;Service Request&quot;.authoredOn.value\n\n//https://www.hca.wa.gov/assets/billers-and-providers/13-760.pdf\n\ndefine &quot;Diagnosis&quot;:\n  First(&quot;SR Related Condition&quot;.code).text.value\n\ndefine &quot;Item Requested&quot;:\n  &quot;Service Request&quot;.code.coding.display.value\n\ndefine &quot;UTI in Last Year&quot;:\n  Exists(&quot;UTI Diagnostic Reports Last Year&quot;)\n\ndefine &quot;Lab Reports UTIs&quot;:\n  &quot;UTI Diagnostic Reports Last Year&quot;.presentedForm\n\ndefine &quot;Dates of UTIs&quot;:\n  &quot;UTI Diagnostic Reports Last Year&quot;.effective.value\n\n//TODO: create example MedicationStatement\ndefine &quot;Antibiotics Used&quot;:\n  [FHIR.MedicationStatement] MS\n    where First(MS.reasonReference.reference) in &quot;UTI Diagnostic Reports Last Year&quot;.id\n\ndefine &quot;Check Symptoms&quot;:\n  'TBD'\n\ndefine &quot;Fever Temperature&quot;:\n  'TBD'\n\ndefine &quot;Catheterization Frequency&quot;:\n  'TBD'\n\ndefine &quot;Additional Comment&quot;:\n  'TBD'\n\ndefine &quot;Physician Name&quot;:\n  &quot;Requesting Physician&quot;.name.family \n\ndefine &quot;Physician Telephone&quot;:\n  UC.Mobile(&quot;Requesting Physician&quot;.telecom).value\n\ndefine &quot;Physician Fax&quot;:\n  Fax(&quot;Requesting Physician&quot;.telecom).value\n\ndefine &quot;Referring Physician Telephone&quot;:\n  'TBD'\n\ndefine &quot;Date&quot;:\n  Today()\n\n//helper definitions\n// define &quot;All ServiceRequests&quot;:\n//   [FHIR.ServiceRequest]\n\n// define &quot;Most Recent ServiceRequest&quot;:\n//   UC.MostRecent(&quot;All ServiceRequests&quot;)\n\ndefine &quot;SR Related Condition&quot;:\n  [FHIR.Condition] C\n  where EndsWith(First(&quot;Service Request&quot;.reasonReference.reference.value), C.id)\n\ndefine &quot;UTI Diagnostic Reports Last Year&quot;:\n  [FHIR.DiagnosticReport] C\n  where &quot;Abnormal Urine Finding&quot;.code in C.conclusionCode.coding.code\n  and C.effective\t&gt; (Today() - 1 year)\n\ndefine &quot;Requesting Physician&quot;:\n  singleton from (\n    [USCore.PractitionerProfile] P\n  where EndsWith(&quot;Service Request&quot;.requester.reference, P.id))\n\ndefine function Fax(contactPoints List&lt;USCore.ContactPoint&gt;):\n  singleton from (contactPoints P where P.system = 'fax')\n</code></pre></td></tr>\n            </table>\n          </td>\n        </tr>\n        \n        \n        \n        \n        \n        <tr>\n          <td colspan=\"2\">\n            <table>\n              <tr><th><b>Content: </b> application/elm+xml</th></tr>\n              <tr><td><pre><code/></pre></td></tr>\n            </table>\n          </td>\n        </tr>\n        \n        \n    </table>\n</div>\n</div>"
  },
  "extension" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger" : 3
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode" : "cds"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode" : "informative"
    }
  ],
  "url" : "http://hl7.org/fhir/us/cql/Library/MNACInitialExpressions",
  "version" : "1.0.0-ballot",
  "name" : "MNACInitialExpressions",
  "title" : "Expression Library for the Medical Necessity For Authorization Of Catheters Example",
  "status" : "draft",
  "experimental" : true,
  "type" : {
    "coding" : [
      {
        "system" : "http://terminology.hl7.org/CodeSystem/library-type",
        "code" : "logic-library"
      }
    ]
  },
  "date" : "2025-09-10T20:00:05+00:00",
  "publisher" : "HL7 International / Clinical Decision Support",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.hl7.org/Special/committees/dss"
        }
      ]
    }
  ],
  "description" : "This library defines initial expressions for use in populating answers to questions in the Medical Necessity For Authorization Of Catheters example questionnaire.",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "urn:iso:std:iso:3166",
          "code" : "US",
          "display" : "United States of America"
        }
      ]
    }
  ],
  "content" : [
    {
      "contentType" : "text/cql",
      "data" : "bGlicmFyeSBNTkFDSW5pdGlhbEV4cHJlc3Npb25zCgp1c2luZyBVU0NvcmUgdmVyc2lvbiAnNy4wLjAnCnVzaW5nIEZISVIgdmVyc2lvbiAnNC4wLjEnCgppbmNsdWRlIGhsNy5maGlyLnV2LmNxbC5GSElSSGVscGVycyB2ZXJzaW9uICc0LjAuMScKaW5jbHVkZSBVU0NvcmVDb21tb24gY2FsbGVkIFVDCmluY2x1ZGUgVVNDb3JlRWxlbWVudHMgY2FsbGVkIFVDRQoKY29kZXN5c3RlbSAiSWRlbnRpZmllciBUeXBlIjogJ2h0dHA6Ly90ZXJtaW5vbG9neS5obDcub3JnL0NvZGVTeXN0ZW0vdjItMDIwMycKY29kZXN5c3RlbSAiSUNEMTAiOiAnaHR0cDovL2hsNy5vcmcvZmhpci9zaWQvaWNkLTEwLWNtJwpjb2Rlc3lzdGVtICJTTk9NRUQgQ1QiOiAnaHR0cDovL3Nub21lZC5pbmZvL3NjdCcKCmNvZGUgIk1lbWJlciBOdW1iZXIiOiAnTUInIGZyb20gIklkZW50aWZpZXIgVHlwZSIKY29kZSAiVVRJIjogJ1Q4My41JyBmcm9tICJJQ0QxMCIKY29kZSAiQWJub3JtYWwgVXJpbmUgRmluZGluZyI6ICcxMDI4NjYwMDAnIGZyb20gIlNOT01FRCBDVCIKCnBhcmFtZXRlciAiU2VydmljZVJlcXVlc3QiIEZISVIuU2VydmljZVJlcXVlc3QKCmNvbnRleHQgUG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