-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e37cd65
commit dacf182
Showing
39 changed files
with
259 additions
and
259 deletions.
There are no files selected for viewing
File renamed without changes.
128 changes: 64 additions & 64 deletions
128
input/maps/IMMZ-C-QRToLM.fml → input/maps/IMMZCQRToLM.fml
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,65 +1,65 @@ | ||
map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCQRToLM" = "IMMZCQRToLM" | ||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source | ||
uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZCRegisterClient" alias IMMZC as target | ||
group QRespToIMMZC ( source qr : QResp, target immzc : IMMZC) { | ||
qr.item as item then { | ||
item.answer first as answer where item.linkId = 'uniqueId' then { | ||
answer.value as content -> immzc.uniqueId = content "SetIdentifier"; | ||
} "FirstAnswerForIdentifier"; | ||
item where item.linkId = 'name' then NameToIMMZC( item, immzc ) "SetNames"; | ||
item where item.linkId = 'caregiver' -> immzc.caregiver as caregiver then NameToIMMZC( item, caregiver ) "SetNames"; | ||
item.answer first as answer where item.linkId = 'sex' then { | ||
answer.value as coding then { | ||
coding.code as content -> immzc.sex = content "SetSex"; | ||
} "ProcessCoding"; | ||
} "FirstAnswerForIdentifier"; | ||
item.answer first as answer where item.linkId = 'birthDate' then { | ||
answer.value as content -> immzc.birthDate = content "SetBirthDate2"; | ||
} "FirstAnswerForBirthDate"; | ||
item.answer as caregiver where item.linkId = 'caregiver' -> immzc.caregiver as caretgt | ||
then NameToIMMZC( caregiver, caretgt ) "SetCaregiver"; | ||
item.answer first as answer where item.linkId = 'phone' then { | ||
answer.value as content -> immzc.phone = content "SetPhone"; | ||
} "FirstAnswerForPhone"; | ||
item.answer first as answer where item.linkId = 'administrativeArea' then { | ||
answer.value as coding -> immzc.administrativeArea as area then { | ||
coding -> area.coding = coding "SetCodingValue"; | ||
coding.display as display -> area.text = display "SetDisplay"; | ||
} "SetCoding"; | ||
} "FirstAnswerForAdministrativeArea"; | ||
item.answer first as answer where item.linkId = 'healthWorker' then { | ||
answer.value as content -> immzc.healthWorker = content "SetHealthWorker"; | ||
} "FirstAnswerForHealthWorker"; | ||
} "processItems"; | ||
} | ||
group NameToIMMZC( source name, target immzc) { | ||
name.item as item then { | ||
item.answer first as answer where item.linkId = 'fullName' then { | ||
answer.value as content -> immzc.name = content "SetFullName"; | ||
} "FirstAnswerForFullName"; | ||
item.answer first as answer where item.linkId = 'firstName' then { | ||
answer.value as content -> immzc.firstName = content "SetFirstName"; | ||
} "FirstAnswerForFirstName"; | ||
item.answer first as answer where item.linkId = 'familyName' then { | ||
answer.value as content -> immzc.familyName = content "SetFamilyName"; | ||
} "FirstAnswerForFamilyName"; | ||
} "processNameItems"; | ||
map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCQRToLM" = "IMMZCQRToLM" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source | ||
uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZCRegisterClient" alias IMMZC as target | ||
|
||
group QRespToIMMZC ( source qr : QResp, target immzc : IMMZC) { | ||
qr.item as item then { | ||
|
||
item.answer first as answer where item.linkId = 'uniqueId' then { | ||
answer.value as content -> immzc.uniqueId = content "SetIdentifier"; | ||
} "FirstAnswerForIdentifier"; | ||
|
||
item where item.linkId = 'name' then NameToIMMZC( item, immzc ) "SetNames"; | ||
|
||
item where item.linkId = 'caregiver' -> immzc.caregiver as caregiver then NameToIMMZC( item, caregiver ) "SetNames"; | ||
|
||
item.answer first as answer where item.linkId = 'sex' then { | ||
answer.value as coding then { | ||
coding.code as content -> immzc.sex = content "SetSex"; | ||
} "ProcessCoding"; | ||
} "FirstAnswerForIdentifier"; | ||
|
||
item.answer first as answer where item.linkId = 'birthDate' then { | ||
answer.value as content -> immzc.birthDate = content "SetBirthDate2"; | ||
} "FirstAnswerForBirthDate"; | ||
|
||
item.answer as caregiver where item.linkId = 'caregiver' -> immzc.caregiver as caretgt | ||
then NameToIMMZC( caregiver, caretgt ) "SetCaregiver"; | ||
|
||
item.answer first as answer where item.linkId = 'phone' then { | ||
answer.value as content -> immzc.phone = content "SetPhone"; | ||
} "FirstAnswerForPhone"; | ||
|
||
item.answer first as answer where item.linkId = 'administrativeArea' then { | ||
answer.value as coding -> immzc.administrativeArea as area then { | ||
coding -> area.coding = coding "SetCodingValue"; | ||
coding.display as display -> area.text = display "SetDisplay"; | ||
} "SetCoding"; | ||
} "FirstAnswerForAdministrativeArea"; | ||
|
||
item.answer first as answer where item.linkId = 'healthWorker' then { | ||
answer.value as content -> immzc.healthWorker = content "SetHealthWorker"; | ||
} "FirstAnswerForHealthWorker"; | ||
|
||
} "processItems"; | ||
|
||
} | ||
|
||
group NameToIMMZC( source name, target immzc) { | ||
name.item as item then { | ||
|
||
item.answer first as answer where item.linkId = 'fullName' then { | ||
answer.value as content -> immzc.name = content "SetFullName"; | ||
} "FirstAnswerForFullName"; | ||
|
||
item.answer first as answer where item.linkId = 'firstName' then { | ||
answer.value as content -> immzc.firstName = content "SetFirstName"; | ||
} "FirstAnswerForFirstName"; | ||
|
||
item.answer first as answer where item.linkId = 'familyName' then { | ||
answer.value as content -> immzc.familyName = content "SetFamilyName"; | ||
} "FirstAnswerForFamilyName"; | ||
|
||
} "processNameItems"; | ||
} |
166 changes: 83 additions & 83 deletions
166
input/maps/IMMZ-C-QRToPatient.fml → input/maps/IMMZCQRToPatient.fml
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,84 @@ | ||
map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCQRToPatient" = "IMMZCQRToPatient" | ||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source | ||
uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZCRegisterClient" alias IMMZC as source | ||
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target | ||
imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCQRToLM" | ||
imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCLMToPatient" | ||
group QRestToIMMZC ( | ||
source qr : QResp, | ||
target patient: Patient | ||
) { | ||
qr -> create("http://smart.who.int/ig/smart-immunizations/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://worldhealthorganization.github.io/smart-immunizations-mini/ConceptMap/IMMZ.C.SexToAdministrativeGender', | ||
'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 "set full name"; | ||
} "firstAnswerForFullName"; | ||
item.answer first as answer where item.linkId = 'firstName' then { | ||
answer.valueString as content -> hname.given = content "set first name"; | ||
} "firstAnswerForFirstName"; | ||
item.answer first as answer where item.linkId = 'familyName' then { | ||
answer.valueString as content -> hname.family = content "set family name"; | ||
} "firstAnswerForFamilyName"; | ||
} "processNameItems"; | ||
} | ||
map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCQRToPatient" = "IMMZCQRToPatient" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source | ||
uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZCRegisterClient" alias IMMZC as source | ||
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target | ||
|
||
imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCQRToLM" | ||
imports "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZCLMToPatient" | ||
|
||
group QRestToIMMZC ( | ||
source qr : QResp, | ||
target patient: Patient | ||
) { | ||
qr -> create("http://smart.who.int/ig/smart-immunizations/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://worldhealthorganization.github.io/smart-immunizations-mini/ConceptMap/IMMZ.C.SexToAdministrativeGender', | ||
'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 "set full name"; | ||
} "firstAnswerForFullName"; | ||
|
||
item.answer first as answer where item.linkId = 'firstName' then { | ||
answer.valueString as content -> hname.given = content "set first name"; | ||
} "firstAnswerForFirstName"; | ||
|
||
item.answer first as answer where item.linkId = 'familyName' then { | ||
answer.valueString as content -> hname.family = content "set family name"; | ||
} "firstAnswerForFamilyName"; | ||
|
||
} "processNameItems"; | ||
} | ||
*/ |
File renamed without changes.
Oops, something went wrong.