forked from WorldHealthOrganization/smart-example-immz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated patient-register structure-maps
- Loading branch information
Showing
3 changed files
with
24 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,22 @@ | ||
map "http://smart.who.int/ig/smart-immunizations-measles/StructureMap/IMMZCQRToPatient" = "IMMZCQRToPatient" | ||
map "http://smart.who.int/ig/smart-immunizations-measles/StructureMap/ee569d2c-3299-4a0d-bd5d-4f88af814ecd" = "IMMZCQRToPatient" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source | ||
uses "http://smart.who.int/ig/smart-immunizations-measles/StructureDefinition/IMMZCRegisterClient" alias IMMZC as source | ||
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target | ||
uses "http://hl7.org/fhir/StructureDefinition/Bundle" as target | ||
|
||
imports "http://smart.who.int/ig/smart-immunizations-measles/StructureMap/IMMZCQRToLM" | ||
imports "http://smart.who.int/ig/smart-immunizations-measles/StructureMap/IMMZCLMToPatient" | ||
|
||
group QRestToIMMZC ( | ||
source qr : QResp, | ||
target patient: Patient | ||
target bundle: Bundle | ||
) { | ||
qr -> create("http://smart.who.int/ig/smart-immunizations-measles/StructureDefinition/IMMZCRegisterClient") as model | ||
then{ | ||
qr -> model then QRespToIMMZC( qr, model) "QRtoLM"; | ||
qr -> patient then IMMZCToPatient( model, patient ) "LMtoPatient"; | ||
} "QRtoPatient"; | ||
} | ||
|
||
/* | ||
group QRespToIMMZC ( | ||
source qr : QResp, | ||
target patient : Patient | ||
) { | ||
qr.item as item then { | ||
|
||
item.answer first as answer where item.linkId = 'uniqueId' -> patient.identifier as identifier then { | ||
answer.valueString as content -> identifier.value = content "set identifier"; | ||
} "firstAnswerForIdentifier"; | ||
|
||
item as name where item.linkId = 'name' -> patient.name as pname then NameToHumanName( name, pname ) "setNames"; | ||
|
||
item.answer first as answer where item.linkId = 'sex' then { | ||
answer.valueCoding as coding then { | ||
coding.code as content -> patient.gender = translate(content, | ||
'http://smart.who.int/ig/smart-immunizations-measles/ConceptMap/IMMZCSexToAdministrativeGender', | ||
'code') "setSex"; | ||
} "processCoding"; | ||
} "firstAnswerForIdentifier2"; | ||
|
||
item.answer first as answer where item.linkId = 'birthDate' then { | ||
answer.valueDate as content -> patient.birthDate = content "set birthDate"; | ||
} "firstAnswerForBirthDate"; | ||
|
||
item as caregiver where item.linkId = 'caregiver' -> patient.contact as contact, contact.name as hname | ||
then NameToHumanName( caregiver, hname ) "set caregiver"; | ||
|
||
item.answer first as answer where item.linkId = 'phone' -> patient.telecom as telecom then { | ||
answer.valueString as content -> telecom.value = content, telecom.system = 'phone' "setPhone"; | ||
} "firstAnswerForPhone"; | ||
|
||
item.answer first as answer where item.linkId = 'administrativeArea' -> patient.address as address then { | ||
answer.valueCoding first as coding -> address then { | ||
coding.code as content -> address.text = content "setAddressToCode"; | ||
coding.display as content -> address.text = content "setAddressToDisplay"; | ||
} "setAddressText"; | ||
} "firstAnswerForAdministrativeArea"; | ||
|
||
} "processItems"; | ||
|
||
} | ||
|
||
group NameToHumanName( | ||
source name, | ||
target hname | ||
) { | ||
name.item as item then { | ||
|
||
item.answer first as answer where item.linkId = 'fullName' then { | ||
answer.valueString as content -> hname.text = content "SeFfullName"; | ||
} "firstAnswerForFullName"; | ||
|
||
item.answer first as answer where item.linkId = 'firstName' then { | ||
answer.valueString as content -> hname.given = content "SetFirstName"; | ||
} "firstAnswerForFirstName"; | ||
|
||
item.answer first as answer where item.linkId = 'familyName' then { | ||
answer.valueString as content -> hname.family = content "SetFamilyName"; | ||
} "firstAnswerForFamilyName"; | ||
|
||
} "processNameItems"; | ||
} | ||
*/ | ||
qr -> bundle.id = uuid() "rule_bundle_id"; | ||
qr -> bundle.type = 'collection' "rule_bundle_type"; | ||
qr -> bundle.entry as entry, entry.resource = create('Patient') as patient, | ||
create("http://smart.who.int/ig/smart-immunizations-measles/StructureDefinition/IMMZCRegisterClient") as model | ||
then{ | ||
qr -> model then QRespToIMMZC( qr, model) "QRtoLM"; | ||
qr -> patient then IMMZCToPatient( model, patient ) "LMtoPatient"; | ||
} "QRtoPatient"; | ||
} |