forked from cqframework/cqf-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Exercises06.cql
77 lines (63 loc) · 2.13 KB
/
Exercises06.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
Data Access
Unqualified Retrieve
Retrieve w/ Default Primary Code Path
Retrieve w/ Specified Code Path
Retrieve w/ Code
Retrieve w/ ValueSet
Retrieve w/ SearchPath
*/
library Exercises06
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'
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'
// Act Codes
code "Inpatient Encounter": 'IMP' from "ActCode" display 'Inpatient Encounter'
context Patient
/*
Write a definition to retrieve Encounters
Use the FHIR [Encounter](http://hl7.org/fhir/encounter.html)
*/
define "Encounters":
[Encounter]
/*
Write a definition to retrieve Inpatient Encounters
Use the FHIR [Encounter](http://hl7.org/fhir/encounter.html)
*/
define "Inpatient Encounters":
[Encounter: class ~ "Inpatient Encounter"]
/*
Write a definition to retrieve Medication Requests
Use the FHIR [MedicationRequest](http://hl7.org/fhir/medicationrequest.html)
*/
define "Medication Requests":
[MedicationRequest]
/*
Write a definition to retrieve Community Medication Requests
Use the FHIR [MedicationRequest](http://hl7.org/fhir/medicationrequest.html)
*/
define "Community Medication Requests":
[MedicationRequest: category in "Community Medication"]
/*
Write a definition to retrieve all Observations
Use the FHIR [Observation](http://hl7.org/fhir/observation.html)
*/
define "Observations":
[Observation]
/*
Write a definition to retrieve all vital signs
Use the FHIR [Observation](http://hl7.org/fhir/observation.html)
*/
define "Vital Signs":
[Observation: category in "Vital Sign"]
/*
Write a definition to retrieve all laboratory results
Use the FHIR [Observation](http://hl7.org/fhir/observation.html)
*/
define "Laboratory Results":
[Observation: category in "Laboratory"]