2026 US Quality Core Implementation Guide
0.5.0 - cibuild US

2026 US Quality Core Implementation Guide, published by Office of the National Coordinator for Health Information Technology (ONC). This guide is not an authorized publication; it is the continuous build for version 0.5.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/FHIR/us-quality-core/ and changes regularly. See the Directory of published versions

## : US Quality Core CommonTests - XML Representation

Active as of 2025-10-02

Raw xml | Download

    <Library xmlns="http://hl7.org/fhir">
      <id value="USQualityCoreCommonTests"/>
      <meta>
        <profile
                 value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary"/>
        <profile
                 value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary"/>
        <profile
                 value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary"/>
        <profile
                 value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary"/>
        <profile
                 value="http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library"/>
        <profile
                 value="http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library"/>
        <profile
                 value="http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library"/>
      </meta>
      <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;">US Quality Core CommonTests</td>
            </tr>

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

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

            <tr>
                <th scope="row"><b>Url: </b></th>
                <td style="padding-left: 4px;"><a href="Library-USQualityCoreCommonTests.html">US Quality Core CommonTests</a></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://hl7.org/fhir/R4/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-10-02 13:51:38+0000</td>
            </tr>

            <tr>
                <th scope="row"><b>Publisher: </b></th>
                <td style="padding-left: 4px;">Office of the National Coordinator for Health Information Technology (ONC)</td>
            </tr>

            <tr>
                <th scope="row"><b>Description: </b></th>
                <td style="padding-left: 4px;"><div><p>Tests for the US Quality Core Common library</p>
    </div></td>
            </tr>

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

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

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

                    <p><b>Dependencies</b></p>
                    <ul>

                        <li><a href="Library-USQualityCore-ModelInfo.html">US Quality Core Model Definition</a> version: 0.5.0</li>

                        <li><a href="Library-USQualityCoreCommon.html">US Quality Core Common</a></li>

                        <li><a href="http://hl7.org/fhir/R4/v3/MaritalStatus/cs.html">v3 Code System MaritalStatus</a></li>

                        <li><a href="http://terminology.hl7.org/6.5.0/CodeSystem-CDCREC.html">CDC Race and Ethnicity</a></li>

                        <li><a href="http://hl7.org/fhir/R4/codesystem-communication-category.html">CommunicationCategory</a></li>

                        <li><a href="http://hl7.org/fhir/R4/codesystem-snomedct.html">SNOMED CT (all versions)</a></li>

                        <li><a href="http://terminology.hl7.org/6.5.0/CodeSystem-CVX.html">Vaccine Administered Code Set (CVX)</a></li>

                        <li><a href="http://terminology.hl7.org/6.5.0/CodeSystem-v3-loinc.html">Logical Observation Identifiers, Names and Codes (LOINC)</a></li>

                        <li><a href="http://hl7.org/fhir/R4/codesystem-task-code.html">Task Codes</a></li>

                        <li><a href="http://hl7.org/fhir/R4/valueset-marital-status.html">MaritalStatus</a></li>

                        <li><a href="http://hl7.org/fhir/R4/valueset-communication-category.html">CommunicationCategory</a></li>

                        <li><code>http://example.org/fhir/ValueSet/device-codes</code></li>

                        <li><code>http://example.org/fhir/ValueSet/immunization-codes</code></li>

                        <li><code>http://example.org/fhir/ValueSet/medication-codes</code></li>

                        <li><code>http://example.org/fhir/ValueSet/observation-codes</code></li>

                        <li><code>http://example.org/fhir/ValueSet/procedure-codes</code></li>

                        <li><a href="http://hl7.org/fhir/R4/valueset-task-code.html">Task Codes</a></li>

                        <li><a href="ValueSet-us-quality-core-negation-reason.html">USQualityCore Negation Reason Codes</a></li>

                    </ul>

                </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 USQualityCoreCommonTests version '0.5.0'

    using USQualityCore version '0.5.0'
    using USCore version '6.1.0-derived'
    using FHIR version '4.0.1'

    include FHIRHelpers version '4.0.1'
    include USQualityCoreCommon

    codesystem &quot;Marital Status Codes&quot;: 'http://terminology.hl7.org/CodeSystem/v3-MaritalStatus'
    codesystem &quot;CDC Race and Ethnicity Codes&quot;: 'urn:oid:2.16.840.1.113883.6.238'
    codesystem &quot;CommunicationCategoryCodeSystem&quot;: 'http://terminology.hl7.org/CodeSystem/communication-category'
    codesystem &quot;SNOMED-CT&quot;: 'http://snomed.info/sct'
    codesystem &quot;CVX&quot;: 'http://hl7.org/fhir/sid/cvx'
    codesystem &quot;LOINC&quot;: 'http://loinc.org'
    codesystem &quot;TaskCodeSystem&quot;: 'http://hl7.org/fhir/CodeSystem/task-code'

    valueset &quot;Marital Status&quot;: 'http://hl7.org/fhir/ValueSet/marital-status'
    valueset &quot;CommunicationCodes&quot;: 'http://hl7.org/fhir/ValueSet/communication-category'
    valueset &quot;DeviceCodes&quot;: 'http://example.org/fhir/ValueSet/device-codes' // Random set of device codes from 'http://hl7.org/fhir/ValueSet/device-type'
    valueset &quot;ImmunizationCodes&quot;: 'http://example.org/fhir/ValueSet/immunization-codes' // Random set of immunization codes from 'http://hl7.org/fhir/us/core/ValueSet/us-core-vaccines-cvx'
    valueset &quot;MedicationCodes&quot;: 'http://example.org/fhir/ValueSet/medication-codes' // Random set of medication codes from 'http://hl7.org/fhir/ValueSet/medication-codes'
    valueset &quot;ObservationCodes&quot;: 'http://example.org/fhir/ValueSet/observation-codes' // Random set of observation codes from 'http://hl7.org/fhir/ValueSet/observation-codes'
    valueset &quot;ProcedureCodes&quot;: 'http://example.org/fhir/ValueSet/procedure-codes' // Random set of procedure codes from 'http://hl7.org/fhir/us/core/ValueSet/us-core-procedure-code'
    valueset &quot;TaskCodes&quot;: 'http://hl7.org/fhir/ValueSet/task-code'
    valueset &quot;NegationReasonCodes&quot;: 'http://fhir.org/guides/onc/us-quality-core/ValueSet/us-quality-core-negation-reason'

    code &quot;Marital Status - Married&quot;: 'M' from &quot;Marital Status Codes&quot;
    code &quot;American Indian or Alaska Native&quot;: '1002-5' from &quot;CDC Race and Ethnicity Codes&quot;
    code &quot;Alaska Native&quot;: '1735-0' from &quot;CDC Race and Ethnicity Codes&quot;
    code &quot;CommunicationCode&quot;: 'alert' from &quot;CommunicationCategoryCodeSystem&quot; display 'Alert'
    code &quot;DeviceCode&quot;: '156009' from &quot;SNOMED-CT&quot; display 'Spine board'
    code &quot;ImmunizationCode&quot;: '01' from &quot;CVX&quot; display 'diphtheria, tetanus toxoids and pertussis vaccine'
    code &quot;MedicationCode&quot;: '26100' from &quot;SNOMED-CT&quot; display 'Codeine phosphate'
    code &quot;ObservationCode&quot;: '1-8' from &quot;LOINC&quot; display 'Acyclovir [Susceptibility]'
    code &quot;ProcedureCode&quot;: '7138802' from &quot;SNOMED-CT&quot; display 'Procedure'
    code &quot;TaskCode&quot;: 'approve' from &quot;TaskCodeSystem&quot; display 'Activate/approve the focal resource'

    context Patient

    define TestAdverseEvent: [&quot;AdverseEvent&quot;]
    define TestAllergyIntolerance: [&quot;AllergyIntolerance&quot;]
    define TestBodyStructure: [&quot;BodyStructure&quot;]
    define TestCarePlan: [&quot;CarePlan&quot;]
    define TestCareTeam: [&quot;CareTeam&quot;]
    define TestClaim: [&quot;Claim&quot;]
    define TestClaimResponse: [&quot;ClaimResponse&quot;]
    define TestCommunication: [&quot;Communication&quot;]
    define TestCommunicationNotDone: [&quot;CommunicationNotDone&quot;]
    define TestCommunicationRequest: [&quot;CommunicationRequest&quot;]
    define TestConditionEncounterDiagnosis: [&quot;ConditionEncounterDiagnosis&quot;]
    define TestConditionProblemsHealthConcerns: [&quot;ConditionProblemsHealthConcerns&quot;]
    define TestCoverage: [&quot;Coverage&quot;]
    define TestDevice: [&quot;Device&quot;]
    define TestDeviceNotRequested: [&quot;DeviceNotRequested&quot;]
    define TestDeviceRequest: [&quot;DeviceRequest&quot;]
    define TestDeviceUseStatement: [&quot;DeviceUseStatement&quot;]
    define TestDiagnosticReportLab: [&quot;DiagnosticReportLab&quot;]
    define TestDiagnosticReportNote: [&quot;DiagnosticReportNote&quot;]
    define TestEncounter: [&quot;Encounter&quot;]
    define TestFamilyMemberHistory: [&quot;FamilyMemberHistory&quot;]
    define TestFlag: [&quot;Flag&quot;]
    define TestGoal: [&quot;Goal&quot;]
    define TestImagingStudy: [&quot;ImagingStudy&quot;]
    define TestImmunization: [&quot;Immunization&quot;]
    define TestImmunizationEvaluation: [&quot;ImmunizationEvaluation&quot;]
    define TestImmunizationNotDone: [&quot;ImmunizationNotDone&quot;]
    define TestImmunizationRecommendation: [&quot;ImmunizationRecommendation&quot;]
    define TestLaboratoryResultObservation: [&quot;LaboratoryResultObservation&quot;]
    define TestLocation: [&quot;Location&quot;]
    define TestMedication: [&quot;Medication&quot;]
    define TestMedicationAdministration: [&quot;MedicationAdministration&quot;]
    define TestMedicationAdministrationNotDone: [&quot;MedicationAdministrationNotDone&quot;]
    define TestMedicationDispense: [&quot;MedicationDispense&quot;]
    define TestMedicationDispenseDeclined: [&quot;MedicationDispenseDeclined&quot;]
    define TestMedicationNotRequested: [&quot;MedicationNotRequested&quot;]
    define TestMedicationRequest: [&quot;MedicationRequest&quot;]
    define TestMedicationStatement: [&quot;MedicationStatement&quot;]
    define TestObservation: [&quot;SimpleObservation&quot;]
    define TestObservationCancelled: [&quot;ObservationCancelled&quot;]
    define TestObservationClinicalTestResult: [&quot;ObservationClinicalResult&quot;]
    define TestObservationImagingResult: [&quot;NonPatientObservation&quot;]
    define TestObservationSurvey: [&quot;ObservationScreeningAssessment&quot;]
    define TestOrganization: [&quot;Organization&quot;]
    define TestPatient: [&quot;Patient&quot;]
    define TestVitalsPanel: [USCore.VitalSignsProfile]
    define TestRespRate: [USCore.RespiratoryRateProfile]
    define TestHeartRate: [USCore.HeartRateProfile]
    define TestBodyTemp: [USCore.BodyTemperatureProfile]
    define TestBodyHeight: [USCore.BodyHeightProfile]
    define TestHeadCircum: [USCore.HeadCircumferenceProfile]
    define TestBodyWeight: [USCore.BodyWeightProfile]
    define TestBMI: [USCore.BMIProfile]
    define TestBP: [USCore.BloodPressureProfile]
    define TestPractitioner: [&quot;Practitioner&quot;]
    define TestPractitionerRole: [&quot;PractitionerRole&quot;]
    define TestProcedure: [&quot;Procedure&quot;]
    define TestProcedureNotDone: [&quot;ProcedureNotDone&quot;]
    define TestRelatedPerson: [&quot;RelatedPerson&quot;]
    define TestServiceNotRequested: [&quot;ServiceNotRequested&quot;]
    define TestServiceRequest: [&quot;ServiceRequest&quot;]
    define TestSpecimen: [&quot;Specimen&quot;]
    define TestSubstance: [&quot;Substance&quot;]
    define TestTask: [&quot;Task&quot;]
    define TestTaskRejected: [&quot;TaskRejected&quot;]
    define TestUSCoreImplantableDevice: [USCore.ImplantableDeviceProfile]
    define TestUSCoreSmokingStatus: [USCore.SmokingStatusProfile]
    define TestUSCorePulseOximetry: [USCore.PulseOximetryProfile]
    define TestUSCorePediatricBMIForAge: [USCore.PediatricBMIforAgeObservationProfile]
    define TestUSCorePediatricWeightForHeight: [USCore.PediatricWeightForHeightObservationProfile]
    define TestUSCorePediatricHeadOccipitalFrontalCircumferencePercentileProfile: [USCore.PediatricHeadOccipitalFrontalCircumferencePercentileProfile]
    //define TestUSCoreObservationSDOHAssessment: [USCore.ObservationSDOHAssessment]
    //define TestUSCoreObservationSocialHistoryProfile: [USCore.ObservationSocialHistoryProfile]
    define TestUSCoreObservationSexualOrientationProfile: [USCore.ObservationSexualOrientationProfile]

    // Validate Encounter.diagnosis cardinality
    define TestEncounterDiagnosisCardinality:
      exists (First([Encounter]).diagnosis)

    // Validate ProcedureNotDone elements
    define TestProcedureNotDoneElements:
      [ProcedureNotDone] P
        where P.recorded() on or before day of Today()
          and exists (P.identifier)
          and P.status = 'not-done'
          and P.statusReason is not null
          and P.category is not null
          and P.code is not null
          and P.performed is null

    // Validate NotDone...

    // CommunicationNotDone
    define TestSpecificCommunicationNotDone:
      [&quot;CommunicationNotDone&quot;: CommunicationCode]

    // TODO: Support this case, need to introduce a terminology contains operator
    // This operator is introduced in CQL R2
    //define TestSpecificCommunicationNotDoneActual:
    //    [&quot;CommunicationNotDone&quot;: topic ~ CommunicationCode]
    //      union [&quot;CommunicationNotDone&quot;: topic ~contains CommunicationCode]

    define TestSpecificCommunicationNotDoneExplicit:
      [&quot;CommunicationNotDone&quot;] C
        where C.topic() ~ CommunicationCode
          or CommunicationCode in C.topic()

    define TestGeneralCommunicationNotDone:
      [&quot;CommunicationNotDone&quot;: CommunicationCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralCommunicationNotDoneActual:
      [&quot;CommunicationNotDone&quot;: topic in CommunicationCodes]
        union [&quot;CommunicationNotDone&quot;: topic ~ CommunicationCodes]

    define TestGeneralCommunicationNotDoneExplicit:
      [&quot;CommunicationNotDone&quot;] C
        where C.topic() in CommunicationCodes
          or C.topic() ~ CommunicationCodes

    // DeviceNotRequested
    define TestSpecificDeviceNotRequested:
      [&quot;DeviceNotRequested&quot;: DeviceCode]

    // TODO: Support this use case
    //define TestSpecificDeviceNotRequestedActual:
    //    [&quot;DeviceNotRequested&quot;: code ~ DeviceCode]
    //      union [&quot;DeviceNotRequested&quot;: code ~contains DeviceCode]

    define TestSpecificDeviceNotRequestedExplicit:
      [DeviceNotRequested] D
        where D.code() ~ DeviceCode
          or DeviceCode in D.code()

    define TestGeneralDeviceNotRequested:
      [&quot;DeviceNotRequested&quot;: DeviceCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralDeviceNotRequestedActual:
      [&quot;DeviceNotRequested&quot;: code in DeviceCodes]
        union [&quot;DeviceNotRequested&quot;: code ~ DeviceCodes]

    define TestGeneralDeviceNotRequestedExplicit:
      [&quot;DeviceNotRequested&quot;] D
        where D.code() in DeviceCodes
          or D.code() ~ DeviceCodes

    define TestGeneralDeviceNotRequestedCodeExplicit:
      [&quot;DeviceNotRequested&quot;] D
        where D.code() in DeviceCodes

    define TestGeneralDeviceNotRequestedValueSetExplicit:
      [&quot;DeviceNotRequested&quot;] D
        where D.code() ~ DeviceCodes

    // ImmunizationNotDone
    define TestSpecificImmunizationNotDone:
      [&quot;ImmunizationNotDone&quot;: ImmunizationCode]

    // TODO: Support this use case
    //define TestSpecificImmunizationNotDoneActual:
    //    [&quot;ImmunizationNotDone&quot;: vaccineCode ~ ImmunizationCode]
    //      union [&quot;ImmunizationNotDone&quot;: vaccineCode ~contains ImmunizationCode]

    define TestSpecificImmunizationNotDoneExplicit:
      [&quot;ImmunizationNotDone&quot;] I
        where I.vaccineCode() ~ ImmunizationCode
          or ImmunizationCode in I.vaccineCode()

    define TestGeneralImmunizationNotDone:
      [&quot;ImmunizationNotDone&quot;: ImmunizationCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralImmunizationNotDoneActual:
      [&quot;ImmunizationNotDone&quot;: vaccineCode in ImmunizationCodes]
        union [&quot;ImmunizationNotDone&quot;: vaccineCode ~ ImmunizationCodes]

    define TestGeneralImmunizationNotDoneExplicit:
      [&quot;ImmunizationNotDone&quot;] I
        where I.vaccineCode() in ImmunizationCodes
          or I.vaccineCode() ~ ImmunizationCodes

    // MedicationAdministrationNotDone
    define TestSpecificMedicationAdministrationNotDone:
      [&quot;MedicationAdministrationNotDone&quot;: MedicationCode]

    // TODO: Support this use case
    //define TestSpecificMedicationAdministrationNotDoneActual:
    //    [&quot;MedicationAdministrationNotDone&quot;: medication ~ MedicationCode]
    //      union [&quot;MedicationAdministrationNotDone&quot;: medication ~contains MedicationCode]

    define TestSpecificMedicationAdministrationNotDoneExplicit:
      [&quot;MedicationAdministrationNotDone&quot;] I
        where I.medication() ~ MedicationCode
          or MedicationCode in I.medication()

    define TestGeneralMedicationAdministrationNotDone:
      [&quot;MedicationAdministrationNotDone&quot;: MedicationCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralMedicationAdministrationNotDoneActual:
      [&quot;MedicationAdministrationNotDone&quot;: medication in MedicationCodes]
        union [&quot;MedicationAdministrationNotDone&quot;: medication ~ MedicationCodes]

    define TestGeneralMedicationAdministrationNotDoneExplicit:
      [&quot;MedicationAdministrationNotDone&quot;] I
        where I.medication() in MedicationCodes
          or I.medication() ~ MedicationCodes

    // MedicationDispenseDeclined
    define TestSpecificMedicationDispenseDeclined:
      [&quot;MedicationDispenseDeclined&quot;: MedicationCode]

    // TODO: Support this use case
    //define TestSpecificMedicationDispenseDeclinedActual:
    //    [&quot;MedicationDispenseDeclined&quot;: medication ~ MedicationCode]
    //      union [&quot;MedicationDispenseDeclined&quot;: medication ~contains MedicationCode]

    define TestSpecificMedicationDispenseDeclinedExplicit:
      [&quot;MedicationDispenseDeclined&quot;] I
        where I.medication() ~ MedicationCode
          or MedicationCode in I.medication()

    define TestGeneralMedicationDispenseDeclined:
      [&quot;MedicationDispenseDeclined&quot;: MedicationCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralMedicationDispenseDeclinedActual:
      [&quot;MedicationDispenseDeclined&quot;: medication in MedicationCodes]
        union [&quot;MedicationDispenseDeclined&quot;: medication ~ MedicationCodes]

    define TestGeneralMedicationDispenseDeclinedExplicit:
      [&quot;MedicationDispenseDeclined&quot;] I
        where I.medication() in MedicationCodes
          or I.medication() ~ MedicationCodes

    // MedicationNotRequested
    define TestSpecificMedicationNotRequested:
      [&quot;MedicationNotRequested&quot;: MedicationCode]

    // TODO: Support this use case
    //define TestSpecificMedicationNotRequestedActual:
    //    [&quot;MedicationNotRequested&quot;: medication ~ MedicationCode]
    //      union [&quot;MedicationNotRequested&quot;: medication ~contains MedicationCode]

    define TestSpecificMedicationNotRequestedExplicit:
      [&quot;MedicationNotRequested&quot;] I
        where I.medication() ~ MedicationCode
          or MedicationCode in I.medication()

    define TestGeneralMedicationNotRequested:
      [&quot;MedicationNotRequested&quot;: MedicationCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralMedicationNotRequestedActual:
      [&quot;MedicationNotRequested&quot;: medication in MedicationCodes]
        union [&quot;MedicationNotRequested&quot;: medication ~ MedicationCodes]

    define TestGeneralMedicationNotRequestedExplicit:
      [&quot;MedicationNotRequested&quot;] I
        where I.medication() in MedicationCodes
          or I.medication() ~ MedicationCodes

    // ObservationCancelled
    define TestSpecificObservationCancelled:
      [&quot;ObservationCancelled&quot;: ObservationCode]

    // TODO: Support this use case
    //define TestSpecificObservationCancelledActual:
    //    [&quot;ObservationCancelled&quot;: code ~ ObservationCode]
    //      union [&quot;ObservationCancelled&quot;: code contains ObservationCode]

    define TestSpecificObservationCancelledExplicit:
      [&quot;ObservationCancelled&quot;] I
        where I.code() ~ ObservationCode
          or ObservationCode in I.code()

    define TestGeneralObservationCancelled:
      [&quot;ObservationCancelled&quot;: ObservationCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralObservationCancelledActual:
      [&quot;ObservationCancelled&quot;: code in ObservationCodes]
        union [&quot;ObservationCancelled&quot;: code ~ ObservationCodes]

    define TestGeneralObservationCancelledExplicit:
      [&quot;ObservationCancelled&quot;] I
        where I.code() in ObservationCodes
          or I.code() ~ ObservationCodes

    // ProcedureNotDone
    define TestSpecificProcedureNotDone:
      [&quot;ProcedureNotDone&quot;: ProcedureCode]

    // TODO: Support this use case
    //define TestSpecificProcedureNotDoneActual:
    //    [&quot;ProcedureNotDone&quot;: code ~ ProcedureCode]
    //      union [&quot;ProcedureNotDone&quot;: code ~contains ProcedureCode]

    define TestSpecificProcedureNotDoneExplicit:
      [&quot;ProcedureNotDone&quot;] I
        where I.code() ~ ProcedureCode
          or ProcedureCode in I.code()

    define TestGeneralProcedureNotDone:
      [&quot;ProcedureNotDone&quot;: ProcedureCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralProcedureNotDoneActual:
      [&quot;ProcedureNotDone&quot;: code in ProcedureCodes]
        union [&quot;ProcedureNotDone&quot;: code ~ ProcedureCodes]

    define TestGeneralProcedureNotDoneExplicit:
      [&quot;ProcedureNotDone&quot;] I
        where I.code() in ProcedureCodes
          or I.code() ~ ProcedureCodes

    // ServiceNotRequested
    define TestSpecificServiceNotRequested:
      [&quot;ServiceNotRequested&quot;: ProcedureCode]

    // TODO: Support this use case
    //define TestSpecificServiceNotRequestedActual:
    //    [&quot;ServiceNotRequested&quot;: code ~ ProcedureCode]
    //      union [&quot;ServiceNotRequested&quot;: code ~contains ProcedureCode]

    define TestSpecificServiceNotRequestedExplicit:
      [&quot;ServiceNotRequested&quot;] I
        where I.code() ~ ProcedureCode
          or ProcedureCode in I.code()

    define TestGeneralServiceNotRequested:
      [&quot;ServiceNotRequested&quot;: ProcedureCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralServiceNotRequestedActual:
      [&quot;ServiceNotRequested&quot;: code in ProcedureCodes]
        union [&quot;ServiceNotRequested&quot;: code ~ ProcedureCodes]

    define TestGeneralServiceNotRequestedExplicit:
      [&quot;ServiceNotRequested&quot;] I
        where I.code() in ProcedureCodes
          or I.code() ~ ProcedureCodes

    // TaskRejected
    define TestSpecificTaskRejected:
      [&quot;TaskRejected&quot;: TaskCode]

    // TODO: Support this use case
    //define TestSpecificTaskRejectedActual:
    //    [&quot;TaskRejected&quot;: code ~ TaskCode]
    //      union [&quot;TaskRejected&quot;: code contains TaskCode]

    define TestSpecificTaskNotDoneExplicit:
      [&quot;TaskRejected&quot;] I
        where I.code() ~ TaskCode
          or TaskCode in I.code()

    define TestGeneralTaskRejected:
      [&quot;TaskRejected&quot;: TaskCodes]

    // NOTE: This warning should not be happening, logged a translator issue to investigate: https://github.com/cqframework/clinical_quality_language/issues/1714
    define TestGeneralTaskRejectedActual:
      [&quot;TaskRejected&quot;: code in TaskCodes]
        union [&quot;TaskRejected&quot;: code ~ TaskCodes]

    define TestGeneralTaskRejectedExplicit:
      [&quot;TaskRejected&quot;] I
        where I.code() in TaskCodes
          or I.code() ~ TaskCodes
    </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>Encoded data (316708 characters)</code></pre></td></tr>
                </table>
              </td>
            </tr>

            <tr>
              <td colspan="2">
                <table>
                  <tr><th><b>Content: </b> application/elm+json</th></tr>
                  <tr><td><pre><code>Encoded data (593504 characters)</code></pre></td></tr>
                </table>
              </td>
            </tr>

        </table>
    </div>
    </div>
      </text>
      <url
           value="http://fhir.org/guides/onc/us-quality-core/Library/USQualityCoreCommonTests"/>
      <version value="0.5.0"/>
      <name value="USQualityCoreCommonTests"/>
      <title value="US Quality Core CommonTests"/>
      <status value="active"/>
      <experimental value="true"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="logic-library"/>
        </coding>
      </type>
      <date value="2025-10-02T13:51:38+00:00"/>
      <publisher
                 value="Office of the National Coordinator for Health Information Technology (ONC)"/>
      <contact>
        <name
              value="Office of the National Coordinator for Health Information Technology (ONC)"/>
        <telecom>
          <system value="url"/>
          <value value="https://www.healthit.gov/feedback"/>
        </telecom>
      </contact>
      <description value="Tests for the US Quality Core Common library"/>
      <jurisdiction>
        <coding>
          <system value="urn:iso:std:iso:3166"/>
          <code value="US"/>
          <display value="United States of America"/>
        </coding>
        <text value="USA"/>
      </jurisdiction>
      <topic>
        <text value="FHIR"/>
      </topic>
      <topic>
        <text value="CQL"/>
      </topic>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Model USQualityCore"/>
        <resource
                  value="http://fhir.org/guides/onc/us-quality-core/Library/USQualityCore-ModelInfo|0.5.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library USQualityCoreCommon"/>
        <resource
                  value="http://fhir.org/guides/onc/us-quality-core/Library/USQualityCoreCommon"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code System Marital Status Codes"/>
        <resource value="http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code System CDC Race and Ethnicity Codes"/>
        <resource value="urn:oid:2.16.840.1.113883.6.238"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code System CommunicationCategoryCodeSystem"/>
        <resource
                  value="http://terminology.hl7.org/CodeSystem/communication-category"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code System SNOMED-CT"/>
        <resource value="http://snomed.info/sct"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code System CVX"/>
        <resource value="http://hl7.org/fhir/sid/cvx"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code System LOINC"/>
        <resource value="http://loinc.org"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code System TaskCodeSystem"/>
        <resource value="http://hl7.org/fhir/CodeSystem/task-code"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value Set Marital Status"/>
        <resource value="http://hl7.org/fhir/ValueSet/marital-status"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value Set CommunicationCodes"/>
        <resource value="http://hl7.org/fhir/ValueSet/communication-category"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value Set DeviceCodes"/>
        <resource value="http://example.org/fhir/ValueSet/device-codes"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value Set ImmunizationCodes"/>
        <resource value="http://example.org/fhir/ValueSet/immunization-codes"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value Set MedicationCodes"/>
        <resource value="http://example.org/fhir/ValueSet/medication-codes"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value Set ObservationCodes"/>
        <resource value="http://example.org/fhir/ValueSet/observation-codes"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value Set ProcedureCodes"/>
        <resource value="http://example.org/fhir/ValueSet/procedure-codes"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value Set TaskCodes"/>
        <resource value="http://hl7.org/fhir/ValueSet/task-code"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value Set NegationReasonCodes"/>
        <resource
                  value="http://fhir.org/guides/onc/us-quality-core/ValueSet/us-quality-core-negation-reason"/>
      </relatedArtifact>
      <content>
        <contentType value="text/cql"/>
        <data
              value="[encoded data, 23844 characters]"/>
      </content>
      <content>
        <contentType value="application/elm+xml"/>
        <data
              value="[encoded data, 316708 characters]"/>
      </content>
      <content>
        <contentType value="application/elm+json"/>
        <data
              value="[encoded data, 593504 characters]"/>
      </content>
    </Library>