@@ -193,7 +193,7 @@ group D13Questions(
193
193
194
194
}
195
195
196
- group MakeObservation (
196
+ group MakeImmzObservation (
197
197
source patient : Reference,
198
198
source immid,
199
199
source code : Coding,
@@ -217,15 +217,33 @@ group MakeObservation(
217
217
} "CreateObservation";
218
218
}
219
219
220
+ group MakeObservation(
221
+ source patient : Reference,
222
+ source code : Coding,
223
+ source cat : Coding,
224
+ source value,
225
+ target bundle : Bundle ) {
226
+ value -> uuid() as oid,
227
+ bundle.entry as entry,
228
+ entry.fullUrl = append("urn:uuid:", oid),
229
+ entry.request as request,
230
+ request.method = "PUT",
231
+ request.url = append("Observation/", oid),
232
+ entry.resource = create("Observation") as obs
233
+ then {
234
+ value -> obs.id = oid "SetId";
235
+ patient -> obs.subject = patient "SetSubject";
236
+ code -> obs.code = code "SetCode";
237
+ value -> obs.value = value "SetValue";
238
+ cat -> obs.category = cat "SetCategory";
239
+ } "CreateObservation";
240
+ }
241
+
220
242
group TypeOfVaccineDose ( source typeof : Coding, target ext : Extension ) {
221
243
typeof -> ext.url = 'http://smart.who.int/immunizations/StructureDefinition/IMMZTypeOfDose' "SetURL";
222
244
typeof -> ext.value = typeof "SetValue";
223
245
}
224
246
225
- group VaccineBrand( source value : Coding, target ext : Extension ) {
226
-
227
- }
228
-
229
247
group MakeImmunization(
230
248
source patient : Reference,
231
249
source immid,
@@ -310,31 +328,31 @@ group D1andD13Observations(
310
328
311
329
immz.birthDose as content ->
312
330
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE263', 'Birth dose') as code
313
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "birthDose";
331
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "birthDose";
314
332
315
333
immz.completedThePrimaryVaccinationSeries as content ->
316
334
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE203', 'Completed the primary vaccination series') as code
317
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "completedThePrimaryVaccinationSeries";
335
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "completedThePrimaryVaccinationSeries";
318
336
319
337
immz.completedTheBoosterSeries as content ->
320
338
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE257', 'Completed the booster series') as code
321
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "completedTheBoosterSeries";
339
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "completedTheBoosterSeries";
322
340
323
341
immz.dateWhenPrimaryVaccinationSeriesWasCompleted as content ->
324
342
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE242', 'Date when primary vaccination series was completed') as code
325
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "dateWhenPrimaryVaccinationSeriesWasCompleted";
343
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "dateWhenPrimaryVaccinationSeriesWasCompleted";
326
344
327
345
immz.hivStatus as content ->
328
346
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE204', 'HIV status') as code
329
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "hivStatus";
347
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "hivStatus";
330
348
331
349
immz.contactDate as content ->
332
350
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE201', 'Contact date') as code
333
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "contactDate";
351
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "contactDate";
334
352
335
353
immz.ancContactNumber as content ->
336
354
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE202', 'ANC contact number') as code
337
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "ancContactNumber";
355
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "ancContactNumber";
338
356
339
357
} "DefineCategory";
340
358
@@ -349,62 +367,62 @@ group D1Observations(
349
367
immz -> c( 'http://terminology.hl7.org/CodeSystem/observation-category', 'survey', 'Survey' ) as survey then {
350
368
immz.pretermBirth as content ->
351
369
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE208', 'Preterm birth') as code
352
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "pretermBirth";
370
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "pretermBirth";
353
371
354
372
immz.immunocompromised as content ->
355
373
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE209', 'Immunocompromised') as code
356
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "immunocompromised";
374
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "immunocompromised";
357
375
358
376
immz.currentlyOnArt as content ->
359
377
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE210', 'Currently on ART') as code
360
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "currentlyOnArt";
378
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "currentlyOnArt";
361
379
362
380
immz.typeOfTbInfectionTestPerformed as content ->
363
381
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE243', 'Type of TB infection test performed') as code
364
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "typeOfTbInfectionTestPerformed";
382
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "typeOfTbInfectionTestPerformed";
365
383
366
384
immz.tbInfectionTestResult as content ->
367
385
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE246', 'TB infection test result') as code
368
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "tbInfectionTestResult";
386
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "tbInfectionTestResult";
369
387
370
388
immz.immunologicallyStable as content ->
371
389
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE249', 'Immunologically stable') as code
372
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "immunologicallyStable";
390
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "immunologicallyStable";
373
391
374
392
immz.clinicallyWell as content ->
375
393
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE250', 'Clinically well') as code
376
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "clinicallyWell";
394
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "clinicallyWell";
377
395
378
396
immz.birthWeightInGrams as value -> create("Quantity") as content, content.system = 'http://unitsofmeasure.org', content.code = 'g', content.unit = 'g', content.value = value,
379
397
c( 'http://loinc.org', '8339-4', 'Birth weight Measured') as bwloinc,
380
398
c( 'http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE211', 'Birth weight in grams') as bwdak,
381
399
create("CodeableConcept") as code, code.coding = bwloinc, code.coding = bwdak,
382
400
c( 'http://terminology.hl7.org/CodeSystem/observation-category', 'vital-signs', 'Vital Signs' ) as vital
383
- then MakeObservation ( patient, immid, code, vital, content, bundle ) "birthWeightInGrams";
401
+ then MakeImmzObservation ( patient, immid, code, vital, content, bundle ) "birthWeightInGrams";
384
402
385
403
immz.artStartDate as content ->
386
404
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE215', 'ART start date') as code
387
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "artStartDate";
405
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "artStartDate";
388
406
389
407
immz.highRiskOfPneumococcalInfection as content ->
390
408
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE251', 'High risk of pneumococcal infection') as code
391
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "highRiskOfPneumococcalInfection";
409
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "highRiskOfPneumococcalInfection";
392
410
393
411
immz.ageInMonthsWhenClientReceivedFirstMeningococcalDose as value -> create("Quantity") as content, content.unit = 'mo', content.value = value,
394
412
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE236', 'Age in months when client received first meningococcal dose') as code
395
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "ageInMonthsWhenClientReceivedFirstMeningococcalDose";
413
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "ageInMonthsWhenClientReceivedFirstMeningococcalDose";
396
414
397
415
immz.vnaLevel as value -> create("Quantity") as content, content.system = 'http://unitsofmeasure.org', content.code = '[IU]/mL', content.unit = '[IU]/mL', content.value = value,
398
416
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE240', 'VNA level') as code
399
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "vnaLevel";
417
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "vnaLevel";
400
418
401
419
immz.riskOfOccupationalExposureToRabiesVirus as content ->
402
420
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE253', 'Risk of occupational exposure to rabies virus') as code
403
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "riskOfOccupationalExposureToRabiesVirus";
421
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "riskOfOccupationalExposureToRabiesVirus";
404
422
405
423
immz.dengueSerostatus as content ->
406
424
c('http://smart.who.int/immunizations/CodeSystem/IMMZ.D', 'DE241', 'Dengue serostatus') as code
407
- then MakeObservation ( patient, immid, code, survey, content, bundle ) "dengueSerostatus";
425
+ then MakeImmzObservation ( patient, immid, code, survey, content, bundle ) "dengueSerostatus";
408
426
409
427
} "DefineCategory";
410
428
}
0 commit comments