| 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: |
| Name | Type | Min | Max | In/Out |
| ScreeningHistoryLookback | Quantity | 0 | 1 | In |
| Patient | Patient | 0 | 1 | Out |
| eve-lastTestColonoscopy | boolean | 0 | 1 | Out |
| eve-lastTestStool | boolean | 0 | 1 | Out |
| MostRecentStoolInconclusive | boolean | 0 | 1 | Out |
| eve-inconclusiveStoolTest | boolean | 0 | 1 | Out |
| MostRecentStoolAbnormal | boolean | 0 | 1 | Out |
| eve-abnormalStoolTest | boolean | 0 | 1 | Out |
| eve-lastTestFlexSig | boolean | 0 | 1 | Out |
| MostRecentFlexSigAbnormal | boolean | 0 | 1 | Out |
| eve-abnormalFlexSig | boolean | 0 | 1 | Out |
| eve-lastTestCTC | boolean | 0 | 1 | Out |
| MostRecentCTCInconclusive | boolean | 0 | 1 | Out |
| eve-inconclusiveCTColonography | boolean | 0 | 1 | Out |
| MostRecentCTCAbnormal | boolean | 0 | 1 | Out |
| eve-abnormalCTColonography | boolean | 0 | 1 | Out |
| eve-colonoscopyFindingCRC | boolean | 0 | 1 | Out |
| eve-recommendedInterval | boolean | 0 | 1 | Out |
| eve-colonoscopyFindingPolyps | boolean | 0 | 1 | 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 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)
|
|