Metadata Title Preventive Care and Screening: Tobacco Use: Screening and Cessation Intervention Version 0.0.001 Short Name Preventive Care and Screening: Tobacco Use: Screening and Cessation Intervention GUID (Version Independent) http://example.org/fhir/us/cqm/Measure/HBPComponent GUID (Version Specific) http://example.org/fhir/us/cqm/Measure/138v12 Identifier urn:oid:2.16.840.1.113883.4.642.40.61.29.18 Effective Period 2022-01-01 through 2022-12-31 Experimental true Use Context Clinical Venue = EC Jurisdiction Global (Whole world) Steward (Publisher) HL7 International / Clinical Quality Information Description This is an example only. Measure Basis boolean Measure Scoring Proportion Measure Type Process Improvement Notation Increased score indicates improvement Measure Group (Rate) (ID: primary) Initial Population ID: primary-tsccomponent-initial-population Description: No description provided Criteria: Initial Population Denominator ID: primary-tsccomponent-denominator Description: No description provided Criteria: Denominator 1 Denominator Exception ID: primary-tsccomponent-denominator-exception Description: No description provided Criteria: Denominator Exceptions 1 Numerator ID: primary-tsccomponent-numerator Description: No description provided Criteria: Numerator 1 Measure Group (Rate) (ID: group-2) Initial Population ID: group-2-tsccomponent-initial-population Description: No description provided Criteria: Initial Population Denominator ID: group-2-tsccomponent-denominator Description: No description provided Criteria: Denominator 2 Denominator Exception ID: group-2-tsccomponent-denominator-exception Description: No description provided Criteria: Denominator Exceptions 2 Numerator ID: group-2-tsccomponent-numerator Description: No description provided Criteria: Numerator 2 Measure Group (Rate) (ID: group-3) Initial Population ID: group-3-tsccomponent-initial-population Description: No description provided Criteria: Initial Population Denominator ID: group-3-tsccomponent-denominator Description: No description provided Criteria: Denominator 3 Denominator Exception ID: group-3-tsccomponent-denominator-exception Description: No description provided Criteria: Denominator Exceptions 3 Numerator ID: group-3-tsccomponent-numerator Description: No description provided Criteria: Numerator 3 Supplemental Data Elements Supplemental Data Element ID: fe7bab72-cc69-44bb-a678-473b24811e67 Usage Code: Supplemental Data Description: No description provided Logic Definition: SDE Ethnicity Supplemental Data Element ID: 2486f84d-df90-489b-8f5c-e55cdcfb361e Usage Code: Supplemental Data Description: No description provided Logic Definition: SDE Payer Supplemental Data Element ID: bb0949c4-1f7b-4ce2-a988-c2e60f1a0079 Usage Code: Supplemental Data Description: No description provided Logic Definition: SDE Race Supplemental Data Element ID: 742028bc-5aa5-4a5b-927d-be1908e10aaf Usage Code: Supplemental Data Description: No description provided Logic Definition: SDE Sex Measure Logic Primary Library TSC Component Library Contents Population Criteria Logic Definitions Terminology Dependencies Data Requirements Population Criteria Measure Group (Rate) (ID: primary) Initial Population define "Initial Population": exists ( ["Patient"] BirthDate where Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate ( BirthDate.birthDate ), start of "Measurement Period" ) >= 18 ) and ( Count("Office Based Visit During Measurement Period")>= 2 or exists "Preventive Visit During Measurement Period" ) Definition Denominator define "Denominator 1": "Initial Population" Definition Denominator Exception define "Denominator Exceptions 1": exists "Medical Reason for Not Screening for Tobacco Use" or "Has Limited Life Expectancy" Definition Numerator define "Numerator 1": "Most Recent Tobacco Use Screening Indicates Tobacco Non User" is not null or "Most Recent Tobacco Use Screening Indicates Tobacco User" is not null Definition Measure Group (Rate) (ID: group-2) Initial Population define "Initial Population": exists ( ["Patient"] BirthDate where Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate ( BirthDate.birthDate ), start of "Measurement Period" ) >= 18 ) and ( Count("Office Based Visit During Measurement Period")>= 2 or exists "Preventive Visit During Measurement Period" ) Definition Denominator define "Denominator 2": "Initial Population" and "Most Recent Tobacco Use Screening Indicates Tobacco User" is not null Definition Denominator Exception define "Denominator Exceptions 2": exists "Medical Reason for Not Counseling Tobacco User" or exists "Medical Reason for Not Ordering Tobacco Cessation Pharmacotherapy" or "Has Limited Life Expectancy" Definition Numerator define "Numerator 2": exists "Tobacco Cessation Counseling Given" or exists "Tobacco Cessation Pharmacotherapy Ordered" Definition Measure Group (Rate) (ID: group-3) Initial Population define "Initial Population": exists ( ["Patient"] BirthDate where Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate ( BirthDate.birthDate ), start of "Measurement Period" ) >= 18 ) and ( Count("Office Based Visit During Measurement Period")>= 2 or exists "Preventive Visit During Measurement Period" ) Definition Denominator define "Denominator 3": "Initial Population" Definition Denominator Exception define "Denominator Exceptions 3": exists "Medical Reason for Not Screening for Tobacco Use" or exists "Medical Reason for Not Counseling Tobacco User" or exists "Medical Reason for Not Ordering Tobacco Cessation Pharmacotherapy" or "Has Limited Life Expectancy" Definition Numerator define "Numerator 3": "Most Recent Tobacco Use Screening Indicates Tobacco Non User" is not null or ( "Most Recent Tobacco Use Screening Indicates Tobacco User" is not null and ( exists "Tobacco Cessation Counseling Given" or exists "Tobacco Cessation Pharmacotherapy Ordered" //or exists "Active Pharmacotherapy for Tobacco Cessation" ) ) Definition Logic Definitions Logic Definition Library Name: SupplementalDataElements define "SDE Race": (flatten ( Patient.extension Extension where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' return Extension.extension )) E where E.url = 'ombCategory' or E.url = 'detailed' return E.value as Coding Logic Definition Library Name: SupplementalDataElements define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end Logic Definition Library Name: SupplementalDataElements define "SDE Payer": [Coverage: type in "Payer"] Payer return { code: Payer.type, period: Payer.period } Logic Definition Library Name: SupplementalDataElements define "SDE Ethnicity": (flatten ( Patient.extension Extension where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' return Extension.extension )) E where E.url = 'ombCategory' or E.url = 'detailed' return E.value as Coding Logic Definition Library Name: TSCComponent define "Most Recent Tobacco Use Screening Indicates Tobacco Non User": ( Last(["Observation": "Tobacco Use Screening"] TobaccoUseScreening where Global."Normalize Interval"(TobaccoUseScreening.effective)overlaps "Measurement Period" sort by start of Global."Normalize Interval"(effective) )) MostRecentTobaccoUseScreening where MostRecentTobaccoUseScreening.value in "Tobacco Non-User" Logic Definition Library Name: TSCComponent define "Most Recent Tobacco Use Screening Indicates Tobacco User": ( Last(["Observation": "Tobacco Use Screening"] TobaccoUseScreening where Global."Normalize Interval"(TobaccoUseScreening.effective)overlaps "Measurement Period" sort by start of Global."Normalize Interval"(effective) )) MostRecentTobaccoUseScreening where MostRecentTobaccoUseScreening.value in "Tobacco User" Logic Definition Library Name: TSCComponent // MedicationStatement is not available in R5, known publication issue //define "Active Pharmacotherapy for Tobacco Cessation": // ["MedicationStatement": "Tobacco Use Cessation Pharmacotherapy"] TakingCessationPharmacotherapy // where Global."Normalize Interval" ( TakingCessationPharmacotherapy.effective ) overlaps after "Measurement Period" // and TakingCessationPharmacotherapy.status in { 'active', 'completed' } define "Tobacco Cessation Counseling Given": ["Encounter": "Tobacco Use Cessation Counseling"] TobaccoCessationCounseling where TobaccoCessationCounseling.period during "Measurement Period" and TobaccoCessationCounseling.status = 'finished' Logic Definition Library Name: TSCComponent define "Tobacco Cessation Pharmacotherapy Ordered": ["MedicationRequest": "Tobacco Use Cessation Pharmacotherapy"] CessationPharmacotherapyOrdered where CessationPharmacotherapyOrdered.authoredOn during "Measurement Period" and CessationPharmacotherapyOrdered.status = 'active' Logic Definition Library Name: TSCComponent define "Numerator 3": "Most Recent Tobacco Use Screening Indicates Tobacco Non User" is not null or ( "Most Recent Tobacco Use Screening Indicates Tobacco User" is not null and ( exists "Tobacco Cessation Counseling Given" or exists "Tobacco Cessation Pharmacotherapy Ordered" //or exists "Active Pharmacotherapy for Tobacco Cessation" ) ) Logic Definition Library Name: TSCComponent define "Medical Reason for Not Screening for Tobacco Use": ["Observation": "Tobacco Use Screening"] NoTobaccoUseScreening where NoTobaccoUseScreening.issued during "Measurement Period" and "Not Done"(NoTobaccoUseScreening) and "Not Done Reason in Medical Reason"(NoTobaccoUseScreening) and NoTobaccoUseScreening.status = 'final' Logic Definition Library Name: TSCComponent //or exists "Active Pharmacotherapy for Tobacco Cessation" define "Has Limited Life Expectancy": exists ( ["Condition"] LimitedLifeExpectancy where Global."Prevalence Period" ( LimitedLifeExpectancy ) overlaps after "Measurement Period" and LimitedLifeExpectancy.clinicalStatus ~ ToConcept(Global."active") ) Logic Definition Library Name: TSCComponent define "Denominator Exceptions 1": exists "Medical Reason for Not Screening for Tobacco Use" or "Has Limited Life Expectancy" Logic Definition Library Name: TSCComponent define "Numerator 1": "Most Recent Tobacco Use Screening Indicates Tobacco Non User" is not null or "Most Recent Tobacco Use Screening Indicates Tobacco User" is not null Logic Definition Library Name: TSCComponent define "Numerator 2": exists "Tobacco Cessation Counseling Given" or exists "Tobacco Cessation Pharmacotherapy Ordered" Logic Definition Library Name: TSCComponent define "SDE Race": SDE."SDE Race" Logic Definition Library Name: TSCComponent define "SDE Sex": SDE."SDE Sex" Logic Definition Library Name: TSCComponent define "Office Based Visit During Measurement Period": ( ["Encounter": "Health behavior intervention, individual, face-to-face; initial 30 minutes"] union ["Encounter": "Health behavior assessment, or re-assessment (ie, health-focused clinical interview, behavioral observations, clinical decision making)"] union ["Encounter": "Home Healthcare Services"] union ["Encounter": "Occupational Therapy Evaluation"] union ["Encounter": "Office Visit"] union ["Encounter": "Ophthalmological Services"] union ["Encounter": "Physical Therapy Evaluation"] union ["Encounter": "Psych Visit - Diagnostic Evaluation"] union ["Encounter": "Psych Visit - Psychotherapy"] union ["Encounter": "Psychoanalysis"] union ["Encounter": "Speech and Hearing Evaluation"] ) OfficeBasedEncounter where OfficeBasedEncounter.period during "Measurement Period" and OfficeBasedEncounter.status = 'finished' Logic Definition Library Name: TSCComponent define "Preventive Visit During Measurement Period": ( ["Encounter": "Annual Wellness Visit"] union ["Encounter": "Preventive Care Services - Established Office Visit, 18 and Up"] union ["Encounter": "Preventive Care Services - Group Counseling"] union ["Encounter": "Preventive Care Services - Other"] union ["Encounter": "Preventive Care Services-Individual Counseling"] union ["Encounter": "Preventive Care Services-Initial Office Visit, 18 and Up"] ) PreventiveEncounter where PreventiveEncounter.period during "Measurement Period" and PreventiveEncounter.status = 'finished' Logic Definition Library Name: TSCComponent define "Initial Population": exists ( ["Patient"] BirthDate where Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate ( BirthDate.birthDate ), start of "Measurement Period" ) >= 18 ) and ( Count("Office Based Visit During Measurement Period")>= 2 or exists "Preventive Visit During Measurement Period" ) Logic Definition Library Name: TSCComponent define "Denominator 3": "Initial Population" Logic Definition Library Name: TSCComponent define "Denominator 2": "Initial Population" and "Most Recent Tobacco Use Screening Indicates Tobacco User" is not null Logic Definition Library Name: TSCComponent define "SDE Payer": SDE."SDE Payer" Logic Definition Library Name: TSCComponent define "SDE Ethnicity": SDE."SDE Ethnicity" Logic Definition Library Name: TSCComponent define "Medical Reason for Not Counseling Tobacco User": ["Procedure": "Tobacco Use Cessation Counseling"] NoTobaccoCessationCounseling where Global."Normalize Interval" ( NoTobaccoCessationCounseling.performed ) starts during "Measurement Period" and ( ( NoTobaccoCessationCounseling.status = 'not-done' and NoTobaccoCessationCounseling.statusReason in "Medical Reason" ) or ( "Not Done"(NoTobaccoCessationCounseling) and "Not Done Reason in Medical Reason"(NoTobaccoCessationCounseling) ) ) Logic Definition Library Name: TSCComponent define "Medical Reason for Not Ordering Tobacco Cessation Pharmacotherapy": ["MedicationRequest": "Tobacco Use Cessation Pharmacotherapy"] NoCessationPharmacotherapyOrdered where NoCessationPharmacotherapyOrdered.authoredOn during "Measurement Period" and NoCessationPharmacotherapyOrdered.status = 'completed' and ( ( "Not Done"(NoCessationPharmacotherapyOrdered) and "Not Done Reason in Medical Reason"(NoCessationPharmacotherapyOrdered) ) or ( NoCessationPharmacotherapyOrdered.doNotPerform = true and NoCessationPharmacotherapyOrdered.statusReason in "Medical Reason" ) ) Logic Definition Library Name: TSCComponent define "Denominator Exceptions 2": exists "Medical Reason for Not Counseling Tobacco User" or exists "Medical Reason for Not Ordering Tobacco Cessation Pharmacotherapy" or "Has Limited Life Expectancy" Logic Definition Library Name: TSCComponent define "Denominator Exceptions 3": exists "Medical Reason for Not Screening for Tobacco Use" or exists "Medical Reason for Not Counseling Tobacco User" or exists "Medical Reason for Not Ordering Tobacco Cessation Pharmacotherapy" or "Has Limited Life Expectancy" Logic Definition Library Name: TSCComponent define "Denominator 1": "Initial Population" Logic Definition Library Name: TSCComponent define function "Not Done"(res DomainResource ): if ( res R where ( "GetModiferExtension"(R, 'http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-notDone').value = true ) ) is not null then true else false Logic Definition Library Name: TSCComponent define function "GetModiferExtension"(res DomainResource, url String ): singleton from "GetModifierExtensions"(res, url) Logic Definition Library Name: TSCComponent define function "GetModifierExtensions"(res DomainResource, url String ): res.modifierExtension E where E.url = ( url ) return E Logic Definition Library Name: TSCComponent define function "Not Done Reason in Medical Reason"(res DomainResource ): if ( res R where "GetModiferExtension"(R, 'http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-notDoneReason').value in "Medical Reason" ) is not null then true else false Logic Definition Library Name: MATGlobalCommonFunctions define function "Prevalence Period"(condition Condition): Interval[start of "Normalize Interval"(condition.onset), end of "Normalize Abatement"(condition)) Logic Definition Library Name: MATGlobalCommonFunctions define function "Normalize Abatement"(condition Condition): if condition.abatement is FHIR.dateTime then Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)] else if condition.abatement is FHIR.Period then FHIRHelpers.ToInterval(condition.abatement as FHIR.Period) else if condition.abatement is FHIR.string then Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute an interval from a String value') else if condition.abatement is FHIR.Age then Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age), FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year) else if condition.abatement is FHIR.Range then Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low), FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year) else if condition.abatement is FHIR.boolean then Interval[end of "Normalize Interval"(condition.onset), condition.recordedDate) else null Logic Definition Library Name: MATGlobalCommonFunctions define function "CalendarAgeInYearsAt"(BirthDateTime DateTime, AsOf DateTime): years between ToDate(BirthDateTime)and ToDate(AsOf) Logic Definition Library Name: MATGlobalCommonFunctions define function "ToDate"(Value DateTime): DateTime(year from Value, month from Value, day from Value, 0, 0, 0, 0, timezoneoffset from Value) Logic Definition Library Name: FHIRHelpers define function ToString(value string): value.value Logic Definition Library Name: FHIRHelpers /* @description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period) value to a CQL DateTime Interval @comment: If the start value of the given period is unspecified, the starting boundary of the resulting interval will be open (meaning the start of the interval is unknown, as opposed to interpreted as the beginning of time). */ define function ToInterval(period FHIR.Period): if period is null then null else if period."start" is null then Interval(period."start".value, period."end".value] else Interval[period."start".value, period."end".value] Logic Definition Library Name: FHIRHelpers define function ToString(value EncounterStatus): value.value Logic Definition Library Name: FHIRHelpers /* @description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept. */ define function ToConcept(concept FHIR.CodeableConcept): if concept is null then null else System.Concept { codes: concept.coding C return ToCode(C), display: concept.text.value } Logic Definition Library Name: FHIRHelpers /* @description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code. */ define function ToCode(coding FHIR.Coding): if coding is null then null else System.Code { code: coding.code.value, system: coding.system.value, version: coding.version.value, display: coding.display.value } Logic Definition Library Name: FHIRHelpers define function ToDateTime(value dateTime): value.value Logic Definition Library Name: FHIRHelpers define function ToString(value MedicationRequestStatus): value.value Logic Definition Library Name: FHIRHelpers define function ToDateTime(value instant): value.value Logic Definition Library Name: FHIRHelpers define function ToBoolean(value boolean): value.value Logic Definition Library Name: FHIRHelpers define function ToString(value uri): value.value Logic Definition Library Name: FHIRHelpers define function ToString(value base64Binary): value.value Logic Definition Library Name: FHIRHelpers define function ToString(value ObservationStatus): 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 AdministrativeGender): value.value Logic Definition Library Name: FHIRHelpers define function ToString(value ProcedureStatus): value.value Terminology Code System Description: Code system ConditionClinicalStatusCodes Resource: Condition Clinical Status Codes Canonical URL: http://terminology.hl7.org/CodeSystem/condition-clinical Code System Description: Code system CPT Resource: Current Procedural Terminology (CPT®) Canonical URL: http://www.ama-assn.org/go/cpt Value Set Description: Value set Tobacco Use Screening Resource: Tobacco Use Screening Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1278 Value Set Description: Value set Tobacco Non-User Resource: Tobacco Non User Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1189 Value Set Description: Value set Tobacco User Resource: Tobacco User Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1170 Value Set Description: Value set Tobacco Use Cessation Counseling Resource: Tobacco Use Cessation Counseling Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.509 Value Set Description: Value set Tobacco Use Cessation Pharmacotherapy Resource: Tobacco Use Cessation Pharmacotherapy Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1190 Value Set Description: Value set Medical Reason Resource: Medical Reason Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1007 Value Set Description: Value set Home Healthcare Services Resource: Home Healthcare Services Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016 Value Set Description: Value set Occupational Therapy Evaluation Resource: Occupational Therapy Evaluation Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1011 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 Ophthalmological Services Resource: Ophthalmological Services Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1285 Value Set Description: Value set Physical Therapy Evaluation Resource: Physical Therapy Evaluation Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1022 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 - 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 Speech and Hearing Evaluation Resource: Speech and Hearing Evaluation Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1530 Value Set Description: Value set Annual Wellness Visit Resource: Annual Wellness Visit Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240 Value Set Description: Value set Preventive Care Services - Established Office Visit, 18 and Up Resource: Preventive Care Services Established Office Visit, 18 and Up Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025 Value Set Description: Value set Preventive Care Services - Group Counseling Resource: Preventive Care Services Group Counseling Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1027 Value Set Description: Value set Preventive Care Services - Other Resource: Preventive Care Services Other Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1030 Value Set Description: Value set Preventive Care Services-Individual Counseling Resource: Preventive Care Services Individual Counseling Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1026 Value Set Description: Value set Preventive Care Services-Initial Office Visit, 18 and Up Resource: Preventive Care Services Initial Office Visit, 18 and Up Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023 Value Set Description: Value set Payer Resource: Payer Type Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591 Direct Reference Code Code: active System: http://terminology.hl7.org/CodeSystem/condition-clinical Direct Reference Code Display: Health behavior intervention, individual, face-to-face; initial 30 minutes Code: 96158 System: http://www.ama-assn.org/go/cpt Direct Reference Code Display: Health behavior assessment, or re-assessment (ie, health-focused clinical interview, behavioral observations, clinical decision making) Code: 96156 System: http://www.ama-assn.org/go/cpt Dependencies Dependency Description: Library Global Resource: MAT Global Common Functions FHIR Libraryversion: null5.0.000) Canonical URL: http://hl7.org/fhir/uv/cqm/Library/MATGlobalCommonFunctions|5.0.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 SDE Resource: Supplemental Data Elementsversion: null2.0.000) Canonical URL: http://hl7.org/fhir/uv/cqm/Library/SupplementalDataElements|2.0.000 Data Requirements Data Requirement Type: Observation Profile(s): Observation Must Support Elements: code, effective, value, issued, status Code Filter(s): Path: code ValueSet: Tobacco Use Screening Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Tobacco Use Cessation Counseling Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type Code(s): Current Procedural Terminology (CPT®): 96158 (Health behavior intervention, individual, face-to-face; initial 30 minutes) Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type Code(s): Current Procedural Terminology (CPT®): 96156 (Health behavior assessment, or re-assessment (ie, health-focused clinical interview, behavioral observations, clinical decision making)) Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Home Healthcare Services Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Occupational Therapy Evaluation Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Office Visit Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Ophthalmological Services Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Physical Therapy Evaluation Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Psych Visit Diagnostic Evaluation Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Psych Visit Psychotherapy Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Psychoanalysis Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Speech and Hearing Evaluation Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Annual Wellness Visit Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Preventive Care Services Established Office Visit, 18 and Up Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Preventive Care Services Group Counseling Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Preventive Care Services Other Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Preventive Care Services Individual Counseling Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, status Code Filter(s): Path: type ValueSet: Preventive Care Services Initial Office Visit, 18 and Up Data Requirement Type: MedicationRequest Profile(s): MedicationRequest Must Support Elements: medication, authoredOn, status, doNotPerform, statusReason Code Filter(s): Path: medication ValueSet: Tobacco Use Cessation Pharmacotherapy Data Requirement Type: MedicationRequest Profile(s): MedicationRequest Must Support Elements: medication.reference, authoredOn, status, doNotPerform, statusReason Data Requirement Type: Medication Profile(s): Medication Must Support Elements: id, code Data Requirement Type: Patient Profile(s): Patient Must Support Elements: url, extension, value, birthDate Data Requirement Type: Condition Profile(s): Condition Must Support Elements: clinicalStatus Data Requirement Type: Coverage Profile(s): Coverage Must Support Elements: type, period Code Filter(s): Path: type ValueSet: Payer Type Data Requirement Type: Procedure Profile(s): Procedure Must Support Elements: code, performed, status, statusReason Code Filter(s): Path: code ValueSet: Tobacco Use Cessation Counseling Generated using version 0.4.9 of the sample-content-ig Liquid templates
Health behavior intervention, individual, face-to-face; initial 30 minutes
Health behavior assessment, or re-assessment (ie, health-focused clinical interview, behavioral observations, clinical decision making)
Most Recent Tobacco Use Screening Indicates Tobacco Non User
define "Most Recent Tobacco Use Screening Indicates Tobacco Non User": ( Last(["Observation": "Tobacco Use Screening"] TobaccoUseScreening where Global."Normalize Interval"(TobaccoUseScreening.effective)overlaps "Measurement Period" sort by start of Global."Normalize Interval"(effective) )) MostRecentTobaccoUseScreening where MostRecentTobaccoUseScreening.value in "Tobacco Non-User"
Most Recent Tobacco Use Screening Indicates Tobacco User
define "Most Recent Tobacco Use Screening Indicates Tobacco User": ( Last(["Observation": "Tobacco Use Screening"] TobaccoUseScreening where Global."Normalize Interval"(TobaccoUseScreening.effective)overlaps "Measurement Period" sort by start of Global."Normalize Interval"(effective) )) MostRecentTobaccoUseScreening where MostRecentTobaccoUseScreening.value in "Tobacco User"
// MedicationStatement is not available in R5, known publication issue //define "Active Pharmacotherapy for Tobacco Cessation": // ["MedicationStatement": "Tobacco Use Cessation Pharmacotherapy"] TakingCessationPharmacotherapy // where Global."Normalize Interval" ( TakingCessationPharmacotherapy.effective ) overlaps after "Measurement Period" // and TakingCessationPharmacotherapy.status in { 'active', 'completed' } define "Tobacco Cessation Counseling Given": ["Encounter": "Tobacco Use Cessation Counseling"] TobaccoCessationCounseling where TobaccoCessationCounseling.period during "Measurement Period" and TobaccoCessationCounseling.status = 'finished'
Tobacco Cessation Pharmacotherapy Ordered
define "Tobacco Cessation Pharmacotherapy Ordered": ["MedicationRequest": "Tobacco Use Cessation Pharmacotherapy"] CessationPharmacotherapyOrdered where CessationPharmacotherapyOrdered.authoredOn during "Measurement Period" and CessationPharmacotherapyOrdered.status = 'active'
define "Numerator 3": "Most Recent Tobacco Use Screening Indicates Tobacco Non User" is not null or ( "Most Recent Tobacco Use Screening Indicates Tobacco User" is not null and ( exists "Tobacco Cessation Counseling Given" or exists "Tobacco Cessation Pharmacotherapy Ordered" //or exists "Active Pharmacotherapy for Tobacco Cessation" ) )
Medical Reason for Not Screening for Tobacco Use
define "Medical Reason for Not Screening for Tobacco Use": ["Observation": "Tobacco Use Screening"] NoTobaccoUseScreening where NoTobaccoUseScreening.issued during "Measurement Period" and "Not Done"(NoTobaccoUseScreening) and "Not Done Reason in Medical Reason"(NoTobaccoUseScreening) and NoTobaccoUseScreening.status = 'final'
//or exists "Active Pharmacotherapy for Tobacco Cessation" define "Has Limited Life Expectancy": exists ( ["Condition"] LimitedLifeExpectancy where Global."Prevalence Period" ( LimitedLifeExpectancy ) overlaps after "Measurement Period" and LimitedLifeExpectancy.clinicalStatus ~ ToConcept(Global."active") )
define "Denominator Exceptions 1": exists "Medical Reason for Not Screening for Tobacco Use" or "Has Limited Life Expectancy"
define "Numerator 1": "Most Recent Tobacco Use Screening Indicates Tobacco Non User" is not null or "Most Recent Tobacco Use Screening Indicates Tobacco User" is not null
define "Numerator 2": exists "Tobacco Cessation Counseling Given" or exists "Tobacco Cessation Pharmacotherapy Ordered"
define "SDE Race": (flatten ( Patient.extension Extension where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' return Extension.extension )) E where E.url = 'ombCategory' or E.url = 'detailed' return E.value as Coding
define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end
Office Based Visit During Measurement Period
define "Office Based Visit During Measurement Period": ( ["Encounter": "Health behavior intervention, individual, face-to-face; initial 30 minutes"] union ["Encounter": "Health behavior assessment, or re-assessment (ie, health-focused clinical interview, behavioral observations, clinical decision making)"] union ["Encounter": "Home Healthcare Services"] union ["Encounter": "Occupational Therapy Evaluation"] union ["Encounter": "Office Visit"] union ["Encounter": "Ophthalmological Services"] union ["Encounter": "Physical Therapy Evaluation"] union ["Encounter": "Psych Visit - Diagnostic Evaluation"] union ["Encounter": "Psych Visit - Psychotherapy"] union ["Encounter": "Psychoanalysis"] union ["Encounter": "Speech and Hearing Evaluation"] ) OfficeBasedEncounter where OfficeBasedEncounter.period during "Measurement Period" and OfficeBasedEncounter.status = 'finished'
Preventive Visit During Measurement Period
define "Preventive Visit During Measurement Period": ( ["Encounter": "Annual Wellness Visit"] union ["Encounter": "Preventive Care Services - Established Office Visit, 18 and Up"] union ["Encounter": "Preventive Care Services - Group Counseling"] union ["Encounter": "Preventive Care Services - Other"] union ["Encounter": "Preventive Care Services-Individual Counseling"] union ["Encounter": "Preventive Care Services-Initial Office Visit, 18 and Up"] ) PreventiveEncounter where PreventiveEncounter.period during "Measurement Period" and PreventiveEncounter.status = 'finished'
define "Initial Population": exists ( ["Patient"] BirthDate where Global."CalendarAgeInYearsAt" ( FHIRHelpers.ToDate ( BirthDate.birthDate ), start of "Measurement Period" ) >= 18 ) and ( Count("Office Based Visit During Measurement Period")>= 2 or exists "Preventive Visit During Measurement Period" )
define "Denominator 3": "Initial Population"
define "Denominator 2": "Initial Population" and "Most Recent Tobacco Use Screening Indicates Tobacco User" is not null
define "SDE Payer": [Coverage: type in "Payer"] Payer return { code: Payer.type, period: Payer.period }
define "SDE Ethnicity": (flatten ( Patient.extension Extension where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' return Extension.extension )) E where E.url = 'ombCategory' or E.url = 'detailed' return E.value as Coding
define "SDE Ethnicity": SDE."SDE Ethnicity"
Medical Reason for Not Counseling Tobacco User
define "Medical Reason for Not Counseling Tobacco User": ["Procedure": "Tobacco Use Cessation Counseling"] NoTobaccoCessationCounseling where Global."Normalize Interval" ( NoTobaccoCessationCounseling.performed ) starts during "Measurement Period" and ( ( NoTobaccoCessationCounseling.status = 'not-done' and NoTobaccoCessationCounseling.statusReason in "Medical Reason" ) or ( "Not Done"(NoTobaccoCessationCounseling) and "Not Done Reason in Medical Reason"(NoTobaccoCessationCounseling) ) )
Medical Reason for Not Ordering Tobacco Cessation Pharmacotherapy
define "Medical Reason for Not Ordering Tobacco Cessation Pharmacotherapy": ["MedicationRequest": "Tobacco Use Cessation Pharmacotherapy"] NoCessationPharmacotherapyOrdered where NoCessationPharmacotherapyOrdered.authoredOn during "Measurement Period" and NoCessationPharmacotherapyOrdered.status = 'completed' and ( ( "Not Done"(NoCessationPharmacotherapyOrdered) and "Not Done Reason in Medical Reason"(NoCessationPharmacotherapyOrdered) ) or ( NoCessationPharmacotherapyOrdered.doNotPerform = true and NoCessationPharmacotherapyOrdered.statusReason in "Medical Reason" ) )
define "Denominator Exceptions 2": exists "Medical Reason for Not Counseling Tobacco User" or exists "Medical Reason for Not Ordering Tobacco Cessation Pharmacotherapy" or "Has Limited Life Expectancy"
define "Denominator Exceptions 3": exists "Medical Reason for Not Screening for Tobacco Use" or exists "Medical Reason for Not Counseling Tobacco User" or exists "Medical Reason for Not Ordering Tobacco Cessation Pharmacotherapy" or "Has Limited Life Expectancy"
define "Denominator 1": "Initial Population"
define function ToString(value string): value.value
/* @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]
define function ToString(value EncounterStatus): value.value
/* @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 }
/* @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 }
define function ToDateTime(value dateTime): value.value
define function ToString(value MedicationRequestStatus): value.value
define function ToDateTime(value instant): value.value
define function "Not Done"(res DomainResource ): if ( res R where ( "GetModiferExtension"(R, 'http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-notDone').value = true ) ) is not null then true else false
define function ToBoolean(value boolean): value.value
define function "GetModiferExtension"(res DomainResource, url String ): singleton from "GetModifierExtensions"(res, url)
define function "GetModifierExtensions"(res DomainResource, url String ): res.modifierExtension E where E.url = ( url ) return E
define function ToString(value uri): value.value
define function "Not Done Reason in Medical Reason"(res DomainResource ): if ( res R where "GetModiferExtension"(R, 'http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-notDoneReason').value in "Medical Reason" ) is not null then true else false
define function ToString(value base64Binary): value.value
define function ToString(value ObservationStatus): value.value
define function "Prevalence Period"(condition Condition): Interval[start of "Normalize Interval"(condition.onset), end of "Normalize Abatement"(condition))
define function "Normalize Abatement"(condition Condition): if condition.abatement is FHIR.dateTime then Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)] else if condition.abatement is FHIR.Period then FHIRHelpers.ToInterval(condition.abatement as FHIR.Period) else if condition.abatement is FHIR.string then Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute an interval from a String value') else if condition.abatement is FHIR.Age then Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age), FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year) else if condition.abatement is FHIR.Range then Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low), FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year) else if condition.abatement is FHIR.boolean then Interval[end of "Normalize Interval"(condition.onset), condition.recordedDate) else null
define function ToDate(value date): value.value
/* @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
/* @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
define function ToString(value AdministrativeGender): value.value
define function "CalendarAgeInYearsAt"(BirthDateTime DateTime, AsOf DateTime): years between ToDate(BirthDateTime)and ToDate(AsOf)
define function "ToDate"(Value DateTime): DateTime(year from Value, month from Value, day from Value, 0, 0, 0, 0, timezoneoffset from Value)
define function ToString(value ProcedureStatus): value.value
Code system ConditionClinicalStatusCodes
Value set Tobacco Use Cessation Counseling
Value set Tobacco Use Cessation Pharmacotherapy
Value set Occupational Therapy Evaluation
Value set Psych Visit - Diagnostic Evaluation
Value set Preventive Care Services - Established Office Visit, 18 and Up
Value set Preventive Care Services - Group Counseling
Value set Preventive Care Services - Other
Value set Preventive Care Services-Individual Counseling
Value set Preventive Care Services-Initial Office Visit, 18 and Up
Preventive Care and Screening: Tobacco Use: Screening and Cessation Intervention
HL7 International / Clinical Quality Information