eCQM QICore Content Implementation Guide
2024.0.0 - CI Build

eCQM QICore Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2024.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/ecqm-content-qicore-2024/ and changes regularly. See the Directory of published versions

Measure: Intravesical Bacillus-Calmette-Guerin for Non-Muscle Invasive Bladder CancerFHIR

Official URL: https://madie.cms.gov/Measure/IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Version: 1.4.000
Draft as of 2024-07-09 Responsible: Oregon Urology Computable Name: IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR
Other Identifiers: Short Name (use: usual, ), UUID:907ead5a-2f8f-468e-b774-309ea8aa6182 (use: official, ), UUID:2247c9d9-9de5-47dd-a2a5-cb05249f6a3e (use: official, ), Publisher (use: official, )

Copyright/Legal: Limited proprietary coding is contained in the measure specifications for convenience. Users of the proprietary code sets should obtain all necessary licenses from the owners of these code sets. Oregon Urology Institute (OUI) and Large Urology Group Practice Association (LUGPA) disclaim all liability for use or accuracy of third party codes contained in the specifications.

CPT(R) contained in the Measure specifications is copyright 2004-2023. American Medical Association. LOINC(R) copyright 2004-2023 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2023 International Health Terminology Standards Development Organisation. ICD-10 copyright 2023 World Health Organization. All Rights Reserved.

Percentage of patients initially diagnosed with non-muscle invasive bladder cancer and who received intravesical Bacillus-Calmette-Guerin (BCG) within 6 months of bladder cancer staging

UNKNOWN

Title: Intravesical Bacillus-Calmette-Guerin for Non-Muscle Invasive Bladder CancerFHIR
Id: IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR
Version: 1.4.000
Url: Intravesical Bacillus-Calmette-Guerin for Non-Muscle Invasive Bladder CancerFHIR
short-name identifier:

CMS646FHIR

version-independent identifier:

urn:uuid:907ead5a-2f8f-468e-b774-309ea8aa6182

version-specific identifier:

urn:uuid:2247c9d9-9de5-47dd-a2a5-cb05249f6a3e

publisher (CMS) identifier:

646FHIR

Effective Period: 2025-01-01..2025-12-31
Status: draft
Publisher: Oregon Urology
Author: Oregon Urology
Description:

Percentage of patients initially diagnosed with non-muscle invasive bladder cancer and who received intravesical Bacillus-Calmette-Guerin (BCG) within 6 months of bladder cancer staging

Purpose:

UNKNOWN

Copyright:

Limited proprietary coding is contained in the measure specifications for convenience. Users of the proprietary code sets should obtain all necessary licenses from the owners of these code sets. Oregon Urology Institute (OUI) and Large Urology Group Practice Association (LUGPA) disclaim all liability for use or accuracy of third party codes contained in the specifications.

CPT(R) contained in the Measure specifications is copyright 2004-2023. American Medical Association. LOINC(R) copyright 2004-2023 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2023 International Health Terminology Standards Development Organisation. ICD-10 copyright 2023 World Health Organization. All Rights Reserved.

Disclaimer:

The performance measure is not a clinical guideline and does not establish a standard of medical care, and has not been tested for all potential applications.

THE MEASURES AND SPECIFICATIONS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.

Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by TM or [TM].

Scoring:

Proportion

Rationale:

Bladder cancer is ranked 10th for new cancer cases in 2020 and is the 9th leading cause of cancer death in the United States. There are 81,400 estimated new cases in 2020 and 17,980 estimated deaths in 2020. In 2016, there were an estimated 699,450 people living with bladder cancer in the United States. Early detection (discovery of cancer in situ or localized to the primary site) is found in 85% of the patients, and with these there is a five-year survival rate of 95.8% for In Situ and 69.2% for Localized. Bladder cancer is rarely found in patients under age 20, with the median age of diagnosis being 73 (NIH, 2020). National Comprehensive Cancer Network (NCCN) Guidelines for Bladder Cancer (version 6.2021) defines intravesical BCG as Category 1 Treatment for Ta - high grade, T1 and Tis non-muscle invasive bladder cancer. Most public data reflects prophylactic or adjuvant use of intravesical therapy with the goal of preventing recurrence or delaying progression to a higher grade or stage. BCG has been shown to be effective as prophylaxis to prevent bladder cancer recurrences following TURBT. The NCCN Bladder Cancer Panel Members recommend BCG as the preferred option over Mitomycin C for adjuvant treatment of high-grade lesions (Ta). BCG is also standard therapy for Primary Tis. Most T1 lesions are high risk and are similarly treated with adjuvant intravesical therapy with BCG being a Category 1 recommendation. (NCCN, 2021).

Clinical recommendation statement:

Intravesical BCG should be administered within 6 months of the initial diagnosis of non-muscle invasive bladder cancer. It may be administered 3-4 weeks after resection, but there needs to be pathological tumor confirmation and must be withheld if there is traumatic catheterization, bacteriuria, persistent gross hematuria, persistent severe local symptoms or systemic symptoms. The normal induction course is 6 weekly instillations of intravesical BCG (AUA Non-Muscle Invasive Bladder Cancer and American Urological Association (AUA) Guideline for the Management of Non-muscle Invasive Bladder Cancer: Stages Ta High Risk, T1 and TIS).

Guidance (Usage): Ta bladder cancer must be high grade Ta only and is supported by the 2016 AUA guidelines and 2018 NCCN guidelines. The BCG dose can be full or partial and can be from any lot or manufacturer. This eCQM is a patient-based measure. Telehealth encounters are not eligible for this measure because the measure requires a clinical action that cannot be conducted via telehealth This FHIR-based measure has been derived from the QDM-based measure: CMS646v5. Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html).
Population Criteria:
6643b88af4fc785d87117101
Initial Population: All patients initially diagnosed with T1, Tis or high grade Ta non-muscle invasive bladder cancer with bladder cancer staging within 6 months before to 6 months after the start of the measurement period and a qualified encounter in the measurement period
Denominator: Equals Initial Population
Denominator Exclusion: Immunosuppressed patients, includes HIV and immunocompromised state, with a diagnosis prior to Bladder Cancer Staging. Immunosuppressive drug therapy starting on or before Bladder Cancer Staging. Active Tuberculosis diagnosis during the Bladder Cancer Staging. Mixed histology urothelial cell carcinoma including micropapillary, plasmacytoid, sarcomatoid, adenocarcinoma and squamous disease prior to Bladder Cancer Staging. Patients who undergo cystectomy, chemotherapy or radiation within 6 months prior to Bladder Cancer Staging.
Numerator: Intravesical Bacillus-Calmette Guerin (BCG) instillation for initial dose or series: BCG is initiated within 6 months of the bladder cancer staging
Denominator Exception: Unavailability of BCG within 6 months after Bladder Cancer Staging
Supplemental Data Elements:

SDE Ethnicity

SDE Payer

SDE Race

SDE Sex

Supplemental Data Guidance : For every patient evaluated by this measure also identify payer, race, ethnicity and sex
Libraries:
IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR
Terminology and Other Dependencies:
  • Library/SupplementalDataElements|3.5.000
  • Library/QICoreCommon|2.1.000
  • Library/FHIRHelpers|4.4.000
  • AdministrativeGender
  • SNOMED CT (all versions)
  • Condition Clinical Status Codes
  • ConditionVerificationStatus
  • International Classification of Diseases, 10th Revision, Clinical Modification (ICD-10-CM)
  • ActCode
  • BCG Bacillus Calmette Guerin for Urology Care
  • Bladder Cancer for Urology Care
  • Office Visit
  • Payer
  • Active Tuberculosis for Urology Care
  • Immunosuppressive Drugs for Urology Care
  • Cystectomy for Urology Care
  • HIV
  • Immunocompromised Conditions
  • Mixed histology urothelial cell carcinoma for Urology Care
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1151.60
  • Parameters:
    name use min max type
    Measurement Period In 0 1 Period
    SDE Sex Out 0 1 Coding
    Numerator Out 0 1 boolean
    Denominator Exception Out 0 1 boolean
    Denominator Out 0 1 boolean
    SDE Payer Out 0 * Resource
    Initial Population Out 0 1 boolean
    SDE Ethnicity Out 0 1 Resource
    Denominator Exclusion Out 0 1 boolean
    SDE Race Out 0 1 Resource
    DataRequirements:
    Resource Type Resource Elements Valueset Name Valueset
    Patient(QICorePatient) ethnicity race
    Condition(QICoreCondition) code Bladder Cancer for Urology Care Bladder Cancer for Urology Care
    Condition(QICoreCondition) code Active Tuberculosis for Urology Care Active Tuberculosis for Urology Care
    Condition(QICoreCondition) code HIV HIV
    Condition(QICoreCondition) code Immunocompromised Conditions Immunocompromised Conditions
    Condition(QICoreCondition) code Mixed histology urothelial cell carcinoma for Urology Care Mixed histology urothelial cell carcinoma for Urology Care
    Procedure(QICoreProcedure) code performed status status.value id id.value
    Procedure(QICoreProcedure) code performed status status.value id id.value Cystectomy for Urology Care Cystectomy for Urology Care
    Procedure(QICoreProcedure) code performed status status.value id id.value
    MedicationAdministration(QICoreMedicationAdministration) medication effective status status.value BCG Bacillus Calmette Guerin for Urology Care BCG Bacillus Calmette Guerin for Urology Care
    Observation(QICoreObservation) value status status.value reference reference.value
    Encounter(QICoreEncounter) type period class status status.value Office Visit Office Visit
    Coverage(QICoreCoverage) type period Payer Type Payer
    Medication(QICoreMedication) id
    Medication(QICoreMedication) id
    MedicationRequest(QICoreMedicationRequest) medication dosageInstruction status status.value intent intent.value Immunosuppressive Drugs for Urology Care Immunosuppressive Drugs for Urology Care
    MedicationRequest(QICoreMedicationRequest) medication.reference dosageInstruction status status.value intent intent.value
    MedicationRequest(QICoreMedicationRequest) medication dosageInstruction status status.value intent intent.value Chemotherapy Agents for Advanced Cancer http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1151.60
    Direct Reference Codes:
    display code system
    Male M http://hl7.org/fhir/administrative-gender
    Female F http://hl7.org/fhir/administrative-gender
    Tumor staging (tumor staging) 254292007 http://snomed.info/sct
    Active active http://terminology.hl7.org/CodeSystem/condition-clinical
    Recurrence recurrence http://terminology.hl7.org/CodeSystem/condition-clinical
    Relapse relapse http://terminology.hl7.org/CodeSystem/condition-clinical
    Confirmed confirmed http://terminology.hl7.org/CodeSystem/condition-ver-status
    American Joint Committee on Cancer cT1 (qualifier value) 1228889001 http://snomed.info/sct
    American Joint Committee on Cancer cTis (qualifier value) 1228884006 http://snomed.info/sct
    American Joint Committee on Cancer cTa (qualifier value) 1228883000 http://snomed.info/sct
    Carcinoma in situ of bladder D09.0 http://hl7.org/fhir/sid/icd-10-cm
    virtual VR http://terminology.hl7.org/CodeSystem/v3-ActCode
    Combined radiotherapy (procedure) 169331000 http://snomed.info/sct
    Logic Definitions:
    Group Scoring Population Criteria Expression
    6643b88af4fc785d87117101 Group scoring: proportion Measure scoring:

    Proportion

    Type:

    Process

    Rate Aggregation: None
    Improvement Notation:

    Increased score indicates improvement

    Initial Population
    define "Initial Population":
      "Has Most Recent Bladder Cancer Tumor Staging is Ta HG, Tis, T1"
        and "Has Qualifying Encounter"
    Denominator
    define "Denominator":
      "Initial Population"
    Denominator Exclusion
    define "Denominator Exclusion":
      exists "Acute Tuberculosis Diagnosis"
        or exists "Immunosuppressive Drugs"
        or exists "Cystectomy Done"
        or "Has Excluding HIV, Immunocompromised Conditions or Mixed Histology Before Staging"
        or "Has Excluding Chemotherapy or Radiotherapy Procedure Before Staging"
    Numerator
    define "Numerator":
      "First BCG Administered" is not null
    Denominator Exception
    /*
    @commentedOut: exists "BCG Not Available Within 6 Months After Bladder Cancer Staging"
    @commentedOutReason: Negation issue related to https://github.com/cqframework/cql-execution/issues/296, which is tied to https://oncprojectracking.healthit.gov/support/browse/BONNIEMAT-1455. Due to this being the only logic in this population added 'false' as a placeholder.
    */
    
    
    define "Denominator Exception":
        //placeholder
      
      false
    Library Name Name
    SupplementalDataElements SDE Sex
    define "SDE Sex":
      case
        when Patient.gender = 'male' then "M"
        when Patient.gender = 'female' then "F"
        else null
      end
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR SDE Sex
    define "SDE Sex":
      SDE."SDE Sex"
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Bladder Cancer Diagnosis
    define "Bladder Cancer Diagnosis":
      [Condition: "Bladder Cancer for Urology Care"] BladderCancer
        where BladderCancer.prevalenceInterval ( ) starts before end of "Measurement Period"
          and BladderCancer.isConfirmedActiveDiagnosis ( )
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR First Bladder Cancer Staging Procedure
    define "First Bladder Cancer Staging Procedure":
      First([Procedure: "Tumor staging (tumor staging)"] BladderCancerStaging
          with "Bladder Cancer Diagnosis" BladderCancer
            such that BladderCancerStaging.performed.toInterval() starts on or before day of start of BladderCancer.prevalenceInterval()
          where BladderCancerStaging.status = 'completed'
          sort by start of performed.toInterval()
      )
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR First BCG Administered
    define "First BCG Administered":
      First([MedicationAdministration: "BCG Bacillus Calmette Guerin for Urology Care"] BCG
          with "First Bladder Cancer Staging Procedure" FirstBladderCancerStaging
            such that BCG.effective.toInterval() starts 6 months or less after start of FirstBladderCancerStaging.performed.toInterval()
              and BCG.effective.toInterval() starts during "Measurement Period"
          where BCG.status in { 'in-progress', 'completed' }
          sort by start of effective.toInterval()
      )
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Numerator
    define "Numerator":
      "First BCG Administered" is not null
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Denominator Exception
    /*
    @commentedOut: exists "BCG Not Available Within 6 Months After Bladder Cancer Staging"
    @commentedOutReason: Negation issue related to https://github.com/cqframework/cql-execution/issues/296, which is tied to https://oncprojectracking.healthit.gov/support/browse/BONNIEMAT-1455. Due to this being the only logic in this population added 'false' as a placeholder.
    */
    
    
    define "Denominator Exception":
        //placeholder
      
      false
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR July 1 of Year Prior to the Measurement Period
    define "July 1 of Year Prior to the Measurement Period":
      DateTime((year from start of "Measurement Period" - 1), 7, 1, 0, 0, 0, 0, 0)
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR June 30 of the Measurement Period
    define "June 30 of the Measurement Period":
      DateTime((year from start of "Measurement Period"), 6, 30, 23, 59, 59, 0, 0)
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR First Bladder Cancer Staging Procedure during 6 Months Prior to Measurement Period through the First 6 Months of Measurement Period
    define "First Bladder Cancer Staging Procedure during 6 Months Prior to Measurement Period through the First 6 Months of Measurement Period":
      "First Bladder Cancer Staging Procedure" FirstBladderCancerStaging
        where FirstBladderCancerStaging.performed.toInterval ( ) during day of Interval["July 1 of Year Prior to the Measurement Period", "June 30 of the Measurement Period"]
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Has Most Recent Bladder Cancer Tumor Staging is Ta HG, Tis, T1
    /*Ta High Grade only to be included.  Ta low grade is to be excluded from this measure.*/
    
    
    define "Has Most Recent Bladder Cancer Tumor Staging is Ta HG, Tis, T1":
      exists ( [Observation] StagingObservation
          where StagingObservation.getStagingProcedure ( ) is not null
            and ( StagingObservation.value as Concept ~ "American Joint Committee on Cancer cT1 (qualifier value)"
                or StagingObservation.value as Concept ~ "American Joint Committee on Cancer cTis (qualifier value)"
                or StagingObservation.value as Concept ~ "American Joint Committee on Cancer cTa (qualifier value)"
                or StagingObservation.value as Concept ~ "Carcinoma in situ of bladder"
            )
            and StagingObservation.status in { 'final', 'amended', 'corrected' }
      )
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Has Qualifying Encounter
    define "Has Qualifying Encounter":
      exists ( [Encounter: "Office Visit"] ValidEncounter
          where ValidEncounter.period during "Measurement Period"
            and ValidEncounter.class !~ "virtual"
            and ValidEncounter.status = 'finished'
      )
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Initial Population
    define "Initial Population":
      "Has Most Recent Bladder Cancer Tumor Staging is Ta HG, Tis, T1"
        and "Has Qualifying Encounter"
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Denominator
    define "Denominator":
      "Initial Population"
    Library Name Name
    SupplementalDataElements SDE Payer
    define "SDE Payer":
      [Coverage: type in "Payer Type"] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR SDE Payer
    define "SDE Payer":
      SDE."SDE Payer"
    Library Name Name
    SupplementalDataElements SDE Ethnicity
    define "SDE Ethnicity":
      Patient.ethnicity E
        return Tuple {
          codes: { E.ombCategory } union E.detailed,
          display: E.text
        }
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR SDE Ethnicity
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Acute Tuberculosis Diagnosis
    define "Acute Tuberculosis Diagnosis":
      [Condition: "Active Tuberculosis for Urology Care"] ActiveTuberculosis
        with "First Bladder Cancer Staging Procedure" FirstBladderCancerStaging
          such that ActiveTuberculosis.prevalenceInterval ( ) overlaps after day of FirstBladderCancerStaging.performed.toInterval ( )
        where ActiveTuberculosis.isConfirmedActiveDiagnosis ( )
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Immunosuppressive Drugs
    define "Immunosuppressive Drugs":
      [MedicationRequest: "Immunosuppressive Drugs for Urology Care"] ImmunosuppressiveDrugs
        let firstMedicationPeriod: First((collapse(ImmunosuppressiveDrugs.dosageInstruction.timing.repeat.bounds DoseTime
              return DoseTime.toInterval()
          )) DrugPeriods
            sort by start of $this
        ),
            //get the very first event
        
        firstMedicationEvent: First((ImmunosuppressiveDrugs.dosageInstruction.timing dosageTiming
                                          //returns first event for the specific dosageTiming
            
            return First(dosageTiming.event dosageTimingEvents
                sort ascending
            )) firstEvents
            sort ascending
        ),
        medicationPeriod: Coalesce(firstMedicationEvent.toInterval(), firstMedicationPeriod)
        with "First Bladder Cancer Staging Procedure" FirstBladderCancerStaging
          such that medicationPeriod starts on or before day of start of FirstBladderCancerStaging.performed.toInterval ( )
        where ImmunosuppressiveDrugs.status in { 'active', 'completed' }
          and ImmunosuppressiveDrugs.intent = 'order'
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Cystectomy Done
    define "Cystectomy Done":
      [Procedure: "Cystectomy for Urology Care"] Cystectomy
        with "First Bladder Cancer Staging Procedure" FirstBladderCancerStaging
          such that Cystectomy.performed.toInterval ( ) 6 months or less before start of FirstBladderCancerStaging.performed.toInterval ( )
        where Cystectomy.status = 'completed'
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Has Excluding HIV, Immunocompromised Conditions or Mixed Histology Before Staging
    define "Has Excluding HIV, Immunocompromised Conditions or Mixed Histology Before Staging":
      exists ( ( [Condition: "HIV"]
          union [Condition: "Immunocompromised Conditions"]
          union [Condition: "Mixed histology urothelial cell carcinoma for Urology Care"] ) ExclusionDiagnosis
          with "First Bladder Cancer Staging Procedure" FirstBladderCancerStaging
            such that ExclusionDiagnosis.prevalenceInterval ( ) starts on or before day of start of FirstBladderCancerStaging.performed.toInterval ( )
          where ExclusionDiagnosis.isConfirmedActiveDiagnosis ( )
      )
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Has Excluding Chemotherapy or Radiotherapy Procedure Before Staging
    define "Has Excluding Chemotherapy or Radiotherapy Procedure Before Staging":
      exists ( ( [MedicationRequest: "Chemotherapy Agents for Advanced Cancer"] ExclusionMed
            let firstMedicationPeriod: First((collapse(ExclusionMed.dosageInstruction.timing.repeat.bounds DoseTime
                  return DoseTime.toInterval()
              )) DrugPeriods
                sort by start of $this
            )
            with "First Bladder Cancer Staging Procedure" FirstBladderCancerStaging
              such that firstMedicationPeriod starts 6 months or less before FirstBladderCancerStaging.performed.toInterval ( )
            where ExclusionMed.status in { 'active', 'completed' }
              and ExclusionMed.intent = 'order'
        )
          union ( [Procedure: "Combined radiotherapy (procedure)"] ExclusionProcedure
              with "First Bladder Cancer Staging Procedure" FirstBladderCancerStaging
                such that ExclusionProcedure.performed.toInterval ( ) starts 6 months or less before FirstBladderCancerStaging.performed.toInterval ( )
              where ExclusionProcedure.status = 'completed'
          )
      )
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR Denominator Exclusion
    define "Denominator Exclusion":
      exists "Acute Tuberculosis Diagnosis"
        or exists "Immunosuppressive Drugs"
        or exists "Cystectomy Done"
        or "Has Excluding HIV, Immunocompromised Conditions or Mixed Histology Before Staging"
        or "Has Excluding Chemotherapy or Radiotherapy Procedure Before Staging"
    Library Name Name
    SupplementalDataElements SDE Race
    define "SDE Race":
      Patient.race R
        return Tuple {
          codes: R.ombCategory union R.detailed,
          display: R.text
        }
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR SDE Race
    define "SDE Race":
      SDE."SDE Race"
    Library Name Name
    QICoreCommon prevalenceInterval
    /*
    @description: Returns an interval representing the normalized prevalence period of a given Condition.
    @comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from
    onset to abatement as specified in the given Condition. If the condition is active, or has an abatement date the resulting 
    interval will have a closed ending boundary. Otherwise, the resulting interval will have an open ending boundary.
    */
    define fluent function prevalenceInterval(condition Condition):
    if condition.clinicalStatus ~ "active"
      or condition.clinicalStatus ~ "recurrence"
      or condition.clinicalStatus ~ "relapse" then
      Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]
    else
        (end of condition.abatementInterval()) abatementDate
        return if abatementDate is null then
          Interval[start of condition.onset.toInterval(), abatementDate)
        else
          Interval[start of condition.onset.toInterval(), abatementDate]
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR isConfirmedActiveDiagnosis
    define fluent function isConfirmedActiveDiagnosis(Condition Condition):
      Condition.isActive ( )
        and Condition.verificationStatus ~ QICoreCommon."confirmed"
    Library Name Name
    QICoreCommon isActive
    /* Candidates for FHIRCommon */
    
    /*
    @description: Returns true if the given condition has a clinical status of active, recurrence, or relapse
    */
    define fluent function isActive(condition Condition):
      condition.clinicalStatus ~ "active"
        or condition.clinicalStatus ~ "recurrence"
        or condition.clinicalStatus ~ "relapse"
    Library Name Name
    IntravesicalBacillusCalmetteGuerinForBladderCancerFHIR getStagingProcedure
    define fluent function getStagingProcedure(StagingObservation Observation):
      StagingObservation.partOf StagingReference
        return "First Bladder Cancer Staging Procedure during 6 Months Prior to Measurement Period through the First 6 Months of Measurement Period" FirstBladderCancerStagingMP
          where FirstBladderCancerStagingMP.id = StagingReference.reference.getId ( )
    Library Name Name
    QICoreCommon getId
    /*
    @description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).
    @comment: This function can be used to determine the logical id of a given resource. It can be used in
    a single-server environment to trace references. However, this function does not attempt to resolve
    or distinguish the base of the given url, and so cannot be used safely in multi-server environments.
    */
    define fluent function getId(uri String):
      Last(Split(uri, '/'))
    Library Name Name
    FHIRHelpers ToString
    define function ToString(value uri): value.value
    Library Name Name
    FHIRHelpers ToCode
    /*
    @description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
    */
    define function ToCode(coding FHIR.Coding):
        if coding is null then
            null
        else
            System.Code {
              code: coding.code.value,
              system: coding.system.value,
              version: coding.version.value,
              display: coding.display.value
            }
    Library Name Name
    QICoreCommon toInterval
    /*
    @description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
    @comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types
    to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
    representations for timing-valued elements in QICore, allowing this function to be used across any resource.
    The input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>.
    The intent of this function is to provide a clear and concise mechanism to treat single
    elements that have multiple possible representations as intervals so that logic doesn't have to account
    for the variability. More complex calculations (such as medication request period or dispense period
    calculation) need specific guidance and consideration. That guidance may make use of this function, but
    the focus of this function is on single element calculations where the semantics are unambiguous.
    If the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.
    If the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,
    and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.
    If the input is a DateTime Interval, the result is the input.
    If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result
    is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending
    immediately before one year later than the date the patient turned the age given as the end of the quantity interval.
    If the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval
    */
    define fluent function toInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>, Timing>):
      case
    	  when choice is DateTime then
        	Interval[choice as DateTime, choice as DateTime]
    		when choice is Interval<DateTime> then
      		choice as Interval<DateTime>
    		when choice is Quantity then
    		  Interval[Patient.birthDate + (choice as Quantity),
    			  Patient.birthDate + (choice as Quantity) + 1 year)
    		when choice is Interval<Quantity> then
    		  Interval[Patient.birthDate + (choice.low as Quantity),
    			  Patient.birthDate + (choice.high as Quantity) + 1 year)
    		when choice is Timing then
          Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval<DateTime>
    		else
    			null as Interval<DateTime>
    	end