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: Child and Adolescent Major Depressive Disorder (MDD): Suicide Risk AssessmentFHIR

Official URL: https://madie.cms.gov/Measure/CMS177FHIRChildMDDSuicideAssmt Version: 1.0.000
Active as of 2026-01-16 Responsible: Mathematica Computable Name: CMS177FHIRChildMDDSuicideAssmt
Other Identifiers: Short Name: CMS177FHIR (use: usual, ), UUID:50d1dfcf-e2bf-41e8-bc1c-c607e5a09e79 (use: official, ), UUID:2df449e3-aa29-4cbb-b042-9c6e583f200a (use: official, ), Endorser: 1365e (use: official, ), Publisher: 177FHIR (use: official, )

Copyright/Legal: Copyright 2025 Mathematica Inc. All Rights Reserved.

The PCPI and American Medical Association’s (AMA) significant past efforts and contributions to the development and updating of the Measure is acknowledged.

Percentage of patient visits for those patients aged 6 through 16 at the start of the measurement period with a diagnosis of major depressive disorder (MDD) with an assessment for suicide risk

Metadata
Title Child and Adolescent Major Depressive Disorder (MDD): Suicide Risk AssessmentFHIR
Version 1.0.000
Short Name CMS177FHIR
GUID (Version Independent) urn:uuid:50d1dfcf-e2bf-41e8-bc1c-c607e5a09e79
GUID (Version Specific) urn:uuid:2df449e3-aa29-4cbb-b042-9c6e583f200a
CMS Identifier 177FHIR
CMS Consensus Based Entity Identifier 1365e
Effective Period 2026-01-01 through 2026-12-31
Steward (Publisher) Mathematica
Developer Mathematica
Description

Percentage of patient visits for those patients aged 6 through 16 at the start of the measurement period with a diagnosis of major depressive disorder (MDD) with an assessment for suicide risk

Copyright

Copyright 2025 Mathematica Inc. All Rights Reserved.

The PCPI and American Medical Association's (AMA) significant past efforts and contributions to the development and updating of the Measure is acknowledged.

Disclaimer

The Measure is not a clinical guideline, does not establish a standard of medical care, and has not been tested for all potential applications. The Measure, while copyrighted, can be reproduced and distributed, without modification, for noncommercial purposes, e.g., use by health care providers in connection with their practices. Commercial use is defined as the sale, license, or distribution of the Measure for commercial gain, or incorporation of the Measure into a product or service that is sold, licensed or distributed for commercial gain.

Commercial uses of the Measure require a license agreement between the user and Mathematica. Neither Mathematica, the PCPI, nor the American Medical Association (AMA), nor the former AMA-convened Physician Consortium for Performance Improvement(R) (AMA-PCPI), nor their members shall be responsible for any use of the Measure. Mathematica encourages use of the Measure by other health care professionals, where appropriate.

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

Limited proprietary coding may be contained in the Measure specifications for convenience. A license agreement must be entered prior to a third party's use of Current Procedural Terminology (CPT[R]) or other proprietary code set contained in the Measure. Any other use of CPT or other coding by a third party is strictly prohibited. Mathematica, the AMA, and former members of the PCPI disclaim all liability for use or accuracy of any CPT(R) or other coding contained in the specifications.

CPT(R) contained in the Measure specifications is copyright 2004-2024 American Medical Association. LOINC(R) is 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 is copyright 2024 World Health Organization. All Rights Reserved. Due to technical limitations, registered trademarks are indicated by (R) or [R].

Rationale

Research has shown that youth with major depressive disorder (MDD) are at a high risk for suicide attempts and completion - among the most significant and devastating sequelae of the disease (Fontanella et al., 2020). Suicide risk is a critical consideration in children and adolescents with MDD, and an important aspect of care that should be assessed at each visit and subsequently managed to minimize that risk. Additionally, the importance of the assessments is underscored by research (Fontanella et al., 2020; Luoma, Martin, & Pearson, 2002) that indicates that many individuals who die by suicide do make contact with primary care providers and mental health services beforehand. More specifically, approximately 15% of suicide victims aged 35 years or younger had seen a mental health professional within 1 month of suicide while approximately 23% had seen a primary care provider within 1 month of suicide (Luoma, Martin, & Pearson, 2002). A recent analysis of depression severity and suicidal ideation symptom trajectories (Witt et al., 2021) found that suicidal ideation among children and young adults (15-25 years) might not improve with depression symptom severity. This evidence suggests the potential utility of continued suicide risk screening even after improvements in depression symptoms. Better assessment and identification of suicide risk in the health care setting should lead to improved connection to treatment and reduction in suicide attempts and deaths by suicide.

Clinical Recommendation Statement

The evaluation must include assessment for the presence of harm to self or others (Birmaher et al., 2007).

Suicidal behavior exists along a continuum from passive thoughts of death to a clearly developed plan and intent to carry out that plan. Because depression is closely associated with suicidal thoughts and behavior, it is imperative to evaluate these symptoms at the initial and subsequent assessments. For this purpose, low burden tools to track suicidal ideation and behavior such as the Columbia-Suicidal Severity Rating Scale can be used. Also, it is crucial to evaluate the risk (e.g., age, sex, stressors, comorbid conditions, hopelessness, impulsivity) and protective factors (e.g., religious belief, concern not to hurt family) that might influence the desire to attempt suicide. The risk for suicidal behavior increases if there is a history of suicide attempts, comorbid psychiatric disorders (e.g., disruptive disorders, substance abuse), impulsivity and aggression, availability of lethal agents (e.g., firearms), exposure to negative events (e.g., physical or sexual abuse, violence), and a family history of suicidal behavior (Birmaher et al., 2007).

A careful and ongoing evaluation of suicide risk is necessary for all patients with major depressive disorder (Category I). Such an assessment includes specific inquiry about suicidal thoughts, intent, plans, means, and behaviors; identification of specific psychiatric symptoms (e.g., psychosis, severe anxiety, substance use) or general medical conditions that may increase the likelihood of acting on suicidal ideas; assessment of past and, particularly, recent suicidal behavior; delineation of current stressors and potential protective factors (e.g., positive reasons for living, strong social support); and identification of any family history of suicide or mental illness (Category I) (Gelenberg et al., 2010).

Citation

American Academy of Child and Adolescent Psychiatry. (2007). Practice parameter for the assessment and treatment of children and adolescents with depressive disorders. Journal of the American Academy of Child and Adolescent Psychiatry, 46(11), 1503-1526. doi:10.1097/chi.0b013e318145ae1c

Citation

American Psychiatric Association. (2010). Practice guideline for the treatment of patients with major depressive disorder. 3rd edition. Retrieved from http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf (This guideline was reaffirmed in 2015.)

Citation

Fontanella, C. A., Warner, L. A., Steelesmith, D., Bridge, J. A., Sweeney, H. A., Campo, J. V. (2020). Clinical profiles and health services patterns of Medicaid-enrolled youths who died by suicide. Journal of the American Medical Association Pediatrics, 174(5), 470-477. doi:10.1001/jamapediatrics.2020.0002

Citation

Luoma, J. B., Martin, C. E., & Pearson, J. L. (2002). Contact with mental health and primary care providers before suicide: A review of the evidence. American Journal of Psychiatry, 159(6), 909-916. doi:10.1176/appi.ajp.159.6.909

Citation

Witt, K., Madsen, T., Berk, M., Dean, O., Chanen, A., McGorry, P.D., Cotton, S., Davey, C.G., Hetrick, S. (2021). Trajectories of change in depression symptoms and suicidal ideation over the course of evidence-based treatment for depression: Secondary analysis of a randomized controlled trial of cognitive behavioral therapy plus fluoxetine in young people. Australian and New Zealand Journal of Psychiatry, 55(5), 506-516. doi:10.1177/0004867421998763

Definition Numerator Definition: The specific type and magnitude of the suicide risk assessment is intended to be at the discretion of the individual clinician and should be specific to the needs of the patient. At a minimum, suicide risk assessment should evaluate: 1. Risk (e.g., age, sex, stressors, comorbid conditions, hopelessness, impulsivity) and protective factors (e.g., religious belief, concern not to hurt family) that may influence the desire to attempt suicide. 2. Current severity of suicidality. 3. Most severe point of suicidality in episode and lifetime.
Definition Numerator Definition: Low burden tools to track suicidal ideation and behavior such as the Columbia-Suicidal Severity Rating Scale can also be used. Because no validated assessment tool or instrument fully meets the aforementioned requirements for the suicide risk assessment, individual tools or instruments have not been explicitly included in coding.
Guidance (Usage) This dQM is an episode-based measure. An episode is defined as each eligible encounter for major depressive disorder (MDD) during the measurement period. A suicide risk assessment should be performed at every visit for MDD during the measurement period. In recognition of the growing use of integrated and team-based care, the diagnosis of depression and the assessment for suicide risk need not be performed by the same provider or clinician. Suicide risk assessments completed via telehealth services can also meet numerator performance. Use of a standardized tool(s) or instrument(s) to assess suicide risk will meet numerator performance, so long as the minimum criteria noted is evaluated. Standardized tools can be mapped to the code "Suicide risk assessment (procedure)" included in the numerator logic, as no individual suicide risk assessment tool or instrument would satisfy the requirements alone. This FHIR-based measure has been derived from the QDM-based measure: CMS177v14. 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 Encounter
Scoring Proportion
Improvement Notation Increased score indicates improvement
Type Process
Rate Aggregation None
Initial Population ID: InitialPopulation_1
Description:

All patient visits for those patients aged 6 through 16 at the start of the measurement period with a diagnosis of major depressive disorder

Criteria: Initial Population
Denominator ID: Denominator_1
Description:

Equals Initial Population

Criteria: Denominator
Numerator ID: Numerator_1
Description:

Patient visits with an assessment for suicide risk

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-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
Supplemental Data Element ID: sde-payer
Usage Code: Supplemental Data
Description: SDE Payer
Logic Definition: SDE Payer
Measure Logic
Primary Library https://madie.cms.gov/Library/CMS177FHIRChildMDDSuicideAssmt
Contents Population Criteria
Logic Definitions
Terminology
Dependencies
Data Requirements
Parameters
Population Criteria
Measure Group (Rate) (ID: Group_1)
Initial Population
define "Initial Population":
  "Major Depressive Disorder Encounter" MDDEncounter
    where ( "AgeInYearsAt"(date from start of "Measurement Period") >= 6
        and "AgeInYearsAt"(date from start of "Measurement Period") <= 16
    )
Definition
Denominator
define "Denominator":
  "Initial Population"
Definition
Numerator
define "Numerator":
  "Encounter With Procedure For Suicide Risk Assessment"
    union "Encounter With Observation For Suicide Risk Assessment"
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: CMS177FHIRChildMDDSuicideAssmt
define "SDE Sex":
  SDE."SDE Sex"
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "Encounter With Condition Major Depressive Disorder":
  ( ["Encounter": "Office Visit"]
    union ["Encounter": "Outpatient Consultation"]
    union ["Encounter": "Psych Visit Diagnostic Evaluation"]
    union ["Encounter": "Psych Visit for Family Psychotherapy"]
    union ["Encounter": "Psych Visit Psychotherapy"]
    union ["Encounter": "Psychoanalysis"]
    union ["Encounter": "Group Psychotherapy"]
    union ["Encounter": "Telephone Visits"] ) ValidEncounter
    where ValidEncounter.status = 'finished'
      and ValidEncounter.period during day of "Measurement Period"
      and exists ( ( ["ConditionProblemsHealthConcerns": "Major Depressive Disorder Active"] MDDConditionProb
            where ValidEncounter.reasonReference.references ( MDDConditionProb )
        )
          union ( ["ConditionEncounterDiagnosis": "Major Depressive Disorder Active"] MDDEncDx
              where ValidEncounter.reasonReference.references ( MDDEncDx )
          )
      )
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "Encounter With Reason Major Depressive Disorder":
  ( ["Encounter": "Office Visit"]
    union ["Encounter": "Outpatient Consultation"]
    union ["Encounter": "Psych Visit Diagnostic Evaluation"]
    union ["Encounter": "Psych Visit for Family Psychotherapy"]
    union ["Encounter": "Psych Visit Psychotherapy"]
    union ["Encounter": "Psychoanalysis"]
    union ["Encounter": "Group Psychotherapy"]
    union ["Encounter": "Telephone Visits"] ) ValidEncounter
    where ValidEncounter.status = 'finished'
      and ValidEncounter.period during day of "Measurement Period"
      and ( ValidEncounter.reasonCode in "Major Depressive Disorder Active" )
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "Major Depressive Disorder Encounter":
  "Encounter With Condition Major Depressive Disorder"
    union "Encounter With Reason Major Depressive Disorder"
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "Encounter With Procedure For Suicide Risk Assessment":
  "Major Depressive Disorder Encounter" MDDEncounter
    with ["Procedure": "Suicide risk assessment (procedure)"] SuicideRiskAssessmentProcedure
      such that SuicideRiskAssessmentProcedure.status = 'completed'
        and SuicideRiskAssessmentProcedure.performed.toInterval ( ) during MDDEncounter.period
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "Encounter With Observation For Suicide Risk Assessment":
  "Major Depressive Disorder Encounter" MDDEncounter
    with ( ["ObservationScreeningAssessment": "Suicide risk assessment (procedure)"]
      union ["ObservationClinicalResult": "Suicide risk assessment (procedure)"] ) ObservationSuicideRiskAssmt
      such that ObservationSuicideRiskAssmt.effective.toInterval ( ) during MDDEncounter.period
        and ObservationSuicideRiskAssmt.status in { 'final', 'corrected', 'amended' }
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "Numerator":
  "Encounter With Procedure For Suicide Risk Assessment"
    union "Encounter With Observation For Suicide Risk Assessment"
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "Initial Population":
  "Major Depressive Disorder Encounter" MDDEncounter
    where ( "AgeInYearsAt"(date from start of "Measurement Period") >= 6
        and "AgeInYearsAt"(date from start of "Measurement Period") <= 16
    )
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "Denominator":
  "Initial Population"
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "SDE Payer":
  SDE."SDE Payer"
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "SDE Ethnicity":
  SDE."SDE Ethnicity"
Logic Definition Library Name: CMS177FHIRChildMDDSuicideAssmt
define "SDE Race":
  SDE."SDE Race"
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
define function ToString(value EncounterStatus): 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
/*
@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 ToString(value ProcedureStatus): value.value
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value dateTime): value.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 ObservationStatus): 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: Returns true if any of the given references are to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(references List<FHIR.Reference>, resource FHIR.Resource):
  exists (references R where R.references(resource))
Logic Definition Library Name: FHIRCommon
/*
@description: Returns true if the given reference is to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference FHIR.Reference, resource FHIR.Resource):
  resource.id = Last(Split(reference.reference, '/'))
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
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 Outpatient Consultation
Resource: Outpatient Consultation
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1008
Value Set Description: Value set Psych Visit Diagnostic Evaluation
Resource: Psych Visit Diagnostic Evaluation
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1492
Value Set Description: Value set Psych Visit for Family Psychotherapy
Resource: Psych Visit for Family Psychotherapy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1018
Value Set Description: Value set Psych Visit Psychotherapy
Resource: Psych Visit Psychotherapy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1496
Value Set Description: Value set Psychoanalysis
Resource: Psychoanalysis
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1141
Value Set Description: Value set Group Psychotherapy
Resource: Group Psychotherapy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1187
Value Set Description: Value set Telephone Visits
Resource: Telephone Visits
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080
Value Set Description: Value set Major Depressive Disorder Active
Resource: Major Depressive Disorder Active
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1491
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: Suicide risk assessment (procedure)
Code: 225337009
System: http://snomed.info/sct
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
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: Resource
Profile(s): Resource
Must Support Elements: id
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, status, period, reasonReference, reasonCode
Code Filter(s):
Path: type
ValueSet: Office Visit
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, status, period, reasonReference, reasonCode
Code Filter(s):
Path: type
ValueSet: Outpatient Consultation
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, status, period, reasonReference, reasonCode
Code Filter(s):
Path: type
ValueSet: Psych Visit Diagnostic Evaluation
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, status, period, reasonReference, reasonCode
Code Filter(s):
Path: type
ValueSet: Psych Visit for Family Psychotherapy
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, status, period, reasonReference, reasonCode
Code Filter(s):
Path: type
ValueSet: Psych Visit Psychotherapy
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, status, period, reasonReference, reasonCode
Code Filter(s):
Path: type
ValueSet: Psychoanalysis
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, status, period, reasonReference, reasonCode
Code Filter(s):
Path: type
ValueSet: Group Psychotherapy
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, status, period, reasonReference, reasonCode
Code Filter(s):
Path: type
ValueSet: Telephone Visits
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: Major Depressive Disorder Active
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: Major Depressive Disorder Active
Data Requirement Type: Patient
Profile(s): Patient
Must Support Elements: birthDate
Data Requirement Type: Procedure
Profile(s): Procedure
Must Support Elements: code, status, performed
Code Filter(s):
Path: code
Code(s): SNOMED CT: 225337009 (Suicide risk assessment (procedure))
Path: status
Code(s): [not stated]: completed (completed)
Data Requirement Type: Observation
Profile(s): http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-observation-screening-assessment
Must Support Elements: code
Code Filter(s):
Path: code
Code(s): SNOMED CT: 225337009 (Suicide risk assessment (procedure))
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
Code Filter(s):
Path: code
Code(s): SNOMED CT: 225337009 (Suicide risk assessment (procedure))
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..* Encounter
Denominator Out 0..* Encounter
SDE Payer Out 0..* Resource
Initial Population Out 0..* Encounter
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