@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://example.org/StructureMap/MeaslesCaseReportMap> a fhir:StructureMap ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "MeaslesCaseReportMap"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap MeaslesCaseReportMap</b></p><a name=\"MeaslesCaseReportMap\"> </a><a name=\"hcMeaslesCaseReportMap\"> </a><pre class=\"fml\">#xD;\n<b>map</b><span style=\"color: navy\"> \"</span>http://example.org/StructureMap/MeaslesCaseReportMap<span style=\"color: navy\">\" = \"</span>MeaslesCaseReportMap<span style=\"color: navy\">\"#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Measles Case Report QuestionnaireResponse to FHIR resources</span>#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Maps to: Patient, Encounter, Condition (Measles), Immunization (MR/Measles), Specimen</span>#xD;\n#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/questionnaireresponse.html\" title=\"QuestionnaireResponse\">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style=\"color: navy\">\" </span><b>alias </b>QuestionnaireResponse <b>as </b><b>source</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/bundle.html\" title=\"Bundle\">http://hl7.org/fhir/StructureDefinition/Bundle</a><span style=\"color: navy\">\" </span><b>alias </b>Bundle <b>as </b><b>target</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/patient.html\" title=\"Patient\">http://hl7.org/fhir/StructureDefinition/Patient</a><span style=\"color: navy\">\" </span><b>alias </b>Patient <b>as </b><b>target</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/encounter.html\" title=\"Encounter\">http://hl7.org/fhir/StructureDefinition/Encounter</a><span style=\"color: navy\">\" </span><b>alias </b>Encounter <b>as </b><b>target</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/condition.html\" title=\"Condition\">http://hl7.org/fhir/StructureDefinition/Condition</a><span style=\"color: navy\">\" </span><b>alias </b>Condition <b>as </b><b>target</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/immunization.html\" title=\"Immunization\">http://hl7.org/fhir/StructureDefinition/Immunization</a><span style=\"color: navy\">\" </span><b>alias </b>Immunization <b>as </b><b>target</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/specimen.html\" title=\"Specimen\">http://hl7.org/fhir/StructureDefinition/Specimen</a><span style=\"color: navy\">\" </span><b>alias </b>Specimen <b>as </b><b>target</b>#xD;\n#xD;\n<b>group </b>MeaslesCaseReportMap<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QuestionnaireResponse, <b>target</b> <span style=\"color: maroon\">bundle</span><span style=\"color: navy\"> : </span>Bundle<span style=\"color: navy\">)</span><span style=\"color: navy\"> {#xD;\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>bundle.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"bundleId\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>bundle.type = <span style=\"color: blue\">'transaction'</span> <i>\"bundleType\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">e</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>e.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">patient</span><b> then </b>MapMeaslesPatient<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">)</span> <i>\"execPatient\"</i><span style=\"color: navy\">;</span>#xD;\n    src<span style=\"color: navy\"><b> -&gt; </b></span> e.request<b> as </b><span style=\"color: maroon\">req</span><span style=\"color: navy\">, </span> req.method = <span style=\"color: blue\">'PUT'</span><span style=\"color: navy\">, </span> req.url = <span style=\"color: navy\">(</span>'Patient/' + %src.subject.reference<span style=\"color: navy\">)</span> <i>\"patientReq\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"patientEntry\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">e</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>e.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Encounter'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">encounter</span><b> then </b>MapMeaslesEncounter<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">encounter</span><span style=\"color: navy\">)</span> <i>\"execEncounter\"</i><span style=\"color: navy\">;</span>#xD;\n    src<span style=\"color: navy\"><b> -&gt; </b></span> e.request<b> as </b><span style=\"color: maroon\">req</span><span style=\"color: navy\">, </span> req.method = <span style=\"color: blue\">'POST'</span><span style=\"color: navy\">, </span> req.url = <span style=\"color: blue\">'Encounter'</span> <i>\"encounterReq\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"encounterEntry\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">e</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>e.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Condition'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">condition</span><b> then </b>MapMeaslesCondition<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">condition</span><span style=\"color: navy\">)</span> <i>\"execCondition\"</i><span style=\"color: navy\">;</span>#xD;\n    src<span style=\"color: navy\"><b> -&gt; </b></span> e.request<b> as </b><span style=\"color: maroon\">req</span><span style=\"color: navy\">, </span> req.method = <span style=\"color: blue\">'POST'</span><span style=\"color: navy\">, </span> req.url = <span style=\"color: blue\">'Condition'</span> <i>\"conditionReq\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"conditionEntry\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">e</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>e.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Immunization'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">immunization</span><b> then </b>MapMeaslesImmunization<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">immunization</span><span style=\"color: navy\">)</span> <i>\"execImmunization\"</i><span style=\"color: navy\">;</span>#xD;\n    src<span style=\"color: navy\"><b> -&gt; </b></span> e.request<b> as </b><span style=\"color: maroon\">req</span><span style=\"color: navy\">, </span> req.method = <span style=\"color: blue\">'POST'</span><span style=\"color: navy\">, </span> req.url = <span style=\"color: blue\">'Immunization'</span> <i>\"immunizationReq\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"immunizationEntry\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">e</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>e.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Specimen'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">specimen</span><b> then </b>MapMeaslesSpecimen<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">specimen</span><span style=\"color: navy\">)</span> <i>\"execSpecimen\"</i><span style=\"color: navy\">;</span>#xD;\n    src<span style=\"color: navy\"><b> -&gt; </b></span> e.request<b> as </b><span style=\"color: maroon\">req</span><span style=\"color: navy\">, </span> req.method = <span style=\"color: blue\">'POST'</span><span style=\"color: navy\">, </span> req.url = <span style=\"color: blue\">'Specimen'</span> <i>\"specimenReq\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"specimenEntry\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><b>group </b>MapMeaslesPatient<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QuestionnaireResponse, <b>target</b> <span style=\"color: maroon\">patient</span><span style=\"color: navy\"> : </span>Patient<span style=\"color: navy\">)</span><span style=\"color: navy\"> {#xD;\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>patient.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"patientId\"</i><span style=\"color: navy\">;</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">demographics</span><b> where </b>linkId = '670954892057'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Given name</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '873240407472'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> patient.name<b> as </b><span style=\"color: maroon\">name</span><span style=\"color: navy\">, </span> name.given = <span style=\"color: maroon\">ans.valueString</span> <i>\"givenName\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"firstName\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Middle name</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '246751846436'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> patient.name<b> as </b><span style=\"color: maroon\">name</span><span style=\"color: navy\">, </span> name.given = <span style=\"color: maroon\">ans.valueString</span> <i>\"middleName\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"middleName\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Family name</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '486402457213'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> patient.name<b> as </b><span style=\"color: maroon\">name</span><span style=\"color: navy\">, </span> name.family = <span style=\"color: maroon\">ans.valueString</span> <i>\"familyName\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"familyName\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Gender</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '929966324957'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.gender = <span style=\"color: navy\">(</span>ans.valueCoding.code<span style=\"color: navy\">)</span> <i>\"gender\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"gender\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Date of birth</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '257830485990'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.birthDate = <span style=\"color: maroon\">ans.valueDate</span> <i>\"birthDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"birthDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Residence (Urban/Rural) as address use</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = 'residence'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.address<b> as </b><span style=\"color: maroon\">addr</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans.valueCoding<b> as </b><span style=\"color: maroon\">val</span><b> where </b>code = 'Urban'<span style=\"color: navy\"><b> -&gt; </b></span> addr.use = <span style=\"color: blue\">'home'</span><span style=\"color: navy\">, </span> addr.type = <span style=\"color: blue\">'physical'</span> <i>\"urbanAddr\"</i><span style=\"color: navy\">;</span>#xD;\n        ans.valueCoding<b> as </b><span style=\"color: maroon\">val</span><b> where </b>code = 'Rural'<span style=\"color: navy\"><b> -&gt; </b></span> addr.use = <span style=\"color: blue\">'home'</span><span style=\"color: navy\">, </span> addr.type = <span style=\"color: blue\">'physical'</span><span style=\"color: navy\">, </span> addr.district = <span style=\"color: blue\">'Rural'</span> <i>\"ruralAddr\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"residenceType\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"residence\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Parent / Guardian</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = 'parent'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.contact<b> as </b><span style=\"color: maroon\">contact</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span> contact.name<b> as </b><span style=\"color: maroon\">cname</span><span style=\"color: navy\">, </span> cname.text = <span style=\"color: maroon\">ans.valueString</span> <i>\"contactName\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"parentContact\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"parent\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Phone</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '754217593839'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> patient.telecom<b> as </b><span style=\"color: maroon\">tel</span><span style=\"color: navy\">, </span> tel.system = <span style=\"color: blue\">'phone'</span><span style=\"color: navy\">, </span> tel.value = <span style=\"color: maroon\">ans.valueString</span> <i>\"phone\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"phone\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">County/Sub-County/Ward address</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '242811643559'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> patient.address<b> as </b><span style=\"color: maroon\">addr</span><span style=\"color: navy\">, </span> addr.line = <span style=\"color: maroon\">ans.valueString</span> <i>\"village\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"village\"</i><span style=\"color: navy\">;</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '946232932304'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> patient.address<b> as </b><span style=\"color: maroon\">addr</span><span style=\"color: navy\">, </span> addr.district = <span style=\"color: maroon\">ans.valueString</span> <i>\"landmark\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"landmark\"</i><span style=\"color: navy\">;</span>#xD;\n    demographics.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '424111786438'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> patient.address<b> as </b><span style=\"color: maroon\">addr</span><span style=\"color: navy\">, </span> addr.line = <span style=\"color: maroon\">ans.valueString</span> <i>\"street\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"street\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"demographics\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><b>group </b>MapMeaslesEncounter<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QuestionnaireResponse, <b>target</b> <span style=\"color: maroon\">encounter</span><span style=\"color: navy\"> : </span>Encounter<span style=\"color: navy\">)</span><span style=\"color: navy\"> {#xD;\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>encounter.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"encounterId\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>encounter.status = <span style=\"color: blue\">'finished'</span> <i>\"status\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>encounter.class<b> as </b><span style=\"color: maroon\">cls</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>cls.system = <span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/v3-ActCode'</span> <i>\"clsSys\"</i><span style=\"color: navy\">;</span>#xD;\n    src<span style=\"color: navy\"><b> -&gt; </b></span>cls.code = <span style=\"color: blue\">'AMB'</span> <i>\"clsCode\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"class\"</i><span style=\"color: navy\">;</span>#xD;\n  src.subject<b> as </b><span style=\"color: maroon\">subj</span><span style=\"color: navy\"><b> -&gt; </b></span> encounter.subject<b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> ref.reference = <span style=\"color: navy\">(</span>'Patient/' + subj.reference<span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">EPID No from reporting site</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">reportSite</span><b> where </b>linkId = '151479012557'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    reportSite.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '992818778559'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>encounter.identifier<b> as </b><span style=\"color: maroon\">id</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span>id.system = <span style=\"color: blue\">'http://example.org/identifier/epid'</span> <i>\"epidSys\"</i><span style=\"color: navy\">;</span>#xD;\n        ans<span style=\"color: navy\"><b> -&gt; </b></span>id.value = <span style=\"color: maroon\">ans.valueString</span> <i>\"epidValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"epidId\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"epidNo\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"reportSite\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Case information</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">caseInfo</span><b> where </b>linkId = '216343227137'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Date first seen at facility → period start</span>#xD;\n    caseInfo.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '554231819382'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> encounter.period<b> as </b><span style=\"color: maroon\">period</span><span style=\"color: navy\">, </span> period.start = <span style=\"color: maroon\">ans.valueDate</span> <i>\"periodStart\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"firstSeen\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">IP/OP number</span>#xD;\n    caseInfo.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '755731625544'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>encounter.identifier<b> as </b><span style=\"color: maroon\">id</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span>id.system = <span style=\"color: blue\">'http://example.org/identifier/ip-op'</span> <i>\"ipopSys\"</i><span style=\"color: navy\">;</span>#xD;\n        ans<span style=\"color: navy\"><b> -&gt; </b></span>id.value = <span style=\"color: maroon\">ans.valueString</span> <i>\"ipopValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"ipopId\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"ipopNo\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Hospitalization</span>#xD;\n    caseInfo.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '483042281962'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><b> where </b>valueCoding.code = 'yes'<span style=\"color: navy\"><b> -&gt; </b></span>encounter.hospitalization<b> as </b><span style=\"color: maroon\">hosp</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span> hosp.admitSource<b> as </b><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span> src.coding<b> as </b><span style=\"color: maroon\">cod</span><span style=\"color: navy\">, </span> cod.system = <span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/admit-source'</span><span style=\"color: navy\">, </span> cod.code = <span style=\"color: blue\">'hosp-trans'</span> <i>\"admitSource\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"hospitalization\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"hospitalized\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Date of admission</span>#xD;\n    caseInfo.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '340908984116'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> encounter.period<b> as </b><span style=\"color: maroon\">period</span><span style=\"color: navy\">, </span> period.start = <span style=\"color: maroon\">ans.valueDate</span> <i>\"admitDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"admitDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Outcome → disposition</span>#xD;\n    caseInfo.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '508745697175'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>encounter.hospitalization<b> as </b><span style=\"color: maroon\">hosp</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans.valueCoding<b> as </b><span style=\"color: maroon\">val</span><b> where </b>code = 'Alive'<span style=\"color: navy\"><b> -&gt; </b></span> hosp.dischargeDisposition<b> as </b><span style=\"color: maroon\">disp</span><span style=\"color: navy\">, </span> disp.coding<b> as </b><span style=\"color: maroon\">cod</span><span style=\"color: navy\">, </span> cod.system = <span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/discharge-disposition'</span><span style=\"color: navy\">, </span> cod.code = <span style=\"color: blue\">'home'</span> <i>\"alive\"</i><span style=\"color: navy\">;</span>#xD;\n        ans.valueCoding<b> as </b><span style=\"color: maroon\">val</span><b> where </b>code = 'Dead'<span style=\"color: navy\"><b> -&gt; </b></span> hosp.dischargeDisposition<b> as </b><span style=\"color: maroon\">disp</span><span style=\"color: navy\">, </span> disp.coding<b> as </b><span style=\"color: maroon\">cod</span><span style=\"color: navy\">, </span> cod.system = <span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/discharge-disposition'</span><span style=\"color: navy\">, </span> cod.code = <span style=\"color: blue\">'exp'</span> <i>\"dead\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"outcomeDisp\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"outcome\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"caseInfo\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Case type (Case or Line List) as type</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">clinicalHistory</span><b> where </b>linkId = '477144604557'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    clinicalHistory.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '865158268604'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>encounter.type<b> as </b><span style=\"color: maroon\">type</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span> type.coding<b> as </b><span style=\"color: maroon\">cod</span><span style=\"color: navy\">, </span> cod.system = <span style=\"color: blue\">'http://example.org/CodeSystem/measles-case-type'</span><span style=\"color: navy\">, </span> cod.code = <span style=\"color: navy\">(</span>ans.valueCoding.code<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> cod.display = <span style=\"color: navy\">(</span>ans.valueCoding.display<span style=\"color: navy\">)</span> <i>\"caseType\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"encounterType\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"caseOrLineList\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"clinicalHistory\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><b>group </b>MapMeaslesCondition<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QuestionnaireResponse, <b>target</b> <span style=\"color: maroon\">condition</span><span style=\"color: navy\"> : </span>Condition<span style=\"color: navy\">)</span><span style=\"color: navy\"> {#xD;\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>condition.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"conditionId\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Measles SNOMED code</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>condition.code<b> as </b><span style=\"color: maroon\">code</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>code.coding<b> as </b><span style=\"color: maroon\">coding</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      src<span style=\"color: navy\"><b> -&gt; </b></span>coding.system = <span style=\"color: blue\">'http://snomed.info/sct'</span> <i>\"snomedSys\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>coding.code = <span style=\"color: blue\">'14189004'</span> <i>\"measlesCode\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>coding.display = <span style=\"color: blue\">'Measles'</span> <i>\"measlesDisplay\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"measlesCoding\"</i><span style=\"color: navy\">;</span>#xD;\n    src<span style=\"color: navy\"><b> -&gt; </b></span>code.text = <span style=\"color: blue\">'Measles'</span> <i>\"measlesText\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"codeBlock\"</i><span style=\"color: navy\">;</span>#xD;\n  src.subject<b> as </b><span style=\"color: maroon\">subj</span><span style=\"color: navy\"><b> -&gt; </b></span> condition.subject<b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> ref.reference = <span style=\"color: navy\">(</span>'Patient/' + subj.reference<span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">clinicalHistory</span><b> where </b>linkId = '477144604557'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Date of onset of illness</span>#xD;\n    clinicalHistory.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '728034137219'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>condition.onset = <span style=\"color: maroon\">ans.valueDate</span> <i>\"onsetDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"onsetDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Clinical symptoms as body site / note</span>#xD;\n    clinicalHistory.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '745196148424'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> condition.note<b> as </b><span style=\"color: maroon\">note</span><span style=\"color: navy\">, </span> note.text = <span style=\"color: navy\">(</span>ans.valueCoding.display<span style=\"color: navy\">)</span> <i>\"symptomNote\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"symptoms\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Date of rash onset</span>#xD;\n    clinicalHistory.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '576528567552'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>condition.extension<b> as </b><span style=\"color: maroon\">ext</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span>ext.url = <span style=\"color: blue\">'http://example.org/StructureDefinition/rashOnsetDate'</span> <i>\"extUrl\"</i><span style=\"color: navy\">;</span>#xD;\n        ans<span style=\"color: navy\"><b> -&gt; </b></span>ext.valueDate = <span style=\"color: maroon\">ans.valueDate</span> <i>\"extValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"rashOnset\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"rashDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Type of rash</span>#xD;\n    clinicalHistory.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '704922081985'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> condition.note<b> as </b><span style=\"color: maroon\">note</span><span style=\"color: navy\">, </span> note.text = <span style=\"color: navy\">(</span>'Rash type: ' + ans.valueCoding.display<span style=\"color: navy\">)</span> <i>\"rashTypeNote\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"rashType\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Home visited for contact investigation</span>#xD;\n    clinicalHistory.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '207408507040'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> condition.note<b> as </b><span style=\"color: maroon\">note</span><span style=\"color: navy\">, </span> note.text = <span style=\"color: navy\">(</span>iif(ans.valueCoding.code = 'yes', 'Home visited for contact investigation: Yes', 'Home visited for contact investigation: No')<span style=\"color: navy\">)</span> <i>\"contactInvestNote\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"homeVisited\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Date of home visit</span>#xD;\n    clinicalHistory.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '566661890668'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>condition.extension<b> as </b><span style=\"color: maroon\">ext</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span>ext.url = <span style=\"color: blue\">'http://example.org/StructureDefinition/contactInvestigationDate'</span> <i>\"extUrl\"</i><span style=\"color: navy\">;</span>#xD;\n        ans<span style=\"color: navy\"><b> -&gt; </b></span>ext.valueDate = <span style=\"color: maroon\">ans.valueDate</span> <i>\"extValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"homeVisitExt\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"homeVisitDate\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"clinicalHistory\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Outcome → clinical status from case info</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">caseInfo</span><b> where </b>linkId = '216343227137'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    caseInfo.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '508745697175'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>condition.clinicalStatus<b> as </b><span style=\"color: maroon\">status</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans.valueCoding<b> as </b><span style=\"color: maroon\">val</span><b> where </b>code = 'Dead'<span style=\"color: navy\"><b> -&gt; </b></span> status.coding<b> as </b><span style=\"color: maroon\">cod</span><span style=\"color: navy\">, </span> cod.system = <span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/condition-clinical'</span><span style=\"color: navy\">, </span> cod.code = <span style=\"color: blue\">'inactive'</span> <i>\"deadStatus\"</i><span style=\"color: navy\">;</span>#xD;\n        ans.valueCoding<b> as </b><span style=\"color: maroon\">val</span><b> where </b>code = 'Alive'<span style=\"color: navy\"><b> -&gt; </b></span> status.coding<b> as </b><span style=\"color: maroon\">cod</span><span style=\"color: navy\">, </span> cod.system = <span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/condition-clinical'</span><span style=\"color: navy\">, </span> cod.code = <span style=\"color: blue\">'active'</span> <i>\"aliveStatus\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"clinicalStatus\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"outcome\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"caseInfoStatus\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><b>group </b>MapMeaslesImmunization<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QuestionnaireResponse, <b>target</b> <span style=\"color: maroon\">immunization</span><span style=\"color: navy\"> : </span>Immunization<span style=\"color: navy\">)</span><span style=\"color: navy\"> {#xD;\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>immunization.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"immunizationId\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>immunization.status = <span style=\"color: blue\">'completed'</span> <i>\"status\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">MR / Measles vaccine code</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>immunization.vaccineCode<b> as </b><span style=\"color: maroon\">code</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>code.coding<b> as </b><span style=\"color: maroon\">coding</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      src<span style=\"color: navy\"><b> -&gt; </b></span>coding.system = <span style=\"color: blue\">'http://hl7.org/fhir/sid/cvx'</span> <i>\"cvxSys\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>coding.code = <span style=\"color: blue\">'05'</span> <i>\"measlesCode\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>coding.display = <span style=\"color: blue\">'Measles-Rubella (MR) Vaccine'</span> <i>\"mrDisplay\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"mrCoding\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"vaccineCode\"</i><span style=\"color: navy\">;</span>#xD;\n  src.subject<b> as </b><span style=\"color: maroon\">subj</span><span style=\"color: navy\"><b> -&gt; </b></span> immunization.patient<b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> ref.reference = <span style=\"color: navy\">(</span>'Patient/' + subj.reference<span style=\"color: navy\">)</span> <i>\"patient\"</i><span style=\"color: navy\">;</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">vaccination</span><b> where </b>linkId = '736291402384'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Vaccination status</span>#xD;\n    vaccination.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '517772812375'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><b> where </b>valueCoding.code = 'no'<span style=\"color: navy\"><b> -&gt; </b></span>immunization.status = <span style=\"color: blue\">'not-done'</span> <i>\"notVaccinated\"</i><span style=\"color: navy\">;</span>#xD;\n      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><b> where </b>valueCoding.code = 'unknown'<span style=\"color: navy\"><b> -&gt; </b></span> immunization.statusReason<b> as </b><span style=\"color: maroon\">reason</span><span style=\"color: navy\">, </span> reason.text = <span style=\"color: blue\">'Unknown vaccination status'</span> <i>\"unknownStatus\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"vaccinationStatus\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Number of doses</span>#xD;\n    vaccination.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '886125589225'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>immunization.protocolApplied<b> as </b><span style=\"color: maroon\">protocol</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span>protocol.doseNumber = <span style=\"color: maroon\">ans.valueInteger</span> <i>\"doseNumber\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"protocol\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"doses\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">MR vaccination in last 30 days</span>#xD;\n    vaccination.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '308128177300'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>immunization.extension<b> as </b><span style=\"color: maroon\">ext</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span>ext.url = <span style=\"color: blue\">'http://example.org/StructureDefinition/vaccineLast30Days'</span> <i>\"extUrl\"</i><span style=\"color: navy\">;</span>#xD;\n        ans<span style=\"color: navy\"><b> -&gt; </b></span>ext.valueCoding = <span style=\"color: maroon\">ans.valueCoding</span> <i>\"extValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"last30DaysExt\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"last30Days\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Date of last vaccination</span>#xD;\n    vaccination.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '544290619304'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>immunization.occurrenceDateTime = <span style=\"color: maroon\">ans.valueDate</span> <i>\"lastVaccDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"lastVaccDate\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"vaccination\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><b>group </b>MapMeaslesSpecimen<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QuestionnaireResponse, <b>target</b> <span style=\"color: maroon\">specimen</span><span style=\"color: navy\"> : </span>Specimen<span style=\"color: navy\">)</span><span style=\"color: navy\"> {#xD;\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>specimen.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"specimenId\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Blood/Urine/Respiratory type (default to blood serum for measles serology)</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>specimen.type<b> as </b><span style=\"color: maroon\">type</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>type.coding<b> as </b><span style=\"color: maroon\">coding</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      src<span style=\"color: navy\"><b> -&gt; </b></span>coding.system = <span style=\"color: blue\">'http://snomed.info/sct'</span> <i>\"snomedSys\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>coding.code = <span style=\"color: blue\">'119364003'</span> <i>\"serumCode\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>coding.display = <span style=\"color: blue\">'Serum specimen'</span> <i>\"serumDisplay\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"serumCoding\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"specimenType\"</i><span style=\"color: navy\">;</span>#xD;\n  src.subject<b> as </b><span style=\"color: maroon\">subj</span><span style=\"color: navy\"><b> -&gt; </b></span> specimen.subject<b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> ref.reference = <span style=\"color: navy\">(</span>'Patient/' + subj.reference<span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">specimenCollection</span><b> where </b>linkId = '271053545237'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Specimen type(s) selected</span>#xD;\n    specimenCollection.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '412689284625'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> specimen.note<b> as </b><span style=\"color: maroon\">note</span><span style=\"color: navy\">, </span> note.text = <span style=\"color: navy\">(</span>'Specimen collected: ' + ans.valueCoding.display<span style=\"color: navy\">)</span> <i>\"specimenNote\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"specimenTypes\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Date of specimen collection</span>#xD;\n    specimenCollection.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '8962468583341'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> specimen.collection<b> as </b><span style=\"color: maroon\">coll</span><span style=\"color: navy\">, </span> coll.collectedDateTime = <span style=\"color: maroon\">ans.valueDate</span> <i>\"collectionDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"collectionDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Date specimen sent to lab</span>#xD;\n    specimenCollection.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '718251724172'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>specimen.processing<b> as </b><span style=\"color: maroon\">proc</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span>proc.description = <span style=\"color: blue\">'Specimen sent to lab'</span> <i>\"procDesc\"</i><span style=\"color: navy\">;</span>#xD;\n        ans<span style=\"color: navy\"><b> -&gt; </b></span>proc.timeDateTime = <span style=\"color: maroon\">ans.valueDate</span> <i>\"procTime\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"sentToLab\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"sentToLabDate\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Other specimen types</span>#xD;\n    specimenCollection.item<b> as </b><span style=\"color: maroon\">item</span><b> where </b>linkId = '340507649387'<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      item.answer first<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> specimen.note<b> as </b><span style=\"color: maroon\">note</span><span style=\"color: navy\">, </span> note.text = <span style=\"color: navy\">(</span>'Other specimen type: ' + ans.valueString<span style=\"color: navy\">)</span> <i>\"otherSpecimenNote\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"otherSpecimen\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"specimenCollection\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span></pre></div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:url [
     fhir:v "http://example.org/StructureMap/MeaslesCaseReportMap"^^xsd:anyURI ;
     fhir:l <http://example.org/StructureMap/MeaslesCaseReportMap>
  ] ; # 
  fhir:version [ fhir:v "0.1.0"] ; # 
  fhir:name [ fhir:v "MeaslesCaseReportMap"] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:date [ fhir:v "2026-05-04T06:19:40+00:00"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "Kenya National Public Health Institute"] ; # 
  fhir:contact ( [
     fhir:name [ fhir:v "Kenya National Public Health Institute" ] ;
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "https://www.nphi.go.ke/" ]
     ] )
  ] [
     fhir:name [ fhir:v "Kenya National Public Health Institute" ] ;
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "https://www.nphi.go.ke/" ] ;
       fhir:use [ fhir:v "work" ]
     ] )
  ] ) ; # 
  fhir:description [ fhir:v "Measles Case Report QuestionnaireResponse to FHIR resources\r\nMaps to: Patient, Encounter, Condition (Measles), Immunization (MR/Measles), Specimen"] ; # 
  fhir:jurisdiction ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "urn:iso:std:iso:3166"^^xsd:anyURI ;
         fhir:l <urn:iso:std:iso:3166>
       ] ;
       fhir:code [ fhir:v "KE" ] ;
       fhir:display [ fhir:v "Kenya" ]
     ] )
  ] ) ; # 
  fhir:structure ( [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse>
     ] ;
     fhir:mode [ fhir:v "source" ] ;
     fhir:alias [ fhir:v "QuestionnaireResponse" ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Bundle"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Bundle>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "Bundle" ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Patient"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Patient>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "Patient" ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "Encounter" ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Condition"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Condition>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "Condition" ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Immunization"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Immunization>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "Immunization" ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/Specimen"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/Specimen>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "Specimen" ]
  ] ) ; # 
  fhir:group ( [
     fhir:name [ fhir:v "MeaslesCaseReportMap" ] ;
     fhir:typeMode [ fhir:v "none" ] ;
     fhir:input ( [
       fhir:name [ fhir:v "src" ] ;
       fhir:type [ fhir:v "QuestionnaireResponse" ] ;
       fhir:mode [ fhir:v "source" ]
     ] [
       fhir:name [ fhir:v "bundle" ] ;
       fhir:type [ fhir:v "Bundle" ] ;
       fhir:mode [ fhir:v "target" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "bundleId" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "bundle" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:transform [ fhir:v "uuid" ]
       ] )
     ] [
       fhir:name [ fhir:v "bundleType" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "bundle" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "type" ] ;
         fhir:transform [ fhir:v "copy" ] ;
         fhir:parameter ( [
           fhir:value [
             a fhir:String ;
             fhir:v "transaction"
           ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "patientEntry" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "bundle" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "e" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "execPatient" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "resource" ] ;
           fhir:variable [ fhir:v "patient" ] ;
           fhir:transform [ fhir:v "create" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Patient"
             ]
           ] )
         ] ) ;
         fhir:dependent ( [
           fhir:name [ fhir:v "MapMeaslesPatient" ] ;
           fhir:variable ( [ fhir:v "src" ] [ fhir:v "patient" ] )
         ] )
       ] [
         fhir:name [ fhir:v "patientReq" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "request" ] ;
           fhir:variable [ fhir:v "req" ]
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "method" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "PUT"
             ]
           ] )
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "url" ] ;
           fhir:transform [ fhir:v "evaluate" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "'Patient/' + %src.subject.reference"
             ]
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "encounterEntry" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "bundle" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "e" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "execEncounter" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "resource" ] ;
           fhir:variable [ fhir:v "encounter" ] ;
           fhir:transform [ fhir:v "create" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Encounter"
             ]
           ] )
         ] ) ;
         fhir:dependent ( [
           fhir:name [ fhir:v "MapMeaslesEncounter" ] ;
           fhir:variable ( [ fhir:v "src" ] [ fhir:v "encounter" ] )
         ] )
       ] [
         fhir:name [ fhir:v "encounterReq" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "request" ] ;
           fhir:variable [ fhir:v "req" ]
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "method" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "POST"
             ]
           ] )
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "url" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Encounter"
             ]
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "conditionEntry" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "bundle" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "e" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "execCondition" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "resource" ] ;
           fhir:variable [ fhir:v "condition" ] ;
           fhir:transform [ fhir:v "create" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Condition"
             ]
           ] )
         ] ) ;
         fhir:dependent ( [
           fhir:name [ fhir:v "MapMeaslesCondition" ] ;
           fhir:variable ( [ fhir:v "src" ] [ fhir:v "condition" ] )
         ] )
       ] [
         fhir:name [ fhir:v "conditionReq" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "request" ] ;
           fhir:variable [ fhir:v "req" ]
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "method" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "POST"
             ]
           ] )
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "url" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Condition"
             ]
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "immunizationEntry" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "bundle" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "e" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "execImmunization" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "resource" ] ;
           fhir:variable [ fhir:v "immunization" ] ;
           fhir:transform [ fhir:v "create" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Immunization"
             ]
           ] )
         ] ) ;
         fhir:dependent ( [
           fhir:name [ fhir:v "MapMeaslesImmunization" ] ;
           fhir:variable ( [ fhir:v "src" ] [ fhir:v "immunization" ] )
         ] )
       ] [
         fhir:name [ fhir:v "immunizationReq" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "request" ] ;
           fhir:variable [ fhir:v "req" ]
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "method" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "POST"
             ]
           ] )
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "url" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Immunization"
             ]
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "specimenEntry" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "bundle" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "e" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "execSpecimen" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "resource" ] ;
           fhir:variable [ fhir:v "specimen" ] ;
           fhir:transform [ fhir:v "create" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Specimen"
             ]
           ] )
         ] ) ;
         fhir:dependent ( [
           fhir:name [ fhir:v "MapMeaslesSpecimen" ] ;
           fhir:variable ( [ fhir:v "src" ] [ fhir:v "specimen" ] )
         ] )
       ] [
         fhir:name [ fhir:v "specimenReq" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "e" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "request" ] ;
           fhir:variable [ fhir:v "req" ]
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "method" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "POST"
             ]
           ] )
         ] [
           fhir:context [ fhir:v "req" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "url" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Specimen"
             ]
           ] )
         ] )
       ] )
     ] )
  ] [
     fhir:name [ fhir:v "MapMeaslesPatient" ] ;
     fhir:typeMode [ fhir:v "none" ] ;
     fhir:input ( [
       fhir:name [ fhir:v "src" ] ;
       fhir:type [ fhir:v "QuestionnaireResponse" ] ;
       fhir:mode [ fhir:v "source" ]
     ] [
       fhir:name [ fhir:v "patient" ] ;
       fhir:type [ fhir:v "Patient" ] ;
       fhir:mode [ fhir:v "target" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "patientId" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "patient" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:transform [ fhir:v "uuid" ]
       ] )
     ] [
       fhir:name [ fhir:v "demographics" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "demographics" ] ;
         fhir:condition [ fhir:v "linkId = '670954892057'" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "firstName" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '873240407472'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "givenName" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "name" ] ;
             fhir:variable [ fhir:v "name" ]
           ] [
             fhir:context [ fhir:v "name" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "given" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueString"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "middleName" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '246751846436'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "middleName" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "name" ] ;
             fhir:variable [ fhir:v "name" ]
           ] [
             fhir:context [ fhir:v "name" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "given" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueString"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "familyName" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '486402457213'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "familyName" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "name" ] ;
             fhir:variable [ fhir:v "name" ]
           ] [
             fhir:context [ fhir:v "name" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "family" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueString"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "gender" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '929966324957'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "gender" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "gender" ] ;
             fhir:transform [ fhir:v "evaluate" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "ans.valueCoding.code"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "birthDate" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '257830485990'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "birthDate" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "birthDate" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueDate"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "residence" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = 'residence'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "residenceType" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "address" ] ;
             fhir:variable [ fhir:v "addr" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "urbanAddr" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ] ;
               fhir:element [ fhir:v "valueCoding" ] ;
               fhir:variable [ fhir:v "val" ] ;
               fhir:condition [ fhir:v "code = 'Urban'" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "addr" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "use" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "home"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "addr" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "type" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "physical"
                 ]
               ] )
             ] )
           ] [
             fhir:name [ fhir:v "ruralAddr" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ] ;
               fhir:element [ fhir:v "valueCoding" ] ;
               fhir:variable [ fhir:v "val" ] ;
               fhir:condition [ fhir:v "code = 'Rural'" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "addr" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "use" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "home"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "addr" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "type" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "physical"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "addr" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "district" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "Rural"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "parent" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = 'parent'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "parentContact" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "contact" ] ;
             fhir:variable [ fhir:v "contact" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "contactName" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "contact" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "name" ] ;
               fhir:variable [ fhir:v "cname" ]
             ] [
               fhir:context [ fhir:v "cname" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "text" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:Id ;
                   fhir:v "ans.valueString"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "phone" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '754217593839'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "phone" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "telecom" ] ;
             fhir:variable [ fhir:v "tel" ]
           ] [
             fhir:context [ fhir:v "tel" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "system" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "phone"
               ]
             ] )
           ] [
             fhir:context [ fhir:v "tel" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "value" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueString"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "village" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '242811643559'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "village" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "address" ] ;
             fhir:variable [ fhir:v "addr" ]
           ] [
             fhir:context [ fhir:v "addr" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "line" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueString"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "landmark" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '946232932304'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "landmark" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "address" ] ;
             fhir:variable [ fhir:v "addr" ]
           ] [
             fhir:context [ fhir:v "addr" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "district" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueString"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "street" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "demographics" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '424111786438'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "street" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "patient" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "address" ] ;
             fhir:variable [ fhir:v "addr" ]
           ] [
             fhir:context [ fhir:v "addr" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "line" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueString"
               ]
             ] )
           ] )
         ] )
       ] )
     ] )
  ] [
     fhir:name [ fhir:v "MapMeaslesEncounter" ] ;
     fhir:typeMode [ fhir:v "none" ] ;
     fhir:input ( [
       fhir:name [ fhir:v "src" ] ;
       fhir:type [ fhir:v "QuestionnaireResponse" ] ;
       fhir:mode [ fhir:v "source" ]
     ] [
       fhir:name [ fhir:v "encounter" ] ;
       fhir:type [ fhir:v "Encounter" ] ;
       fhir:mode [ fhir:v "target" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "encounterId" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "encounter" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:transform [ fhir:v "uuid" ]
       ] )
     ] [
       fhir:name [ fhir:v "status" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "encounter" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "status" ] ;
         fhir:transform [ fhir:v "copy" ] ;
         fhir:parameter ( [
           fhir:value [
             a fhir:String ;
             fhir:v "finished"
           ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "class" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "encounter" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "class" ] ;
         fhir:variable [ fhir:v "cls" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "clsSys" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "cls" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "system" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"
             ]
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "clsCode" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "cls" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "code" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "AMB"
             ]
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "subject" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "subject" ] ;
         fhir:variable [ fhir:v "subj" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "encounter" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "subject" ] ;
         fhir:variable [ fhir:v "ref" ]
       ] [
         fhir:context [ fhir:v "ref" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "reference" ] ;
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [
             a fhir:String ;
             fhir:v "'Patient/' + subj.reference"
           ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "reportSite" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "reportSite" ] ;
         fhir:condition [ fhir:v "linkId = '151479012557'" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "epidNo" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "reportSite" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '992818778559'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "epidId" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "encounter" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "identifier" ] ;
             fhir:variable [ fhir:v "id" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "epidSys" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "id" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "system" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://example.org/identifier/epid"
                 ]
               ] )
             ] )
           ] [
             fhir:name [ fhir:v "epidValue" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "id" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "value" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:Id ;
                   fhir:v "ans.valueString"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "caseInfo" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "caseInfo" ] ;
         fhir:condition [ fhir:v "linkId = '216343227137'" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "firstSeen" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "caseInfo" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '554231819382'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "periodStart" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "encounter" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "period" ] ;
             fhir:variable [ fhir:v "period" ]
           ] [
             fhir:context [ fhir:v "period" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "start" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueDate"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "ipopNo" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "caseInfo" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '755731625544'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "ipopId" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "encounter" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "identifier" ] ;
             fhir:variable [ fhir:v "id" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "ipopSys" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "id" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "system" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://example.org/identifier/ip-op"
                 ]
               ] )
             ] )
           ] [
             fhir:name [ fhir:v "ipopValue" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "id" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "value" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:Id ;
                   fhir:v "ans.valueString"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "hospitalized" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "caseInfo" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '483042281962'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "hospitalization" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ] ;
             fhir:condition [ fhir:v "valueCoding.code = 'yes'" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "encounter" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "hospitalization" ] ;
             fhir:variable [ fhir:v "hosp" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "admitSource" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "hosp" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "admitSource" ] ;
               fhir:variable [ fhir:v "src" ]
             ] [
               fhir:context [ fhir:v "src" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "coding" ] ;
               fhir:variable [ fhir:v "cod" ]
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "system" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://terminology.hl7.org/CodeSystem/admit-source"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "code" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "hosp-trans"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "admitDate" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "caseInfo" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '340908984116'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "admitDate" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "encounter" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "period" ] ;
             fhir:variable [ fhir:v "period" ]
           ] [
             fhir:context [ fhir:v "period" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "start" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueDate"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "outcome" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "caseInfo" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '508745697175'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "outcomeDisp" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "encounter" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "hospitalization" ] ;
             fhir:variable [ fhir:v "hosp" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "alive" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ] ;
               fhir:element [ fhir:v "valueCoding" ] ;
               fhir:variable [ fhir:v "val" ] ;
               fhir:condition [ fhir:v "code = 'Alive'" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "hosp" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "dischargeDisposition" ] ;
               fhir:variable [ fhir:v "disp" ]
             ] [
               fhir:context [ fhir:v "disp" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "coding" ] ;
               fhir:variable [ fhir:v "cod" ]
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "system" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://terminology.hl7.org/CodeSystem/discharge-disposition"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "code" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "home"
                 ]
               ] )
             ] )
           ] [
             fhir:name [ fhir:v "dead" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ] ;
               fhir:element [ fhir:v "valueCoding" ] ;
               fhir:variable [ fhir:v "val" ] ;
               fhir:condition [ fhir:v "code = 'Dead'" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "hosp" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "dischargeDisposition" ] ;
               fhir:variable [ fhir:v "disp" ]
             ] [
               fhir:context [ fhir:v "disp" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "coding" ] ;
               fhir:variable [ fhir:v "cod" ]
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "system" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://terminology.hl7.org/CodeSystem/discharge-disposition"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "code" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "exp"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "clinicalHistory" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "clinicalHistory" ] ;
         fhir:condition [ fhir:v "linkId = '477144604557'" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "caseOrLineList" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "clinicalHistory" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '865158268604'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "encounterType" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "encounter" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "type" ] ;
             fhir:variable [ fhir:v "type" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "caseType" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "type" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "coding" ] ;
               fhir:variable [ fhir:v "cod" ]
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "system" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://example.org/CodeSystem/measles-case-type"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "code" ] ;
               fhir:transform [ fhir:v "evaluate" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "ans.valueCoding.code"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "display" ] ;
               fhir:transform [ fhir:v "evaluate" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "ans.valueCoding.display"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] )
     ] )
  ] [
     fhir:name [ fhir:v "MapMeaslesCondition" ] ;
     fhir:typeMode [ fhir:v "none" ] ;
     fhir:input ( [
       fhir:name [ fhir:v "src" ] ;
       fhir:type [ fhir:v "QuestionnaireResponse" ] ;
       fhir:mode [ fhir:v "source" ]
     ] [
       fhir:name [ fhir:v "condition" ] ;
       fhir:type [ fhir:v "Condition" ] ;
       fhir:mode [ fhir:v "target" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "conditionId" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "condition" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:transform [ fhir:v "uuid" ]
       ] )
     ] [
       fhir:name [ fhir:v "codeBlock" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "condition" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "code" ] ;
         fhir:variable [ fhir:v "code" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "measlesCoding" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "code" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "coding" ] ;
           fhir:variable [ fhir:v "coding" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "snomedSys" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "src" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "coding" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "system" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "http://snomed.info/sct"
               ]
             ] )
           ] )
         ] [
           fhir:name [ fhir:v "measlesCode" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "src" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "coding" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "code" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "14189004"
               ]
             ] )
           ] )
         ] [
           fhir:name [ fhir:v "measlesDisplay" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "src" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "coding" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "display" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "Measles"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "measlesText" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "code" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "text" ] ;
           fhir:transform [ fhir:v "copy" ] ;
           fhir:parameter ( [
             fhir:value [
               a fhir:String ;
               fhir:v "Measles"
             ]
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "subject" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "subject" ] ;
         fhir:variable [ fhir:v "subj" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "condition" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "subject" ] ;
         fhir:variable [ fhir:v "ref" ]
       ] [
         fhir:context [ fhir:v "ref" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "reference" ] ;
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [
             a fhir:String ;
             fhir:v "'Patient/' + subj.reference"
           ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "clinicalHistory" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "clinicalHistory" ] ;
         fhir:condition [ fhir:v "linkId = '477144604557'" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "onsetDate" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "clinicalHistory" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '728034137219'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "onsetDate" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "condition" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "onset" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueDate"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "symptoms" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "clinicalHistory" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '745196148424'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "symptomNote" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "condition" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "note" ] ;
             fhir:variable [ fhir:v "note" ]
           ] [
             fhir:context [ fhir:v "note" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "text" ] ;
             fhir:transform [ fhir:v "evaluate" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "ans.valueCoding.display"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "rashDate" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "clinicalHistory" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '576528567552'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "rashOnset" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "condition" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "extension" ] ;
             fhir:variable [ fhir:v "ext" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "extUrl" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "ext" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "url" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://example.org/StructureDefinition/rashOnsetDate"
                 ]
               ] )
             ] )
           ] [
             fhir:name [ fhir:v "extValue" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "ext" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "valueDate" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:Id ;
                   fhir:v "ans.valueDate"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "rashType" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "clinicalHistory" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '704922081985'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "rashTypeNote" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "condition" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "note" ] ;
             fhir:variable [ fhir:v "note" ]
           ] [
             fhir:context [ fhir:v "note" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "text" ] ;
             fhir:transform [ fhir:v "evaluate" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "'Rash type: ' + ans.valueCoding.display"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "homeVisited" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "clinicalHistory" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '207408507040'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "contactInvestNote" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "condition" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "note" ] ;
             fhir:variable [ fhir:v "note" ]
           ] [
             fhir:context [ fhir:v "note" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "text" ] ;
             fhir:transform [ fhir:v "evaluate" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "iif(ans.valueCoding.code = 'yes', 'Home visited for contact investigation: Yes', 'Home visited for contact investigation: No')"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "homeVisitDate" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "clinicalHistory" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '566661890668'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "homeVisitExt" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "condition" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "extension" ] ;
             fhir:variable [ fhir:v "ext" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "extUrl" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "ext" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "url" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://example.org/StructureDefinition/contactInvestigationDate"
                 ]
               ] )
             ] )
           ] [
             fhir:name [ fhir:v "extValue" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "ext" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "valueDate" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:Id ;
                   fhir:v "ans.valueDate"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "caseInfoStatus" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "caseInfo" ] ;
         fhir:condition [ fhir:v "linkId = '216343227137'" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "outcome" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "caseInfo" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '508745697175'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "clinicalStatus" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "condition" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "clinicalStatus" ] ;
             fhir:variable [ fhir:v "status" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "deadStatus" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ] ;
               fhir:element [ fhir:v "valueCoding" ] ;
               fhir:variable [ fhir:v "val" ] ;
               fhir:condition [ fhir:v "code = 'Dead'" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "status" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "coding" ] ;
               fhir:variable [ fhir:v "cod" ]
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "system" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://terminology.hl7.org/CodeSystem/condition-clinical"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "code" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "inactive"
                 ]
               ] )
             ] )
           ] [
             fhir:name [ fhir:v "aliveStatus" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ] ;
               fhir:element [ fhir:v "valueCoding" ] ;
               fhir:variable [ fhir:v "val" ] ;
               fhir:condition [ fhir:v "code = 'Alive'" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "status" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "coding" ] ;
               fhir:variable [ fhir:v "cod" ]
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "system" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://terminology.hl7.org/CodeSystem/condition-clinical"
                 ]
               ] )
             ] [
               fhir:context [ fhir:v "cod" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "code" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "active"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] )
     ] )
  ] [
     fhir:name [ fhir:v "MapMeaslesImmunization" ] ;
     fhir:typeMode [ fhir:v "none" ] ;
     fhir:input ( [
       fhir:name [ fhir:v "src" ] ;
       fhir:type [ fhir:v "QuestionnaireResponse" ] ;
       fhir:mode [ fhir:v "source" ]
     ] [
       fhir:name [ fhir:v "immunization" ] ;
       fhir:type [ fhir:v "Immunization" ] ;
       fhir:mode [ fhir:v "target" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "immunizationId" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "immunization" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:transform [ fhir:v "uuid" ]
       ] )
     ] [
       fhir:name [ fhir:v "status" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "immunization" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "status" ] ;
         fhir:transform [ fhir:v "copy" ] ;
         fhir:parameter ( [
           fhir:value [
             a fhir:String ;
             fhir:v "completed"
           ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "vaccineCode" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "immunization" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "vaccineCode" ] ;
         fhir:variable [ fhir:v "code" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "mrCoding" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "code" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "coding" ] ;
           fhir:variable [ fhir:v "coding" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "cvxSys" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "src" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "coding" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "system" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "http://hl7.org/fhir/sid/cvx"
               ]
             ] )
           ] )
         ] [
           fhir:name [ fhir:v "measlesCode" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "src" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "coding" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "code" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "05"
               ]
             ] )
           ] )
         ] [
           fhir:name [ fhir:v "mrDisplay" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "src" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "coding" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "display" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "Measles-Rubella (MR) Vaccine"
               ]
             ] )
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "patient" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "subject" ] ;
         fhir:variable [ fhir:v "subj" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "immunization" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "patient" ] ;
         fhir:variable [ fhir:v "ref" ]
       ] [
         fhir:context [ fhir:v "ref" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "reference" ] ;
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [
             a fhir:String ;
             fhir:v "'Patient/' + subj.reference"
           ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "vaccination" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "vaccination" ] ;
         fhir:condition [ fhir:v "linkId = '736291402384'" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "vaccinationStatus" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "vaccination" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '517772812375'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "notVaccinated" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ] ;
             fhir:condition [ fhir:v "valueCoding.code = 'no'" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "immunization" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "status" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "not-done"
               ]
             ] )
           ] )
         ] [
           fhir:name [ fhir:v "unknownStatus" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ] ;
             fhir:condition [ fhir:v "valueCoding.code = 'unknown'" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "immunization" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "statusReason" ] ;
             fhir:variable [ fhir:v "reason" ]
           ] [
             fhir:context [ fhir:v "reason" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "text" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "Unknown vaccination status"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "doses" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "vaccination" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '886125589225'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "protocol" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "immunization" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "protocolApplied" ] ;
             fhir:variable [ fhir:v "protocol" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "doseNumber" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "protocol" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "doseNumber" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:Id ;
                   fhir:v "ans.valueInteger"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "last30Days" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "vaccination" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '308128177300'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "last30DaysExt" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "immunization" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "extension" ] ;
             fhir:variable [ fhir:v "ext" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "extUrl" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "ext" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "url" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "http://example.org/StructureDefinition/vaccineLast30Days"
                 ]
               ] )
             ] )
           ] [
             fhir:name [ fhir:v "extValue" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "ext" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "valueCoding" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:Id ;
                   fhir:v "ans.valueCoding"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "lastVaccDate" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "vaccination" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '544290619304'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "lastVaccDate" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "immunization" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "occurrenceDateTime" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueDate"
               ]
             ] )
           ] )
         ] )
       ] )
     ] )
  ] [
     fhir:name [ fhir:v "MapMeaslesSpecimen" ] ;
     fhir:typeMode [ fhir:v "none" ] ;
     fhir:input ( [
       fhir:name [ fhir:v "src" ] ;
       fhir:type [ fhir:v "QuestionnaireResponse" ] ;
       fhir:mode [ fhir:v "source" ]
     ] [
       fhir:name [ fhir:v "specimen" ] ;
       fhir:type [ fhir:v "Specimen" ] ;
       fhir:mode [ fhir:v "target" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "specimenId" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "specimen" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "id" ] ;
         fhir:transform [ fhir:v "uuid" ]
       ] )
     ] [
       fhir:name [ fhir:v "specimenType" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "specimen" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "type" ] ;
         fhir:variable [ fhir:v "type" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "serumCoding" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "src" ]
         ] ) ;
         fhir:target ( [
           fhir:context [ fhir:v "type" ] ;
           fhir:contextType [ fhir:v "variable" ] ;
           fhir:element [ fhir:v "coding" ] ;
           fhir:variable [ fhir:v "coding" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "snomedSys" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "src" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "coding" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "system" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "http://snomed.info/sct"
               ]
             ] )
           ] )
         ] [
           fhir:name [ fhir:v "serumCode" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "src" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "coding" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "code" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "119364003"
               ]
             ] )
           ] )
         ] [
           fhir:name [ fhir:v "serumDisplay" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "src" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "coding" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "display" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "Serum specimen"
               ]
             ] )
           ] )
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "subject" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "subject" ] ;
         fhir:variable [ fhir:v "subj" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "specimen" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "subject" ] ;
         fhir:variable [ fhir:v "ref" ]
       ] [
         fhir:context [ fhir:v "ref" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "reference" ] ;
         fhir:transform [ fhir:v "evaluate" ] ;
         fhir:parameter ( [
           fhir:value [
             a fhir:String ;
             fhir:v "'Patient/' + subj.reference"
           ]
         ] )
       ] )
     ] [
       fhir:name [ fhir:v "specimenCollection" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "src" ] ;
         fhir:element [ fhir:v "item" ] ;
         fhir:variable [ fhir:v "specimenCollection" ] ;
         fhir:condition [ fhir:v "linkId = '271053545237'" ]
       ] ) ;
       fhir:rule ( [
         fhir:name [ fhir:v "specimenTypes" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "specimenCollection" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '412689284625'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "specimenNote" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "specimen" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "note" ] ;
             fhir:variable [ fhir:v "note" ]
           ] [
             fhir:context [ fhir:v "note" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "text" ] ;
             fhir:transform [ fhir:v "evaluate" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "'Specimen collected: ' + ans.valueCoding.display"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "collectionDate" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "specimenCollection" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '8962468583341'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "collectionDate" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "specimen" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "collection" ] ;
             fhir:variable [ fhir:v "coll" ]
           ] [
             fhir:context [ fhir:v "coll" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "collectedDateTime" ] ;
             fhir:transform [ fhir:v "copy" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:Id ;
                 fhir:v "ans.valueDate"
               ]
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "sentToLabDate" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "specimenCollection" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '718251724172'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "sentToLab" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "specimen" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "processing" ] ;
             fhir:variable [ fhir:v "proc" ]
           ] ) ;
           fhir:rule ( [
             fhir:name [ fhir:v "procDesc" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "proc" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "description" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:String ;
                   fhir:v "Specimen sent to lab"
                 ]
               ] )
             ] )
           ] [
             fhir:name [ fhir:v "procTime" ] ;
             fhir:source ( [
               fhir:context [ fhir:v "ans" ]
             ] ) ;
             fhir:target ( [
               fhir:context [ fhir:v "proc" ] ;
               fhir:contextType [ fhir:v "variable" ] ;
               fhir:element [ fhir:v "timeDateTime" ] ;
               fhir:transform [ fhir:v "copy" ] ;
               fhir:parameter ( [
                 fhir:value [
                   a fhir:Id ;
                   fhir:v "ans.valueDate"
                 ]
               ] )
             ] )
           ] )
         ] )
       ] [
         fhir:name [ fhir:v "otherSpecimen" ] ;
         fhir:source ( [
           fhir:context [ fhir:v "specimenCollection" ] ;
           fhir:element [ fhir:v "item" ] ;
           fhir:variable [ fhir:v "item" ] ;
           fhir:condition [ fhir:v "linkId = '340507649387'" ]
         ] ) ;
         fhir:rule ( [
           fhir:name [ fhir:v "otherSpecimenNote" ] ;
           fhir:source ( [
             fhir:context [ fhir:v "item" ] ;
             fhir:element [ fhir:v "answer" ] ;
             fhir:listMode [ fhir:v "first" ] ;
             fhir:variable [ fhir:v "ans" ]
           ] ) ;
           fhir:target ( [
             fhir:context [ fhir:v "specimen" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "note" ] ;
             fhir:variable [ fhir:v "note" ]
           ] [
             fhir:context [ fhir:v "note" ] ;
             fhir:contextType [ fhir:v "variable" ] ;
             fhir:element [ fhir:v "text" ] ;
             fhir:transform [ fhir:v "evaluate" ] ;
             fhir:parameter ( [
               fhir:value [
                 a fhir:String ;
                 fhir:v "'Other specimen type: ' + ans.valueString"
               ]
             ] )
           ] )
         ] )
       ] )
     ] )
  ] ) . # 

# -------------------------------------------------------------------------------------

