Colorectal Cancer Concepts
0.1.0 - CI Build International flag

Colorectal Cancer Concepts, 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/cqf-ccc/ and changes regularly. See the Directory of published versions

Library: Colorectal Cancer Elements

Official URL: http://fhir.org/guides/cqf/ccc/Library/ColorectalCancerElements Version: 0.1.0
Active as of 2020-11-29 Computable Name: ColorectalCancerElements

Colorectal Cancer Elements

Title: Colorectal Cancer Elements
Id: ColorectalCancerElements
Version: 0.1.0
Url: Colorectal Cancer Elements
Type:

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

code: logic-library

Date: 2020-11-29 15:54:22-0700
Publisher: Clinical Quality Framework
Description:

Colorectal Cancer Elements

Knowledge Capability: shareable computable publishable executable
Knowledge Representation Level: structured
Jurisdiction: 001
Topic:
Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Measurement PeriodPeriod01In
PatientPatient01Out
AsOfdateTime01Out
Flexible Sigmoidoscopy PerformedProcedure0*Out
Flexible Sigmoidoscopy from Patient HistoryCondition0*Out
CT Colonography PerformedProcedure0*Out
Total Colectomy PerformedProcedure0*Out
Total Colectomy from Patient HistoryCondition0*Out
Fecal Occult Blood Test ResultObservation0*Out
Fecal Immunochemical Test DNA ResultObservation0*Out
Colonoscopy PerformedProcedure0*Out
Colonoscopy from Patient HistoryCondition0*Out
Active Malignant NeoplasmCondition0*Out
Fecal Occult Blood Test Result Within 1 YearObservation0*Out
Most Recent Fecal Occult Blood Test ResultObservation01Out
Fecal Immunochemical Test DNA Result Within 3 YearsObservation0*Out
Most Recent Fecal Immunochemical Test DNA ResultObservation01Out
Flexible Sigmoidoscopy Performed Within 5 YearsProcedure0*Out
Most Recent Flexible Sigmoidoscopy PerformedProcedure01Out
CT Colonography Performed Within 5 YearsProcedure0*Out
Most Recent CT Colonography PerformedProcedure01Out
Colonoscopy Performed Within 10 YearsProcedure0*Out
Most Recent Colonoscopy PerformedProcedure01Out
Has Active Malignant Neoplasmboolean01Out
Has Total Colectomy Performedboolean01Out
Has History of Total Colectomyboolean01Out
Has Appropriate Colorectal Cancer Screeningboolean01Out
Has History of Appropriate Colorectal Cancer Screeningboolean01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient
Procedure http://hl7.org/fhir/StructureDefinition/Procedure ;; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1019
Procedure http://hl7.org/fhir/StructureDefinition/Procedure ;;; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1010
Procedure http://hl7.org/fhir/StructureDefinition/Procedure ;;; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1038
Procedure http://hl7.org/fhir/StructureDefinition/Procedure ;;; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1020
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.108.12.1001
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.198.12.1019
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.198.12.1010
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.108.12.1020
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.1011
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.108.12.1039
Content: text/cql
library ColorectalCancerElements version '0.1.0'

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'
include FHIRCommon version '4.0.1' called FC

include ColorectalCancerConcepts called Cx

// QUESTION: Should this be a single timepoint, or is a period required?
//parameter AsOf DateTime default Now()

/*
NOTE: Introduced Measurement Period as the parameter here for demonstration purposes
so it will run on the current implementations.
*/
parameter "Measurement Period" Interval<DateTime>
  default Interval[Now() - 1 year, Now()]

context Patient

define AsOf:
  end of "Measurement Period"

/*
@description: Completed Flexible Sigmoidoscopy Procedures
*/
define "Flexible Sigmoidoscopy Performed":
  [Procedure: Cx."Flexible Sigmoidoscopy"] FlexibleSigmoidoscopy
		where FlexibleSigmoidoscopy.status = 'completed'

// NOTE: HEDIS version allows for a "history of" SNOMED code as FHIR.Condition. Code is present in eCQM valueset.
define "Flexible Sigmoidoscopy from Patient History":
  [Condition: Cx."Flexible Sigmoidoscopy"] FlexibleSigmoidoscopyCondition
    where FlexibleSigmoidoscopyCondition.clinicalStatus in FC."Active Condition"
      and FlexibleSigmoidoscopyCondition.verificationStatus ~ FC."confirmed"

define "CT Colonography Performed":
  [Procedure: Cx."CT Colonography"] Colonography
    where Colonography.status = 'completed'

define "Total Colectomy Performed":
  [Procedure: Cx."Total Colectomy"] Colectomy
    where Colectomy.status = 'completed'

// NOTE: HEDIS version allows for a "history of" SNOMED code as FHIR.Condition. Code is present in eCQM valueset.
define "Total Colectomy from Patient History":
  [Condition: Cx."Total Colectomy"] ColectomyCondition
    where ColectomyCondition.clinicalStatus in FC."Active Condition"
      and ColectomyCondition.verificationStatus ~ FC."confirmed"

define "Fecal Occult Blood Test Result":
  [Observation: Cx."Fecal Occult Blood Test (FOBT)"] FecalOccultResult
		where FecalOccultResult.status in {'final', 'amended', 'corrected', 'preliminary'}
			and FecalOccultResult.value is not null

define "Fecal Immunochemical Test DNA Result":
  [Observation: Cx."FIT DNA"] FitDNA
		where FitDNA.status in {'final', 'amended', 'corrected', 'preliminary'}
			and FitDNA.value is not null

define "Colonoscopy Performed":
  [Procedure: Cx."Colonoscopy"] Colonoscopy
		where Colonoscopy.status = 'completed'

// NOTE: HEDIS version allows for a "history of" SNOMED code as FHIR.Condition. Code is present in eCQM valueset.
define "Colonoscopy from Patient History":
  [Condition: Cx."Colonoscopy"] C
    where C.clinicalStatus in FC."Active Condition"
    and C.verificationStatus ~ FC."confirmed"

define "Active Malignant Neoplasm":
  [Condition: Cx."Malignant Neoplasm of Colon"] ColorectalCancer
    where ColorectalCancer.clinicalStatus in FC."Active Condition"
      and ColorectalCancer.verificationStatus ~ FC."confirmed"

define "Fecal Occult Blood Test Result Within 1 Year":
  "Fecal Occult Blood Test Result" R
    where R.issued 1 year or less on or before AsOf

define "Most Recent Fecal Occult Blood Test Result":
  MostRecent("Fecal Occult Blood Test Result", AsOf)

define "Fecal Immunochemical Test DNA Result Within 3 Years":
  "Fecal Immunochemical Test DNA Result" R
    where R.issued 3 years or less on or before AsOf

define "Most Recent Fecal Immunochemical Test DNA Result":
  MostRecent("Fecal Immunochemical Test DNA Result", AsOf)

define "Flexible Sigmoidoscopy Performed Within 5 Years":
  "Flexible Sigmoidoscopy Performed" P
    where FC.ToInterval(P.performed) ends 5 years or less on or before AsOf

define "Most Recent Flexible Sigmoidoscopy Performed":
  MostRecent("Flexible Sigmoidoscopy Performed", AsOf)

define "CT Colonography Performed Within 5 Years":
  "CT Colonography Performed" P
    where FC.ToInterval(P.performed) ends 5 years or less on or before AsOf

define "Most Recent CT Colonography Performed":
  MostRecent("CT Colonography Performed", AsOf)

define "Colonoscopy Performed Within 10 Years":
  "Colonoscopy Performed" P
    where FC.ToInterval(P.performed) ends 10 years or less on or before AsOf

define "Most Recent Colonoscopy Performed":
  MostRecent("Colonoscopy Performed", AsOf)

define "Has Active Malignant Neoplasm":
  exists (
    "Active Malignant Neoplasm" M
      where FC.ToPrevalenceInterval(M) starts on or before AsOf
  )

// NOTE: Added these two for HEDIS version.
define "Has Total Colectomy Performed":
  exists (
    PerformedWithin("Total Colectomy Performed", 1 year)
  )

define "Has History of Total Colectomy":
 exists (
    "Total Colectomy from Patient History" ColectomyHistory
      where FC.ToPrevalenceInterval(ColectomyHistory) starts on or before AsOf
  )

/*
  FOBT within 1 year
    or FIT DNA within 3 years
    or CT Colonography within 5 years
    or Flexible Sigmoidoscopy within 5 years
    or Colonoscopy within 10 years
*/
define "Has Appropriate Colorectal Cancer Screening":
  exists "Fecal Occult Blood Test Result Within 1 Year"
    or exists "Fecal Immunochemical Test DNA Result Within 3 Years"
    or exists "CT Colonography Performed Within 5 Years"
    or exists "Flexible Sigmoidoscopy Performed Within 5 Years"
    or exists "Colonoscopy Performed Within 10 Years"

// NOTE: For Condition options
define "Has History of Appropriate Colorectal Cancer Screening":
  exists (
    "Flexible Sigmoidoscopy from Patient History" FlexSigCondition
      where FC.ToPrevalenceInterval(FlexSigCondition) starts on or after day of AsOf - 5 years)
  or exists (
    "Colonoscopy from Patient History" ColonscopyCondition
      where FC.ToPrevalenceInterval(ColonscopyCondition) starts on or after day of AsOf - 10 years)

define function MostRecent(procedures List<Procedure>, asOf DateTime):
  First(
    procedures P
      sort by start of FC.ToInterval(performed)
  )

define function MostRecent(observations List<Observation>, asOf DateTime):
  First(
    observations O
      sort by issued
  )

define function IssuedWithin(observations List<Observation>, lookback System.Quantity):
  observations O
    where O.issued on or after day of AsOf - lookback

define function PerformedWithin(procedures List<Procedure>, lookback System.Quantity):
  procedures P
    where end of FC.ToInterval(P.performed) on or after day of AsOf - lookback
Content: application/elm+xml
Encoded data (138324 characters)
Content: application/elm+json
Encoded data (247412 characters)