| Id: |
FollowUp |
| Version: |
0.1.0 |
| Url: |
FollowUp |
| 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/FollowUpEvents|1.0.0
http://cancerscreeningcds.github.io/crcsm-cds/Library/FollowUpActions|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
http://cancerscreeningcds.github.io/crcsm-cds/Library/CSMCommonFunctions|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)
- 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: |
| Name | Type | Min | Max | In/Out |
| ScreeningHistoryLookback | Quantity | 0 | 1 | In |
| Patient | Patient | 0 | 1 | Out |
| ColonoscopyCRC | Resource | 0 | 1 | Out |
| ColonoscopyPolyps | Resource | 0 | 1 | Out |
| HasEndoscopistRecommendation | Resource | 0 | 1 | Out |
| FollowUpColonoscopy | Resource | 0 | 1 | Out |
| FollowUpStoolTest | Resource | 0 | 1 | Out |
| FollowUpFlexSig | Resource | 0 | 1 | Out |
| FollowUpCTColonography | Resource | 0 | 1 | Out |
| flow-FollowUp | Resource | 0 | * | Out |
| ExistsFollowupColonoscopyCRCResult | boolean | 0 | 1 | Out |
| FollowupColonoscopyCRCResultCode | Coding | 0 | 1 | Out |
| FollowupColonoscopyCRCResultReason | Coding | 0 | 1 | Out |
| FollowupColonoscopyCRCResultTiming | Resource | 0 | 1 | Out |
| FollowupColonoscopyCRCResultTimingEvent | string | 0 | 1 | Out |
| FollowupColonoscopyCRCResultFlag | Resource | 0 | * | Out |
| ExistsFollowupColonoscopyPolypResult | boolean | 0 | 1 | Out |
| FollowupColonoscopyPolypResultCode | Coding | 0 | 1 | Out |
| FollowupColonoscopyPolypResultReason | Coding | 0 | 1 | Out |
| FollowupColonoscopyPolypResultTiming | Resource | 0 | 1 | Out |
| FollowupColonoscopyPolypResultTimingEvent | string | 0 | 1 | Out |
| FollowupColonoscopyPolypResultFlag | Resource | 0 | * | Out |
| ExistsFollowupCTCInconclusiveResult | boolean | 0 | 1 | Out |
| FollowupCTCInconclusiveResultCode | Coding | 0 | 1 | Out |
| FollowupCTCInconclusiveResultReason | Coding | 0 | 1 | Out |
| FollowupCTCInconclusiveResultTiming | Resource | 0 | 1 | Out |
| FollowupCTCInconclusiveResultTimingEvent | string | 0 | 1 | Out |
| FollowupCTCInconclusiveResultFlag | Resource | 0 | * | Out |
| ExistsFollowupCTCAbnormalResult | boolean | 0 | 1 | Out |
| FollowupCTCAbnormalResultCode | Coding | 0 | 1 | Out |
| FollowupCTCAbnormalResultReason | Coding | 0 | 1 | Out |
| FollowupCTCAbnormalResultTiming | Resource | 0 | 1 | Out |
| FollowupCTCAbnormalResultTimingEvent | string | 0 | 1 | Out |
| FollowupCTCAbnormalResultFlag | Resource | 0 | * | Out |
| ExistsFollowupStoolInconclusiveResult | boolean | 0 | 1 | Out |
| FollowupStoolInconclusiveResultCode | Coding | 0 | 1 | Out |
| FollowupStoolInconclusiveResultReason | Coding | 0 | 1 | Out |
| FollowupStoolInconclusiveResultTiming | Resource | 0 | 1 | Out |
| FollowupStoolInconclusiveResultTimingEvent | string | 0 | 1 | Out |
| FollowupStoolInconclusiveResultFlag | Resource | 0 | * | Out |
| ExistsFollowupStoolAbnormalResult | boolean | 0 | 1 | Out |
| FollowupStoolAbnormalResultCode | Coding | 0 | 1 | Out |
| FollowupStoolAbnormalResultReason | Coding | 0 | 1 | Out |
| FollowupStoolAbnormalResultTiming | Resource | 0 | 1 | Out |
| FollowupStoolAbnormalResultTimingEvent | string | 0 | 1 | Out |
| FollowupStoolAbnormalResultFlag | Resource | 0 | * | Out |
| ExistsFollowupFlexSigAbnormalResult | boolean | 0 | 1 | Out |
| FollowupFlexSigAbnormalResultCode | Coding | 0 | 1 | Out |
| FollowupFlexSigAbnormalResultReason | Coding | 0 | 1 | Out |
| FollowupFlexSigAbnormalResultTiming | Resource | 0 | 1 | Out |
| FollowupFlexSigAbnormalResultTimingEvent | string | 0 | 1 | Out |
| FollowupFlexSigAbnormalResultFlag | Resource | 0 | * | Out |
|
| Data Requirements: |
| Type | Profile | MS | Code 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 FollowUp version '1.0.0'
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1' called FHIRHelpers
include FollowUpEvents version '1.0.0' called Events
include FollowUpActions version '1.0.0' called Actions
include DataElements version '1.0.0' called DataElements
include CRCSMCommonFunctions version '1.0.0' called CRCSMCommon
context Patient
//------------------------------------------------------------------------------
// RECOMMENDATIONS
//------------------------------------------------------------------------------
define "flow-FollowUp":
{
FollowUpColonoscopy,
FollowUpStoolTest,
FollowUpFlexSig,
FollowUpCTColonography
}
except { null }
define FollowUpStoolTest:
if Events."eve-lastTestStool" is true then
if Events."eve-inconclusiveStoolTest" is true then
Actions."act-repeatScreening" // TODO: (not in L2): check for pending order of any test?
else if Events."eve-abnormalStoolTest" is true then
Actions."act-FollowUpColonoscopy"
else
null
else null
define FollowUpFlexSig:
if Events."eve-lastTestFlexSig" is true then
if Events."eve-abnormalFlexSig" is true then
Actions."act-FollowUpColonoscopy"
else null
else null
// TODO: (not in L2): split abnormal and malignant findings. Malignant -> oncology referral
// TODO: (not in L2): add check for recommended interval from endoscopist when no abnormal findings?
// TODO: (not in L2): add repeat testing/consult with endoscopist for inconclusive flex sig?
// TODO: (not in L2): add explicit normal finding?
define FollowUpCTColonography:
if Events."eve-lastTestCTC" is true then
if Events."eve-inconclusiveCTColonography" then
Actions."act-repeatScreening" // TODO: (not in L2): check for pending order of any test?
else if Events."eve-abnormalCTColonography" then
Actions."act-FollowUpColonoscopy"
else
null
else null
// TODO: split abnormal and malignant findings. Malignant -> oncology referral (or surgery referral per radiology guidelines)
// TODO: add check for recommended interval from radiologist when no abnormal findings? Prep can be an issue here too.
// TODO: (not in L2): add explicit normal finding?
define FollowUpColonoscopy:
if Events."eve-lastTestColonoscopy" is not true then null
else if ColonoscopyCRC is not null then ColonoscopyCRC
else if HasEndoscopistRecommendation is not null then HasEndoscopistRecommendation
else null
define ColonoscopyCRC:
if Events."eve-colonoscopyFindingCRC" is true
then Actions."act-oncologyReferral"
else null
define HasEndoscopistRecommendation:
if Events."eve-recommendedInterval" is false
then ColonoscopyPolyps
else null
define ColonoscopyPolyps:
if Events."eve-colonoscopyFindingPolyps" is true
then Actions."act-followUpColonoscopist"
else null
//------------------------------------------------------------------------------
// DYNAMIC VALUES
//------------------------------------------------------------------------------
//Colonoscopy
define ExistsFollowupColonoscopyCRCResult:
ColonoscopyCRC is not null
define FollowupColonoscopyCRCResultCode:
ColonoscopyCRC R return R.code
define FollowupColonoscopyCRCResultReason:
ColonoscopyCRC R return R.reason
define FollowupColonoscopyCRCResultTiming:
ColonoscopyCRC R return R.timingTiming
define FollowupColonoscopyCRCResultTimingEvent:
FollowupColonoscopyCRCResultTiming R return First(R.event)
define FollowupColonoscopyCRCResultFlag:
ColonoscopyCRC R return CRCSMCommon.CreateRecommendationFlagExtension(R.flag)
define ExistsFollowupColonoscopyPolypResult:
ColonoscopyPolyps is not null
define FollowupColonoscopyPolypResultCode:
ColonoscopyPolyps R return R.code
define FollowupColonoscopyPolypResultReason:
ColonoscopyPolyps R return R.reason
define FollowupColonoscopyPolypResultTiming:
ColonoscopyPolyps R return R.timingTiming
define FollowupColonoscopyPolypResultTimingEvent:
FollowupColonoscopyPolypResultTiming R return First(R.event)
define FollowupColonoscopyPolypResultFlag:
ColonoscopyPolyps R return CRCSMCommon.CreateRecommendationFlagExtension(R.flag)
//CTC
define ExistsFollowupCTCInconclusiveResult:
Events."eve-inconclusiveCTColonography" is true and FollowUpCTColonography is not null
define FollowupCTCInconclusiveResultCode:
FollowUpCTColonography R return R.code
define FollowupCTCInconclusiveResultReason:
FollowUpCTColonography R return R.reason
define FollowupCTCInconclusiveResultTiming:
FollowUpCTColonography R return R.timingTiming
define FollowupCTCInconclusiveResultTimingEvent:
FollowupCTCInconclusiveResultTiming R return First(R.event)
define FollowupCTCInconclusiveResultFlag:
FollowUpCTColonography R return CRCSMCommon.CreateRecommendationFlagExtension(R.flag)
define ExistsFollowupCTCAbnormalResult:
Events."eve-abnormalCTColonography" is true and FollowUpCTColonography is not null
define FollowupCTCAbnormalResultCode:
FollowUpCTColonography R return R.code
define FollowupCTCAbnormalResultReason:
FollowUpCTColonography R return R.reason
define FollowupCTCAbnormalResultTiming:
FollowUpCTColonography R return R.timingTiming
define FollowupCTCAbnormalResultTimingEvent:
FollowupCTCAbnormalResultTiming R return First(R.event)
define FollowupCTCAbnormalResultFlag:
FollowUpCTColonography R return CRCSMCommon.CreateRecommendationFlagExtension(R.flag)
//stool test
define ExistsFollowupStoolInconclusiveResult:
Events."eve-inconclusiveStoolTest" is true and FollowUpStoolTest is not null
define FollowupStoolInconclusiveResultCode:
FollowUpStoolTest R return R.code
define FollowupStoolInconclusiveResultReason:
FollowUpStoolTest R return R.reason
define FollowupStoolInconclusiveResultTiming:
FollowUpStoolTest R return R.timingTiming
define FollowupStoolInconclusiveResultTimingEvent:
FollowupStoolInconclusiveResultTiming R return First(R.event)
define FollowupStoolInconclusiveResultFlag:
FollowUpStoolTest R return CRCSMCommon.CreateRecommendationFlagExtension(R.flag)
define ExistsFollowupStoolAbnormalResult:
Events."eve-abnormalStoolTest" is true and FollowUpStoolTest is not null
define FollowupStoolAbnormalResultCode:
FollowUpStoolTest R return R.code
define FollowupStoolAbnormalResultReason:
FollowUpStoolTest R return R.reason
define FollowupStoolAbnormalResultTiming:
FollowUpStoolTest R return R.timingTiming
define FollowupStoolAbnormalResultTimingEvent:
FollowupStoolAbnormalResultTiming R return First(R.event)
define FollowupStoolAbnormalResultFlag:
FollowUpStoolTest R return CRCSMCommon.CreateRecommendationFlagExtension(R.flag)
//flex sig
define ExistsFollowupFlexSigAbnormalResult:
Events."eve-abnormalFlexSig" is true and FollowUpFlexSig is not null
define FollowupFlexSigAbnormalResultCode:
FollowUpFlexSig R return R.code
define FollowupFlexSigAbnormalResultReason:
FollowUpFlexSig R return R.reason
define FollowupFlexSigAbnormalResultTiming:
FollowUpFlexSig R return R.timingTiming
define FollowupFlexSigAbnormalResultTimingEvent:
FollowupFlexSigAbnormalResultTiming R return First(R.event)
define FollowupFlexSigAbnormalResultFlag:
FollowUpFlexSig R return CRCSMCommon.CreateRecommendationFlagExtension(R.flag)
|
|
| Content: application/elm+xml |
Encoded data (166056 characters)
|
|
| Content: application/elm+json |
Encoded data (300512 characters)
|
|