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: FollowUpEvents

Official URL: http://cancerscreeningcds.github.io/crcsm-cds/Library/FollowUpEvents Version: 0.1.0
Draft as of 2025-02-28 Computable Name: FollowUpEvents
Id: FollowUpEvents
Version: 0.1.0
Url: FollowUpEvents
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/CDSConnectCommonsforFHIRv401|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/CSMCommonFunctions|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/DataElements|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/CRCSMCommonFunctions|1.0.0
  • SNOMED CT (all versions)
  • Logical Observation Identifiers, Names and Codes (LOINC)
  • CT Colonography Reporting and Data System (C-RADS)
  • CT Colonography Reporting and Data System (C-RADS)
  • 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
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1032.353
  • http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1032.326
Parameters:
NameTypeMinMaxIn/Out
ScreeningHistoryLookbackQuantity01In
PatientPatient01Out
eve-lastTestColonoscopyboolean01Out
eve-lastTestStoolboolean01Out
MostRecentStoolInconclusiveboolean01Out
eve-inconclusiveStoolTestboolean01Out
MostRecentStoolAbnormalboolean01Out
eve-abnormalStoolTestboolean01Out
eve-lastTestFlexSigboolean01Out
MostRecentFlexSigAbnormalboolean01Out
eve-abnormalFlexSigboolean01Out
eve-lastTestCTCboolean01Out
MostRecentCTCInconclusiveboolean01Out
eve-inconclusiveCTColonographyboolean01Out
MostRecentCTCAbnormalboolean01Out
eve-abnormalCTColonographyboolean01Out
eve-colonoscopyFindingCRCboolean01Out
eve-recommendedIntervalboolean01Out
eve-colonoscopyFindingPolypsboolean01Out
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 FollowUpEvents version '1.0.0'

using FHIR version '4.0.1'

include FHIRHelpers  version '4.0.1' called FHIRHelpers
include CDSConnectCommonsforFHIRv401 version '1.0.0' called C3F
include CSMCommonFunctions version '1.0.0' called Common
include DataElements version '1.0.0' called DataElements

codesystem "SNOMED-CT": 'http://snomed.info/sct'

code "Inconclusive": '419984006' from "SNOMED-CT" display 'Inconclusive (qualifier value)'
code "Invalid": '455371000124106' from "SNOMED-CT" display 'Invalid result (qualifier value)'
code "Positive": '10828004' from "SNOMED-CT" display 'Positive (qualifier value)'

context Patient

define "eve-lastTestColonoscopy":
  DataElements."de-MostRecentTestIsColonoscopy" is true

define "eve-lastTestStool":
  DataElements."de-MostRecentTestIsFOBT" is true or DataElements."de-MostRecentTestIssDNAFIT" is true

define "eve-inconclusiveStoolTest":
  MostRecentStoolInconclusive is true

define "eve-abnormalStoolTest":
  MostRecentStoolAbnormal is true

define "eve-lastTestFlexSig":
  DataElements."de-MostRecentTestIsFlexSig" is true

define "eve-abnormalFlexSig":
  MostRecentFlexSigAbnormal is true

define "eve-lastTestCTC":
  DataElements."de-MostRecentTestIsCTC" is true

define "eve-inconclusiveCTColonography":
  MostRecentCTCInconclusive is true 

define "eve-abnormalCTColonography":
  MostRecentCTCAbnormal is true 

define MostRecentStoolInconclusive:
  exists DataElements.MostRecentColorectalScreeningTestResults.results R
    where
      AnyTrue(R.coding C
        return FHIRHelpers.ToCode(C) in {
          "Inconclusive",
          "Invalid"
      })

define MostRecentStoolAbnormal:
  exists DataElements.MostRecentColorectalScreeningTestResults.results R
    where
      AnyTrue(R.coding C
        return FHIRHelpers.ToCode(C) ~ "Positive"
      )

define MostRecentFlexSigAbnormal:
  "eve-lastTestFlexSig" is true and AnyTrue({
    DataElements."de-FindingPolyps",
    DataElements."de-FindingCRC"
    })
//TODO: malignant should warrant an oncology referral. There _may_ be a follow-up colonoscopy or not, depending on obstruction, etc.

define MostRecentCTCInconclusive:
  DataElements."de-CTCInconclusive" is true

define MostRecentCTCAbnormal:
  DataElements."de-CTCFindingPolyps" is true or DataElements."de-CTCFindingCRC" is true
//TODO: malignant should warrant an oncology referral. There _may_ be a follow-up colonoscopy or not, depending on obstruction, etc.

define "eve-colonoscopyFindingCRC":
  DataElements."de-FindingCRC" is true and "eve-lastTestColonoscopy"

define "eve-recommendedInterval":
  DataElements."de-RecommendedInterval"

define "eve-colonoscopyFindingPolyps":
  "eve-lastTestColonoscopy" is true and DataElements."de-FindingPolyps" is true


Content: application/elm+xml
Encoded data (44984 characters)
Content: application/elm+json
Encoded data (79080 characters)