forked from cqframework/cqf-exercises
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Exercises07.cql
55 lines (42 loc) · 1.43 KB
/
Exercises07.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Queries
Query Structure
Filtering with Where
With Relationships
Without Relationships
Shaping Results with Return
Ordering Results with Sort
*/
library Exercises07
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'
codesystem "LOINC": 'http://loinc.org'
codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
codesystem "MedicationRequestCategory": 'http://terminology.hl7.org/CodeSystem/medicationrequest-category'
codesystem "ObservationCategory": 'http://terminology.hl7.org/CodeSystem/observation-category'
valueset "Community Medication": 'http://example.org/fhir/ValueSet/community-medication'
valueset "Vital Sign": 'http://example.org/fhir/ValueSet/vital-sign'
valueset "Laboratory": 'http://example.org/fhir/ValueSet/laboratory'
code "Blood Glucose": '2339-0' from "LOINC" display 'Glucose Bld-mCnc'
// Act Codes
code "Inpatient Encounter": 'IMP' from "ActCode" display 'Inpatient Encounter'
context Patient
/*
Write a query to return only Laboratory results that are final or
amended and have a quantitative result
*/
/*
Write a query to return encounters that have a quantitative laboratory result
during the encounter
*/
/*
Write a query to return encounters that did not have a procedure performed
during the encounter
*/
/*
Write a query to return the most recent blood glucose observation
*/
/*
Write a definition that returns the difference between the two most recent
blood glucose observations
*/