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

Id: DiabetesHemoglobinA1cHbA1cPoorControl9FHIR
Version: 0.1.0
Url: DiabetesHemoglobinA1cHbA1cPoorControl9FHIR
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2021-04-23 15:57:06+0000
Publisher: Clinical Quality Framework
Description:

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

Jurisdiction: 001
Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Measurement PeriodPeriod01In
PatientPatient01Out
SDE EthnicityCoding0*Out
SDE PayerResource0*Out
SDE RaceCoding0*Out
SDE SexCoding01Out
SDE Ageinteger01Out
Stratifier Age GroupCoding01Out
SDE State of Residencestring01Out
SDE Postal Code of Residencestring01Out
SDE Food Insecurity Risk StatusCodeableConcept01Out
Qualifying EncountersEncounter0*Out
Initial Populationboolean01Out
Denominatorboolean01Out
Denominator Exclusionsboolean01Out
Has HbA1c Lab TestObservation0*Out
Most Recent HbA1c Lab TestObservation01Out
Has Most Recent HbA1c Without Resultboolean01Out
Has Most Recent Elevated HbA1cboolean01Out
Has No Record Of HbA1cboolean01Out
Numeratorboolean01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient
Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001
Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1240
Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025
Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023
Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1016
Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1006
Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type

system: http://www.ama-assn.org/go/cpt

code: 97802

display: Medical nutrition therapy; initial assessment and intervention, individual, face-to-face with the patient, each 15 minutes

Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type

system: http://www.ama-assn.org/go/cpt

code: 97803

display: Medical nutrition therapy; re-assessment and intervention, individual, face-to-face with the patient, each 15 minutes

Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type

system: http://www.ama-assn.org/go/cpt

code: 97804

display: Medical nutrition therapy; group (2 or more individual(s)), each 30 minutes

Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type

system: http://www.cms.gov/Medicare/Coding/HCPCSReleaseCodeSets

code: G0270

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

Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type

system: http://www.cms.gov/Medicare/Coding/HCPCSReleaseCodeSets

code: G0271

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

Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080
Condition http://hl7.org/fhir/StructureDefinition/Condition ; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.103.12.1001
Observation http://hl7.org/fhir/StructureDefinition/Observation ;; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1013
Content: text/cql
/*
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")
Content: application/elm+xml
Encoded data (99988 characters)
Content: application/elm+json
Encoded data (175352 characters)