Measure title | Breast Cancer Screening | Measure ID | BCS-E |
---|---|---|---|
Description | The percentage of women 50–74 years of age who had a mammogram to screen for breast cancer. | ||
Measurement period | - . | ||
Copyright and disclaimer notice | HEDIS® is a registered trademark of the National Committee for Quality Assurance (“NCQA”). The HEDIS measures and specifications were developed by and are owned by NCQA. NCQA holds a copyright in these materials and may rescind or alter these materials at any time. Users of the HEDIS measures and specifications shall not have the right to alter, enhance or otherwise modify the HEDIS measures and specifications, and shall not disassemble, recompile or reverse engineer the HEDIS measures and specifications. Anyone desiring to use or reproduce the materials, subject to licensed user restrictions, without modification for an internal non-commercial purpose may do so without obtaining any approval from NCQA. Use of the Rules for Allowable Adjustments of HEDIS to make permitted adjustments of the materials does not constitute a modification. All other uses, including a commercial use (including but not limited to vendors using the measures and specifications with a product or service to calculate measure results), or any external reproduction, distribution and publication of the HEDIS measures or results (“rates”) therefrom must be approved by NCQA and are subject to a license at the discretion of NCQA. Any use of the materials to identify records or calculate measure results, for example, requires a custom license and may necessitate certification pursuant to NCQA’s Measure Certification Program. HEDIS measures and specifications are not clinical guidelines, do not establish a standard of medical care and have not been tested for all potential applications. The measures and specifications are provided “as is” without warranty of any kind. NCQA makes no representations, warranties or endorsements about the quality of any product, test or protocol identified as numerator compliant or otherwise identified as meeting the requirements of a HEDIS measure or specification. NCQA also makes no representations, warranties or endorsements about the quality of any organization or clinician who uses or reports performance measures. NCQA has no liability to anyone who relies on HEDIS measures and specifications or data reflective of performance under such measures and specifications. Unadjusted Uncertified Measures: A calculated measure result (a “rate”) from a HEDIS measure that has not been certified via NCQA’s Measure Certification Program, and is based on unadjusted HEDIS specifications, may not be called a “Health Plan HEDIS rate” until it is audited and designated reportable by an NCQA-Certified HEDIS Compliance Auditor. Until such time, such measure rates shall be designated or referred to as “Uncertified, Unaudited Health Plan HEDIS Rates.” Adjusted Uncertified Measures: A calculated measure result (a “rate”) from a HEDIS measure that has not been certified via NCQA’s Measure Certification Program, and is based on adjusted HEDIS specifications, may not be called an “Adjusted HEDIS rate” until it is audited and designated reportable by an NCQA-Certified HEDIS Compliance Auditor. Until such time, such measure rates shall be designated or referred to as “Adjusted, Uncertified, Unaudited HEDIS Rates.” 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. NCQA disclaims all liability for use or accuracy of any coding contained in the specifications. The American Medical Association holds a copyright to the CPT® codes contained in the measure specifications. The American Hospital Association holds a copyright to the Uniform Billing Codes (“UB”) contained in the measure specifications. The UB Codes in the HEDIS specifications are included with the permission of the AHA. All uses of the UB Codes may require a license from the AHA. Anyone desiring to use the UB Codes in a commercial product to generate HEDIS results, or for any other commercial use, must obtain a commercial use license directly from the AHA. To inquire about licensing, contact ub04@aha.org. Some measure specifications contain coding from LOINC® (http://loinc.org). The LOINC table, LOINC codes, LOINC panels and form file, LOINC linguistic variants file, LOINC/RSNA Radiology Playbook, and LOINC/IEEE Medical Device Code Mapping Table are copyright © 1995–2021 Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and are available at no cost under the license at http://loinc.org/terms-of-use. “SNOMED” and “SNOMED CT” are registered trademarks of the International Health Terminology Standards Development Organisation (IHTSDO). “HL7” is the registered trademark of Health Level Seven International. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopy, recording or any information storage and retrieval system, without the written permission of NCQA. © 2021 by the National Committee for Quality Assurance All rights reserved. NCQA Customer Support: 888-275-7585 Submit policy clarification support questions via My NCQA (http://my.ncqa.org) | ||
Clinical recommendation statement | The U.S. Preventive Services Task Force recommends screening women 50–74 years of age for breast cancer every 2 years. (B recommendation) | ||
Citations | U.S. Preventive Services Task Force. 2016. “Screening for Breast Cancer: U.S. Preventive Services Task Force Recommendation Statement. Ann Intern Med 164(4):279–96. | ||
Characteristics | |||
Scoring | Proportion. | ||
Type | Process. | ||
Stratification |
| ||
Risk adjustment | None. | ||
Improvement notation | A higher rate indicates better performance. | ||
Guidance | For Medicare plans, I-SNP and LTI exclusions are not included in the measure calculation logic and need to be programmed manually. Allocation: No more than one gap in enrollment of up to 45 days for each full calendar year of the Participation Period (i.e., the Measurement Period and the year prior to the Measurement Period). No gaps in enrollment are allowed from October 1 two years prior to the Measurement Period through December 31 two years prior to the Measurement Period. Reporting: SES and product line stratifications are not included in the measure calculation logic and need to be programmed manually. | ||
Definitions | |||
Participation | The identifiers and descriptors for each organization’s coverage used to define members’ eligibility for measure reporting. Allocation for reporting is based on eligibility during the Participation Period. | ||
Participation Period | October 1 two years prior to the Measurement Period through the end of the Measurement Period. | ||
Initial Population | Women 52–74 years of age by the end of the Measurement Period who also meet the criteria for Participation. | ||
Exclusions |
| ||
Denominator | The Initial Population, minus Exclusions. | ||
Numerator | One or more mammograms any time on or between October 1 two years prior to the Measurement Period and the end of the Measurement Period. | ||
Data criteria (element level) | |||
Value Sets:
Direct Reference Codes and Codesystems:
|
define "Initial Population": AgeInYearsAt(date from end of "Measurement Period" )in Interval[52, 74] and Patient.gender.value = 'female' and "Enrolled During Participation Period"
define "Denominator": "Initial Population"
define "Exclusions": Hospice."Hospice Intervention or Encounter" or "Mastectomy Exclusion" or AdvancedIllnessFrailty."Advanced Illness and Frailty Exclusion Not Including Over Age 80" or PalliativeCare."Palliative Care Overlapping Period" ( "Measurement Period" )
define "Numerator": exists ( [Observation: "Mammography"] Mammogram where FHIRBase."Normalize Interval" ( Mammogram.effective ) ends during "Participation Period" )
define "Bilateral Mastectomy Diagnosis": ( Status."Active Condition" ( [Condition: "History of Bilateral Mastectomy"] ) ) BilateralMastectomyHistory where FHIRBase."Prevalence Period" ( BilateralMastectomyHistory ) starts on or before end of "Measurement Period"
define "Bilateral Mastectomy Procedure": ( ( Status."Completed Procedure" ( [Procedure: "Bilateral Mastectomy"] ) ) union ( ( Status."Completed Procedure" ( [Procedure: "Unilateral Mastectomy"] ) ) UnilateralMastectomyProcedure where UnilateralMastectomyProcedure.bodySite in "Bilateral Modifier" ) union ( ( Status."Completed Procedure" ( [Procedure: "Clinical Unilateral Mastectomy"] ) ) ClinicalUnilateralMastectomyProcedure where ClinicalUnilateralMastectomyProcedure.bodySite in "Clinical Bilateral Modifier" ) ) BilateralMastectomyPerformed where FHIRBase."Normalize Interval" ( BilateralMastectomyPerformed.performed ) ends on or before end of "Measurement Period"
define "Denominator": "Initial Population"
define "Enrolled During Participation Period": Enrollment."Health Plan Enrollment Criteria" ( "Member Coverage", date from end of "Measurement Period", Interval[date from "October 1 Two Years Prior to the Measurement Period", date from end of "Measurement Period" - 2 years], 0 ) and Enrollment."Health Plan Enrollment Criteria" ( "Member Coverage", date from end of "Measurement Period", Interval[date from start of "Measurement Period" - 1 year, date from end of "Measurement Period" - 1 year], 45 ) and Enrollment."Health Plan Enrollment Criteria" ( "Member Coverage", date from end of "Measurement Period", Interval[date from start of "Measurement Period", date from end of "Measurement Period"], 45 )
define "Exclusions": Hospice."Hospice Intervention or Encounter" or "Mastectomy Exclusion" or AdvancedIllnessFrailty."Advanced Illness and Frailty Exclusion Not Including Over Age 80" or PalliativeCare."Palliative Care Overlapping Period" ( "Measurement Period" )
define "Initial Population": AgeInYearsAt(date from end of "Measurement Period" )in Interval[52, 74] and Patient.gender.value = 'female' and "Enrolled During Participation Period"
define "Left Mastectomy Diagnosis": ( Status."Active Condition" ( [Condition: "Absence of Left Breast"] ) ) LeftMastectomyDiagnosis where FHIRBase."Prevalence Period" ( LeftMastectomyDiagnosis ) starts on or before end of "Measurement Period"
define "Left Mastectomy Procedure": ( ( Status."Completed Procedure" ( [Procedure: "Unilateral Mastectomy Left"] ) ) union ( ( Status."Completed Procedure" ( [Procedure: "Unilateral Mastectomy"] ) ) UnilateralMastectomyProcedure where UnilateralMastectomyProcedure.bodySite in "Left Modifier" ) union ( ( Status."Completed Procedure" ( [Procedure: "Clinical Unilateral Mastectomy"] ) ) ClinicalUnilateralMastectomyProcedure where ClinicalUnilateralMastectomyProcedure.bodySite in "Clinical Left Modifier" ) ) LeftMastectomyProcedure where FHIRBase."Normalize Interval" ( LeftMastectomyProcedure.performed ) ends on or before end of "Measurement Period"
define "Mastectomy Exclusion": ( ( exists "Right Mastectomy Diagnosis" or exists "Right Mastectomy Procedure" ) and ( exists "Left Mastectomy Diagnosis" or exists "Left Mastectomy Procedure" ) ) or exists "Bilateral Mastectomy Diagnosis" or exists "Bilateral Mastectomy Procedure"
define "Member Coverage": [Coverage] C where FHIRBase."Normalize Interval" ( C.period ) overlaps "Participation Period"
define "Numerator": exists ( [Observation: "Mammography"] Mammogram where FHIRBase."Normalize Interval" ( Mammogram.effective ) ends during "Participation Period" )
define "October 1 Two Years Prior to the Measurement Period": DateTime((year from start of "Measurement Period" - 2), 10, 1, 0, 0, 0, 0, 0)
define "Participation Period": Interval["October 1 Two Years Prior to the Measurement Period", end of "Measurement Period"]
define "Right Mastectomy Diagnosis": ( Status."Active Condition" ( [Condition: "Absence of Right Breast"] ) ) RightMastectomyDiagnosis where FHIRBase."Prevalence Period" ( RightMastectomyDiagnosis ) starts on or before end of "Measurement Period"
define "Right Mastectomy Procedure": ( ( Status."Completed Procedure" ( [Procedure: "Unilateral Mastectomy Right"] ) ) union ( ( Status."Completed Procedure" ( [Procedure: "Unilateral Mastectomy"] ) ) UnilateralMastectomyProcedure where UnilateralMastectomyProcedure.bodySite in "Right Modifier" ) union ( ( Status."Completed Procedure" ( [Procedure: "Clinical Unilateral Mastectomy"] ) ) ClinicalUnilateralMastectomyProcedure where ClinicalUnilateralMastectomyProcedure.bodySite in "Clinical Right Modifier" ) ) RightMastectomyProcedure where FHIRBase."Normalize Interval" ( RightMastectomyProcedure.performed ) ends on or before end of "Measurement Period"
define "Acute Inpatient Discharge with Advanced Illness": exists ( ( Claims."Medical Claims With Diagnosis" ( Claims."Medical Claims With Nonacute or Acute Inpatient Discharge" ( [Claim] ).AcuteInpatientDischarge, "Advanced Illness ValueSet" ).ServicePeriod ) InpatientDischarge where date from end of InpatientDischarge during Interval[date from start of "Measurement Period" - 1 year, date from end of "Measurement Period"] )
define "Acute Inpatient Encounter with Advanced Illness": exists ( ( Status."Finished Encounter" ( [Encounter: "Acute Inpatient"] ) ) InpatientEncounter where Encounters."Encounter Has Diagnosis" ( InpatientEncounter, [Condition: "Advanced Illness"] ) and date from start of FHIRBase."Normalize Interval" ( InpatientEncounter.period ) during Interval[date from start of "Measurement Period" - 1 year, date from end of "Measurement Period"] )
define "Advanced Illness and Frailty Exclusion Not Including Over Age 80": AgeInYearsAt(date from end of "Measurement Period" )>= 66 and "Has Criteria Indicating Frailty" and ( "Two Outpatient Visits with Advanced Illness on Different Dates of Service" or "Acute Inpatient Encounter with Advanced Illness" or "Acute Inpatient Discharge with Advanced Illness" or "Dementia Medications In Year Before or During Measurement Period" )
define "Advanced Illness ValueSet": FHIRBase."VS Cast Function" ( "Advanced Illness" )
define "Dementia Medications In Year Before or During Measurement Period": exists ( ( Status."Dispensed Medication" ( [MedicationDispense: "Dementia Medications"] ) ) DementiaMedDispensed where date from start of FHIRBase."Normalize Interval" ( DementiaMedDispensed.whenHandedOver ) during Interval[date from start of "Measurement Period" - 1 year, date from end of "Measurement Period"] )
define "Has Criteria Indicating Frailty": exists ( [Observation: "Frailty Device"] FrailtyDeviceApplied where FHIRBase."Normalize Interval" ( FrailtyDeviceApplied.effective ) overlaps "Measurement Period" ) or exists ( ( Status."Active Condition" ( [Condition: "Frailty Diagnosis"] ) ) FrailtyDiagnosis where FHIRBase."Prevalence Period" ( FrailtyDiagnosis ) overlaps "Measurement Period" ) or exists ( ( Status."Finished Encounter" ( [Encounter: "Frailty Encounter"] ) ) FrailtyEncounter where FHIRBase."Normalize Interval" ( FrailtyEncounter.period ) overlaps "Measurement Period" ) or exists ( [Observation: "Frailty Symptom"] FrailtySymptom where FHIRBase."Normalize Interval" ( FrailtySymptom.effective ) overlaps "Measurement Period" )
define "Nonacute Inpatient Discharge with Advanced Illness": ( ( Claims."Medical Claims With Diagnosis" ( Claims."Medical Claims With Nonacute or Acute Inpatient Discharge" ( [Claim] ).NonacuteInpatientDischarge, "Advanced Illness ValueSet" ).ServicePeriod ) DischargeWithDiagnosis where date from end of DischargeWithDiagnosis during Interval[date from start of "Measurement Period" - 1 year, date from end of "Measurement Period"]) InpatientDischarge return date from end of InpatientDischarge
define "Outpatient Encounters or Discharges with Advanced Illness": if ( "Outpatient Encounters with Advanced Illness" union "Nonacute Inpatient Discharge with Advanced Illness" ) is not null then ( "Outpatient Encounters with Advanced Illness" union "Nonacute Inpatient Discharge with Advanced Illness" ) else if "Outpatient Encounters with Advanced Illness" is null then "Nonacute Inpatient Discharge with Advanced Illness" else if "Nonacute Inpatient Discharge with Advanced Illness" is null then "Outpatient Encounters with Advanced Illness" else null
define "Outpatient Encounters with Advanced Illness": ( ( Status."Finished Encounter" ( [Encounter: "Outpatient"] union [Encounter: "Observation"] union [Encounter: "ED"] union [Encounter: "Telephone Visits"] union [Encounter: "Online Assessments"] union [Encounter: "Nonacute Inpatient"] ) ) OutpatientEncounter where Encounters."Encounter Has Diagnosis" ( OutpatientEncounter, [Condition: "Advanced Illness"] ) and date from start of FHIRBase."Normalize Interval" ( OutpatientEncounter.period ) during Interval[date from start of "Measurement Period" - 1 year, date from end of "Measurement Period"]) EncounterWithDiagnosis return date from end of FHIRBase."Normalize Interval" ( EncounterWithDiagnosis.period )
define "Two Outpatient Visits with Advanced Illness on Different Dates of Service": exists ( from "Outpatient Encounters or Discharges with Advanced Illness" OutpatientVisit1, "Outpatient Encounters or Discharges with Advanced Illness" OutpatientVisit2 where OutpatientVisit2 1 day or more after OutpatientVisit1 return OutpatientVisit1 )
define "Hospice Intervention or Encounter": exists ((Status."Completed or Ongoing Procedure"([Procedure:"Hospice Intervention"])) HospiceInt where NCQAFHIRBase."Normalize Interval"(HospiceInt.performed) overlaps "Measurement Period" ) or exists ((Status."Finished Encounter"(["Encounter": "Hospice Encounter"])) HospiceEnc where NCQAFHIRBase."Normalize Interval" (HospiceEnc.period) overlaps "Measurement Period" )
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
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 }
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 }
define function ToDate(value date): value.value
define function ToDateTime(value dateTime): value.value
define function ToDateTime(value instant): value.value
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
define function ToString(value EncounterStatus): value.value
define function ToString(value MedicationDispenseStatus): value.value
define function ToString(value ProcedureStatus): value.value
define function ToString(value string): value.value
define function "Collapse Date Interval Workaround"(intervals List<Interval<Date>>): if intervals is null then { } as List<Interval<Date>> else if Count(intervals)= 0 then { } as List<Interval<Date>> else collapse ( intervals I where not AnyTrue( intervals J return I properly included in J ) ) per day
define function "Collapsed Date Interval Stats"(collapsedIntervals List<Interval<Date>>): Tuple { "Intervals": collapsedIntervals, "Interval Count": Count(collapsedIntervals), "Total Days In Intervals": if Count(collapsedIntervals)= 0 then 0 else Sum(collapsedIntervals I return Max({ duration in days of I + 1, 0 })), "Longest Interval": if Count(collapsedIntervals)= 0 then null as Interval<Date> else First(collapsedIntervals I return Tuple { "interval": I, "days": Max({ duration in days of I + 1, 0 }) } sort by "days" desc).interval, "Total Days In Longest Interval": if Count(collapsedIntervals)= 0 then 0 else Max({ duration in days of First(collapsedIntervals I return Tuple { "interval": I, "days": Max({ duration in days of I + 1, 0 }) } sort by "days" desc).interval + 1, 0 }) }
define function "Date Interval Covering Relative to Base Interval"(baseInterval Interval<Date>, coveringIntervals List<Interval<Date>>): "Collapse Date Interval Workaround"(("Sort Date Intervals"(coveringIntervals)) sortedInterval return baseInterval intersect sortedInterval)
define function "Date Interval Gaps Relative to Base Interval"(baseInterval Interval<Date>, coveringIntervals List<Interval<Date>>): ( Tuple { sortedCoverings: "Date Interval Covering Relative to Base Interval"(baseInterval, coveringIntervals) } ) variableDeclarations return ( Tuple { frontgaps: if Count(variableDeclarations.sortedCoverings)= 0 then { baseInterval } else ( variableDeclarations.sortedCoverings sortedCovering return if IndexOf(variableDeclarations.sortedCoverings, sortedCovering) = 0 then ( Interval[start of baseInterval, start of sortedCovering] intersect baseInterval) except sortedCovering else Interval( start of variableDeclarations.sortedCoverings[IndexOf(variableDeclarations.sortedCoverings, sortedCovering)- 1], end of sortedCovering ) except variableDeclarations.sortedCoverings[IndexOf(variableDeclarations.sortedCoverings, sortedCovering)- 1] except sortedCovering), endgap: if Count(variableDeclarations.sortedCoverings)= 0 then { } as List<Interval<Date>> else { ( Interval( start of Last(variableDeclarations.sortedCoverings), end of baseInterval] except Last(variableDeclarations.sortedCoverings)) intersect baseInterval } } ) calculations return "Collapse Date Interval Workaround"( calculations.frontgaps union calculations.endgap )
define function "Date Interval Gaps Relative to Base Interval Stats"(baseInterval Interval<Date>, coveringIntervals List<Interval<Date>>): ( Tuple { "Gap Intervals": "Date Interval Gaps Relative to Base Interval"(baseInterval, coveringIntervals) } ) variableDeclarations return ( "Collapsed Date Interval Stats"(variableDeclarations."Gap Intervals"))
define function "Sort Date Intervals"(intervals List<Interval<Date>>): if intervals is null then { } as List<Interval<Date>> else if Count(intervals)= 0 then { } as List<Interval<Date>> else ( ( intervals I return Tuple { interval: I, startOfInterval: if start of I is null then minimum Date else start of I } sort by startOfInterval asc ) sortedIntervals return sortedIntervals.interval )
define function "Medical Claims With Diagnosis"(claim List<FHIR.Claim>, DiagnosisValueSet List<System.Code>): ( Tuple { "MedicalClaim": "Professional or Institutional Claims"(claim), "DiagnosesAsStrings": DiagnosisValueSet d return d.code } ) ClaimWithDiagnosis return ( Tuple { "DiagnosisItems": if ClaimWithDiagnosis."MedicalClaim" is null then null else ClaimWithDiagnosis."MedicalClaim" DiagnosisLine where exists ( ( ( DiagnosisLine.diagnosis.diagnosis ).coding ) HeaderCode where HeaderCode.code.value in ClaimWithDiagnosis."DiagnosesAsStrings" ) } ) HeaderDefinition return ( if exists HeaderDefinition."DiagnosisItems" then ( Tuple { Claim: HeaderDefinition."DiagnosisItems", ServicePeriod: HeaderDefinition.DiagnosisItems.item NormalDate return FHIRBase."Normalize Interval" ( NormalDate.serviced ) } ) else null ) FinalList where FinalList is not null
define function "Medical Claims With Nonacute or Acute Inpatient Discharge"(claim List<FHIR.Claim>): ( Tuple { "MedicalClaim": "Professional or Institutional Claims"(claim) } ) ClaimWithInpatientStay return ( Tuple { "InpatientStayLineItems": if ClaimWithInpatientStay."MedicalClaim" is null then null else ( ClaimWithInpatientStay."MedicalClaim" c where exists ( ( c.item ) i where exists ( FHIRHelpers.ToConcept ( i.revenue ).codes ) rev where rev.code in "Inpatient Stay" ) ), "NonacuteInpatientLineItems": if ClaimWithInpatientStay."MedicalClaim" is null then null else ( ClaimWithInpatientStay."MedicalClaim" c where exists ( c.item i where exists ( FHIRHelpers.ToConcept ( i.revenue ).codes ) rev where rev.code in ( "Nonacute Inpatient Stay" ) ) or exists ( ( c.subType.coding ) tob where tob.code.value in "Nonacute Inpatient Stay" ) ) } ) LineItemDefinition return Tuple { "InpatientDischarge": LineItemDefinition."InpatientStayLineItems", "NonacuteInpatientDischarge": LineItemDefinition."NonacuteInpatientLineItems" nonAcuteInpatientStay with LineItemDefinition."InpatientStayLineItems" inpatientStay such that nonAcuteInpatientStay.id = inpatientStay.id, "AcuteInpatientDischarge": LineItemDefinition."InpatientStayLineItems" inpatientStay without LineItemDefinition."NonacuteInpatientLineItems" nonAcuteInpatientStay such that inpatientStay.id = nonAcuteInpatientStay.id }
define function "Professional or Institutional Claims"(claim List<FHIR.Claim>): claim MedicalClaim where ( FHIRHelpers.ToConcept ( MedicalClaim.type ).codes contains Terminology."Professional" or FHIRHelpers.ToConcept ( MedicalClaim.type ).codes contains Terminology."Institutional" )
define function "Encounter Has Diagnosis"(Encounter FHIR.Encounter, Conditions List<FHIR.Condition>): AnyTrue((Encounter.diagnosis D return D.condition.reference)CRef return exists(Conditions C where C.id = FHIRBase."GetId"(CRef) ) )
define function "GetId"(uri String): if ( PositionOf('/', uri)> 0 ) then Last(Split(uri, '/')) else uri
define function "Normalize Abatement"(abatement Choice<FHIR.dateTime, FHIR.Age, FHIR.Period, FHIR.Range, FHIR.string>): if abatement is FHIR.dateTime then Interval[FHIRHelpers.ToDateTime ( abatement as FHIR.dateTime ), FHIRHelpers.ToDateTime ( abatement as FHIR.dateTime )] else if abatement is FHIR.Period then Interval[abatement.start.value, abatement. end.value] else if abatement is FHIR.string then Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute an interval from a String value') else if abatement is FHIR.Age then Interval[FHIRHelpers.ToDate ( Patient.birthDate ) + FHIRHelpers.ToQuantity ( abatement as FHIR.Age ), FHIRHelpers.ToDate ( Patient.birthDate ) + FHIRHelpers.ToQuantity ( abatement as FHIR.Age ) + 1 year ) else if abatement is FHIR.Range then Interval[FHIRHelpers.ToDate ( Patient.birthDate ) + FHIRHelpers.ToQuantity ( ( abatement as FHIR.Range ).low ), FHIRHelpers.ToDate ( Patient.birthDate ) + FHIRHelpers.ToQuantity ( ( abatement as FHIR.Range ).high ) + 1 year ) else null
define function "Normalize Interval"(choice Choice<FHIR.dateTime, FHIR.date, 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.date then Interval[ToDateTime(choice as FHIR.date), ToDateTime(choice as FHIR.date)] when choice is FHIR.Period then Interval[choice.start.value, choice. end.value] 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, '1', 'Error', 'Cannot compute a single interval from a Timing type') when choice is FHIR.string then Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute an interval from a String value') else null as Interval<DateTime> end
define function "Normalize Onset"(onset Choice<FHIR.dateTime, FHIR.Age, FHIR.Period, FHIR.Range, FHIR.string>): if onset is FHIR.dateTime then Interval[FHIRHelpers.ToDateTime ( onset as FHIR.dateTime ), FHIRHelpers.ToDateTime ( onset as FHIR.dateTime )] else if onset is FHIR.Period then Interval[onset.start.value, onset. end.value] else if onset is FHIR.string then Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute an interval from a String value') else if onset is FHIR.Age then Interval[FHIRHelpers.ToDate ( Patient.birthDate ) + FHIRHelpers.ToQuantity ( onset as FHIR.Age ), FHIRHelpers.ToDate ( Patient.birthDate ) + FHIRHelpers.ToQuantity ( onset as FHIR.Age ) + 1 year ) else if onset is FHIR.Range then Interval[FHIRHelpers.ToDate ( Patient.birthDate ) + FHIRHelpers.ToQuantity ( ( onset as FHIR.Range ).low ), FHIRHelpers.ToDate ( Patient.birthDate ) + FHIRHelpers.ToQuantity ( ( onset as FHIR.Range ).high ) + 1 year ) else null
define function "Prevalence Period"(condition Condition): Interval[start of "Normalize Onset"(condition.onset), end of "Normalize Abatement"(condition.abatement)]
define function "VS Cast Function"(VSet List<System.Code>): ( ( cast { "VSet", 1 }[0]as Tuple { codes List<System.Code>, oid System.String, version System.String } ).codes ) VSetCodes return System.Code { code: VSetCodes.code, system: VSetCodes.system }
define function "All Coverage Info"(Coverage List<FHIR.Coverage>, participationPeriod Interval<Date>): Coverage C let IntervalInfo: "CoverageIntervals"(Coverage, participationPeriod), Collapsed: "Collapsed Coverage Intervals"(IntervalInfo), Adjacent: "Collapsed Coverage Adjacent Intervals"(Collapsed), CollapsedFinal: "Collapsed Final Coverage Intervals"(Collapsed, Adjacent) return Tuple { IntervalInfo: IntervalInfo, Collapsed: Collapsed, Adjacent: Adjacent, CollapsedFinal: CollapsedFinal }
define function "Anchor Date Criteria"(Coverage List<FHIR.Coverage>, AnchorDate Date, participationPeriod Interval<Date>): if AnchorDate in participationPeriod then exists ( ( "All Coverage Info"(Coverage, participationPeriod).CollapsedFinal ) FinalInterval where AnchorDate in FinalInterval ) else if not ( AnchorDate in participationPeriod ) then exists ( Coverage.period Cperiod where AnchorDate in Interval[date from start of FHIRBase."Normalize Interval" ( Cperiod ), date from end of FHIRBase."Normalize Interval" ( Cperiod )] ) else if AnchorDate is null then true else false
define function "Collapsed Coverage Adjacent Intervals"(Intervals List<Interval<Date>>): from Intervals Coverage1, Intervals Coverage2 where end of Coverage1 within 1 day of start of Coverage2 return Interval[start of Coverage1, end of Coverage2]
define function "Collapsed Coverage Intervals"(Intervals List<Interval<Date>>): CQLBase."Collapse Date Interval Workaround" ( Intervals )
define function "Collapsed Final Coverage Intervals"(collapsedI List<Interval<Date>>, adjacentI List<Interval<Date>>): CQLBase."Collapse Date Interval Workaround" ( "Collapsed Coverage Intervals"(collapsedI) union "Collapsed Coverage Adjacent Intervals"(adjacentI))
define function "CoverageIntervals"(Coverage List<FHIR.Coverage>, participationPeriod Interval<Date>): Coverage C return Interval[date from start of FHIRBase."Normalize Interval" ( C.period ), date from end of FHIRBase."Normalize Interval" ( C.period )] intersect Interval[start of participationPeriod, end of participationPeriod]
define function "Health Plan Coverage Resources"(Coverage List<FHIR.Coverage>): ( Coverage C where exists C.type.coding cTypeCoding where ( FHIRHelpers.ToCode ( cTypeCoding ) ~ Terminology."managed care policy" or FHIRHelpers.ToCode ( cTypeCoding ) ~ Terminology."retiree health program" or FHIRHelpers.ToCode ( cTypeCoding ) ~ Terminology."subsidized health program" ) ) HPCoverageResource where HPCoverageResource is not null
define function "Health Plan Enrollment Criteria"(Coverage List<FHIR.Coverage>, AnchorDate Date, participationPeriod Interval<Date>, AllowedGapDays Integer): ( CQLBase."Date Interval Gaps Relative to Base Interval Stats" ( participationPeriod, "All Coverage Info"("Health Plan Coverage Resources"(Coverage), participationPeriod).CollapsedFinal ) ) GapsInEnrollment return ( GapsInEnrollment."Interval Count" <= 1 and GapsInEnrollment."Total Days In Longest Interval" <= AllowedGapDays and "Anchor Date Criteria"(Coverage, AnchorDate, participationPeriod) )
define function "Palliative Care Overlapping Period"(Period Interval<DateTime>): exists ( [Observation: "Palliative Care Assessment"] PalliativeAssessment where Interval[date from start of FHIRBase."Normalize Interval" ( PalliativeAssessment.effective ), date from end of FHIRBase."Normalize Interval" ( PalliativeAssessment.effective )]overlaps Interval[date from start of Period, date from end of Period] ) or exists ( ( Status."Finished Encounter" ( [Encounter: "Palliative Care Encounter"] ) ) PalliativeEncounter where Interval[date from start of FHIRBase."Normalize Interval" ( PalliativeEncounter.period ), date from end of FHIRBase."Normalize Interval" ( PalliativeEncounter.period )]overlaps Interval[date from start of Period, date from end of Period] ) or exists ( ( Status."Completed or Ongoing Procedure" ( [Procedure: "Palliative Care Intervention"] ) ) PalliativeIntervention where Interval[date from start of FHIRBase."Normalize Interval" ( PalliativeIntervention.performed ), date from end of FHIRBase."Normalize Interval" ( PalliativeIntervention.performed )]overlaps Interval[date from start of Period, date from end of Period] ) or exists ( ( Status."Active Condition" ( [Condition: "Encounter for palliative care"] ) ) PalliativeDiagnosis where Interval[date from start of FHIRBase."Prevalence Period" ( PalliativeDiagnosis ), date from end of FHIRBase."Prevalence Period" ( PalliativeDiagnosis )]overlaps Interval[date from start of Period, date from end of Period] )
define function "Active Condition"(Condition List<FHIR.Condition>): Condition C where C.clinicalStatus = Terminology."active"
define function "Completed or Ongoing Procedure"(Proc List<FHIR.Procedure>): Proc P where P.status in {'completed', 'in-progress'}
define function "Completed Procedure"(Proc List<FHIR.Procedure>): Proc P where P.status = 'completed'
define function "Dispensed Medication"(Med List<FHIR.MedicationDispense>): Med M where M.status = 'completed'
define function "Finished Encounter"(Enc List<FHIR.Encounter>): Enc E where E.status = 'finished'