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 - XML Representation

Page standards status: Informative Maturity Level: 3

Raw xml | Download


<Library xmlns="http://hl7.org/fhir">
  <id value="MNACInitialExpressions"/>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
<div>
    <table class="grid dict">
        
        
        <tr>
            <th scope="row"><b>Title: </b></th>
            <td style="padding-left: 4px;">Expression Library for the Medical Necessity For Authorization Of Catheters Example</td>
        </tr>
        

        
        
        <tr>
            <th scope="row"><b>Id: </b></th>
            <td style="padding-left: 4px;">MNACInitialExpressions</td>
        </tr>
        

        
        
        <tr>
            <th scope="row"><b>Version: </b></th>
            <td style="padding-left: 4px;">1.0.0-ballot</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Url: </b></th>
            <td style="padding-left: 4px;"><a href="Library-MNACInitialExpressions.html">Expression Library for the Medical Necessity For Authorization Of Catheters Example</a></td>
        </tr>
        

        

        

        
        <tr>
            <th scope="row"><b>Status: </b></th>
            <td style="padding-left: 4px;">draft</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Experimental: </b></th>
            <td style="padding-left: 4px;">true</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Type: </b></th>
            <td style="padding-left: 4px;">
                
                    
                        
                        <p style="margin-bottom: 5px;">
                            <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>
                        </p>
                        
                        
                        <p style="margin-bottom: 5px;">
                            <b>code: </b> <span>logic-library</span>
                        </p>
                        
                        
                    
                
                
            </td>
        </tr>
        

        

        
        <tr>
            <th scope="row"><b>Date: </b></th>
            <td style="padding-left: 4px;">2025-09-10 20:00:05+0000</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Publisher: </b></th>
            <td style="padding-left: 4px;">HL7 International / Clinical Decision Support</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Description: </b></th>
            <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>
</div></td>
        </tr>
        

        

        

        

        
        <tr>
            <th scope="row"><b>Jurisdiction: </b></th>
            <td style="padding-left: 4px;">US</td>
        </tr>
        

        

        

        

        

        

        

        

        

        

        
        
        <tr>
          <td colspan="2">
            <table>
              <tr><th><a id="cql-content"><b>Content: </b></a> text/cql</th></tr>
              <tr><td><pre><code class="language-cql">library MNACInitialExpressions

using USCore version '7.0.0'
using FHIR version '4.0.1'

include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1'
include USCoreCommon called UC
include USCoreElements called UCE

codesystem &quot;Identifier Type&quot;: 'http://terminology.hl7.org/CodeSystem/v2-0203'
codesystem &quot;ICD10&quot;: 'http://hl7.org/fhir/sid/icd-10-cm'
codesystem &quot;SNOMED CT&quot;: 'http://snomed.info/sct'

code &quot;Member Number&quot;: 'MB' from &quot;Identifier Type&quot;
code &quot;UTI&quot;: 'T83.5' from &quot;ICD10&quot;
code &quot;Abnormal Urine Finding&quot;: '102866000' from &quot;SNOMED CT&quot;

parameter &quot;ServiceRequest&quot; FHIR.ServiceRequest

context Patient

define &quot;Retrieve Service Request test parameter&quot;:
  // The VSCode extension doesn't support parameters
  // When executing CQL with the VSCode extension retrieve the resource specific for the test case
  //   the list of resource ids match the resources from the test case folders
  singleton from ([FHIR.ServiceRequest] SR where SR.id in { 
    'service-request-example'})

define &quot;Service Request&quot;:
  Coalesce(
    ServiceRequest,
    &quot;Retrieve Service Request test parameter&quot;
  )

define &quot;Date of Request&quot;:
  &quot;Service Request&quot;.authoredOn.value

//https://www.hca.wa.gov/assets/billers-and-providers/13-760.pdf

define &quot;Diagnosis&quot;:
  First(&quot;SR Related Condition&quot;.code).text.value

define &quot;Item Requested&quot;:
  &quot;Service Request&quot;.code.coding.display.value

define &quot;UTI in Last Year&quot;:
  Exists(&quot;UTI Diagnostic Reports Last Year&quot;)

define &quot;Lab Reports UTIs&quot;:
  &quot;UTI Diagnostic Reports Last Year&quot;.presentedForm

define &quot;Dates of UTIs&quot;:
  &quot;UTI Diagnostic Reports Last Year&quot;.effective.value

//TODO: create example MedicationStatement
define &quot;Antibiotics Used&quot;:
  [FHIR.MedicationStatement] MS
    where First(MS.reasonReference.reference) in &quot;UTI Diagnostic Reports Last Year&quot;.id

define &quot;Check Symptoms&quot;:
  'TBD'

define &quot;Fever Temperature&quot;:
  'TBD'

define &quot;Catheterization Frequency&quot;:
  'TBD'

define &quot;Additional Comment&quot;:
  'TBD'

define &quot;Physician Name&quot;:
  &quot;Requesting Physician&quot;.name.family 

define &quot;Physician Telephone&quot;:
  UC.Mobile(&quot;Requesting Physician&quot;.telecom).value

define &quot;Physician Fax&quot;:
  Fax(&quot;Requesting Physician&quot;.telecom).value

define &quot;Referring Physician Telephone&quot;:
  'TBD'

define &quot;Date&quot;:
  Today()

//helper definitions
// define &quot;All ServiceRequests&quot;:
//   [FHIR.ServiceRequest]

// define &quot;Most Recent ServiceRequest&quot;:
//   UC.MostRecent(&quot;All ServiceRequests&quot;)

define &quot;SR Related Condition&quot;:
  [FHIR.Condition] C
  where EndsWith(First(&quot;Service Request&quot;.reasonReference.reference.value), C.id)

define &quot;UTI Diagnostic Reports Last Year&quot;:
  [FHIR.DiagnosticReport] C
  where &quot;Abnormal Urine Finding&quot;.code in C.conclusionCode.coding.code
  and C.effective	&gt; (Today() - 1 year)

define &quot;Requesting Physician&quot;:
  singleton from (
    [USCore.PractitionerProfile] P
  where EndsWith(&quot;Service Request&quot;.requester.reference, P.id))

define function Fax(contactPoints List&lt;USCore.ContactPoint&gt;):
  singleton from (contactPoints P where P.system = 'fax')
</code></pre></td></tr>
            </table>
          </td>
        </tr>
        
        
        
        
        
        <tr>
          <td colspan="2">
            <table>
              <tr><th><b>Content: </b> application/elm+xml</th></tr>
              <tr><td><pre><code/></pre></td></tr>
            </table>
          </td>
        </tr>
        
        
    </table>
</div>
</div>
  </text>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="3"/>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="cds"/>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="informative"/>
  </extension>
  <url value="http://hl7.org/fhir/us/cql/Library/MNACInitialExpressions"/>
  <version value="1.0.0-ballot"/>
  <name value="MNACInitialExpressions"/>
  <title
         value="Expression Library for the Medical Necessity For Authorization Of Catheters Example"/>
  <status value="draft"/>
  <experimental value="true"/>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
      <code value="logic-library"/>
    </coding>
  </type>
  <date value="2025-09-10T20:00:05+00:00"/>
  <publisher value="HL7 International / Clinical Decision Support"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="http://www.hl7.org/Special/committees/dss"/>
    </telecom>
  </contact>
  <description
               value="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 value="urn:iso:std:iso:3166"/>
      <code value="US"/>
      <display value="United States of America"/>
    </coding>
  </jurisdiction>
  <content>
    <contentType value="text/cql"/>
    <data
          value="bGlicmFyeSBNTkFDSW5pdGlhbEV4cHJlc3Npb25zCgp1c2luZyBVU0NvcmUgdmVyc2lvbiAnNy4wLjAnCnVzaW5nIEZISVIgdmVyc2lvbiAnNC4wLjEnCgppbmNsdWRlIGhsNy5maGlyLnV2LmNxbC5GSElSSGVscGVycyB2ZXJzaW9uICc0LjAuMScKaW5jbHVkZSBVU0NvcmVDb21tb24gY2FsbG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