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

Official URL: http://cancerscreeningcds.github.io/crcsm-cds/Library/DecisionToScreen Version: 0.1.0
Draft as of 2025-02-28 Computable Name: DecisionToScreen
Id: DecisionToScreen
Version: 0.1.0
Url: DecisionToScreen
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/DecisionToScreenEvents|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/DecisionToScreenActions|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/DataElements|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/IncreasedRiskExclusions|1.0.0
  • http://cancerscreeningcds.github.io/crcsm-cds/Library/USPSTFAvgRisk|1.0.0
Parameters:
NameTypeMinMaxIn/Out
PatientPatient01Out
StopScreeningAgeResource01Out
SDMContinueScreeningAgeResource01Out
SDMContinueScreeningLifeExpResource01Out
IncreasedRiskExclusionsRecommendationsResource01Out
USPSTFAverageRiskRecommendationsResource01Out
flow-DecisionToScreenResource0*Out
ExistsSDMContinueScreeningAgeboolean01Out
SDMContinueScreeningAgeCodeCoding01Out
SDMContinueScreeningAgeReasonCoding01Out
ExistsSDMContinueScreeningLifeExpboolean01Out
SDMContinueScreeningLifeExpCodeCoding01Out
SDMContinueScreeningLifeExpReasonCoding01Out
ExistsStopScreeningAgeboolean01Out
StopScreeningAgeCodeCoding01Out
StopScreeningAgeReasonCoding01Out
ExistsIncreasedRiskExclusionsRecommendationsboolean01Out
ExistsUSPSTFAverageRiskRecommendationsboolean01Out
ExistsHereditarySyndromeboolean01Out
HereditarySyndromeCodeCoding01Out
HereditarySyndromeReasonCoding01Out
ExistsIBDboolean01Out
IBDCodeCoding01Out
IBDReasonCoding01Out
ExistsHxCRCboolean01Out
HxCRCCodeCoding01Out
HxCRCReasonCoding01Out
ExistsFamilyHxboolean01Out
FamilyHxCodeCoding01Out
FamilyHxReasonCoding01Out
ExistsHxPolypsboolean01Out
HxPolypsCodeCoding01Out
HxPolypsReasonCoding01Out
ExistsUSPSTFAvgRiskboolean01Out
USPSTFAvgRiskCodeCoding01Out
USPSTFAvgRiskReasonCoding01Out
USPSTFAvgRiskTimingResource01Out
USPSTFAvgRiskTimingEventstring01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient
Content: text/cql
library DecisionToScreen version '1.0.0'

using FHIR version '4.0.1'
include FHIRHelpers  version '4.0.1' called FHIRHelpers

include DecisionToScreenEvents version '1.0.0' called Events
include DecisionToScreenActions version '1.0.0' called Actions
include DataElements version '1.0.0' called DataElements
include IncreasedRiskExclusions version '1.0.0' called IncreasedRiskExclusions
include USPSTFAvgRisk version '1.0.0' called USPSTFAvgRisk

context Patient

//------------------------------------------------------------------------------
// RECOMMENDATIONS
//------------------------------------------------------------------------------

define "flow-DecisionToScreen":  
  {
    StopScreeningAge,
    SDMContinueScreeningAge,
    SDMContinueScreeningLifeExp,
    IncreasedRiskExclusionsRecommendations,
    USPSTFAverageRiskRecommendations
  }
    except { null, {} }

define SDMContinueScreeningAge:
  if Events."eve-AgeOver76" is true
    then Actions."act-SelectivelyOfferScreening"
    else null

define SDMContinueScreeningLifeExp:
  if Events."eve-LifeExp" is true
    then Actions."act-sdmcontinuelifexp"
    else null

define StopScreeningAge:
  if Events."eve-Age86AndOlder" is true
    then Actions."act-HarmsLikelyOutweighBenefits"
    else null

define IncreasedRiskExclusionsRecommendations:
  IncreasedRiskExclusions."flow-IncreasedRiskExclusions"

define USPSTFAverageRiskRecommendations:
  if IncreasedRiskExclusionsRecommendations is null and StopScreeningAge is null
    then USPSTFAvgRisk."flow-USPSTFAvgRisk"
    else null

//------------------------------------------------------------------------------
// DYNAMIC VALUES
//------------------------------------------------------------------------------  

define ExistsSDMContinueScreeningAge:
  SDMContinueScreeningAge is not null

define SDMContinueScreeningAgeCode:
  SDMContinueScreeningAge.code

define SDMContinueScreeningAgeReason:
  SDMContinueScreeningAge.reason

define ExistsSDMContinueScreeningLifeExp:
  SDMContinueScreeningLifeExp is not null

define SDMContinueScreeningLifeExpCode:
  SDMContinueScreeningLifeExp.code  

define SDMContinueScreeningLifeExpReason:
  SDMContinueScreeningLifeExp.reason

define ExistsStopScreeningAge:
  StopScreeningAge is not null

define StopScreeningAgeCode:
  StopScreeningAge.code

define StopScreeningAgeReason:
  StopScreeningAge.reason

define ExistsIncreasedRiskExclusionsRecommendations:
  IncreasedRiskExclusionsRecommendations is not null

define ExistsUSPSTFAverageRiskRecommendations:
  USPSTFAverageRiskRecommendations is not null

//------------------------------------------------------------------------------
// DYNAMIC VALUES INCREASED RISK SCREENING/SURVEILLANCE
//------------------------------------------------------------------------------

define ExistsHereditarySyndrome:
  IncreasedRiskExclusions.ExistsHereditarySyndrome

define HereditarySyndromeCode:
  IncreasedRiskExclusions.HereditarySyndromeCode

define HereditarySyndromeReason:
  IncreasedRiskExclusions.HereditarySyndromeReason

define ExistsIBD:
  IncreasedRiskExclusions.ExistsIBD

define IBDCode:
  IncreasedRiskExclusions.IBDCode

define IBDReason:
  IncreasedRiskExclusions.IBDReason

define ExistsHxCRC:
  IncreasedRiskExclusions.ExistsHxCRC

define HxCRCCode:
  IncreasedRiskExclusions.HxCRCCode

define HxCRCReason:
  IncreasedRiskExclusions.HxCRCReason

define ExistsFamilyHx:
  IncreasedRiskExclusions.ExistsFamilyHx

define FamilyHxCode:
  IncreasedRiskExclusions.FamilyHxCode

define FamilyHxReason:
  IncreasedRiskExclusions.FamilyHxReason

define ExistsHxPolyps:
  IncreasedRiskExclusions.ExistsHxPolyps

define HxPolypsCode:
  IncreasedRiskExclusions.HxPolypsCode

define HxPolypsReason:
  IncreasedRiskExclusions.HxPolypsReason

//------------------------------------------------------------------------------
// DYNAMIC VALUES AVERAGE RISK
//------------------------------------------------------------------------------

define ExistsUSPSTFAvgRisk:
  USPSTFAvgRisk.ExistsUSPSTFAvgRisk

define USPSTFAvgRiskCode:    
  USPSTFAvgRisk.USPSTFAvgRiskCode

define USPSTFAvgRiskReason:
  USPSTFAvgRisk.USPSTFAvgRiskReason

define USPSTFAvgRiskTiming:    
  USPSTFAvgRisk.USPSTFAvgRiskTiming

define USPSTFAvgRiskTimingEvent:    
  USPSTFAvgRisk.USPSTFAvgRiskTimingEvent
Content: application/elm+xml
Encoded data (61204 characters)
Content: application/elm+json
Encoded data (106476 characters)