HL7 FHIR Implementation Guide: Sri Lanka
0.1.0 - STU1

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/HIMSRiskBehaviourQRToObs-TobaccoSmoking | Version: 0.1.0
Draft as of 2023-11-10 | Computable Name: HIMSRiskBehaviourQRToObs-TobaccoSmoking

Maps the Risk Behaviour Questionnaire Response to the HIMS Observation resource data elements.

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

    // Maps the Risk Behaviour Questionnaire Response to the HIMS Observation resource data elements.

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

    imports "http://openhie.org/fhir/sri-lanka/StructureMap/HIMSRiskBehaviourQRToLM-TobaccoSmoking"
    imports "http://openhie.org/fhir/sri-lanka/StructureMap/HIMSRiskBehaviourLMToObs-TobaccoSmoking"

    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('Observation') as observation,  create('http://openhie.org/fhir/sri-lanka/StructureDefinition/HIMSRiskBehaviourDataDictionary') as model then {
        qr -> model then QRespToIMMZC(qr, model) "QRtoLM";
        qr -> observation then DataDictToObservation(model, observation) "LMtoObservation";
        qr -> observation.status = final "ruleObservationStatus";
        qr ->  observation.code = create('CodeableConcept') as coding,  c.system = 'http://snomed.info/sct',  c.code = '365981007' "SetObsCode";
      } "QRtoObservation";
    }