Chronic Disease Surveillance
0.1.0 - CI Build International flag

Chronic Disease Surveillance, published by Clinical Quality Framework. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/aphl-chronic-ig/ and changes regularly. See the Directory of published versions

Library: DiabetesHemoglobinA1cHbA1cPoorControl9FHIR

Official URL: http://fhir.org/guides/cqf/aphl/chronic-ds/Library/DiabetesHemoglobinA1cHbA1cPoorControl9FHIR Version: 0.1.0
Active as of 2021-04-23 Computable Name: DiabetesHemoglobinA1cHbA1cPoorControl9FHIR

Diabetes: Hemoglobin A1c (HbA1c) Poor Control (> 9%)FHIR

Metadata
Version 0.1.0
Jurisdiction 001 from http://unstats.un.org/unsd/methods/m49/m49.htm
Steward (Publisher) Clinical Quality Framework
Description

Diabetes: Hemoglobin A1c (HbA1c) Poor Control (> 9%)FHIR

Type logic-library from http://terminology.hl7.org/CodeSystem/library-type
Parameter Name: Measurement Period
Use: In
Min Cardinality: 0
Max Cardinality: 1
Type: Period
Parameter Name: Patient
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Patient
Parameter Name: SDE Ethnicity
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Coding
Parameter Name: SDE Payer
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Race
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Coding
Parameter Name: SDE Sex
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Coding
Parameter Name: SDE Age
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: integer
Parameter Name: Stratifier Age Group
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Coding
Parameter Name: SDE State of Residence
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: string
Parameter Name: SDE Postal Code of Residence
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: string
Parameter Name: SDE Food Insecurity Risk Status
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: CodeableConcept
Parameter Name: Qualifying Encounters
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Encounter
Parameter Name: Initial Population
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: Denominator
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: Denominator Exclusions
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: Has HbA1c Lab Test
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Observation
Parameter Name: Most Recent HbA1c Lab Test
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Observation
Parameter Name: Has Most Recent HbA1c Without Result
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: Has Most Recent Elevated HbA1c
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: Has No Record Of HbA1c
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: Numerator
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Data Requirement Type: Patient
Profile(s): Patient
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: 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-Initial Office Visit, 18 and Up
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: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1006
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, period, status
Code Filter(s):
Path: type
Code(s): Current Procedural Terminology (CPT®) 97802: Medical nutrition therapy; initial assessment and intervention, individual, face-to-face with the patient, each 15 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®) 97803: Medical nutrition therapy; re-assessment and intervention, individual, face-to-face with the patient, each 15 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®) 97804: Medical nutrition therapy; group (2 or more individual(s)), each 30 minutes
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, period, status
Code Filter(s):
Path: type
Code(s): Healthcare Common Procedure Coding System (HCPCS) level II alphanumeric codes G0270: Medical nutrition therapy; reassessment and subsequent intervention(s) following second referral in same year for change in diagnosis, medical condition or treatment regimen (including additional hours needed for renal disease), individual, face to face with the patient, each 15 minutes
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, period, status
Code Filter(s):
Path: type
Code(s): Healthcare Common Procedure Coding System (HCPCS) level II alphanumeric codes G0271: Medical nutrition therapy, reassessment and subsequent intervention(s) following second referral in same year for change in diagnosis, medical condition, or treatment regimen (including additional hours needed for renal disease), group (2 or more individuals), each 30 minutes
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, period, status
Code Filter(s):
Path: type
ValueSet: Telephone Visits
Data Requirement Type: Condition
Profile(s): Condition
Must Support Elements: code
Code Filter(s):
Path: code
ValueSet: Diabetes
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, effective
Code Filter(s):
Path: code
ValueSet: HbA1c Laboratory Test
Library Content
CQL Content
/*
FHIR Translation of CMS122: Diabetes: HemoglobinA1c Poor Control
*/
library DiabetesHemoglobinA1cHbA1cPoorControl9FHIR version '0.0.001'

using FHIR version '4.0.1'

include FHIRHelpers version '4.1.000' called FHIRHelpers
include SupplementalDataElementsFHIR4 version '2.0.000' called SDE
include MATGlobalCommonFunctionsFHIR4 version '6.0.000' called Global
include AdultOutpatientEncountersFHIR4 version '2.0.000' called AdultOutpatientEncounters
include HospiceFHIR4 version '2.0.000' called Hospice
include AdvancedIllnessandFrailtyExclusionECQMFHIR4 version '5.12.000' called Frailty
include SurveillanceDataElementsFHIR4 version '1.0.000' called SurveillanceDataElements
include AlphoraCommon called AC
include PalliativeCareFHIR called PalliativeCare
include FHIRCommon version '1.1.000' called FC 

codesystem "LOINC": 'http://loinc.org'
codesystem "HCPCS": 'http://www.cms.gov/Medicare/Coding/HCPCSReleaseCodeSets'
codesystem "CPT": 'http://www.ama-assn.org/go/cpt'
codesystem "ObservationCategoryCodes": 'http://terminology.hl7.org/CodeSystem/observation-category'

valueset "Diabetes": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.103.12.1001'
valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837'
valueset "HbA1c Laboratory Test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1013'
valueset "Annual Wellness Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240'
valueset "Home Healthcare Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016'
valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001'
valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025'
valueset "Preventive Care Services - Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023'
valueset "Nutrition Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1006'
valueset "Telephone Visits": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080'

code "Medical nutrition therapy, reassessment and subsequent intervention(s) following second referral in same year for change in diagnosis, medical condition, or treatment regimen (including additional hours needed for renal disease), group (2 or more individuals), each 30 minutes": 'G0271' from "HCPCS" display 'Medical nutrition therapy, reassessment and subsequent intervention(s) following second referral in same year for change in diagnosis, medical condition, or treatment regimen (including additional hours needed for renal disease), group (2 or more individuals), each 30 minutes'
code "Medical nutrition therapy; group (2 or more individual(s)), each 30 minutes": '97804' from "CPT" display 'Medical nutrition therapy; group (2 or more individual(s)), each 30 minutes'
code "Medical nutrition therapy; initial assessment and intervention, individual, face-to-face with the patient, each 15 minutes": '97802' from "CPT" display 'Medical nutrition therapy; initial assessment and intervention, individual, face-to-face with the patient, each 15 minutes'
code "Medical nutrition therapy; re-assessment and intervention, individual, face-to-face with the patient, each 15 minutes": '97803' from "CPT" display 'Medical nutrition therapy; re-assessment and intervention, individual, face-to-face with the patient, each 15 minutes'
code "Medical nutrition therapy; reassessment and subsequent intervention(s) following second referral in same year for change in diagnosis, medical condition or treatment regimen (including additional hours needed for renal disease), individual, face to face with the patient, each 15 minutes": 'G0270' from "HCPCS" display 'Medical nutrition therapy; reassessment and subsequent intervention(s) following second referral in same year for change in diagnosis, medical condition or treatment regimen (including additional hours needed for renal disease), individual, face to face with the patient, each 15 minutes'
code "laboratory": 'laboratory' from "ObservationCategoryCodes" display 'laboratory'
code "Birth date": '21112-8' from "LOINC" display 'Birth date'

parameter "Measurement Period" default Interval[@2025-01-01T00:00:00.0, @2026-01-01T00:00:00.0)

context Patient

define "SDE Ethnicity":
  SDE."SDE Ethnicity"

define "SDE Payer":
  SDE."SDE Payer"

define "SDE Race":
  SDE."SDE Race"

define "SDE Sex":
  SDE."SDE Sex"

define "SDE Age":
  SurveillanceDataElements."Age"

define "Stratifier Age Group":
  SurveillanceDataElements."Age Group"

define "SDE State of Residence":
  SurveillanceDataElements."State of Residence"

define "SDE Postal Code of Residence":
  SurveillanceDataElements."Postal Code of Residence"

define "SDE Food Insecurity Risk Status":
  SurveillanceDataElements."Food Insecurity Risk Status"

define "Initial Population":
  AgeInYearsAt(end of "Measurement Period") in Interval[18, 75]
    and exists("Qualifying Encounters")
    and exists( (AC.QualifiedConditions([Condition: "Diabetes"])) Diabetes
      where FC.ToPrevalenceInterval(Diabetes) overlaps "Measurement Period" )

define "Qualifying Encounters":
  (
    [Encounter: "Office Visit"]
	    union [Encounter: "Annual Wellness Visit"]
	    union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"]
      union [Encounter: "Preventive Care Services - Initial Office Visit, 18 and Up"]
      union [Encounter: "Home Healthcare Services"]
      union [Encounter: "Nutrition Services"]
      union [Encounter: "Medical nutrition therapy; initial assessment and intervention, individual, face-to-face with the patient, each 15 minutes"]
      union [Encounter: "Medical nutrition therapy; re-assessment and intervention, individual, face-to-face with the patient, each 15 minutes"]
      union [Encounter: "Medical nutrition therapy; group (2 or more individual(s)), each 30 minutes"]
      union [Encounter: "Medical nutrition therapy; reassessment and subsequent intervention(s) following second referral in same year for change in diagnosis, medical condition or treatment regimen (including additional hours needed for renal disease), individual, face to face with the patient, each 15 minutes"]
      union [Encounter: "Medical nutrition therapy, reassessment and subsequent intervention(s) following second referral in same year for change in diagnosis, medical condition, or treatment regimen (including additional hours needed for renal disease), group (2 or more individuals), each 30 minutes"]
      union [Encounter: "Telephone Visits"]
  ) ValidEncounters
    where ValidEncounters.period during "Measurement Period"
	  and ValidEncounters.status ~ 'finished'

define "Denominator":
  "Initial Population"

define "Denominator Exclusions":
  Hospice."Has Hospice"
    or Frailty."Is Age 66 or Older Living Long Term in a Nursing Home"
    or Frailty."Is Age 66 or Older with Advanced Illness and Frailty"
    or PalliativeCare."Palliative Care in the Measurement Period"

define "Numerator":
  "Has Most Recent HbA1c Without Result"
    or "Has Most Recent Elevated HbA1c"
    or "Has No Record Of HbA1c"

define "Has HbA1c Lab Test":
  (AC.LaboratoryObservation([Observation: "HbA1c Laboratory Test"]))

define "Most Recent HbA1c Lab Test":
  AC.MostRecent("Has HbA1c Lab Test" HbA1cTest
    where FC.ToInterval(HbA1cTest.effective) during "Measurement Period")

define "Has Most Recent Elevated HbA1c":
  "Most Recent HbA1c Lab Test".value >= 9 '%'

define "Has Most Recent HbA1c Without Result":
  ("Most Recent HbA1c Lab Test" is not null)
    and ("Most Recent HbA1c Lab Test".value is null)

define "Has No Record Of HbA1c":
  not exists("Has HbA1c Lab Test")
ELM XML Content
Encoded data (99988 characters)
ELM JSON Content
Encoded data (175352 characters)
Generated using version 0.5.1-cibuild of the sample-content-ig Liquid templates