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: Urinary Symptom Score Change 6-12 Months After Diagnosis of Benign Prostatic HyperplasiaFHIR

Official URL: https://madie.cms.gov/Measure/UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Version: 1.4.000
Draft as of 2024-07-09 Responsible: Large Urology Group Practice Association (LUGPA) Computable Name: UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR
Other Identifiers: Short Name (use: usual, ), UUID:0748d873-8e20-441e-9bbf-c1eefe3ea054 (use: official, ), UUID:43e6a3d8-3d0d-4d94-b4c2-bb0232d83fb2 (use: official, ), Publisher (use: official, )

Copyright/Legal: Limited proprietary coding is contained in the measure specifications for user convenience. Users of the proprietary code sets should obtain all necessary licenses from the owners of these code sets. Large Urology Group Practice Association (LUGPA) and Oregon Urology Institute (OUI) disclaim all liability for use or accuracy of any 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 with an office visit within the measurement period and with a new diagnosis of clinically significant Benign Prostatic Hyperplasia who have International Prostate Symptoms Score (IPSS) or American Urological Association (AUA) Symptom Index (SI) documented at time of diagnosis and again 6-12 months later with an improvement of 3 points

UNKNOWN

Title: Urinary Symptom Score Change 6-12 Months After Diagnosis of Benign Prostatic HyperplasiaFHIR
Id: UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR
Version: 1.4.000
Url: Urinary Symptom Score Change 6-12 Months After Diagnosis of Benign Prostatic HyperplasiaFHIR
short-name identifier:

CMS771FHIR

version-independent identifier:

urn:uuid:0748d873-8e20-441e-9bbf-c1eefe3ea054

version-specific identifier:

urn:uuid:43e6a3d8-3d0d-4d94-b4c2-bb0232d83fb2

publisher (CMS) identifier:

771FHIR

Effective Period: 2025-01-01..2025-12-31
Status: draft
Publisher: Large Urology Group Practice Association (LUGPA)
Author: Large Urology Group Practice Association (LUGPA)
Description:

Percentage of patients with an office visit within the measurement period and with a new diagnosis of clinically significant Benign Prostatic Hyperplasia who have International Prostate Symptoms Score (IPSS) or American Urological Association (AUA) Symptom Index (SI) documented at time of diagnosis and again 6-12 months later with an improvement of 3 points

Purpose:

UNKNOWN

Copyright:

Limited proprietary coding is contained in the measure specifications for user convenience. Users of the proprietary code sets should obtain all necessary licenses from the owners of these code sets. Large Urology Group Practice Association (LUGPA) and Oregon Urology Institute (OUI) disclaim all liability for use or accuracy of any 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 MEASURE 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:

Benign prostatic hyperplasia (BPH) is one of the most common conditions affecting older men, with a prevalence of 50% by age 60 years and 90% by the ninth decade of life (Medina et al., 1999). The enlarged gland had been proposed to contribute to the overall lower urinary tract symptoms (LUTS) complex (McVary et al., 2014). Although LUTS secondary to BPH is not often a life-threatening condition, the impact of LUTS/BPH on quality of life can be significant (Wei et al., 2005). The American Urological Association Symptom Index (AUA-SI) and the International Prostate Symptom Score (IPSS) were developed to measure outcomes in studies of different treatments for BPH (Wuerstle et al., 2011). The IPSS uses the same questions as the AUA-SI, but also adds a disease-specific quality of life question (OLeary, 2005). The IPSS was adopted in 1993 by the World Health Organization. It is a reproducible, validated index designed to determine disease severity and response to therapy (D’Silva et al., 2014). It includes 3 storage symptom questions (frequency, nocturia, urgency) and four voiding symptoms (feeling of incomplete emptying, intermittency, straining, and a weak stream) as well as a Bother question: If you were to spend the rest of your life with your urinary condition just the way it is now, how would you feel about that? A three-point improvement in the score is considered meaningful (McVary et al., 2014).

Clinical recommendation statement:

The symptoms of BPH are lower urinary tract symptoms (LUTS). There are other disorders with similar symptoms that need to be excluded. History, physical examination, and testing are required prior to a diagnosis of BPH. IPSS by itself is not a reliable diagnostic tool for LUTS suggestive of BPH but serves as a quantitative measure of LUTS after the diagnosis is established (D’Silva et al., 2014). Medical and surgical interventions for BPH recommend a follow up IPSS evaluation to determine effectiveness of treatment. IPSS should be evaluated at the time of diagnosis and after definitive treatment.

Guidance (Usage): The IPSS is inclusive of the symptom index score and the quality of life score. The AUA-SI is the symptom index score alone and must be added to the QOL score. The AUA-SI with the QOL equals the IPSS. Both of these are the urinary symptom score. The patient must have a urinary symptom score (USS) within 1 month after initial diagnosis. If more than one USS in the initial one month, then the first USS counts. The patient must have a USS again at 6-12 months after the initial diagnosis and if more than one USS in this time frame, then the last USS counts. The result of the test is a numeric value that relates to a continuous numeric scale. Reported either as an integer, a ratio, a real number, or a range. The test result value may optionally contain a relational operator from the set {<=, <, >, >=}. Valid values for a quantitative test are of the form “7”, “-7”, “7.4”, “-7.4”, “7.8912”, “0.125”, “<10”, “<10.15”, “>12000”, 1-10, 1:256. Hospitalization within 30 days of Initial BPH Diagnosis refers to a 30-day period between the end of the hospitalization and the clinical office setting BPH diagnosis. This is due to aggravating factors from hospitalization, such as bed rest, medications, surgery, and altered body functions. 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: CMS771v6. 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:
6643b8e4f4fc785d87117128
Initial Population: Male patients with an initial diagnosis of benign prostatic hyperplasia 6 months prior to the measurement period, and a urinary symptom score assessment within 1 month of initial diagnosis and a follow-up urinary symptom score assessment within 6-12 months, who had a qualifying visit during the measurement period
Denominator: Equals Initial Population
Denominator Exclusion: Patients with urinary retention that starts within 1 year of initial BPH diagnosis. Patients with an initial BPH diagnosis that starts during, or within 30 days after end of hospitalization. Patients with a diagnosis of morbid obesity, or with a BMI Exam >=40 before the follow up urinary symptom score.
Numerator: Patients with a documented improvement of at least 3 points in their urinary symptom score during the measurement period
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:
UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR
Terminology and Other Dependencies:
  • Library/SupplementalDataElements|3.5.000
  • Library/FHIRHelpers|4.4.000
  • Library/QICoreCommon|2.1.000
  • AdministrativeGender
  • Logical Observation Identifiers, Names and Codes (LOINC)
  • International Classification of Diseases, 10th Revision, Clinical Modification (ICD-10-CM)
  • Condition Clinical Status Codes
  • ConditionVerificationStatus
  • ActCode
  • Office Visit
  • Payer
  • Urinary retention
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1151.59
  • Morbid Obesity
  • Parameters:
    name use min max type
    Measurement Period In 0 1 Period
    SDE Sex Out 0 1 Coding
    Numerator 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 Exclusions Out 0 1 boolean
    SDE Race Out 0 1 Resource
    DataRequirements:
    Resource Type Resource Elements Valueset Name Valueset
    Patient(QICorePatient) ethnicity race
    Observation(QICoreObservation) code effective status status.value value
    Observation(QICoreObservation) code effective status status.value value
    Observation(QICoreObservation) code status status.value value effective
    Condition(QICoreCondition) code Urinary retention Urinary retention
    Condition(QICoreCondition) code Morbid Obesity Morbid Obesity
    Condition(QICoreCondition) code
    Encounter(QICoreEncounter) type period class status status.value Office Visit Office Visit
    Encounter(QICoreEncounter) type period status status.value Hospital Services for Urology http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1151.59
    Coverage(QICoreCoverage) type period Payer Type Payer
    Observation(Observation Body Mass Index Profile) value status status.value effective
    Direct Reference Codes:
    display code system
    Male M http://hl7.org/fhir/administrative-gender
    Female F http://hl7.org/fhir/administrative-gender
    International Prostate Symptom Score [IPSS] 80976-4 http://loinc.org
    American Urological Association Symptom Index [AUASI] 80883-2 http://loinc.org
    If you were to spend the rest of your life with your urinary condition just the way it is now, how would you feel about that [IPSS] 81090-3 http://loinc.org
    Benign prostatic hyperplasia with lower urinary tract symptoms N40.1 http://hl7.org/fhir/sid/icd-10-cm
    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
    virtual VR http://terminology.hl7.org/CodeSystem/v3-ActCode
    Logic Definitions:
    Group Scoring Population Criteria Expression
    6643b8e4f4fc785d87117128 Group scoring: proportion
    Type:

    Outcome

    Rate Aggregation: None
    Improvement Notation:

    Increased score indicates improvement

    Initial Population
    define "Initial Population":
      ( "Patient is Male" )
        and "Has Qualifying Encounter"
        and "Has Qualifying BPH Diagnosis"
        and "Urinary Symptom Score Within 1 Month after Initial BPH Diagnosis" is not null
        and "Urinary Symptom Score 6 to 12 Months After Initial BPH Diagnosis" is not null
    Denominator
    define "Denominator":
      "Initial Population"
    Denominator Exclusion
    define "Denominator Exclusions":
      exists ( "Urinary Retention Diagnosis Starts Within 1 Year After Initial BPH Diagnosis" )
        or ( "Has Initial BPH Diagnosis Starts During or Within 30 Days After End of Hospitalization" is not null )
        or ( "Morbid Obesity Diagnosis or BMI Exam Result Greater Than or Equal to 40 Starts On or Before Follow Up USS Assessment" )
    Numerator
    define "Numerator":
      "Urinary Symptom Score Improvement Greater Than or Equal To 3"
    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
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR SDE Sex
    define "SDE Sex":
      SDE."SDE Sex"
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Documented IPSS Assessment Result
    define "Documented IPSS Assessment Result":
      [Observation: "International Prostate Symptom Score [IPSS]"] IPSSAssessment
        where IPSSAssessment.status in { 'final', 'amended', 'corrected' }
          and IPSSAssessment.value is not null
        return {
          effectiveDatetime: IPSSAssessment.effective.earliest ( ),
          valueInteger: IPSSAssessment.value as Integer
        }
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR AUA Symptom Index and Quality of Life Assessment Result
    define "AUA Symptom Index and Quality of Life Assessment Result":
      [Observation: "American Urological Association Symptom Index [AUASI]"] AUASIAssessment
        let LastQOLOnDate: Last([Observation: "If you were to spend the rest of your life with your urinary condition just the way it is now, how would you feel about that [IPSS]"] QOLAssessment
            where QOLAssessment.effective.earliest() same day as AUASIAssessment.effective.earliest()
              and QOLAssessment.status in { 'final', 'amended', 'corrected' }
              and QOLAssessment.value is not null
            sort by effective.earliest()
        )
        where AUASIAssessment.status in { 'final', 'amended', 'corrected' }
          and AUASIAssessment.value is not null
        return {
          effectiveDatetime: AUASIAssessment.effective.earliest ( ),
          valueInteger: ( AUASIAssessment.value as Integer ) + ( LastQOLOnDate.value as Integer )
        }
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Urinary Symptom Score Assessment
    define "Urinary Symptom Score Assessment":
      "Documented IPSS Assessment Result"
        union "AUA Symptom Index and Quality of Life Assessment Result"
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Initial BPH Diagnosis Starts Within 6 Months Before the Measurement Period
    define "Initial BPH Diagnosis Starts Within 6 Months Before the Measurement Period":
      First([Condition: "Benign prostatic hyperplasia with lower urinary tract symptoms"] NewBPHDiagnosis
          where NewBPHDiagnosis.prevalenceInterval() starts during Interval[start of "Measurement Period" - 6 months, start of "Measurement Period"]
            and NewBPHDiagnosis.isConfirmedActiveDiagnosis()
          sort by start of onset.toInterval()
      )
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Urinary Symptom Score Within 1 Month after Initial BPH Diagnosis
    define "Urinary Symptom Score Within 1 Month after Initial BPH Diagnosis":
      First("Urinary Symptom Score Assessment" USSAssessment
          with "Initial BPH Diagnosis Starts Within 6 Months Before the Measurement Period" InitialBPHDiagnosis
            such that USSAssessment.effectiveDatetime 1 month or less on or after day of start of InitialBPHDiagnosis.prevalenceInterval()
          sort by effectiveDatetime
      )
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Urinary Symptom Score 6 to 12 Months After Initial BPH Diagnosis
    define "Urinary Symptom Score 6 to 12 Months After Initial BPH Diagnosis":
      Last("Urinary Symptom Score Assessment" USSAssessment
          with "Initial BPH Diagnosis Starts Within 6 Months Before the Measurement Period" InitialBPHDiagnosis
            such that months between start of InitialBPHDiagnosis.prevalenceInterval() and USSAssessment.effectiveDatetime in Interval[6, 12]
          sort by effectiveDatetime
      )
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Urinary Symptom Score Change
    define "Urinary Symptom Score Change":
      from
        "Urinary Symptom Score Within 1 Month after Initial BPH Diagnosis" FirstUSSAssessment,
        "Urinary Symptom Score 6 to 12 Months After Initial BPH Diagnosis" FollowUpUSSAssessment
        let USSChange: ( FirstUSSAssessment.valueInteger ) - ( FollowUpUSSAssessment.valueInteger )
        return USSChange
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Urinary Symptom Score Improvement Greater Than or Equal To 3
    define "Urinary Symptom Score Improvement Greater Than or Equal To 3":
      ( "Urinary Symptom Score Change" USSImprovement
          where USSImprovement >= 3
      ) is not null
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Numerator
    define "Numerator":
      "Urinary Symptom Score Improvement Greater Than or Equal To 3"
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Patient is Male
    define "Patient is Male":
      Patient.gender = 'male'
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Has Qualifying Encounter
    define "Has Qualifying Encounter":
      exists ( [Encounter: "Office Visit"] ValidEncounter
          where ValidEncounter.period during day of "Measurement Period"
            and ValidEncounter.class !~ "virtual"
            and ValidEncounter.status = 'finished'
      )
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Has Qualifying BPH Diagnosis
    define "Has Qualifying BPH Diagnosis":
      "Initial BPH Diagnosis Starts Within 6 Months Before the Measurement Period" is not null
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Initial Population
    define "Initial Population":
      ( "Patient is Male" )
        and "Has Qualifying Encounter"
        and "Has Qualifying BPH Diagnosis"
        and "Urinary Symptom Score Within 1 Month after Initial BPH Diagnosis" is not null
        and "Urinary Symptom Score 6 to 12 Months After Initial BPH Diagnosis" is not null
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR 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
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR 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
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR SDE Ethnicity
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Urinary Retention Diagnosis Starts Within 1 Year After Initial BPH Diagnosis
    define "Urinary Retention Diagnosis Starts Within 1 Year After Initial BPH Diagnosis":
      [Condition: "Urinary retention"] UrinaryRetention
        with "Initial BPH Diagnosis Starts Within 6 Months Before the Measurement Period" InitialBPHDiagnosis
          such that UrinaryRetention.prevalenceInterval ( ) starts 1 year or less on or after day of start of InitialBPHDiagnosis.prevalenceInterval ( )
        where UrinaryRetention.isConfirmedActiveDiagnosis ( )
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Has Initial BPH Diagnosis Starts During or Within 30 Days After End of Hospitalization
    define "Has Initial BPH Diagnosis Starts During or Within 30 Days After End of Hospitalization":
      "Initial BPH Diagnosis Starts Within 6 Months Before the Measurement Period" InitialBPHDiagnosis
        with [Encounter: "Hospital Services for Urology"] InHospitalServices
          such that InitialBPHDiagnosis.prevalenceInterval ( ) starts during Interval[start of InHospitalServices.period, end of InHospitalServices.period + 31 days]
            and InHospitalServices.status = 'finished'
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Morbid Obesity Diagnosis On or Before Follow Up USS Assessment
    define "Morbid Obesity Diagnosis On or Before Follow Up USS Assessment":
      [Condition: "Morbid Obesity"] MorbidObesity
        with "Urinary Symptom Score 6 to 12 Months After Initial BPH Diagnosis" FollowUpUSSAssessment
          such that MorbidObesity.prevalenceInterval ( ) overlaps "Measurement Period"
            and MorbidObesity.prevalenceInterval ( ) starts on or before FollowUpUSSAssessment.effectiveDatetime
        where MorbidObesity.isConfirmedActiveDiagnosis ( )
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR BMI Exam Result Greater Than or Equal To 40 During Measurement Period and On or Before Follow Up USS Assessment
    /*
    * @code: Body mass index (BMI) [Ratio] - 39156-5
    * @profile: http://hl7.org/fhir/StructureDefinition/bmi
    */
    
    
    define "BMI Exam Result Greater Than or Equal To 40 During Measurement Period and On or Before Follow Up USS Assessment":
      exists ( ["observation-bmi"] BMIExam
          with "Urinary Symptom Score 6 to 12 Months After Initial BPH Diagnosis" FollowUpUSSAssessment
            such that BMIExam.value >= 40 'kg/m2'
              and BMIExam.status in { 'final', 'amended', 'corrected' }
              and BMIExam.effective.earliest ( ) during day of "Measurement Period"
              and BMIExam.effective.earliest ( ) on or before FollowUpUSSAssessment.effectiveDatetime
          return BMIExam.effective.earliest ( )
      )
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Morbid Obesity Diagnosis or BMI Exam Result Greater Than or Equal to 40 Starts On or Before Follow Up USS Assessment
    define "Morbid Obesity Diagnosis or BMI Exam Result Greater Than or Equal to 40 Starts On or Before Follow Up USS Assessment":
      exists "Morbid Obesity Diagnosis On or Before Follow Up USS Assessment"
        or "BMI Exam Result Greater Than or Equal To 40 During Measurement Period and On or Before Follow Up USS Assessment"
    Library Name Name
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR Denominator Exclusions
    define "Denominator Exclusions":
      exists ( "Urinary Retention Diagnosis Starts Within 1 Year After Initial BPH Diagnosis" )
        or ( "Has Initial BPH Diagnosis Starts During or Within 30 Days After End of Hospitalization" is not null )
        or ( "Morbid Obesity Diagnosis or BMI Exam Result Greater Than or Equal to 40 Starts On or Before Follow Up USS Assessment" )
    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
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR SDE Race
    define "SDE Race":
      SDE."SDE Race"
    Library Name Name
    QICoreCommon earliest
    /*
    @description: Given an interval, return the starting point if the interval has a starting boundary specified,
    otherwise, return the ending point
    */
    define fluent function earliest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):
      (choice.toInterval()) period
        return
          if (period."hasStart"()) then start of period
          else end of period
    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
    UrinarySymptomScoreChangeAfterBenignProstaticHyperplasiaFHIR 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
    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
            }