Draft dQM CMS Content Implementation Guide
2025.1.0 - CI Build

Draft dQM CMS Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2025.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/dqm-content-cms-2025/ and changes regularly. See the Directory of published versions

Measure: Bone Density Evaluation for Patients with Prostate Cancer and Receiving Androgen Deprivation TherapyFHIR

Official URL: https://madie.cms.gov/Measure/CMS645FHIRBoneDensityPCADTherapy Version: 1.0.000
Active as of 2026-01-16 Responsible: Oregon Urology Computable Name: CMS645FHIRBoneDensityPCADTherapy
Other Identifiers: Short Name: CMS645FHIR (use: usual, ), UUID:299de9c4-755d-4f5a-ac9e-fa74fe34f759 (use: official, ), UUID:5cd769d8-9a63-4637-b18e-76ee9c68cbf9 (use: official, ), Publisher: 645FHIR (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 the use or accuracy of third-party codes contained in the specifications.

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

Percentage of patients determined as having prostate cancer who are currently starting or undergoing androgen deprivation therapy (ADT), for an anticipated period of 12 months or greater and who receive an initial bone density evaluation. The bone density evaluation must be prior to the start of ADT or within 3 months of the start of ADT.

Metadata
Title Bone Density Evaluation for Patients with Prostate Cancer and Receiving Androgen Deprivation TherapyFHIR
Version 1.0.000
Short Name CMS645FHIR
GUID (Version Independent) urn:uuid:299de9c4-755d-4f5a-ac9e-fa74fe34f759
GUID (Version Specific) urn:uuid:5cd769d8-9a63-4637-b18e-76ee9c68cbf9
CMS Identifier 645FHIR
Effective Period 2026-01-01 through 2026-12-31
Steward (Publisher) Oregon Urology
Developer Oregon Urology
Description

Percentage of patients determined as having prostate cancer who are currently starting or undergoing androgen deprivation therapy (ADT), for an anticipated period of 12 months or greater and who receive an initial bone density evaluation. The bone density evaluation must be prior to the start of ADT or within 3 months of the start of ADT.

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 the use or accuracy of third-party codes contained in the specifications.

CPT(R) contained in the Measure specifications is copyright 2004-2024. American Medical Association. LOINC(R) copyright 2004-2024 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2024. International Health Terminology Standards Development Organisation. ICD-10 copyright 2024 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].

Rationale

Androgen suppression as a treatment for prostate cancer can cause osteoporosis (Qaseem, 2008). Patients with prostate cancer undergoing prolonged androgen deprivation therapy (ADT) incur bone loss at a rate higher than menopausal patients (Guise, 2007). In preserving bone health, the goal is to prevent or treat osteopenia/osteoporosis for the patient on ADT and to prevent or delay skeletal-related events. The National Osteoporosis Foundation recommendations include a baseline assessment of bone density with a dual-energy X-ray absorptiometry (DEXA) scan and daily calcium and Vitamin D supplementation (Watts, 2012). The DEXA scan is the gold standard for bone density screening. Patients at risk for adverse bone consequences from chronic ADT do not always receive care according to evidence-based guidelines. These findings call for improved processes that standardize evidence-based practice, including baseline and follow-up bone density assessment (Watts, 2012).

Clinical Recommendation Statement

Bone density screening should be performed at the start of Androgen Deprivation Therapy (ADT) for prostate cancer. It should also be performed every 2 years for the patient with continued ADT or for patients with known osteoporosis. Current insurance practice is to possibly cover the cost of bone density screening if osteoporosis is known or if there is a high-risk drug. Some patients choose to delay bone density screening until after ADT is started and they therefore have insurance authorization due to the administration of a high-risk drug.

Citation

Cosman, F., deBeur, S.J., LeBoff, M.S., Lewiecki, E. M., Tanner, B., Randall, S., & Lindsay, R. (2014). Clinician's Guide to Prevention and Treatment of Osteoporosis. Osteoporosis International, 25(10), 2359--2381. https://doi.org/10.1007/s00198-014-2794-2

Citation

Finkelstein, J., & Yu, E. (2017). Clinical manifestations, diagnosis, and evaluation of osteoporosis in men. Retrieved from https://www.uptodate.com/contents/clinical-manifestations-diagnosis-and-evaluation-of-osteoporosis-in-men/print?source=see_link

Citation

Guise, T.A., Oefelein, M.G., Eastham, J.A., Cookson, M.S., Higano, C.S., & Smith, M.R. (2007). Estrogenic side effects of androgen deprivation therapy. Reviews in urology, 9(4), 163-180.

Citation

Qaseem, A., Snow, V., Shekelle, P., Hopkins, R., Forciea, M. A., Owens, D. K., & for the Clinical Efficacy Assessment Subcommittee of the American College of Physicians. (2008). Annals of Internal Medicine. Screening for osteoporosis in men: A clinical practice guideline from the American College of Physicians, 2008. Annals of Internal Medicine, 148(9), 680-684. https://doi.org/10.7326/0003-4819-148-9-200805060-00008

Citation

Ward, R. J., Roberts, C. C., Bencardino, J. T., Arnold, E., Baccei, S. J., Cassidy, R. C., ... Weissman, B. N. (2017). ACR Appropriateness Criteria (R) Osteoporosis and Bone Mineral Density. Journal of the American College of Radiology, 14(5), S189--S202. https://doi.org/10.1016/j.jacr.2017.02.018

Citation

Watts, N. B., Adler, R. A., Bilezikian, J. P., Drake, M. T., Eastell, R., Orwoll, E. S., & Finkelstein, J. S. (2012). Osteoporosis in Men: An Endocrine Society Clinical Practice Guideline. The Journal of Clinical Endocrinology & Metabolism, 97(6), 1802--1822. https://doi.org/10.1210/jc.2011-3045

Definition Dual Energy X-ray Absorptiometry (DEXA): A scan that measures the bone of the spine, hip, or total body and measures bone mineral density. It is considered one of the most accurate measurements.
Definition First Androgen Deprivation Therapy: The first Androgen Deprivation Therapy (ADT) is measured as the first order or administration of ADT for an anticipated period of 12 months or greater to a patient with prostate cancer.
Definition Peripheral Dual Energy X-ray Absorptiometry (PDXA): Bone mineral density measurement of the wrist, heel, or finger.
Guidance (Usage) In order to capture the practitioner's intent of androgen deprivation therapy (ADT) for a period of 12 months or greater, SNOMEDCT 456381000124102 which is Injection of leuprolide acetate for the twelve-month period (regime/therapy) is the correct code. This eCQM is a patient-based measure. This FHIR-based measure has been derived from the QDM-based measure CMS645v9. Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU6/) for more information on QI-Core and mapping recommendations from QDM to QI-Core STU 6 (https://hl7.org/fhir/us/qicore/STU6/qdm-to-qicore.html).
Measure Group (Rate) (ID: Group_1)
Basis boolean
Scoring Proportion
Improvement Notation Increased score indicates improvement
Type Process
Initial Population ID: InitialPopulation_1
Description:

Patients with a qualifying encounter in the measurement period AND with a diagnosis of prostate cancer AND with an order for ADT or an active medication of ADT with an intent for treatment greater than or equal to 12 months during the measurement period AND order for ADT in 3 months before to 9 months after the start of the measurement period

Criteria: Initial Population
Denominator ID: Denominator_1
Description:

Equals Initial Population

Criteria: Denominator
Denominator Exception ID: DenominatorException_1
Description:

Patient refused the bone density evaluation at the time ordered or did not have it performed within 3 months after the start of ADT

Criteria: Denominator Exception
Numerator ID: Numerator_1
Description:

Patients with a bone density evaluation within the two years prior to the start of or less than three months after the start of ADT treatment

Criteria: Numerator
<p>For every patient evaluated by this measure also identify payer, race, ethnicity and sex</p>
Supplemental Data Elements
Supplemental Data Element ID: sde-ethnicity
Usage Code: Supplemental Data
Description: SDE Ethnicity
Logic Definition: SDE Ethnicity
Supplemental Data Element ID: sde-payer
Usage Code: Supplemental Data
Description: SDE Payer
Logic Definition: SDE Payer
Supplemental Data Element ID: sde-race
Usage Code: Supplemental Data
Description: SDE Race
Logic Definition: SDE Race
Supplemental Data Element ID: sde-sex
Usage Code: Supplemental Data
Description: SDE Sex
Logic Definition: SDE Sex
Measure Logic
Primary Library https://madie.cms.gov/Library/CMS645FHIRBoneDensityPCADTherapy
Contents Population Criteria
Logic Definitions
Terminology
Dependencies
Data Requirements
Parameters
Population Criteria
Measure Group (Rate) (ID: Group_1)
Initial Population
define "Initial Population":
  "Has Qualifying Encounter"
    and exists "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period"
Definition
Denominator
define "Denominator":
  "Initial Population"
Definition
Denominator Exception
define "Denominator Exception":
  exists ( "No Bone Density Scan Ordered Due to Patient Refusal" )
    or exists ( "No Bone Density Scan Performed Due to Patient Refusal" )
Definition
Numerator
define "Numerator":
  "Has Baseline DEXA Scan Two Years Prior to the Start of or Less than Three Months After the Start of ADT"
Definition
Logic Definitions
Logic Definition Library Name: SupplementalDataElements
define "SDE Sex":
  case
    when Patient.sex() = '248153007' then "Male (finding)"
    when Patient.sex() = '248152002' then "Female (finding)"
    else null
  end
Logic Definition Library Name: SupplementalDataElements
define "SDE Payer":
  [USQualityCore.Coverage: type in "Payer Type"] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }
Logic Definition Library Name: SupplementalDataElements
define "SDE Ethnicity":
  (Patient.ethnicity()) E
    return Tuple {
      codes: { E.ombCategory } union E.detailed,
      display: E.text
    }
Logic Definition Library Name: SupplementalDataElements
define "SDE Race":
  (Patient.race()) R
    return Tuple {
      codes: R.ombCategory union R.detailed,
      display: R.text
    }
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "SDE Sex":
  SDE."SDE Sex"
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Androgen Deprivation Therapy for Urology Care Medication Active Start Dates":
  [MedicationRequest: "Androgen Deprivation Therapy for Urology Care"] ADTActive
    let firstMedicationPeriod: First((collapse(ADTActive.dosageInstruction.timing.repeat.bounds DoseTime
          return DoseTime.toInterval()
      )) DrugPeriods
        sort by start of $this
    ),

    //get the very first event as interval
    
    firstMedicationEvent: First((ADTActive.dosageInstruction.timing dosageTiming
        //returns first event for the specific dosageTiming
        
        return First(dosageTiming.event dosageTimingEvents
            sort ascending
        )) firstEvents
        sort ascending
    ),
    medicationDateTime: Min({ firstMedicationEvent, start of firstMedicationPeriod, 
      end of firstMedicationPeriod }
    )
    where ADTActive.status in { 'active', 'completed' }
      and ADTActive.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
    return medicationDateTime
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Androgen Deprivation Therapy for Urology Care Medication Order Start Dates":
  [MedicationRequest: "Androgen Deprivation Therapy for Urology Care"] ADTOrder
    let firstMedicationPeriod: First((collapse(ADTOrder.dosageInstruction.timing.repeat.bounds DoseTime
          return DoseTime.toInterval()
      )) DrugPeriods
        sort by start of $this
    ),
    medicationDateTime: Min({ ADTOrder.authoredOn, start of firstMedicationPeriod, 
      end of firstMedicationPeriod }
    )
    where ADTOrder.status in { 'active', 'completed' }
      and ADTOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
    return medicationDateTime
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Prostate Cancer Diagnosis":
  ( [ConditionProblemsHealthConcerns: "Prostate Cancer"]
    union [ConditionEncounterDiagnosis: "Prostate Cancer"] ) ProstateCancer
    where ProstateCancer.onset.toInterval ( ) overlaps day of "Measurement Period"
      and ProstateCancer.isVerified ( )
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "First ADT in 3 Months Before to 9 Months After Start of Measurement Period":
  First(("Androgen Deprivation Therapy for Urology Care Medication Active Start Dates"
      union "Androgen Deprivation Therapy for Urology Care Medication Order Start Dates") ADTDateTime
      with "Prostate Cancer Diagnosis" ProstateCancer
        such that ADTDateTime during day of ProstateCancer.onset.toInterval ( )
          and ADTDateTime during day of Interval[start of "Measurement Period" - 3 months, start of "Measurement Period" + 9 months]
      sort ascending
  )
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period":
  [ServiceRequest: "Injection of leuprolide acetate for twelve month period (regime/therapy)"] OrderTwelveMonthADT
    with "First ADT in 3 Months Before to 9 Months After Start of Measurement Period" FirstADTMP
      such that OrderTwelveMonthADT.authoredOn on or after day of FirstADTMP
        and OrderTwelveMonthADT.authoredOn during day of Interval[start of "Measurement Period" - 3 months, start of "Measurement Period" + 9 months]
        and OrderTwelveMonthADT.status in { 'active', 'completed' }
        and OrderTwelveMonthADT.intent = 'order'
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Has Baseline DEXA Scan Two Years Prior to the Start of or Less than Three Months After the Start of ADT":
  exists ( ( [ServiceRequest: "DEXA Bone Density for Urology Care"] DEXAOrdered
        with "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period" OrderTwelveMonthsADT
          such that DEXAOrdered.authoredOn 3 months or less on or after day of OrderTwelveMonthsADT.authoredOn
            or DEXAOrdered.authoredOn 2 years or less before day of OrderTwelveMonthsADT.authoredOn
        where DEXAOrdered.status in { 'active', 'completed' }
          and DEXAOrdered.intent = 'order'
    )
      union ( [ObservationClinicalResult: "DEXA Bone Density for Urology Care"] DEXAPerformed
          with "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period" OrderTwelveMonthsADT
            such that DEXAPerformed.effective.toInterval ( ) 3 months or less on or after day of OrderTwelveMonthsADT.authoredOn
              or DEXAPerformed.effective.toInterval ( ) 2 years or less before day of OrderTwelveMonthsADT.authoredOn
          where DEXAPerformed.status in { 'final', 'amended', 'corrected' }
      )
  )
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Numerator":
  "Has Baseline DEXA Scan Two Years Prior to the Start of or Less than Three Months After the Start of ADT"
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "No Bone Density Scan Ordered Due to Patient Refusal":
  [ServiceNotRequested: "DEXA Bone Density for Urology Care"] DEXANotOrdered
    with "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period" OrderTwelveMonthsADT
      such that DEXANotOrdered.authoredOn 3 months or less on or after day of OrderTwelveMonthsADT.authoredOn
        and DEXANotOrdered.reasonRefused ( ) in "Patient Declined"
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "No Bone Density Scan Performed Due to Patient Refusal":
  [ObservationCancelled: "DEXA Bone Density for Urology Care"] DEXANotPerformed
    with "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period" OrderTwelveMonthsADT
      such that DEXANotPerformed.issued 3 months or less on or after day of OrderTwelveMonthsADT.authoredOn
        and DEXANotPerformed.notDoneReason ( ) in "Patient Declined"
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Denominator Exception":
  exists ( "No Bone Density Scan Ordered Due to Patient Refusal" )
    or exists ( "No Bone Density Scan Performed Due to Patient Refusal" )
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Has Qualifying Encounter":
  exists ( ["Encounter": "Office Visit"] OfficeVisit
      where OfficeVisit.period during day of "Measurement Period"
        and OfficeVisit.status = 'finished'
  )
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Initial Population":
  "Has Qualifying Encounter"
    and exists "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period"
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "Denominator":
  "Initial Population"
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "SDE Payer":
  SDE."SDE Payer"
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "SDE Ethnicity":
  SDE."SDE Ethnicity"
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
define "SDE Race":
  SDE."SDE Race"
Logic Definition Library Name: CMS645FHIRBoneDensityPCADTherapy
/*      
@description: Returns true if the given condition either has no verification status or has a verification status of confirmed, unconfirmed, provisional, or differential
*/


define fluent function isVerified(condition Choice<ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns>):
  condition.verificationStatus is not null implies ( condition.verificationStatus ~ Status."confirmed"
      or condition.verificationStatus ~ Status."unconfirmed"
      or condition.verificationStatus ~ Status."provisional"
      or condition.verificationStatus ~ Status."differential"
  )
Logic Definition Library Name: USQualityCoreCommon
/*
@description: Returns the value of the recorded extension for a Medication Administration Not Done
*/
define fluent function reasonRefused(serviceNotRequested ServiceNotRequested):
  serviceNotRequested.ext('http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-doNotPerformReason').value as FHIR.CodeableConcept
Logic Definition Library Name: USQualityCoreCommon
/*
@description: Returns the notDoneReason for an ObservationCancelled
*/
define fluent function notDoneReason(observationCancelled ObservationCancelled):
  observationCancelled.ext('http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-notDoneReason').value as FHIR.CodeableConcept
Logic Definition Library Name: FHIRHelpers
define function ToString(value string): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value uri): value.value
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
    if concept is null then
        null
    else
        System.Concept {
            codes: concept.coding C return ToCode(C),
            display: concept.text.value
        }
Logic Definition Library Name: FHIRHelpers
/*
@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
        }
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value dateTime): value.value
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
value to a CQL DateTime Interval
@comment: If the start value of the given period is unspecified, the starting
boundary of the resulting interval will be open (meaning the start of the interval
is unknown, as opposed to interpreted as the beginning of time).
*/
define function ToInterval(period FHIR.Period):
    if period is null then
        null
    else
        if period."start" is null then
            Interval(period."start".value, period."end".value]
        else
            Interval[period."start".value, period."end".value]
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value instant): value.value
Logic Definition Library Name: FHIRHelpers
define function ToDate(value date): value.value
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) 
value to a CQL Quantity
@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
@seealso: ToCalendarUnit
*/
define function ToQuantity(quantity FHIR.Quantity):
    case
        when quantity is null then null
        when quantity.value is null then null
        when quantity.comparator is not null then
            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
        else
            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
    end
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts a UCUM definite duration unit to a CQL calendar duration
unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) 
topic of the CQL specification.
@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
*/
define function ToCalendarUnit(unit System.String):
    case unit
        when 'ms' then 'millisecond'
        when 's' then 'second'
        when 'min' then 'minute'
        when 'h' then 'hour'
        when 'd' then 'day'
        when 'wk' then 'week'
        when 'mo' then 'month'
        when 'a' then 'year'
        else unit
    end
Logic Definition Library Name: FHIRHelpers
define function ToString(value MedicationRequestStatus): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value MedicationRequestIntent): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value ServiceRequestStatus): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value ServiceRequestIntent): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value ObservationStatus): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value EncounterStatus): value.value
Logic Definition Library Name: FHIRCommon
/*
@description: Returns the single extension (if present) on the given resource with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define fluent function ext(domainResource DomainResource, url String):
  singleton from domainResource.exts(url)
Logic Definition Library Name: FHIRCommon
/*
@description: Returns any extensions defined on the given resource with the specified url
*/
define fluent function exts(domainResource DomainResource, url String):
  domainResource.extension E
    where E.url = url
    return E
Logic Definition Library Name: FHIRCommon
/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range 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 FHIR, allowing this function to be used across any resource.

The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
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 Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.

NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):
  case
    when choice is FHIR.dateTime then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
    when choice is FHIR.Period then
      FHIRHelpers.ToInterval(choice as FHIR.Period)
    when choice is FHIR.instant then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
    when choice is FHIR.Age then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
    when choice is FHIR.Range then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
    when choice is FHIR.Timing then
      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
    when choice is FHIR.string then
      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
    else
      null as Interval<DateTime>
  end
Logic Definition Library Name: FHIRCommon
/*
@description: Returns the single extension (if present) on the given element with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given element with the specified url.
*/
define fluent function ext(element Element, url String):
  singleton from element.exts(url)
Logic Definition Library Name: FHIRCommon
/*
@description: Returns any extensions defined on the given element with the specified url.
*/
define fluent function exts(element Element, url String):
  element.extension E
    where E.url = url
    return E
Logic Definition Library Name: USCoreCommon
/*
@description: Returns the sex element as defined for the USCore patient profile
*/
define fluent function sex(patient Patient):
  patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex').value as FHIR.code
Logic Definition Library Name: USCoreCommon
define fluent function ethnicity(patient Patient):
  (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity')) E
    return {
      ombCategory: E.ext('ombCategory').value as FHIR.Coding,
      detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
      text: E.ext('text').value as FHIR.string
    }
Logic Definition Library Name: USCoreCommon
define fluent function race(patient Patient):
  (patient.ext('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race')) E
    return {
      ombCategory: (E.exts('ombCategory')) o return o.value as FHIR.Coding,
      detailed: (E.exts('detailed')) d return d.value as FHIR.Coding,
      text: E.ext('text').value as FHIR.string
    }
Terminology
Code System Description: Code system SNOMEDCT
Resource: SNOMED CT (all versions)
Canonical URL: http://snomed.info/sct
Code System Description: Code system ConditionVerificationStatusCodes
Resource: ConditionVerificationStatus
Canonical URL: http://terminology.hl7.org/CodeSystem/condition-ver-status
Value Set Description: Value set DEXA Bone Density for Urology Care
Resource: DEXA Bone Density for Urology Care
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.359
Value Set Description: Value set Androgen Deprivation Therapy for Urology Care
Resource: Androgen Deprivation Therapy for Urology Care
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.352
Value Set Description: Value set Prostate Cancer
Resource: Prostate Cancer
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.319
Value Set Description: Value set Patient Declined
Resource: Patient Declined
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1582
Value Set Description: Value set Office Visit
Resource: Office Visit
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001
Value Set Description: Value set Payer Type
Resource: Payer Type
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
Direct Reference Code Display: Male (finding)
Code: 248153007
System: http://snomed.info/sct
Direct Reference Code Display: Female (finding)
Code: 248152002
System: http://snomed.info/sct
Direct Reference Code Display: Injection of leuprolide acetate for twelve month period (regime/therapy)
Code: 456381000124102
System: http://snomed.info/sct
Direct Reference Code Display: confirmed
Code: confirmed
System: http://terminology.hl7.org/CodeSystem/condition-ver-status
Direct Reference Code Display: unconfirmed
Code: unconfirmed
System: http://terminology.hl7.org/CodeSystem/condition-ver-status
Direct Reference Code Display: provisional
Code: provisional
System: http://terminology.hl7.org/CodeSystem/condition-ver-status
Direct Reference Code Display: differential
Code: differential
System: http://terminology.hl7.org/CodeSystem/condition-ver-status
Dependencies
Dependency Description: USQualityCore model information
Resource: https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild
Canonical URL: https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild
Dependency Description: USCore model information
Resource: http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived
Canonical URL: http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|6.1.0-derived
Dependency Description: FHIR model information
Resource: http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1
Dependency Description: Library SDE
Resource: SupplementalDataElements version: 6.1.000
Canonical URL: https://madie.cms.gov/Library/SupplementalDataElements|6.1.000
Dependency Description: Library FHIRHelpers
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Dependency Description: Library USCommon
Resource: http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot
Canonical URL: http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot
Dependency Description: Library FHIRCommon
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Dependency Description: Library Status
Resource: Status version: 2.1.000
Canonical URL: https://madie.cms.gov/Library/Status|2.1.000
Dependency Description: Library USQualityCoreCommon
Resource: US Quality Core Common version: 0.1.0-cibuild
Canonical URL: https://madie.cms.gov/Library/USQualityCoreCommon|0.1.0-cibuild
Data Requirements
Data Requirement Type: Patient
Profile(s): http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-patient
Must Support Elements: ombCategory, detailed, text
Data Requirement Type: Patient
Profile(s): Patient
Must Support Elements: birthDate
Data Requirement Type: Medication
Profile(s): Medication
Must Support Elements: id, code
Code Filter(s):
Path: code
ValueSet: Androgen Deprivation Therapy for Urology Care
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication.reference, dosageInstruction, status, intent, authoredOn
Data Requirement Type: MedicationRequest
Profile(s): MedicationRequest
Must Support Elements: medication, dosageInstruction, status, intent, authoredOn
Code Filter(s):
Path: medication
ValueSet: Androgen Deprivation Therapy for Urology Care
Data Requirement Type: Condition
Profile(s): http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-problems-health-concerns
Must Support Elements: code
Code Filter(s):
Path: code
ValueSet: Prostate Cancer
Data Requirement Type: Condition
Profile(s): http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-condition-encounter-diagnosis
Must Support Elements: code
Code Filter(s):
Path: code
ValueSet: Prostate Cancer
Data Requirement Type: ServiceRequest
Profile(s): ServiceRequest
Must Support Elements: code, authoredOn, status, intent
Code Filter(s):
Path: code
Code(s): SNOMED CT: 456381000124102 (Injection of leuprolide acetate for twelve month period (regime/therapy))
Path: intent
Code(s): [not stated]: order (order)
Data Requirement Type: ServiceRequest
Profile(s): ServiceRequest
Must Support Elements: code, authoredOn, status, intent
Code Filter(s):
Path: code
ValueSet: DEXA Bone Density for Urology Care
Data Requirement Type: Observation
Profile(s): http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-observation-clinical-result
Must Support Elements: code, effective, status
Code Filter(s):
Path: code
ValueSet: DEXA Bone Density for Urology Care
Data Requirement Type: ServiceRequest
Profile(s): http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-servicenotrequested
Must Support Elements: code, authoredOn
Code Filter(s):
Path: code
ValueSet: DEXA Bone Density for Urology Care
Data Requirement Type: Observation
Profile(s): http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-observationcancelled
Must Support Elements: code, issued
Code Filter(s):
Path: code
ValueSet: DEXA Bone Density for Urology Care
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, period, status
Code Filter(s):
Path: type
ValueSet: Office Visit
Path: status
Code(s): [not stated]: finished (finished)
Data Requirement Type: Coverage
Profile(s): http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-coverage
Must Support Elements: type, period
Code Filter(s):
Path: type
ValueSet: Payer Type
Parameters
Name Use Card. Type Documentation
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
SDE Race Out 0..1 Resource
Generated using version 0.5.4 of the sample-content-ig Liquid templates