HL7 FHIR Implementation Guide: Sri Lanka
0.1.0 - STU1 International flag

HL7 FHIR Implementation Guide: Sri Lanka, published by Jembi Health Systems. This is not an authorized publication; it is the continuous build for version 0.1.0. This version is based on the current content of https://github.com/jembi/Sri-Lanka and changes regularly. See the Directory of published versions

StructureMap:

Official URL: http://openhie.org/fhir/sri-lanka/StructureMap/HIMSQRToPatient Version: 0.1.0
Draft as of 2023-11-10 Computable Name: HIMSQRToPatient

Maps the Questionnaire Response to the HIMS Patient resource data elements.

map "http://openhie.org/fhir/sri-lanka/StructureMap/HIMSQRToPatient" = "HIMSQRToPatient"

// Maps the Questionnaire Response to the HIMS Patient resource data elements.

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source
uses "http://openhie.org/fhir/sri-lanka/StructureDefinition/HIMSPatientRegistrationDataDictionary" alias IMMZC as source
uses "http://hl7.org/fhir/StructureDefinition/Bundle" as target
uses "http://hl7.org/fhir/StructureDefinition/Patient" as target

imports "http://openhie.org/fhir/sri-lanka/StructureMap/HIMSPatientQRToLM"
imports "http://openhie.org/fhir/sri-lanka/StructureMap/HIMSLMToPatientRegistration"

group QRestToIMMZC(source qr : QResp, target bundle : Bundle) {
  qr -> bundle.id = uuid() "ruleBundleId";
  qr -> bundle.type = 'collection' "ruleBundleType";
  qr ->  bundle.entry as entry,  entry.resource = create('Patient') as patient,  create('http://openhie.org/fhir/sri-lanka/StructureDefinition/HIMSPatientRegistrationDataDictionary') as model then {
    qr -> model then QRespToIMMZC(qr, model) "QRtoLM";
    qr -> patient then DataDictToPatient(model, patient) "LMtoPatient";
    qr -> patient.active = true "rulePatientActive";
  } "QRtoPatient";
}