-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cql
37 lines (30 loc) · 2.11 KB
/
test.cql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
library HeartFailurePhenotype version '1.1.000'
using FHIR version 'R4'
valueset "Primary Heart Failure Codes 428.X in ICD9CM": '2.16.840.1.113883.3.526.2.24'
valueset "Heart Failure Mentions in Unstructured Problem List": '2.16.840.1.113883.3.526.2.24'
valueset "Heart Failure SNOMED CT Code 84114007 in Structured Problem List": '2.16.840.1.113883.3.526.2.24'
valueset "Structured Problem List Section Codes": '2.16.840.1.113883.3.526.2.24'
valueset "Unstructured Problem List Section Codes": '2.16.840.1.113883.3.526.2.24'
valueset "Clinical Notes Document Type Codes": '2.16.840.1.113883.3.526.2.24'
valueset "NLP System ConText Codes": '2.16.840.1.113883.3.526.2.24'
context Patient
define "Presence of ICD9-CM Diagnosis Codes for HF":
exists(["Condition": "Primary Heart Failure Codes 428.X in ICD9CM"])
define "Presence of SNOMED CT Code 84114007 in Structured Problem List":
exists(["Composition": "Clinical Notes Document Type Codes"] doc
where doc.section.code in ["Structured Problem List Section Codes"]
and doc.section.entry in ["Condition": "Heart Failure SNOMED CT Code 84114007 in Structured Problem List"]
)
define "Presence of Heart Failure Mentions in Unstructured Problem List":
exists(["Composition": "Clinical Notes Document Type Codes"] doc
where doc.extension.nlp_system in ["NLP System ConText Codes"]
and doc.section.code in ["Unstructured Problem List Section Codes"]
and doc.section.entry in (
["Condition": "Heart Failure Mentions in Unstructured Problem List"] mentions
where mentions.extension.certainty_modifier = 1 // only include positive mentions
)
)
define "Heart Failure Cases":
"Presence of ICD9-CM Diagnosis Codes for HF"
and ( "Presence of Heart Failure Mentions in Unstructured Problem List"
or "Presence of SNOMED CT Code 84114007 in Structured Problem List")