Stream: cql
Topic: at the pointy end
Erich Schulz (Jun 26 2016 at 03:18):
22 // system.interface.Retrieve({
23 // type: "Observation",
24 // typeUri: "http://hl7.org/fhir",
25 // codeProperty: 'code',
26 // codes: priv['Systolic blood pressure'](),
27 // dateProperty: 'effectiveDateTime.value',
28 // dateRange: ,
29 // patient: context.patient.id
30 // })
31
32 fhir.retrieve = function(params) {
33 var patients = params.patient_id
34 ? [params.patient_id] // wrap provided individual in []
35 : all_test_patients // no patient provided so grab all
36 // get array of resources
37 return multiPatientResourceByType(patients, params.type)
38 // apply the filter
39 .then(function (resources) {
40 debug('resources', resources)
41 return _.filter(resources, function(r) {
42 return true // all for now
43 })
44 })
45 }
Erich Schulz (Jun 26 2016 at 03:20):
lines 22 are what a call from the compiled CQL will look like
Erich Schulz (Jun 26 2016 at 03:22):
all I need to do now is apply the criteria given in lines 25-28 in a Boolean expression (to drop into line 42)
Erich Schulz (Jun 26 2016 at 03:33):
mmmm actually looking at the testdata that gives me the format i should follow...
Erich Schulz (Jun 26 2016 at 03:34):
"code":{
"coding":[{
"system":"http://loinc.org",
"code":"8310-5"
}],
"text":"Body Temperature"
},
"subject":{"reference":"Patient/105738"},
"effectiveDateTime":"2016-06-24T20:44:01+10:00",
Erich Schulz (Jun 26 2016 at 05:15):
mmm I guess I just look for an intersection between the code lists
Erich Schulz (Jun 26 2016 at 05:16):
the range thing is more complex due to uncertainty and funky range specs within cql...
Last updated: Apr 12 2022 at 19:14 UTC