Colorectal Cancer Screening and Management (CRCSM) Clinical Decision Support (CDS) Implementation Guide
0.1.0 - ci-build

Colorectal Cancer Screening and Management (CRCSM) Clinical Decision Support (CDS) Implementation Guide - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Library: DetermineNextDueDateActions

Official URL: http://cancerscreeningcds.github.io/crcsm-cds/Library/DetermineNextDueDateActions Version: 0.1.0
Draft as of 2025-02-28 Computable Name: DetermineNextDueDateActions
Id: DetermineNextDueDateActions
Version: 0.1.0
Url: DetermineNextDueDateActions
Status: draft
Type:

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

code: logic-library

Date: 2025-02-28 21:24:30+0000
Publisher: MITRE
Related Artifacts:

Dependencies

  • http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/FHIRHelpers|4.0.1
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/DataElements|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/CSMCommonFunctions|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/CRCSMCommonFunctions|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/CDSConnectCommonsforFHIRv401|1.0.0
  • Logical Observation Identifiers, Names and Codes (LOINC)
  • SNOMED CT (all versions)
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.11.1020
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.11.1145
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1032.356
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1032.359
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.11.1097
Parameters:
NameTypeMinMaxIn/Out
ScreeningHistoryLookbackQuantity01In
PatientPatient01Out
MostRecentColorectalScreeningDatedateTime01Out
act-ColonoscopyEvery10dateTime01Out
act-FOBTEveryYeardateTime01Out
act-sDNAFITEvery1to3dateTime01Out
act-CTColonographyEvery5dateTime01Out
act-FlexSigEvery5dateTime01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient
DiagnosticReport http://hl7.org/fhir/StructureDefinition/DiagnosticReport ;;;;;; code filter:
path: code
Observation http://hl7.org/fhir/StructureDefinition/Observation ;;;;;;;;;; code filter:
path: code
Observation http://hl7.org/fhir/StructureDefinition/Observation ;;;;;;;;;;
Content: text/cql
library DetermineNextDueDateActions version '1.0.0'

using FHIR version '4.0.1'

include FHIRHelpers  version '4.0.1' called FHIRHelpers
include DataElements version '1.0.0' called DataElements

//------------------------------------------------------------------------------
// CODE SYSTEMS, VALUE SETS, AND CODES
//------------------------------------------------------------------------------

context Patient

//------------------------------------------------------------------------------
// Define Code and Timing for each test
//------------------------------------------------------------------------------

define MostRecentColorectalScreeningDate:
  DataElements.MostRecentColorectalScreeningDate

define function UpdateDueDate(screeningInterval System.Quantity):
  if MostRecentColorectalScreeningDate is not null then
    MostRecentColorectalScreeningDate + screeningInterval
  else 
    null

define function UpdateDueDate(screeningInterval System.Quantity, followupInterval System.Quantity):
  if MostRecentColorectalScreeningDate is not null then
    MostRecentColorectalScreeningDate + Min({screeningInterval, followupInterval})
  else 
    null

define "act-ColonoscopyEvery10":
  if DataElements."de-RecommendedInterval" then
    UpdateDueDate(10 years, DataElements.FollowUpIntervalFromEndoscopist)
  else UpdateDueDate(10 years)

define "act-FOBTEveryYear":
  UpdateDueDate(1 years)

// TODO: Determine Screening interval for "Every 1 to 3 years"
define "act-sDNAFITEvery1to3":
  UpdateDueDate(1 years)

define "act-CTColonographyEvery5":
  UpdateDueDate(5 years)

define "act-FlexSigEvery5":
  if DataElements."de-RecommendedInterval" then
    UpdateDueDate(5 years, DataElements.FollowUpIntervalFromEndoscopist)
  else UpdateDueDate(5 years)

//------------------------------------------------------------------------------
// Call CRCSMCommonFunctions.SetRecommendation for each test
//------------------------------------------------------------------------------

// define "act-ColonoscopyEvery10":
//   // TODO: Implement logic for act-ColonoscopyEvery10

// define "act-FOBTEveryYear":
//   // TODO: Implement logic for act-FOBTEveryYear

// define "act-sDNAFITEvery1to3":
//   // TODO: Implement logic for act-sDNAFITEvery1to3

// define "act-CTColonographyEvery5":
//   // TODO: Implement logic for act-CTColonographyEvery5

// define "act-FlexSigEvery5":
//   // TODO: Implement logic for act-FlexSigEvery5
Content: application/elm+xml
Encoded data (23732 characters)
Content: application/elm+json
Encoded data (42244 characters)