Skip to content

Commit

Permalink
Add Consent CQL Test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkiel committed Feb 28, 2025
1 parent 620a6ee commit 7440f95
Show file tree
Hide file tree
Showing 3 changed files with 309 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,8 @@

(testing-query "q61-encounter-class" 2)

(testing-query "q62-consent" 4)

(let [result (evaluate "q1" "subject-list")]
(testing "MeasureReport is valid"
(is (s/valid? :blaze/resource (:resource result))))
Expand Down Expand Up @@ -1201,4 +1203,4 @@

(comment
(log/set-min-level! :debug)
(evaluate "q61-encounter-class"))
(evaluate "q62-consent"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
library "q62-consent"
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'

codesystem consent_policy: 'urn:oid:2.16.840.1.113883.3.1937.777.24.5.3'

context Patient

define InInitialPopulation:
exists
from [Consent] C
where exists from C.provision.provision.code C where C ~ Code '2.16.840.1.113883.3.1937.777.24.5.3.8' from consent_policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"resource": {
"resourceType": "Patient",
"id": "0"
},
"request": {
"method": "PUT",
"url": "Patient/0"
}
},
{
"resource": {
"resourceType": "Patient",
"id": "1"
},
"request": {
"method": "PUT",
"url": "Patient/1"
}
},
{
"resource": {
"resourceType": "Patient",
"id": "2"
},
"request": {
"method": "PUT",
"url": "Patient/2"
}
},
{
"resource": {
"resourceType": "Patient",
"id": "3"
},
"request": {
"method": "PUT",
"url": "Patient/3"
}
},
{
"resource": {
"resourceType": "Patient",
"id": "4"
},
"request": {
"method": "PUT",
"url": "Patient/4"
}
},
{
"resource": {
"resourceType": "Patient",
"id": "5"
},
"request": {
"method": "PUT",
"url": "Patient/5"
}
},
{
"resource": {
"resourceType": "Consent",
"id": "0",
"patient": {
"reference": "Patient/0"
},
"provision": {
"provision": [
{
"code": [
{
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3",
"code": "2.16.840.1.113883.3.1937.777.24.5.3.8",
"display": "MDAT wissenschaftlich nutzen EU DSGVO NIVEAU"
}
]
}
]
}
]
}
},
"request": {
"method": "PUT",
"url": "Consent/0"
}
},
{
"resource": {
"resourceType": "Consent",
"id": "1",
"patient": {
"reference": "Patient/1"
},
"provision": {
"provision": [
{
"code": [
{
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3",
"code": "2.16.840.1.113883.3.1937.777.24.5.3.8",
"display": "MDAT wissenschaftlich nutzen EU DSGVO NIVEAU"
},
{
"system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3",
"code": "2.16.840.1.113883.3.1937.777.24.5.3.3",
"display": "IDAT speichern, verarbeiten"
}
]
}
]
}
]
}
},
"request": {
"method": "PUT",
"url": "Consent/1"
}
},
{
"resource": {
"resourceType": "Consent",
"id": "2",
"patient": {
"reference": "Patient/2"
},
"provision": {
"provision": [
{
"code": [
{
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3",
"code": "2.16.840.1.113883.3.1937.777.24.5.3.3",
"display": "IDAT speichern, verarbeiten"
}
]
},
{
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3",
"code": "2.16.840.1.113883.3.1937.777.24.5.3.8",
"display": "MDAT wissenschaftlich nutzen EU DSGVO NIVEAU"
}
]
}
]
}
]
}
},
"request": {
"method": "PUT",
"url": "Consent/2"
}
},
{
"resource": {
"resourceType": "Consent",
"id": "3",
"patient": {
"reference": "Patient/3"
},
"provision": {
"provision": [
{
"code": [
{
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3",
"code": "2.16.840.1.113883.3.1937.777.24.5.3.3",
"display": "IDAT speichern, verarbeiten"
}
]
}
]
},
{
"code": [
{
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3",
"code": "2.16.840.1.113883.3.1937.777.24.5.3.8",
"display": "MDAT wissenschaftlich nutzen EU DSGVO NIVEAU"
}
]
}
]
}
]
}
},
"request": {
"method": "PUT",
"url": "Consent/3"
}
},
{
"resource": {
"resourceType": "Consent",
"id": "4",
"patient": {
"reference": "Patient/4"
},
"provision": {
"provision": [
{
"code": [
{
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3",
"code": "2.16.840.1.113883.3.1937.777.24.5.3.3",
"display": "IDAT speichern, verarbeiten"
}
]
}
]
}
]
}
},
"request": {
"method": "PUT",
"url": "Consent/4"
}
},
{
"resource": {
"resourceType": "Measure",
"id": "0",
"url": "0",
"status": "active",
"subjectCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/resource-types",
"code": "Patient"
}
]
},
"library": [
"0"
],
"scoring": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/measure-scoring",
"code": "cohort"
}
]
},
"group": [
{
"population": [
{
"code": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/measure-population",
"code": "initial-population"
}
]
},
"criteria": {
"language": "text/cql-identifier",
"expression": "InInitialPopulation"
}
}
]
}
]
},
"request": {
"method": "PUT",
"url": "Measure/0"
}
}
]
}

0 comments on commit 7440f95

Please sign in to comment.