Données socles des Entrepôts de Données de Santé Hospitalier
0.1.0 - ci-build France (la) flag

Données socles des Entrepôts de Données de Santé Hospitalier - version de développement local (intégration continue v0.1.0) construite par les outils de publication FHIR (HL7® FHIR® Standard). Voir le répertoire des versions publiées

: Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles - TTL Representation

Draft as of 2026-07-11

Raw ttl | Download

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://hl7.org/fhir/StructureMap/Q2FSL> a fhir:StructureMap ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:Resource.id [ fhir:value "Q2FSL"] ;
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ] ;
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Narratif généré : StructureMap Q2FSL</b></p><a name=\"Q2FSL\"> </a><a name=\"hcQ2FSL\"> </a><pre class=\"fml\">#xD;\n<b>map</b><span style=\"color: navy\"> \"</span>https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureMap/Q2FSL<span style=\"color: navy\">\" = \"</span>Q2FSL<span style=\"color: navy\">\"#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles</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#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Main entry point: Transform QuestionnaireResponse to Bundle</span>#xD;\n<b>group </b>QuestionnaireResponseToBundle<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>  <span style=\"color: navy\">// </span><span style=\"color: green\">Initialize Bundle</span>#xD;\n  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\">'collection'</span> <i>\"bundletype\"</i><span style=\"color: navy\">;</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>bundle.timestamp = <span style=\"color: navy\">(</span>now()<span style=\"color: navy\">)</span> <i>\"setTimestamp\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Create Patient resource</span>#xD;\n  src<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">patientEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>patientEntry.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><span style=\"color: navy\"> {#xD;\n</span>      src<b> then </b>CreatePatient<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>\"createpatient\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span> patient.id<b> as </b><span style=\"color: maroon\">patientId</span><span style=\"color: navy\">, </span> patientEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patientId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Create Locations from geocoding data</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">src then CreateLocations(src, patient, bundle) \"create-locations\";</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Create Encounters from PMSI data</span>#xD;\n      src<b> then </b>CreateEncounters<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><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createencounters\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Create Laboratory Observations</span>#xD;\n      src<b> then </b>CreateLaboratoryObservations<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><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createlabobservations\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Create Medication Requests</span>#xD;\n      src<b> then </b>CreateMedicationRequests<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><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createmedicationrequests\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Create Medication Administrations</span>#xD;\n      src<b> then </b>CreateMedicationAdministrations<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><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createmedicationadministrations\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Create Vital Sign Observations</span>#xD;\n      src<b> then </b>CreateVitalSignObservations<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><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createvitalsigns\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"createpatientresource\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"patiententry\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Group: Create Patient from QuestionnaireResponse</span>#xD;\n<b>group </b>CreatePatient<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<span style=\"color: navy\"><b> -&gt; </b></span>patient.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-patient'</span> <i>\"patientprofile\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"patientmeta\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Extract patient identity data from linkId 4647259356106 &gt; 2958000860428</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">socioDemo</span><b> where </b>(linkId = '4647259356106')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    socioDemo.item<b> as </b><span style=\"color: maroon\">identity</span><b> where </b>(linkId = '2958000860428')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Patient name (linkId 8605698058770 = family, 6214879623503 = given)</span>#xD;\n      identity<span style=\"color: navy\"><b> -&gt; </b></span>patient.name = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'HumanName'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">name</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        identity.item<b> as </b><span style=\"color: maroon\">familyItem</span><b> where </b>(linkId = '8605698058770')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>          familyItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>name.family = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"setfamily\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"extractfamily\"</i><span style=\"color: navy\">;</span>#xD;\n        identity.item<b> as </b><span style=\"color: maroon\">givenItem</span><b> where </b>(linkId = '6214879623503')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>          givenItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>name.given = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"setgiven\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"extractgiven\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"setname\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">NIR identifier (linkId 5711960356160)</span>#xD;\n      identity.item<b> as </b><span style=\"color: maroon\">nirItem</span><b> where </b>(linkId = '5711960356160')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        nirItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.identifier = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Identifier'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">nir</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans<span style=\"color: navy\"><b> -&gt; </b></span>nir.system = <span style=\"color: blue\">'urn:oid:1.2.250.1.213.1.4.8'</span> <i>\"nirsystem\"</i><span style=\"color: navy\">;</span>#xD;\n          ans<span style=\"color: navy\"><b> -&gt; </b></span>nir.value = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"nirvalue\"</i><span style=\"color: navy\">;</span>#xD;\n          ans<span style=\"color: navy\"><b> -&gt; </b></span>nir.type = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://interopsante.org/fhir/CodeSystem/fr-v2-0203'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'NIR'</span><span style=\"color: navy\">)</span> <i>\"nirtype\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"setnir\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractnir\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">INS identifier (linkId 3764723550987)</span>#xD;\n      identity.item<b> as </b><span style=\"color: maroon\">insItem</span><b> where </b>(linkId = '3764723550987')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        insItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.identifier = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Identifier'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ins</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans<span style=\"color: navy\"><b> -&gt; </b></span>ins.system = <span style=\"color: blue\">'urn:oid:1.2.250.1.213.1.4.10'</span> <i>\"inssystem\"</i><span style=\"color: navy\">;</span>#xD;\n          ans<span style=\"color: navy\"><b> -&gt; </b></span>ins.value = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"insvalue\"</i><span style=\"color: navy\">;</span>#xD;\n          ans<span style=\"color: navy\"><b> -&gt; </b></span>ins.type = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://interopsante.org/fhir/CodeSystem/fr-v2-0203'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'INS-C'</span><span style=\"color: navy\">)</span> <i>\"instype\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"setins\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractins\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Birth date (linkId 5036133558154)</span>#xD;\n      identity.item<b> as </b><span style=\"color: maroon\">birthItem</span><b> where </b>(linkId = '5036133558154')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        birthItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.birthDate = <span style=\"color: navy\">(</span>%ans.valueDate<span style=\"color: navy\">)</span> <i>\"setbirthdate\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractbirthdate\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Death date (linkId 5633552097315)</span>#xD;\n      identity.item<b> as </b><span style=\"color: maroon\">deathItem</span><b> where </b>(linkId = '5633552097315')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        deathItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.deceased = <span style=\"color: navy\">(</span>%ans.valueDate<span style=\"color: navy\">)</span> <i>\"setdeceaseddate\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Death source (linkId 9098810065693)</span>#xD;\n        deathItem.item<b> as </b><span style=\"color: maroon\">deathSource</span><b> where </b>(linkId = '9098810065693')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>          deathSource.answer<b> as </b><span style=\"color: maroon\">sourceAns</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ext</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            sourceAns<span style=\"color: navy\"><b> -&gt; </b></span>ext.url = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-death-source'</span> <i>\"deathsourceurl\"</i><span style=\"color: navy\">;</span>#xD;\n            sourceAns<span style=\"color: navy\"><b> -&gt; </b></span>ext.value = <span style=\"color: navy\">(</span>%sourceAns.valueCoding<span style=\"color: navy\">)</span> <i>\"deathsourcevalue\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"setdeathsourceext\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"extractdeathsource\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractdeath\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Multiple birth rank (linkId 6931296968515)</span>#xD;\n      identity.item<b> as </b><span style=\"color: maroon\">multipleItem</span><b> where </b>(linkId = '6931296968515')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        multipleItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.multipleBirth = <span style=\"color: navy\">(</span>%ans.valueInteger<span style=\"color: navy\">)</span> <i>\"setmultiplebirth\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractmultiplebirth\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"processidentity\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Gender from PMSI data (linkId 3894630481120 within 2825244231605)</span>#xD;\n    src.item<b> as </b><span style=\"color: maroon\">pmsiGroup</span><b> where </b>(linkId = '2825244231605')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      pmsiGroup.item<b> as </b><span style=\"color: maroon\">sexItem</span><b> where </b>(linkId = '3894630481120')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        sexItem.answer<b> as </b><span style=\"color: maroon\">ans</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans.valueString<b> as </b><span style=\"color: maroon\">female</span><b> where </b>($this = 'f')<span style=\"color: navy\"><b> -&gt; </b></span>patient.gender = <span style=\"color: blue\">'female'</span> <i>\"setGenderF\"</i><span style=\"color: navy\">;</span>#xD;\n          ans.valueString<b> as </b><span style=\"color: maroon\">female</span><b> where </b>($this = 'm')<span style=\"color: navy\"><b> -&gt; </b></span>patient.gender = <span style=\"color: blue\">'male'</span> <i>\"setGenderM\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"valueCoding\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractgender\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Address from code géographique (linkId 2446369196222)</span>#xD;\n      pmsiGroup.item<b> as </b><span style=\"color: maroon\">codeGeoItem</span><b> where </b>(linkId = '2446369196222')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        codeGeoItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>patient.address = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Address'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">addr</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans<span style=\"color: navy\"><b> -&gt; </b></span>addr.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><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\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-pmsi-code-geo'</span> <i>\"codegeourl\"</i><span style=\"color: navy\">;</span>#xD;\n            ans.value<b> as </b><span style=\"color: maroon\">val</span><span style=\"color: navy\"><b> -&gt; </b></span>ext.value = <b>cast</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">val</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'code'</span><span style=\"color: navy\">)</span> <i>\"codegeovalue\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"setcodegeoext\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">// </span><span style=\"color: green\">Environnement</span>#xD;\n          socioDemo.item<b> as </b><span style=\"color: maroon\">environnementItem</span><b> where </b>(linkId = '5491974639955')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>            <span style=\"color: navy\">// </span><span style=\"color: green\">geolocation</span>#xD;\n            environnementItem.item<b> as </b><span style=\"color: maroon\">geocodageItem</span><b> where </b>(linkId = '3816475533472')<span style=\"color: navy\"><b> -&gt; </b></span>addr.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">geolocationExt</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>              geocodageItem.item<b> as </b><span style=\"color: maroon\">latItem</span><b> where </b>(linkId = '3709843054556')<span style=\"color: navy\"><b> -&gt; </b></span> geolocationExt.url = <span style=\"color: blue\">'http://hl7.org/fhir/StructureDefinition/geolocation'</span><span style=\"color: navy\">, </span> geolocationExt.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">latExt</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                latItem.answer<b> as </b><span style=\"color: maroon\">lat</span><span style=\"color: navy\"><b> -&gt; </b></span> latExt.url = <span style=\"color: blue\">'latitude'</span><span style=\"color: navy\">, </span> latExt.value = <span style=\"color: navy\">(</span>%lat.valueDecimal<span style=\"color: navy\">)</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                  geocodageItem.item<b> as </b><span style=\"color: maroon\">longItem</span><b> where </b>(linkId = '7651448032665')<span style=\"color: navy\"><b> -&gt; </b></span>geolocationExt.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">longExt</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                    longItem.answer<b> as </b><span style=\"color: maroon\">long</span><span style=\"color: navy\"><b> -&gt; </b></span> longExt.url = <span style=\"color: blue\">'longitude'</span><span style=\"color: navy\">, </span> longExt.value = <span style=\"color: navy\">(</span>%long.valueDecimal<span style=\"color: navy\">)</span> <i>\"setLong\"</i><span style=\"color: navy\">;</span>#xD;\n                  <span style=\"color: navy\">}</span> <i>\"createLongExt\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">}</span> <i>\"setLat\"</i><span style=\"color: navy\">;</span>#xD;\n              <span style=\"color: navy\">}</span> <i>\"createLatExt\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"createGeolocExt\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">IRIS</span>#xD;\n            environnementItem.item<b> as </b><span style=\"color: maroon\">irisItem</span><b> where </b>(linkId = '7621032273792')<span style=\"color: navy\"><b> -&gt; </b></span> addr.line<b> as </b><span style=\"color: maroon\">addrLine</span><span style=\"color: navy\">, </span> addrLine.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">irisExt</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>              irisItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> irisExt.url = <span style=\"color: blue\">'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-censusTract'</span><span style=\"color: navy\">, </span> irisExt.valueString = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"setIrisExt\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"navIrisItem\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"navEnv\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"setaddress\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractcodegeo\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"extractpmsidemographics\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"processsociodemographics\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Group: Create Locations from geocoding and IRIS data</span>#xD;\n<b>group </b>CreateLocations<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, <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>  <span style=\"color: navy\">// </span><span style=\"color: green\">Extract geocoding data from linkId 4647259356106 &gt; 5491974639955 &gt; 3816475533472</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">socioDemo</span><b> where </b>(linkId = '4647259356106')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    socioDemo.item<b> as </b><span style=\"color: maroon\">environment</span><b> where </b>(linkId = '5491974639955')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Geocoding locations (repeating group 3816475533472)</span>#xD;\n      environment.item<b> as </b><span style=\"color: maroon\">geocodingItem</span><b> where </b>(linkId = '3816475533472')<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">locationEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        geocodingItem<span style=\"color: navy\"><b> -&gt; </b></span>locationEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Location'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">location</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          geocodingItem<span style=\"color: navy\"><b> -&gt; </b></span>location.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"locationid\"</i><span style=\"color: navy\">;</span>#xD;\n          geocodingItem<span style=\"color: navy\"><b> -&gt; </b></span>location.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            geocodingItem<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-location'</span> <i>\"locationprofile\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"locationmeta\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">// </span><span style=\"color: green\">Position with latitude and longitude</span>#xD;\n          geocodingItem<span style=\"color: navy\"><b> -&gt; </b></span>location.position = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'LocationPosition'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">pos</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            <span style=\"color: navy\">// </span><span style=\"color: green\">Latitude (linkId 3709843054556)</span>#xD;\n            geocodingItem.item<b> as </b><span style=\"color: maroon\">latItem</span><b> where </b>(linkId = '3709843054556')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              latItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>pos.latitude = <span style=\"color: navy\">(</span>%ans.valueDecimal<span style=\"color: navy\">)</span> <i>\"setlatitude\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"extractlatitude\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">Longitude (linkId 7651448032665)</span>#xD;\n            geocodingItem.item<b> as </b><span style=\"color: maroon\">longItem</span><b> where </b>(linkId = '7651448032665')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              longItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>pos.longitude = <span style=\"color: navy\">(</span>%ans.valueDecimal<span style=\"color: navy\">)</span> <i>\"setlongitude\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"extractlongitude\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"setposition\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">// </span><span style=\"color: green\">Extension for collection date (linkId 1185653257776)</span>#xD;\n          <span style=\"color: navy\">// </span><span style=\"color: green\">geocodingItem.item as dateItem where (linkId = '1185653257776') then {             dateItem.answer as ans -&gt; location.extension = create('Extension') as ext then {               ans -&gt; ext.url = 'http://hl7.org/fhir/StructureDefinition/data-collection-date' \"date-url\";               ans -&gt; ext.value = (%ans.valueDate) \"date-value\";             } \"set-collection-date\";           } \"extract-collection-date\";</span>#xD;\n          location<span style=\"color: navy\"><b> -&gt; </b></span>locationEntry.request<b> as </b><span style=\"color: maroon\">request</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            location<span style=\"color: navy\"><b> -&gt; </b></span>request.method = <span style=\"color: blue\">'POST'</span> <i>\"setmethod\"</i><span style=\"color: navy\">;</span>#xD;\n            location<span style=\"color: navy\"><b> -&gt; </b></span>request.url = <span style=\"color: blue\">'Location'</span> <i>\"seturl\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"setrequest\"</i><span style=\"color: navy\">;</span>#xD;\n          location.id<b> as </b><span style=\"color: maroon\">locId</span><span style=\"color: navy\"><b> -&gt; </b></span>locationEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">locId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"createlocation\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"geocodinglocationentry\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">IRIS locations (repeating item 7621032273792)</span>#xD;\n      environment.item<b> as </b><span style=\"color: maroon\">irisItem</span><b> where </b>(linkId = '7621032273792')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        irisItem.answer<b> as </b><span style=\"color: maroon\">irisAnswer</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">locationEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          irisAnswer<span style=\"color: navy\"><b> -&gt; </b></span>locationEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Location'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">location</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            irisAnswer<span style=\"color: navy\"><b> -&gt; </b></span>location.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"locationid\"</i><span style=\"color: navy\">;</span>#xD;\n            irisAnswer<span style=\"color: navy\"><b> -&gt; </b></span>location.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>              irisAnswer<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-location'</span> <i>\"locationprofile\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"locationmeta\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">IRIS code as identifier</span>#xD;\n            irisAnswer<span style=\"color: navy\"><b> -&gt; </b></span>location.identifier = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Identifier'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">identifier</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>              irisAnswer<span style=\"color: navy\"><b> -&gt; </b></span>identifier.system = <span style=\"color: blue\">'urn:oid:2.16.840.1.113883.2.8.1.5.5'</span> <i>\"irissystem\"</i><span style=\"color: navy\">;</span>#xD;\n              irisAnswer<span style=\"color: navy\"><b> -&gt; </b></span>identifier.value = <span style=\"color: navy\">(</span>%irisAnswer.valueCoding.code<span style=\"color: navy\">)</span> <i>\"irisvalue\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"setirisidentifier\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">Collection date from nested item (linkId 4999580038872)</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">irisAnswer.item as dateItem where (linkId = '4999580038872') then {               dateItem.answer as ans -&gt; location.extension = create('Extension') as ext then {                 ans -&gt; ext.url = 'http://hl7.org/fhir/StructureDefinition/data-collection-date' \"date-url\";                 ans -&gt; ext.value = (%ans.valueDate) \"date-value\";               } \"set-collection-date\";             } \"extract-iris-date\";</span>#xD;\n            location<span style=\"color: navy\"><b> -&gt; </b></span>locationEntry.request<b> as </b><span style=\"color: maroon\">request</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>              location<span style=\"color: navy\"><b> -&gt; </b></span>request.method = <span style=\"color: blue\">'POST'</span> <i>\"setmethod\"</i><span style=\"color: navy\">;</span>#xD;\n              location<span style=\"color: navy\"><b> -&gt; </b></span>request.url = <span style=\"color: blue\">'Location'</span> <i>\"seturl\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"setrequest\"</i><span style=\"color: navy\">;</span>#xD;\n            location.id<b> as </b><span style=\"color: maroon\">locId</span><span style=\"color: navy\"><b> -&gt; </b></span>locationEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">locId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"createirislocation\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"irislocationentry\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"processiris\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"processenvironment\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"processsociodemographicslocation\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Group: Create Encounters from PMSI data</span>#xD;\n<b>group </b>CreateEncounters<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, <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>  <span style=\"color: navy\">// </span><span style=\"color: green\">PMSI data group (linkId 2825244231605) - Note: This can repeat in the structure</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">pmsiItem</span><b> where </b>(linkId = '2825244231605')<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">encounterEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    pmsiItem<span style=\"color: navy\"><b> -&gt; </b></span>encounterEntry.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><span style=\"color: navy\"> {#xD;\n</span>      pmsiItem<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      pmsiItem<span style=\"color: navy\"><b> -&gt; </b></span>encounter.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        pmsiItem<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-encounter'</span> <i>\"encounterprofile\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"encountermeta\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">status</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>encounter.status = <span style=\"color: blue\">'finished'</span> <i>\"setStatus\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">class</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span>encounter.class = <b>c</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/v3-ActCode'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'IMP'</span><span style=\"color: navy\">)</span> <i>\"setClass\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Link to patient</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span> encounter.subject = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> patient.id<b> as </b><span style=\"color: maroon\">patId</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patId</span><span style=\"color: navy\">)</span> <i>\"setsubject\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Encounter period (start: 5991443718282, end: 6114780320846)</span>#xD;\n      pmsiItem<span style=\"color: navy\"><b> -&gt; </b></span>encounter.period = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Period'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">period</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        pmsiItem.item<b> as </b><span style=\"color: maroon\">startItem</span><b> where </b>(linkId = '5991443718282')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>          startItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>period.start = <span style=\"color: navy\">(</span>%ans.valueDate<span style=\"color: navy\">)</span> <i>\"setstart\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"extractstart\"</i><span style=\"color: navy\">;</span>#xD;\n        pmsiItem.item<b> as </b><span style=\"color: maroon\">endItem</span><b> where </b>(linkId = '6114780320846')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>          endItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>period.end = <span style=\"color: navy\">(</span>%ans.valueDate<span style=\"color: navy\">)</span> <i>\"setend\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"extractend\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"setperiod\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Mode d'entrée (linkId 6172398101212)</span>#xD;\n      pmsiItem.item<b> as </b><span style=\"color: maroon\">modeInItem</span><b> where </b>(linkId = '6172398101212')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        modeInItem.answer<b> as </b><span style=\"color: maroon\">ans</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans.valueString<b> as </b><span style=\"color: maroon\">valueString</span><span style=\"color: navy\"><b> -&gt; </b></span> encounter.hospitalization<b> as </b><span style=\"color: maroon\">hosp</span><span style=\"color: navy\">, </span> hosp.admitSource<b> as </b><span style=\"color: maroon\">admitSource</span><span style=\"color: navy\">, </span> admitSource.coding<b> as </b><span style=\"color: maroon\">admitSourceCoding</span><span style=\"color: navy\">, </span> admitSourceCoding.code = <span style=\"color: maroon\">valueString</span> <i>\"setadmitsource\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"navValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractmodein\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Mode de sortie (linkId 3354867075704)</span>#xD;\n      pmsiItem.item<b> as </b><span style=\"color: maroon\">modeOutItem</span><b> where </b>(linkId = '3354867075704')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        modeOutItem.answer<b> as </b><span style=\"color: maroon\">ans</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans.valueString<b> as </b><span style=\"color: maroon\">valueString</span><span style=\"color: navy\"><b> -&gt; </b></span> encounter.hospitalization<b> as </b><span style=\"color: maroon\">hosp</span><span style=\"color: navy\">, </span> hosp.dischargeDisposition<b> as </b><span style=\"color: maroon\">dischargeDisposition</span><span style=\"color: navy\">, </span> dischargeDisposition.coding<b> as </b><span style=\"color: maroon\">dischargeDispositionCoding</span><span style=\"color: navy\">, </span> dischargeDispositionCoding.code = <span style=\"color: maroon\">valueString</span> <i>\"setdischargedisposition\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"navValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractmodeout\"</i><span style=\"color: navy\">;</span>#xD;\n      src<span style=\"color: navy\"><b> -&gt; </b></span> encounter.id<b> as </b><span style=\"color: maroon\">encId</span><span style=\"color: navy\">, </span> encounterEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">encId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Create nested Conditions and Procedures</span>#xD;\n      pmsiItem<b> then </b>CreateConditions<span style=\"color: navy\">(</span><span style=\"color: maroon\">pmsiItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">encounter</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createconditions\"</i><span style=\"color: navy\">;</span>#xD;\n      pmsiItem<b> then </b>CreateProcedures<span style=\"color: navy\">(</span><span style=\"color: maroon\">pmsiItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">encounter</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createprocedures\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"createencounter\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"encounterentry\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Group: Create Conditions from nested diagnostics</span>#xD;\n<b>group </b>CreateConditions<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">pmsiItem</span>, <b>target</b> <span style=\"color: maroon\">patient</span><span style=\"color: navy\"> : </span>Patient, <b>target</b> <span style=\"color: maroon\">encounter</span><span style=\"color: navy\"> : </span>Encounter, <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>  <span style=\"color: navy\">// </span><span style=\"color: green\">Diagnostics group (linkId 9391816419630) - can repeat</span>#xD;\n  pmsiItem.item<b> as </b><span style=\"color: maroon\">diagGroup</span><b> where </b>(linkId = '9391816419630')<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">conditionEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    diagGroup<span style=\"color: navy\"><b> -&gt; </b></span>conditionEntry.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><span style=\"color: navy\"> {#xD;\n</span>      diagGroup<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      diagGroup<span style=\"color: navy\"><b> -&gt; </b></span>condition.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        diagGroup<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-condition'</span> <i>\"conditionprofile\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"conditionmeta\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Link to patient</span>#xD;\n      diagGroup<span style=\"color: navy\"><b> -&gt; </b></span> condition.subject = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> patient.id<b> as </b><span style=\"color: maroon\">patId</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patId</span><span style=\"color: navy\">)</span> <i>\"setsubject\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Link to encounter</span>#xD;\n      diagGroup<span style=\"color: navy\"><b> -&gt; </b></span> encounter.id<b> as </b><span style=\"color: maroon\">encId</span><span style=\"color: navy\">, </span> condition.encounter = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Encounter/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">encId</span><span style=\"color: navy\">)</span> <i>\"setencounter\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Diagnostic code (linkId 5505101189372) - CIM-10</span>#xD;\n      diagGroup.item<b> as </b><span style=\"color: maroon\">diagCodeItem</span><b> where </b>(linkId = '5505101189372')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        diagCodeItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>condition.code = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">code</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans<span style=\"color: navy\"><b> -&gt; </b></span> code.coding<b> as </b><span style=\"color: maroon\">coding</span><span style=\"color: navy\">, </span> coding.code = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"setcoding\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"setcode\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractdiagcode\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Type de diagnostic (linkId 6427586743735) - DP/DAS/DR</span>#xD;\n      diagGroup.item<b> as </b><span style=\"color: maroon\">diagTypeItem</span><b> where </b>(linkId = '6427586743735')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        diagTypeItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>condition.category = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">category</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans<span style=\"color: navy\"><b> -&gt; </b></span>category.coding = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Coding'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">coding</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            ans<span style=\"color: navy\"><b> -&gt; </b></span>coding.system = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/CodeSystem/pmsi-mco-diag-type'</span> <i>\"diagtypesystem\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span>coding.code = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"diagtypecode\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"setcategorycoding\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"setcategory\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractdiagtype\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Recorded date (linkId 7114466839467)</span>#xD;\n      diagGroup.item<b> as </b><span style=\"color: maroon\">dateItem</span><b> where </b>(linkId = '7114466839467')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        dateItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>condition.recordedDate = <span style=\"color: navy\">(</span>%ans.valueDate<span style=\"color: navy\">)</span> <i>\"setrecordeddate\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractrecordeddate\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">fullurl</span>#xD;\n      pmsiItem<span style=\"color: navy\"><b> -&gt; </b></span> condition.id<b> as </b><span style=\"color: maroon\">condId</span><span style=\"color: navy\">, </span> conditionEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">condId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"createcondition\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"conditionentry\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Group: Create Procedures from nested actes</span>#xD;\n<b>group </b>CreateProcedures<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">pmsiItem</span>, <b>target</b> <span style=\"color: maroon\">patient</span><span style=\"color: navy\"> : </span>Patient, <b>target</b> <span style=\"color: maroon\">encounter</span><span style=\"color: navy\"> : </span>Encounter, <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>  <span style=\"color: navy\">// </span><span style=\"color: green\">Actes group (linkId 591926901726) - can repeat</span>#xD;\n  pmsiItem.item<b> as </b><span style=\"color: maroon\">acteGroup</span><b> where </b>(linkId = '591926901726')<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">procedureEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    acteGroup<span style=\"color: navy\"><b> -&gt; </b></span>procedureEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Procedure'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">procedure</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      acteGroup<span style=\"color: navy\"><b> -&gt; </b></span>procedure.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"procedureid\"</i><span style=\"color: navy\">;</span>#xD;\n      acteGroup<span style=\"color: navy\"><b> -&gt; </b></span>procedure.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        acteGroup<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-procedure'</span> <i>\"procedureprofile\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"proceduremeta\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">status</span>#xD;\n      acteGroup<span style=\"color: navy\"><b> -&gt; </b></span>procedure.status = <span style=\"color: blue\">'completed'</span> <i>\"setStatus\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Link to patient</span>#xD;\n      acteGroup<span style=\"color: navy\"><b> -&gt; </b></span> procedure.subject = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> patient.id<b> as </b><span style=\"color: maroon\">patId</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patId</span><span style=\"color: navy\">)</span> <i>\"setsubject\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Link to encounter</span>#xD;\n      acteGroup<span style=\"color: navy\"><b> -&gt; </b></span> encounter.id<b> as </b><span style=\"color: maroon\">encId</span><span style=\"color: navy\">, </span> procedure.encounter = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Encounter/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">encId</span><span style=\"color: navy\">)</span> <i>\"setencounter\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Acte code (linkId 7758110033600) - CCAM</span>#xD;\n      acteGroup.item<b> as </b><span style=\"color: maroon\">acteCodeItem</span><b> where </b>(linkId = '7758110033600')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        acteCodeItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>procedure.code = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">code</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans<span style=\"color: navy\"><b> -&gt; </b></span> code.coding<b> as </b><span style=\"color: maroon\">coding</span><span style=\"color: navy\">, </span> coding.code = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"setcoding\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"setcode\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractactecode\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Date de l'acte (linkId 5066866286682)</span>#xD;\n      acteGroup.item<b> as </b><span style=\"color: maroon\">dateItem</span><b> where </b>(linkId = '5066866286682')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        dateItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>procedure.performed = <span style=\"color: navy\">(</span>%ans.valueDateTime<span style=\"color: navy\">)</span> <i>\"setperformed\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractperformeddate\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">fullurl</span>#xD;\n      pmsiItem<span style=\"color: navy\"><b> -&gt; </b></span> procedure.id<b> as </b><span style=\"color: maroon\">procId</span><span style=\"color: navy\">, </span> procedureEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">procId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"createprocedure\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"procedureentry\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Group: Create Medication Requests</span>#xD;\n<b>group </b>CreateMedicationRequests<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, <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>  <span style=\"color: navy\">// </span><span style=\"color: green\">Exposition médicamenteuse (linkId 817801935685)</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">medExpoGroup</span><b> where </b>(linkId = '817801935685')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Médicament prescrit (linkId 156631794800) - repeating</span>#xD;\n    medExpoGroup.item<b> as </b><span style=\"color: maroon\">prescribedGroup</span><b> where </b>(linkId = '156631794800')<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">medReqEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      prescribedGroup<span style=\"color: navy\"><b> -&gt; </b></span>medReqEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'MedicationRequest'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">medReq</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        prescribedGroup<span style=\"color: navy\"><b> -&gt; </b></span>medReq.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"medreqid\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">fullurl</span>#xD;\n        src<span style=\"color: navy\"><b> -&gt; </b></span> medReq.id<b> as </b><span style=\"color: maroon\">medReqId</span><span style=\"color: navy\">, </span> medReqEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">medReqId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n        prescribedGroup<span style=\"color: navy\"><b> -&gt; </b></span>medReq.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          prescribedGroup<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-medication-request'</span> <i>\"medreqprofile\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"medreqmeta\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Link to patient</span>#xD;\n        prescribedGroup<span style=\"color: navy\"><b> -&gt; </b></span> medReq.subject = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> patient.id<b> as </b><span style=\"color: maroon\">patId</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patId</span><span style=\"color: navy\">)</span> <i>\"setsubject\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Status and intent</span>#xD;\n        prescribedGroup<span style=\"color: navy\"><b> -&gt; </b></span>medReq.status = <span style=\"color: blue\">'active'</span> <i>\"setstatus\"</i><span style=\"color: navy\">;</span>#xD;\n        prescribedGroup<span style=\"color: navy\"><b> -&gt; </b></span>medReq.intent = <span style=\"color: blue\">'order'</span> <i>\"setintent\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">MedicationCodeableConcept</span>#xD;\n        prescribedGroup.answer<b> as </b><span style=\"color: maroon\">prescribedMedication</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          prescribedMedication.item<b> as </b><span style=\"color: maroon\">atcItem</span><b> where </b>(linkId = '1923143398283')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>            atcItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> medReq.medication = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">medReqCC</span><span style=\"color: navy\">, </span> medReqCC.coding<b> as </b><span style=\"color: maroon\">medReqC</span><span style=\"color: navy\">, </span> medReqC.code = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> medReqC.display = <span style=\"color: navy\">(</span>%prescribedMedication.valueString<span style=\"color: navy\">)</span> <i>\"setAtcCoding\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"navAtcItem\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"navPrescribedMedication\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Create Medication resource and reference</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">prescribedGroup -&gt; bundle.entry as medEntry then {           prescribedGroup -&gt; medEntry.resource = create('Medication') as medication then {             prescribedGroup -&gt; medication.id = uuid() \"med-id\";              // ATC code from nested items             prescribedGroup.item as atcItem where (linkId.contains('ATC')) then {               atcItem.answer as ans -&gt; medication.code = create('CodeableConcept') as code then {                 ans -&gt; code.coding = (%ans.valueCoding) \"set-atc-coding\";               } \"set-med-code\";             } \"extract-atc\";              prescribedGroup -&gt; medication.id as medId, medEntry.fullUrl = append('urn:uuid:', medId) \"set-fullUrl\";              // Link MedicationRequest to Medication             prescribedGroup -&gt; medication.id as medId, medReq.medication = create('Reference') as ref, ref.reference = append('Medication/', medId) \"set-medication-reference\";            } \"create-medication\";         } \"medication-entry\";</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Dosage instructions</span>#xD;\n        prescribedGroup<span style=\"color: navy\"><b> -&gt; </b></span>medReq.dosageInstruction = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Dosage'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">dosage</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          <span style=\"color: navy\">// </span><span style=\"color: green\">Route</span>#xD;\n          prescribedGroup.answer<b> as </b><span style=\"color: maroon\">prescribedMedication</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            prescribedMedication.item<b> as </b><span style=\"color: maroon\">routeItem</span><b> where </b>(linkId = '387026794874')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              routeItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>dosage.route<b> as </b><span style=\"color: maroon\">route</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                ans<span style=\"color: navy\"><b> -&gt; </b></span> route.coding<b> as </b><span style=\"color: maroon\">routeCoding</span><span style=\"color: navy\">, </span> routeCoding.code = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"setroutecoding\"</i><span style=\"color: navy\">;</span>#xD;\n              <span style=\"color: navy\">}</span> <i>\"setroute\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"navRouteItem\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"navPrescribedMedication\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">// </span><span style=\"color: green\">Timing</span>#xD;\n          medExpoGroup.item<b> as </b><span style=\"color: maroon\">posoGroup</span><b> where </b>(linkId = '6348237104421')<span style=\"color: navy\"><b> -&gt; </b></span> dosage.timing<b> as </b><span style=\"color: maroon\">timing</span><span style=\"color: navy\">, </span> timing.repeat<b> as </b><span style=\"color: maroon\">timingRepeat</span><span style=\"color: navy\">, </span> timingRepeat.boundsPeriod<b> as </b><span style=\"color: maroon\">timingPeriod</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            posoGroup.item<b> as </b><span style=\"color: maroon\">DateDebItem</span><b> where </b>(linkId = '316347573327')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              DateDebItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>timingPeriod.start = <span style=\"color: navy\">(</span>%ans.valueDate<span style=\"color: navy\">)</span> <i>\"setDateDeb\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"navDateDeb\"</i><span style=\"color: navy\">;</span>#xD;\n            posoGroup.item<b> as </b><span style=\"color: maroon\">DateFinItem</span><b> where </b>(linkId = '429570775935')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              DateFinItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>timingPeriod.end = <span style=\"color: navy\">(</span>%ans.valueDate<span style=\"color: navy\">)</span> <i>\"setDateFin\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"navDateFin\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"navPoso\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"setdosage\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"createmedreq\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"medreqentry\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"processmedexpo\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Group: Create Medication Administrations</span>#xD;\n<b>group </b>CreateMedicationAdministrations<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, <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>  <span style=\"color: navy\">// </span><span style=\"color: green\">Exposition médicamenteuse (linkId 817801935685)</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">medExpoGroup</span><b> where </b>(linkId = '817801935685')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Médicament administré (linkId 266852453304) - repeating</span>#xD;\n    medExpoGroup.item<b> as </b><span style=\"color: maroon\">adminGroup</span><b> where </b>(linkId = '266852453304')<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">medAdminEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      adminGroup<span style=\"color: navy\"><b> -&gt; </b></span>medAdminEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'MedicationAdministration'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">medAdmin</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        adminGroup<span style=\"color: navy\"><b> -&gt; </b></span>medAdmin.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"medadminid\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">fullurl</span>#xD;\n        src<span style=\"color: navy\"><b> -&gt; </b></span> medAdmin.id<b> as </b><span style=\"color: maroon\">medAdminId</span><span style=\"color: navy\">, </span> medAdminEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">medAdminId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n        adminGroup<span style=\"color: navy\"><b> -&gt; </b></span>medAdmin.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          adminGroup<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-medication-administration'</span> <i>\"medadminprofile\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"medadminmeta\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Link to patient</span>#xD;\n        adminGroup<span style=\"color: navy\"><b> -&gt; </b></span> medAdmin.subject = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> patient.id<b> as </b><span style=\"color: maroon\">patId</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patId</span><span style=\"color: navy\">)</span> <i>\"setsubject\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Status</span>#xD;\n        adminGroup<span style=\"color: navy\"><b> -&gt; </b></span>medAdmin.status = <span style=\"color: blue\">'completed'</span> <i>\"setstatus\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">MedicationCodeableConcept</span>#xD;\n        adminGroup.answer<b> as </b><span style=\"color: maroon\">administeredMedication</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          administeredMedication.item<b> as </b><span style=\"color: maroon\">atcItem</span><b> where </b>(linkId = '631972144976')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>            atcItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span> medAdmin.medication = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">medAdminCC</span><span style=\"color: navy\">, </span> medAdminCC.coding<b> as </b><span style=\"color: maroon\">medAdminC</span><span style=\"color: navy\">, </span> medAdminC.code = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> medAdminC.display = <span style=\"color: navy\">(</span>%administeredMedication.valueString<span style=\"color: navy\">)</span> <i>\"setAtcCoding\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"navAtcItem\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"navadministeredMedication\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Create Medication resource and reference</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">adminGroup -&gt; bundle.entry as medEntry then {           adminGroup -&gt; medEntry.resource = create('Medication') as medication then {             adminGroup -&gt; medication.id = uuid() \"med-id\";              // ATC code from nested items             adminGroup.item as atcItem where (linkId.contains('ATC')) then {               atcItem.answer as ans -&gt; medication.code = create('CodeableConcept') as code then {                 ans -&gt; code.coding = (%ans.valueCoding) \"set-atc-coding\";               } \"set-med-code\";             } \"extract-atc\";              adminGroup -&gt; medication.id as medId, medEntry.fullUrl = append('Medication/', medId) \"set-fullUrl\";              // Link MedicationAdministration to Medication             adminGroup -&gt; medication.id as medId, medAdmin.medication = create('Reference') as ref, ref.reference = append('urn:uuid:', medId) \"set-medication-reference\";            } \"create-medication\";         } \"medication-entry\";</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Dosage (FHIR)</span>#xD;\n        adminGroup<span style=\"color: navy\"><b> -&gt; </b></span>medAdmin.dosage<b> as </b><span style=\"color: maroon\">dosage</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          <span style=\"color: navy\">// </span><span style=\"color: green\">Route</span>#xD;\n          adminGroup.answer<b> as </b><span style=\"color: maroon\">administeredMedication</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            administeredMedication.item<b> as </b><span style=\"color: maroon\">routeItem</span><b> where </b>(linkId = '811931484859')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              routeItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>dosage.route = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">route</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                ans<span style=\"color: navy\"><b> -&gt; </b></span> route.coding<b> as </b><span style=\"color: maroon\">routeCoding</span><span style=\"color: navy\">, </span> routeCoding.code = <span style=\"color: navy\">(</span>%ans.valueString<span style=\"color: navy\">)</span> <i>\"setroutecoding\"</i><span style=\"color: navy\">;</span>#xD;\n              <span style=\"color: navy\">}</span> <i>\"setroute\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"navRoute\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"navadministeredMedication\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">// </span><span style=\"color: green\">Dosage (QR)</span>#xD;\n          medExpoGroup.item<b> as </b><span style=\"color: maroon\">doseGroup</span><b> where </b>(linkId = '5720103839343')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>            <span style=\"color: navy\">// </span><span style=\"color: green\">Dose</span>#xD;\n            doseGroup.item<b> as </b><span style=\"color: maroon\">quantityItem</span><b> where </b>(linkId = '4765772671997')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              quantityItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>dosage.dose = <span style=\"color: navy\">(</span>%ans.valueQuantity<span style=\"color: navy\">)</span> <i>\"setDose\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"navquantity\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">Effective period</span>#xD;\n            doseGroup.item<b> as </b><span style=\"color: maroon\">startItem</span><b> where </b>(linkId = '1443558617577')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              startItem.answer<b> as </b><span style=\"color: maroon\">startAns</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                doseGroup.item<b> as </b><span style=\"color: maroon\">endItem</span><b> where </b>(linkId = '780829110731')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>                  endItem.answer<b> as </b><span style=\"color: maroon\">endAns</span><span style=\"color: navy\"><b> -&gt; </b></span> medAdmin.effectivePeriod<b> as </b><span style=\"color: maroon\">adminPeriod</span><span style=\"color: navy\">, </span> adminPeriod.start = <span style=\"color: navy\">(</span>%startAns.value<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> adminPeriod.end = <span style=\"color: navy\">(</span>%endAns.value<span style=\"color: navy\">)</span> <i>\"setAdminPeriod\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">}</span> <i>\"navEnd\"</i><span style=\"color: navy\">;</span>#xD;\n              <span style=\"color: navy\">}</span> <i>\"navStartAns\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"navStart\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"navDosage\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"setdosage\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"createmedadmin\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"medadminentry\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"processmedexpoadmin\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Group: Create Vital Sign Observations</span>#xD;\n<b>group </b>CreateVitalSignObservations<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, <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>  <span style=\"color: navy\">// </span><span style=\"color: green\">Examen clinique (linkId 214880328197)</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">examGroup</span><b> where </b>(linkId = '214880328197')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Dossier de soins (linkId 305831246173) - repeating</span>#xD;\n    examGroup.item<b> as </b><span style=\"color: maroon\">dossierGroup</span><b> where </b>(linkId = '305831246173')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Height (linkId 4846902346416)</span>#xD;\n      dossierGroup.item<b> as </b><span style=\"color: maroon\">heightItem</span><b> where </b>(linkId = '4846902346416')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        heightItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">obsEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans<span style=\"color: navy\"><b> -&gt; </b></span>obsEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Observation'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">obs</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"obsid\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span> obs.id<b> as </b><span style=\"color: maroon\">obsId</span><span style=\"color: navy\">, </span> obsEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">obsId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>              ans<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-observation-body-height'</span> <i>\"obsprofile\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"obsmeta\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.status = <span style=\"color: blue\">'final'</span> <i>\"obsstatus\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.category = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'vital-signs'</span><span style=\"color: navy\">)</span> <i>\"obscategory\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.code = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'8302-2'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Body height'</span><span style=\"color: navy\">)</span> <i>\"obscode\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">Link to patient</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span> obs.subject = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> patient.id<b> as </b><span style=\"color: maroon\">patId</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patId</span><span style=\"color: navy\">)</span> <i>\"setsubject\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">Value</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span> obs.value = <span style=\"color: navy\">(</span>%ans.valueQuantity<span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtObsVal</span><span style=\"color: navy\">, </span> tgtObsVal.code = <span style=\"color: navy\">(</span>%ans.valueQuantity.unit<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> tgtObsVal.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span> <i>\"setvalue\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">Effective date from nested item</span>#xD;\n            ans.item<b> as </b><span style=\"color: maroon\">dateItem</span><b> where </b>(linkId = '941821315470')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              dateItem.answer<b> as </b><span style=\"color: maroon\">dateAns</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                dateAns.value<b> as </b><span style=\"color: maroon\">val</span><span style=\"color: navy\"><b> -&gt; </b></span>obs.effective = <b>cast</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">val</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'dateTime'</span><span style=\"color: navy\">)</span> <i>\"seteffective\"</i><span style=\"color: navy\">;</span>#xD;\n              <span style=\"color: navy\">}</span> <i>\"navDateAns\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"extracteffective\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"createheightobs\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"heightobsentry\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractheight\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Weight (linkId 451513217936)</span>#xD;\n      dossierGroup.item<b> as </b><span style=\"color: maroon\">weightItem</span><b> where </b>(linkId = '451513217936')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        weightItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">obsEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans<span style=\"color: navy\"><b> -&gt; </b></span>obsEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Observation'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">obs</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"obsid\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span> obs.id<b> as </b><span style=\"color: maroon\">obsId</span><span style=\"color: navy\">, </span> obsEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">obsId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>              ans<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-observation-body-weight'</span> <i>\"obsprofile\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"obsmeta\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.status = <span style=\"color: blue\">'final'</span> <i>\"obsstatus\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.category = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'vital-signs'</span><span style=\"color: navy\">)</span> <i>\"obscategory\"</i><span style=\"color: navy\">;</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.code = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'29463-7'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Body weight'</span><span style=\"color: navy\">)</span> <i>\"obscode\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">Link to patient</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span> obs.subject = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> patient.id<b> as </b><span style=\"color: maroon\">patId</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patId</span><span style=\"color: navy\">)</span> <i>\"setsubject\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">Value</span>#xD;\n            ans<span style=\"color: navy\"><b> -&gt; </b></span> obs.value = <span style=\"color: navy\">(</span>%ans.valueQuantity<span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtObsVal</span><span style=\"color: navy\">, </span> tgtObsVal.code = <span style=\"color: navy\">(</span>%ans.valueQuantity.unit<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> tgtObsVal.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span> <i>\"setvalue\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">// </span><span style=\"color: green\">Effective date from nested item</span>#xD;\n            ans.item<b> as </b><span style=\"color: maroon\">dateItem</span><b> where </b>(linkId = '151269044052')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>              dateItem.answer<b> as </b><span style=\"color: maroon\">dateAns</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                dateAns.value<b> as </b><span style=\"color: maroon\">val</span><span style=\"color: navy\"><b> -&gt; </b></span>obs.effective = <b>cast</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">val</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'dateTime'</span><span style=\"color: navy\">)</span> <i>\"seteffective\"</i><span style=\"color: navy\">;</span>#xD;\n              <span style=\"color: navy\">}</span> <i>\"navDateAns\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"extracteffective\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"createweightobs\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"weightobsentry\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractweight\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Blood Pressure - need both systolic and diastolic</span>#xD;\n      dossierGroup.item<b> as </b><span style=\"color: maroon\">sysItem</span><b> where </b>(linkId = '4160905247955')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        sysItem.answer<b> as </b><span style=\"color: maroon\">sysAns</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          dossierGroup.item<b> as </b><span style=\"color: maroon\">diaItem</span><b> where </b>(linkId = '848797127998')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>            diaItem.answer<b> as </b><span style=\"color: maroon\">diaAns</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">obsEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>              sysAns<span style=\"color: navy\"><b> -&gt; </b></span>obsEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Observation'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">obs</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                sysAns<span style=\"color: navy\"><b> -&gt; </b></span>obs.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"obsid\"</i><span style=\"color: navy\">;</span>#xD;\n                sysAns<span style=\"color: navy\"><b> -&gt; </b></span> obs.id<b> as </b><span style=\"color: maroon\">obsId</span><span style=\"color: navy\">, </span> obsEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">obsId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n                sysAns<span style=\"color: navy\"><b> -&gt; </b></span>obs.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                  sysAns<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-observation-blood-pressure'</span> <i>\"obsprofile\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">}</span> <i>\"obsmeta\"</i><span style=\"color: navy\">;</span>#xD;\n                sysAns<span style=\"color: navy\"><b> -&gt; </b></span>obs.status = <span style=\"color: blue\">'final'</span> <i>\"obsstatus\"</i><span style=\"color: navy\">;</span>#xD;\n                sysAns<span style=\"color: navy\"><b> -&gt; </b></span>obs.category = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'vital-signs'</span><span style=\"color: navy\">)</span> <i>\"obscategory\"</i><span style=\"color: navy\">;</span>#xD;\n                sysAns<span style=\"color: navy\"><b> -&gt; </b></span>obs.code = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'85354-9'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Blood pressure panel'</span><span style=\"color: navy\">)</span> <i>\"obscode\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">// </span><span style=\"color: green\">Link to patient</span>#xD;\n                sysAns<span style=\"color: navy\"><b> -&gt; </b></span> obs.subject = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> patient.id<b> as </b><span style=\"color: maroon\">patId</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patId</span><span style=\"color: navy\">)</span> <i>\"setsubject\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">// </span><span style=\"color: green\">Systolic component</span>#xD;\n                sysAns<span style=\"color: navy\"><b> -&gt; </b></span>obs.component<b> as </b><span style=\"color: maroon\">sysComp</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                  sysAns<span style=\"color: navy\"><b> -&gt; </b></span>sysComp.code = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'8480-6'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Systolic blood pressure'</span><span style=\"color: navy\">)</span> <i>\"syscode\"</i><span style=\"color: navy\">;</span>#xD;\n                  sysAns<span style=\"color: navy\"><b> -&gt; </b></span> sysComp.value = <span style=\"color: navy\">(</span>%sysAns.valueQuantity<span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">sysVal</span><span style=\"color: navy\">, </span> sysVal.code = <span style=\"color: navy\">(</span>%sysAns.valueQuantity.unit<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> sysVal.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span> <i>\"sysvalue\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">}</span> <i>\"setsystolic\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">// </span><span style=\"color: green\">Diastolic component</span>#xD;\n                diaAns<span style=\"color: navy\"><b> -&gt; </b></span>obs.component<b> as </b><span style=\"color: maroon\">diaComp</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                  diaAns<span style=\"color: navy\"><b> -&gt; </b></span>diaComp.code = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'8462-4'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Diastolic blood pressure'</span><span style=\"color: navy\">)</span> <i>\"diacode\"</i><span style=\"color: navy\">;</span>#xD;\n                  diaAns<span style=\"color: navy\"><b> -&gt; </b></span> diaComp.value = <span style=\"color: navy\">(</span>%diaAns.valueQuantity<span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">diaVal</span><span style=\"color: navy\">, </span> diaVal.code = <span style=\"color: navy\">(</span>%diaAns.valueQuantity.unit<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> diaVal.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span> <i>\"diavalue\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">}</span> <i>\"setdiastolic\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">// </span><span style=\"color: green\">Effective date from nested item</span>#xD;\n                sysAns.item<b> as </b><span style=\"color: maroon\">sysDateItem</span><b> where </b>(linkId = '987654638442')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>                  sysDateItem.answer<b> as </b><span style=\"color: maroon\">dateAns</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>                    dateAns.value<b> as </b><span style=\"color: maroon\">val</span><span style=\"color: navy\"><b> -&gt; </b></span>obs.effective = <b>cast</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">val</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'dateTime'</span><span style=\"color: navy\">)</span> <i>\"seteffective\"</i><span style=\"color: navy\">;</span>#xD;\n                  <span style=\"color: navy\">}</span> <i>\"navDateAns\"</i><span style=\"color: navy\">;</span>#xD;\n                <span style=\"color: navy\">}</span> <i>\"navDate\"</i><span style=\"color: navy\">;</span>#xD;\n              <span style=\"color: navy\">}</span> <i>\"createbpobs\"</i><span style=\"color: navy\">;</span>#xD;\n            <span style=\"color: navy\">}</span> <i>\"bpobsentr\"</i><span style=\"color: navy\">;</span>#xD;\n          <span style=\"color: navy\">}</span> <i>\"extractdiastolic\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"processsystolic\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractbloodpressure\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"processdossier\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"processexam\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Group: Create Laboratory Observations</span>#xD;\n<b>group </b>CreateLaboratoryObservations<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, <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>  <span style=\"color: navy\">// </span><span style=\"color: green\">Biologie group (linkId 7702944131447)</span>#xD;\n  src.item<b> as </b><span style=\"color: maroon\">bioGroup</span><b> where </b>(linkId = '7702944131447')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Fonction rénale (linkId 5241323453538)</span>#xD;\n    bioGroup.item<b> as </b><span style=\"color: maroon\">renalGroup</span><b> where </b>(linkId = '5241323453538')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Urée (linkId 7169026818760)</span>#xD;\n      renalGroup.item<b> as </b><span style=\"color: maroon\">ureaItem</span><b> where </b>(linkId = '7169026818760')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ureaItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">ureaItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createureaobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extracturea\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Créatininémie (linkId 500408205043)</span>#xD;\n      renalGroup.item<b> as </b><span style=\"color: maroon\">creatItem</span><b> where </b>(linkId = '500408205043')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        creatItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">creatItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createcreatobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractcreat\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">DFG (linkId 786621340679)</span>#xD;\n      renalGroup.item<b> as </b><span style=\"color: maroon\">dfgItem</span><b> where </b>(linkId = '786621340679')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        dfgItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">dfgItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createdfgobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractdfg\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"processrenal\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Hémogramme (linkId 419282985970)</span>#xD;\n    bioGroup.item<b> as </b><span style=\"color: maroon\">hemoGroup</span><b> where </b>(linkId = '419282985970')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Leucocytes (linkId 210077225604)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">leukoItem</span><b> where </b>(linkId = '210077225604')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        leukoItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">leukoItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createleukoobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractleuko\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Hémoglobine (linkId 304159088493)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">hemoItem</span><b> where </b>(linkId = '304159088493')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        hemoItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">hemoItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createhemoobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extracthemo\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Hématocrite (linkId 813863316705)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">hematItem</span><b> where </b>(linkId = '813863316705')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        hematItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">hematItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createhematobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extracthemat\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Erythrocytes (linkId 459731866614)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">eryItem</span><b> where </b>(linkId = '459731866614')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        eryItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">eryItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createeryobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractery\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">VGM (linkId 163624088831)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">vgmItem</span><b> where </b>(linkId = '163624088831')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        vgmItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vgmItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createvgmobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractvgm\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Plaquettes (linkId 794156787471)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">platItem</span><b> where </b>(linkId = '794156787471')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        platItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">platItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createplatobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractplat\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Neutrophiles (linkId 961905168477)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">neutItem</span><b> where </b>(linkId = '961905168477')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        neutItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">neutItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createneutobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractneut\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Lymphocytes (linkId 695150914696)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">lymphItem</span><b> where </b>(linkId = '695150914696')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        lymphItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">lymphItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createlymphobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractlymph\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Eosinophiles (linkId 700490326748)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">eosiItem</span><b> where </b>(linkId = '700490326748')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        eosiItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">eosiItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createeosiobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extracteosi\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Monocytes (linkId 168661900522)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">monoItem</span><b> where </b>(linkId = '168661900522')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        monoItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">monoItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createmonoobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractmono\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">TP (linkId 658898841893)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">tpItem</span><b> where </b>(linkId = '658898841893')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        tpItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tpItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createtpobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extracttp\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">TCA (linkId 795145096241)</span>#xD;\n      hemoGroup.item<b> as </b><span style=\"color: maroon\">tcaItem</span><b> where </b>(linkId = '795145096241')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        tcaItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tcaItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createtcaobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extracttca\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"processhemo\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Bilan hépatique (linkId 796308115381)</span>#xD;\n    bioGroup.item<b> as </b><span style=\"color: maroon\">liverGroup</span><b> where </b>(linkId = '796308115381')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">ASAT (linkId 715226319725)</span>#xD;\n      liverGroup.item<b> as </b><span style=\"color: maroon\">asatItem</span><b> where </b>(linkId = '715226319725')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        asatItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">asatItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createasatobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractasat\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">ALAT (linkId 876439410327)</span>#xD;\n      liverGroup.item<b> as </b><span style=\"color: maroon\">alatItem</span><b> where </b>(linkId = '876439410327')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        alatItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">alatItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createalatobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractalat\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">GGT (linkId 287545455976)</span>#xD;\n      liverGroup.item<b> as </b><span style=\"color: maroon\">ggtItem</span><b> where </b>(linkId = '287545455976')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ggtItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">ggtItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createggtobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractggt\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">PAL (linkId 508269571594)</span>#xD;\n      liverGroup.item<b> as </b><span style=\"color: maroon\">palItem</span><b> where </b>(linkId = '508269571594')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        palItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">palItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createpalobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractpal\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Bilirubine totale (linkId 927344090061)</span>#xD;\n      liverGroup.item<b> as </b><span style=\"color: maroon\">bilTotItem</span><b> where </b>(linkId = '927344090061')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        bilTotItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bilTotItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createbiltotobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractbiltot\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Bilirubine conjuguée (linkId 208196328453)</span>#xD;\n      liverGroup.item<b> as </b><span style=\"color: maroon\">bilConjItem</span><b> where </b>(linkId = '208196328453')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        bilConjItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bilConjItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createbilconjobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractbilconj\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"processliver\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Métabolisme glucidique (linkId 334039497382)</span>#xD;\n    bioGroup.item<b> as </b><span style=\"color: maroon\">glucoseGroup</span><b> where </b>(linkId = '334039497382')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Glycémie à jeun (linkId 273778921448)</span>#xD;\n      glucoseGroup.item<b> as </b><span style=\"color: maroon\">glycItem</span><b> where </b>(linkId = '273778921448')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        glycItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">glycItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createglycobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractglyc\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">HbA1c (linkId 632894677152)</span>#xD;\n      glucoseGroup.item<b> as </b><span style=\"color: maroon\">hba1cItem</span><b> where </b>(linkId = '632894677152')<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        hba1cItem.answer<b> as </b><span style=\"color: maroon\">ans</span><span style=\"color: navy\"><b> -&gt; </b></span>bundle<b> then </b>CreateLabObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">ans</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">hba1cItem</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patient</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bundle</span><span style=\"color: navy\">)</span> <i>\"createhba1cobs\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extracthba1c\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"processglucose\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"processbiology\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Helper: Create a single Laboratory Observation</span>#xD;\n<b>group </b>CreateLabObservation<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">ans</span>, <b>source</b> <span style=\"color: maroon\">parentItem</span>, <b>target</b> <span style=\"color: maroon\">patient</span><span style=\"color: navy\"> : </span>Patient, <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>  ans<span style=\"color: navy\"><b> -&gt; </b></span>bundle.entry<b> as </b><span style=\"color: maroon\">obsEntry</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    ans<span style=\"color: navy\"><b> -&gt; </b></span>obsEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Observation'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">obs</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.id = <b>uuid</b><span style=\"color: navy\">(</span><span style=\"color: navy\">)</span> <i>\"obsid\"</i><span style=\"color: navy\">;</span>#xD;\n      ans<span style=\"color: navy\"><b> -&gt; </b></span> obs.id<b> as </b><span style=\"color: maroon\">obsId</span><span style=\"color: navy\">, </span> obsEntry.fullUrl = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'urn:uuid:'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">obsId</span><span style=\"color: navy\">)</span> <i>\"setfullUrl\"</i><span style=\"color: navy\">;</span>#xD;\n      ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.meta = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Meta'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">meta</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span>meta.profile = <span style=\"color: blue\">'https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/dm-observation-laboratory-generic'</span> <i>\"obsprofile\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"obsmeta\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Status</span>#xD;\n      ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.status = <span style=\"color: blue\">'final'</span> <i>\"obsstatus\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Category</span>#xD;\n      ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.category = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">cat</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans<span style=\"color: navy\"><b> -&gt; </b></span>cat.coding = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Coding'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">coding</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          ans<span style=\"color: navy\"><b> -&gt; </b></span>coding.system = <span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/observation-category'</span> <i>\"catsystem\"</i><span style=\"color: navy\">;</span>#xD;\n          ans<span style=\"color: navy\"><b> -&gt; </b></span>coding.code = <span style=\"color: blue\">'laboratory'</span> <i>\"catcode\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"setcategorycoding\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"setcategory\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Link to patient</span>#xD;\n      ans<span style=\"color: navy\"><b> -&gt; </b></span> obs.subject = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ref</span><span style=\"color: navy\">, </span> patient.id<b> as </b><span style=\"color: maroon\">patId</span><span style=\"color: navy\">, </span> ref.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Patient/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">patId</span><span style=\"color: navy\">)</span> <i>\"setsubject\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Value as Quantity</span>#xD;\n      ans<span style=\"color: navy\"><b> -&gt; </b></span> obs.value = <span style=\"color: navy\">(</span>%ans.valueQuantity<span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtObsVal</span><span style=\"color: navy\">, </span> tgtObsVal.code = <span style=\"color: navy\">(</span>%ans.valueQuantity.unit<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> tgtObsVal.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span> <i>\"setvalue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Extract nested items - LOINC code, effective date, status, reference ranges</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">LOINC code</span>#xD;\n      ans.item<b> as </b><span style=\"color: maroon\">loincItem</span><b> where </b>(text.contains('code loinc'))<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        loincItem.answer<b> as </b><span style=\"color: maroon\">loincAns</span><span style=\"color: navy\"><b> -&gt; </b></span> obs.code<b> as </b><span style=\"color: maroon\">code</span><span style=\"color: navy\">, </span> code.coding<b> as </b><span style=\"color: maroon\">coding</span><span style=\"color: navy\">, </span> coding.code = <span style=\"color: navy\">(</span>%loincAns.valueString<span style=\"color: navy\">)</span> <i>\"setloinccoding\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extractloinc\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">effectiveDateTime</span>#xD;\n      ans.item<b> as </b><span style=\"color: maroon\">dateItem</span><b> where </b>(text.contains('Date et heure du prélèvement'))<b> then</b><span style=\"color: navy\"> {#xD;\n</span>        dateItem.answer<b> as </b><span style=\"color: maroon\">dateAns</span><span style=\"color: navy\"><b> -&gt; </b></span>obs.effective = <span style=\"color: navy\">(</span>%dateAns.valueDateTime<span style=\"color: navy\">)</span> <i>\"seteffective\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"extracteffective\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: #b36b00\" title=\"Cet élément n'était pas défini avant R5\">// parentItem.item as statusItem where (linkId.contains('Statut de validation')) then {         statusItem.answer as statusAns -&gt; obs.extension = create('Extension') as ext then {           statusAns -&gt; ext.url = 'http://hl7.org/fhir/StructureDefinition/observation-status' \"status-url\";           statusAns -&gt; ext.value = (%statusAns.valueString) \"status-value\";         } \"set-status-ext\";       } \"extract-validation-status\";</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Reference ranges (low and high)</span>#xD;\n      ans<span style=\"color: navy\"><b> -&gt; </b></span>obs.referenceRange<b> as </b><span style=\"color: maroon\">refRange</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        ans.item<b> as </b><span style=\"color: maroon\">lowItem</span><b> where </b>(text.contains('Borne inférieure'))<b> then</b><span style=\"color: navy\"> {#xD;\n</span>          lowItem.answer<b> as </b><span style=\"color: maroon\">lowAns</span><span style=\"color: navy\"><b> -&gt; </b></span> refRange.low = <span style=\"color: navy\">(</span>%lowAns.valueQuantity<span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtLow</span><span style=\"color: navy\">, </span> tgtLow.code = <span style=\"color: navy\">(</span>%ans.valueQuantity.unit<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> tgtLow.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span> <i>\"setlow\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"extractlow\"</i><span style=\"color: navy\">;</span>#xD;\n        ans.item<b> as </b><span style=\"color: maroon\">highItem</span><b> where </b>(text.contains('Borne supérieure'))<b> then</b><span style=\"color: navy\"> {#xD;\n</span>          highItem.answer<b> as </b><span style=\"color: maroon\">highAns</span><span style=\"color: navy\"><b> -&gt; </b></span> refRange.high = <span style=\"color: navy\">(</span>%highAns.valueQuantity<span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtHigh</span><span style=\"color: navy\">, </span> tgtHigh.code = <span style=\"color: navy\">(</span>%ans.valueQuantity.unit<span style=\"color: navy\">)</span><span style=\"color: navy\">, </span> tgtHigh.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span> <i>\"sethigh\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"extracthigh\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"setrefrange\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"createobs\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"obsentry\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span></pre></div>"
  ] ;
  fhir:StructureMap.url [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureMap/Q2FSL"] ;
  fhir:StructureMap.version [ fhir:value "0.1.0"] ;
  fhir:StructureMap.name [ fhir:value "Q2FSL"] ;
  fhir:StructureMap.title [ fhir:value "Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles"] ;
  fhir:StructureMap.status [ fhir:value "draft"] ;
  fhir:StructureMap.date [ fhir:value "2026-07-11T15:39:45+00:00"^^xsd:dateTime] ;
  fhir:StructureMap.publisher [ fhir:value "AP-HP"] ;
  fhir:StructureMap.contact [
     fhir:index 0 ;
     fhir:ContactDetail.name [ fhir:value "AP-HP" ] ;
     fhir:ContactDetail.telecom [
       fhir:index 0 ;
       fhir:ContactPoint.system [ fhir:value "url" ] ;
       fhir:ContactPoint.value [ fhir:value "https://aphp.fr" ]
     ]
  ] ;
  fhir:StructureMap.description [ fhir:value "Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles"] ;
  fhir:StructureMap.jurisdiction [
     fhir:index 0 ;
     fhir:CodeableConcept.coding [
       fhir:index 0 ;
       fhir:Coding.system [ fhir:value "urn:iso:std:iso:3166" ] ;
       fhir:Coding.code [ fhir:value "FRA" ]
     ]
  ] ;
  fhir:StructureMap.structure [
     fhir:index 0 ;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" ;
       fhir:link <http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse>
     ] ;
     fhir:StructureMap.structure.mode [ fhir:value "source" ] ;
     fhir:StructureMap.structure.alias [ fhir:value "QuestionnaireResponse" ]
  ], [
     fhir:index 1 ;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Bundle" ;
       fhir:link <http://hl7.org/fhir/StructureDefinition/Bundle>
     ] ;
     fhir:StructureMap.structure.mode [ fhir:value "target" ] ;
     fhir:StructureMap.structure.alias [ fhir:value "Bundle" ]
  ] ;
  fhir:StructureMap.group [
     fhir:index 0 ;
     fhir:StructureMap.group.name [ fhir:value "QuestionnaireResponseToBundle" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Main entry point: Transform QuestionnaireResponse to Bundle" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "src" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "QuestionnaireResponse" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "bundleid" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
         fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
       ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.rule.name [ fhir:value "bundletype" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "type" ] ;
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "collection" ]
         ]
       ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.rule.name [ fhir:value "setTimestamp" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "timestamp" ] ;
         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "now()" ]
         ]
       ]
     ], [
       fhir:index 3 ;
       fhir:StructureMap.group.rule.name [ fhir:value "patiententry" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "patientEntry" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "createpatientresource" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "patientEntry" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "patient" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createpatient" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreatePatient" ] ;
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "src" ;
               fhir:index 0
             ], [
               fhir:value "patient" ;
               fhir:index 1
             ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "patientId" ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "patientEntry" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patientId" ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createencounters" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateEncounters" ] ;
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "src" ;
               fhir:index 0
             ], [
               fhir:value "patient" ;
               fhir:index 1
             ], [
               fhir:value "bundle" ;
               fhir:index 2
             ]
           ]
         ], [
           fhir:index 3 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createlabobservations" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLaboratoryObservations" ] ;
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "src" ;
               fhir:index 0
             ], [
               fhir:value "patient" ;
               fhir:index 1
             ], [
               fhir:value "bundle" ;
               fhir:index 2
             ]
           ]
         ], [
           fhir:index 4 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createmedicationrequests" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateMedicationRequests" ] ;
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "src" ;
               fhir:index 0
             ], [
               fhir:value "patient" ;
               fhir:index 1
             ], [
               fhir:value "bundle" ;
               fhir:index 2
             ]
           ]
         ], [
           fhir:index 5 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createmedicationadministrations" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateMedicationAdministrations" ] ;
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "src" ;
               fhir:index 0
             ], [
               fhir:value "patient" ;
               fhir:index 1
             ], [
               fhir:value "bundle" ;
               fhir:index 2
             ]
           ]
         ], [
           fhir:index 6 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createvitalsigns" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateVitalSignObservations" ] ;
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "src" ;
               fhir:index 0
             ], [
               fhir:value "patient" ;
               fhir:index 1
             ], [
               fhir:value "bundle" ;
               fhir:index 2
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 1 ;
     fhir:StructureMap.group.name [ fhir:value "CreatePatient" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Group: Create Patient from QuestionnaireResponse" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "src" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "QuestionnaireResponse" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "patientid" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
         fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
       ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.rule.name [ fhir:value "patientmeta" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
         fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
         ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "patientprofile" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-patient" ]
           ]
         ]
       ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.rule.name [ fhir:value "processsociodemographics" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "socioDemo" ] ;
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '4647259356106')" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "processidentity" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "socioDemo" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "identity" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '2958000860428')" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setname" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "identity" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "name" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "name" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "HumanName" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "extractfamily" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "identity" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "familyItem" ] ;
               fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '8605698058770')" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setfamily" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "familyItem" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "name" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "family" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                 ]
               ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.name [ fhir:value "extractgiven" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "identity" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "givenItem" ] ;
               fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '6214879623503')" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setgiven" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "givenItem" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "name" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "given" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractnir" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "identity" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "nirItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5711960356160')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setnir" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "nirItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "identifier" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "nir" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Identifier" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "nirsystem" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "nir" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:oid:1.2.250.1.213.1.4.8" ]
                 ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.name [ fhir:value "nirvalue" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "nir" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                 ]
               ]
             ], [
               fhir:index 2 ;
               fhir:StructureMap.group.rule.name [ fhir:value "nirtype" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "nir" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "type" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://interopsante.org/fhir/CodeSystem/fr-v2-0203" ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "NIR" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractins" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "identity" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "insItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '3764723550987')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setins" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "insItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "identifier" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "ins" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Identifier" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "inssystem" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "ins" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:oid:1.2.250.1.213.1.4.10" ]
                 ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.name [ fhir:value "insvalue" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "ins" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                 ]
               ]
             ], [
               fhir:index 2 ;
               fhir:StructureMap.group.rule.name [ fhir:value "instype" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "ins" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "type" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://interopsante.org/fhir/CodeSystem/fr-v2-0203" ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "INS-C" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 3 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractbirthdate" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "identity" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "birthItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5036133558154')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setbirthdate" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "birthItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "birthDate" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDate" ]
               ]
             ]
           ]
         ], [
           fhir:index 4 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractdeath" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "identity" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "deathItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5633552097315')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setdeceaseddate" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "deathItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "deceased" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDate" ]
               ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.name [ fhir:value "extractdeathsource" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "deathItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "deathSource" ] ;
               fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '9098810065693')" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setdeathsourceext" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "deathSource" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "sourceAns" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Extension" ]
                 ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "deathsourceurl" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "sourceAns" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-death-source" ]
                   ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "deathsourcevalue" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "sourceAns" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%sourceAns.valueCoding" ]
                   ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 5 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractmultiplebirth" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "identity" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "multipleItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '6931296968515')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setmultiplebirth" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "multipleItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "multipleBirth" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueInteger" ]
               ]
             ]
           ]
         ]
       ], [
         fhir:index 1 ;
         fhir:StructureMap.group.rule.name [ fhir:value "extractpmsidemographics" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "src" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "pmsiGroup" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '2825244231605')" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractgender" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "sexItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '3894630481120')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "valueCoding" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "sexItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setGenderF" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "valueString" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "female" ] ;
                 fhir:StructureMap.group.rule.source.condition [ fhir:value "($this = 'f')" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "gender" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "female" ]
                 ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setGenderM" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "valueString" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "female" ] ;
                 fhir:StructureMap.group.rule.source.condition [ fhir:value "($this = 'm')" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "gender" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "male" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractcodegeo" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "codeGeoItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '2446369196222')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setaddress" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "codeGeoItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "address" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "addr" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Address" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setcodegeoext" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "addr" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "ext" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Extension" ]
                 ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "codegeourl" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-pmsi-code-geo" ]
                   ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "codegeovalue" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "val" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ext" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "cast" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "val" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "code" ]
                   ]
                 ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.name [ fhir:value "navEnv" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "socioDemo" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "environnementItem" ] ;
                 fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5491974639955')" ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "createGeolocExt" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "environnementItem" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "geocodageItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '3816475533472')" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "addr" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "geolocationExt" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Extension" ]
                   ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "createLatExt" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "geocodageItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "latItem" ] ;
                     fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '3709843054556')" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "geolocationExt" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://hl7.org/fhir/StructureDefinition/geolocation" ]
                     ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "geolocationExt" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
                     fhir:StructureMap.group.rule.target.variable [ fhir:value "latExt" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Extension" ]
                     ]
                   ] ;
                   fhir:StructureMap.group.rule.rule [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "setLat" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "latItem" ] ;
                       fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                       fhir:StructureMap.group.rule.source.variable [ fhir:value "lat" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "latExt" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "latitude" ]
                       ]
                     ], [
                       fhir:index 1 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "latExt" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%lat.valueDecimal" ]
                       ]
                     ] ;
                     fhir:StructureMap.group.rule.rule [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.name [ fhir:value "createLongExt" ] ;
                       fhir:StructureMap.group.rule.source [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.source.context [ fhir:value "geocodageItem" ] ;
                         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                         fhir:StructureMap.group.rule.source.variable [ fhir:value "longItem" ] ;
                         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '7651448032665')" ]
                       ] ;
                       fhir:StructureMap.group.rule.target [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "geolocationExt" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
                         fhir:StructureMap.group.rule.target.variable [ fhir:value "longExt" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Extension" ]
                         ]
                       ] ;
                       fhir:StructureMap.group.rule.rule [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.name [ fhir:value "setLong" ] ;
                         fhir:StructureMap.group.rule.source [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.source.context [ fhir:value "longItem" ] ;
                           fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                           fhir:StructureMap.group.rule.source.variable [ fhir:value "long" ]
                         ] ;
                         fhir:StructureMap.group.rule.target [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.context [ fhir:value "longExt" ] ;
                           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                           fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
                           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                           fhir:StructureMap.group.rule.target.parameter [
                             fhir:index 0 ;
                             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "longitude" ]
                           ]
                         ], [
                           fhir:index 1 ;
                           fhir:StructureMap.group.rule.target.context [ fhir:value "longExt" ] ;
                           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                           fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                           fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                           fhir:StructureMap.group.rule.target.parameter [
                             fhir:index 0 ;
                             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%long.valueDecimal" ]
                           ]
                         ]
                       ]
                     ]
                   ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "navIrisItem" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "environnementItem" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "irisItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '7621032273792')" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "addr" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "line" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "addrLine" ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "addrLine" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "irisExt" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Extension" ]
                   ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "setIrisExt" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "irisItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "irisExt" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-censusTract" ]
                     ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "irisExt" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "valueString" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                     ]
                   ]
                 ]
               ]
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 2 ;
     fhir:StructureMap.group.name [ fhir:value "CreateLocations" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Group: Create Locations from geocoding and IRIS data" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "src" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "QuestionnaireResponse" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "processsociodemographicslocation" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "socioDemo" ] ;
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '4647259356106')" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "processenvironment" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "socioDemo" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "environment" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5491974639955')" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "geocodinglocationentry" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "environment" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "geocodingItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '3816475533472')" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "locationEntry" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createlocation" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "geocodingItem" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "locationEntry" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "location" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Location" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "locationid" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "geocodingItem" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "location" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.name [ fhir:value "locationmeta" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "geocodingItem" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "location" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
                 ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "locationprofile" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "geocodingItem" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-location" ]
                   ]
                 ]
               ]
             ], [
               fhir:index 2 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setposition" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "geocodingItem" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "location" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "position" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "pos" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "LocationPosition" ]
                 ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "extractlatitude" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "geocodingItem" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "latItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '3709843054556')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "setlatitude" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "latItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "pos" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "latitude" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDecimal" ]
                     ]
                   ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "extractlongitude" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "geocodingItem" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "longItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '7651448032665')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "setlongitude" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "longItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "pos" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "longitude" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDecimal" ]
                     ]
                   ]
                 ]
               ]
             ], [
               fhir:index 3 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setrequest" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "location" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "locationEntry" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "request" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "request" ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setmethod" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "location" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "request" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "method" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "POST" ]
                   ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "seturl" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "location" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "request" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Location" ]
                   ]
                 ]
               ]
             ], [
               fhir:index 4 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "location" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "id" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "locId" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "locationEntry" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "locId" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "processiris" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "environment" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "irisItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '7621032273792')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "irislocationentry" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "irisItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "irisAnswer" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "locationEntry" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "createirislocation" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "irisAnswer" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "locationEntry" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "location" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Location" ]
                 ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "locationid" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "irisAnswer" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "location" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "locationmeta" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "irisAnswer" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "location" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
                   ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "locationprofile" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "irisAnswer" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-location" ]
                     ]
                   ]
                 ]
               ], [
                 fhir:index 2 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setirisidentifier" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "irisAnswer" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "location" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "identifier" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "identifier" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Identifier" ]
                   ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "irissystem" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "irisAnswer" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "identifier" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:oid:2.16.840.1.113883.2.8.1.5.5" ]
                     ]
                   ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "irisvalue" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "irisAnswer" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "identifier" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%irisAnswer.valueCoding.code" ]
                     ]
                   ]
                 ]
               ], [
                 fhir:index 3 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setrequest" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "location" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "locationEntry" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "request" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "request" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "setmethod" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "location" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "request" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "method" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "POST" ]
                     ]
                   ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "seturl" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "location" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "request" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Location" ]
                     ]
                   ]
                 ]
               ], [
                 fhir:index 4 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "location" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "id" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "locId" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "locationEntry" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "locId" ]
                   ]
                 ]
               ]
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 3 ;
     fhir:StructureMap.group.name [ fhir:value "CreateEncounters" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Group: Create Encounters from PMSI data" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "src" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "QuestionnaireResponse" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "encounterentry" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "pmsiItem" ] ;
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '2825244231605')" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "encounterEntry" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "createencounter" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "encounterEntry" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "encounter" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Encounter" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "encounterid" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "encountermeta" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "encounterprofile" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-encounter" ]
               ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setStatus" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "status" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "finished" ]
             ]
           ]
         ], [
           fhir:index 3 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setClass" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "class" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "c" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://terminology.hl7.org/CodeSystem/v3-ActCode" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "IMP" ]
             ]
           ]
         ], [
           fhir:index 4 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setsubject" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "patId" ]
           ], [
             fhir:index 2 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient/" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patId" ]
             ]
           ]
         ], [
           fhir:index 5 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setperiod" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "period" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "period" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Period" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "extractstart" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "startItem" ] ;
               fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5991443718282')" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setstart" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "startItem" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "period" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "start" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDate" ]
                 ]
               ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.name [ fhir:value "extractend" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "endItem" ] ;
               fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '6114780320846')" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setend" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "endItem" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "period" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "end" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDate" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 6 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractmodein" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "modeInItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '6172398101212')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "navValue" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "modeInItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setadmitsource" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "valueString" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "valueString" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "hospitalization" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "hosp" ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "hosp" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "admitSource" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "admitSource" ]
               ], [
                 fhir:index 2 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "admitSource" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "admitSourceCoding" ]
               ], [
                 fhir:index 3 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "admitSourceCoding" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueString" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 7 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractmodeout" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "modeOutItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '3354867075704')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "navValue" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "modeOutItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setdischargedisposition" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "valueString" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "valueString" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "hospitalization" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "hosp" ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "hosp" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "dischargeDisposition" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "dischargeDisposition" ]
               ], [
                 fhir:index 2 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "dischargeDisposition" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "dischargeDispositionCoding" ]
               ], [
                 fhir:index 3 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "dischargeDispositionCoding" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "valueString" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 8 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "encId" ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounterEntry" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "encId" ]
             ]
           ]
         ], [
           fhir:index 9 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createconditions" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ]
           ] ;
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateConditions" ] ;
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "pmsiItem" ;
               fhir:index 0
             ], [
               fhir:value "patient" ;
               fhir:index 1
             ], [
               fhir:value "encounter" ;
               fhir:index 2
             ], [
               fhir:value "bundle" ;
               fhir:index 3
             ]
           ]
         ], [
           fhir:index 10 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createprocedures" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ]
           ] ;
           fhir:StructureMap.group.rule.dependent [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateProcedures" ] ;
             fhir:StructureMap.group.rule.dependent.variable [
               fhir:value "pmsiItem" ;
               fhir:index 0
             ], [
               fhir:value "patient" ;
               fhir:index 1
             ], [
               fhir:value "encounter" ;
               fhir:index 2
             ], [
               fhir:value "bundle" ;
               fhir:index 3
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 4 ;
     fhir:StructureMap.group.name [ fhir:value "CreateConditions" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Group: Create Conditions from nested diagnostics" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "pmsiItem" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.input.name [ fhir:value "encounter" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Encounter" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 3 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "conditionentry" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "diagGroup" ] ;
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '9391816419630')" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "conditionEntry" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "createcondition" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "diagGroup" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "conditionEntry" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "condition" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Condition" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "conditionid" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "diagGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "condition" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "conditionmeta" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "diagGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "condition" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "conditionprofile" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "diagGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-condition" ]
               ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setsubject" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "diagGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "condition" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "patId" ]
           ], [
             fhir:index 2 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient/" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patId" ]
             ]
           ]
         ], [
           fhir:index 3 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setencounter" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "diagGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "encId" ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "condition" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
             ]
           ], [
             fhir:index 2 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Encounter/" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "encId" ]
             ]
           ]
         ], [
           fhir:index 4 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractdiagcode" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "diagGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "diagCodeItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5505101189372')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setcode" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "diagCodeItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "condition" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CodeableConcept" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setcoding" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "code" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "coding" ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 5 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractdiagtype" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "diagGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "diagTypeItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '6427586743735')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setcategory" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "diagTypeItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "condition" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "category" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "category" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CodeableConcept" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setcategorycoding" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "category" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Coding" ]
                 ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "diagtypesystem" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/CodeSystem/pmsi-mco-diag-type" ]
                   ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "diagtypecode" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                   ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 6 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractrecordeddate" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "diagGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "dateItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '7114466839467')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setrecordeddate" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "dateItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "condition" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "recordedDate" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDate" ]
               ]
             ]
           ]
         ], [
           fhir:index 7 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "condition" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "condId" ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "conditionEntry" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "condId" ]
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 5 ;
     fhir:StructureMap.group.name [ fhir:value "CreateProcedures" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Group: Create Procedures from nested actes" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "pmsiItem" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.input.name [ fhir:value "encounter" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Encounter" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 3 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "procedureentry" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "acteGroup" ] ;
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '591926901726')" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "procedureEntry" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "createprocedure" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "acteGroup" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "procedureEntry" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "procedure" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Procedure" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "procedureid" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "acteGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "procedure" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "proceduremeta" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "acteGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "procedure" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "procedureprofile" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "acteGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-procedure" ]
               ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setStatus" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "acteGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "procedure" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "status" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]
             ]
           ]
         ], [
           fhir:index 3 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setsubject" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "acteGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "procedure" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "patId" ]
           ], [
             fhir:index 2 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient/" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patId" ]
             ]
           ]
         ], [
           fhir:index 4 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setencounter" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "acteGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "encId" ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "procedure" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "encounter" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
             ]
           ], [
             fhir:index 2 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Encounter/" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "encId" ]
             ]
           ]
         ], [
           fhir:index 5 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractactecode" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "acteGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "acteCodeItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '7758110033600')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setcode" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "acteCodeItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "procedure" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CodeableConcept" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setcoding" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "code" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "coding" ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 6 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractperformeddate" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "acteGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "dateItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5066866286682')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setperformed" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "dateItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "procedure" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "performed" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDateTime" ]
               ]
             ]
           ]
         ], [
           fhir:index 7 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "pmsiItem" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "procedure" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "procId" ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "procedureEntry" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "procId" ]
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 6 ;
     fhir:StructureMap.group.name [ fhir:value "CreateMedicationRequests" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Group: Create Medication Requests" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "src" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "QuestionnaireResponse" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "processmedexpo" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "medExpoGroup" ] ;
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '817801935685')" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "medreqentry" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medExpoGroup" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "prescribedGroup" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '156631794800')" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "medReqEntry" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createmedreq" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "medReqEntry" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "medReq" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MedicationRequest" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "medreqid" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medReq" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medReq" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "medReqId" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medReqEntry" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "medReqId" ]
               ]
             ]
           ], [
             fhir:index 2 ;
             fhir:StructureMap.group.rule.name [ fhir:value "medreqmeta" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medReq" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "medreqprofile" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-medication-request" ]
                 ]
               ]
             ]
           ], [
             fhir:index 3 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setsubject" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medReq" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "patId" ]
             ], [
               fhir:index 2 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient/" ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patId" ]
               ]
             ]
           ], [
             fhir:index 4 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setstatus" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medReq" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "status" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "active" ]
               ]
             ]
           ], [
             fhir:index 5 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setintent" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medReq" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "intent" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "order" ]
               ]
             ]
           ], [
             fhir:index 6 ;
             fhir:StructureMap.group.rule.name [ fhir:value "navPrescribedMedication" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "prescribedMedication" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "navAtcItem" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedMedication" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "atcItem" ] ;
                 fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '1923143398283')" ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setAtcCoding" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "atcItem" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medReq" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "medication" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "medReqCC" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CodeableConcept" ]
                   ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medReqCC" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "medReqC" ]
                 ], [
                   fhir:index 2 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medReqC" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                   ]
                 ], [
                   fhir:index 3 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medReqC" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "display" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%prescribedMedication.valueString" ]
                   ]
                 ]
               ]
             ]
           ], [
             fhir:index 7 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setdosage" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medReq" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "dosageInstruction" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Dosage" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "navPrescribedMedication" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedGroup" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "prescribedMedication" ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "navRouteItem" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "prescribedMedication" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "routeItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '387026794874')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "setroute" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "routeItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "route" ] ;
                     fhir:StructureMap.group.rule.target.variable [ fhir:value "route" ]
                   ] ;
                   fhir:StructureMap.group.rule.rule [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "setroutecoding" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "route" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
                       fhir:StructureMap.group.rule.target.variable [ fhir:value "routeCoding" ]
                     ], [
                       fhir:index 1 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "routeCoding" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                       ]
                     ]
                   ]
                 ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.name [ fhir:value "navPoso" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "medExpoGroup" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "posoGroup" ] ;
                 fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '6348237104421')" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "timing" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "timing" ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "timing" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "repeat" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "timingRepeat" ]
               ], [
                 fhir:index 2 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "timingRepeat" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "boundsPeriod" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "timingPeriod" ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "navDateDeb" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "posoGroup" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "DateDebItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '316347573327')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "setDateDeb" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "DateDebItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "timingPeriod" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "start" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDate" ]
                     ]
                   ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "navDateFin" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "posoGroup" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "DateFinItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '429570775935')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "setDateFin" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "DateFinItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "timingPeriod" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "end" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueDate" ]
                     ]
                   ]
                 ]
               ]
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 7 ;
     fhir:StructureMap.group.name [ fhir:value "CreateMedicationAdministrations" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Group: Create Medication Administrations" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "src" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "QuestionnaireResponse" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "processmedexpoadmin" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "medExpoGroup" ] ;
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '817801935685')" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "medadminentry" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "medExpoGroup" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "adminGroup" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '266852453304')" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "medAdminEntry" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "createmedadmin" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "adminGroup" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "medAdminEntry" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "medAdmin" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "MedicationAdministration" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "medadminid" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "adminGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medAdmin" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "src" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medAdmin" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "medAdminId" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medAdminEntry" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "medAdminId" ]
               ]
             ]
           ], [
             fhir:index 2 ;
             fhir:StructureMap.group.rule.name [ fhir:value "medadminmeta" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "adminGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medAdmin" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "medadminprofile" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "adminGroup" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-medication-administration" ]
                 ]
               ]
             ]
           ], [
             fhir:index 3 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setsubject" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "adminGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medAdmin" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "patId" ]
             ], [
               fhir:index 2 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient/" ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patId" ]
               ]
             ]
           ], [
             fhir:index 4 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setstatus" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "adminGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medAdmin" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "status" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "completed" ]
               ]
             ]
           ], [
             fhir:index 5 ;
             fhir:StructureMap.group.rule.name [ fhir:value "navadministeredMedication" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "adminGroup" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "administeredMedication" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "navAtcItem" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "administeredMedication" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "atcItem" ] ;
                 fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '631972144976')" ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setAtcCoding" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "atcItem" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medAdmin" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "medication" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "medAdminCC" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CodeableConcept" ]
                   ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medAdminCC" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "medAdminC" ]
                 ], [
                   fhir:index 2 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medAdminC" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                   ]
                 ], [
                   fhir:index 3 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "medAdminC" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "display" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%administeredMedication.valueString" ]
                   ]
                 ]
               ]
             ]
           ], [
             fhir:index 6 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setdosage" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "adminGroup" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "medAdmin" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "dosage" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "dosage" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "navadministeredMedication" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "adminGroup" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "administeredMedication" ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "navRoute" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "administeredMedication" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "routeItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '811931484859')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "setroute" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "routeItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "route" ] ;
                     fhir:StructureMap.group.rule.target.variable [ fhir:value "route" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CodeableConcept" ]
                     ]
                   ] ;
                   fhir:StructureMap.group.rule.rule [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "setroutecoding" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "route" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
                       fhir:StructureMap.group.rule.target.variable [ fhir:value "routeCoding" ]
                     ], [
                       fhir:index 1 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "routeCoding" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueString" ]
                       ]
                     ]
                   ]
                 ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.name [ fhir:value "navDosage" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "medExpoGroup" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "doseGroup" ] ;
                 fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5720103839343')" ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "navquantity" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "doseGroup" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "quantityItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '4765772671997')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "setDose" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "quantityItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "dosage" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "dose" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueQuantity" ]
                     ]
                   ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "navStart" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "doseGroup" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "startItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '1443558617577')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "navStartAns" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "startItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "startAns" ]
                   ] ;
                   fhir:StructureMap.group.rule.rule [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "navEnd" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "doseGroup" ] ;
                       fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                       fhir:StructureMap.group.rule.source.variable [ fhir:value "endItem" ] ;
                       fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '780829110731')" ]
                     ] ;
                     fhir:StructureMap.group.rule.rule [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.name [ fhir:value "setAdminPeriod" ] ;
                       fhir:StructureMap.group.rule.source [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.source.context [ fhir:value "endItem" ] ;
                         fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                         fhir:StructureMap.group.rule.source.variable [ fhir:value "endAns" ]
                       ] ;
                       fhir:StructureMap.group.rule.target [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "medAdmin" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "effectivePeriod" ] ;
                         fhir:StructureMap.group.rule.target.variable [ fhir:value "adminPeriod" ]
                       ], [
                         fhir:index 1 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "adminPeriod" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "start" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%startAns.value" ]
                         ]
                       ], [
                         fhir:index 2 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "adminPeriod" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "end" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%endAns.value" ]
                         ]
                       ]
                     ]
                   ]
                 ]
               ]
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 8 ;
     fhir:StructureMap.group.name [ fhir:value "CreateVitalSignObservations" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Group: Create Vital Sign Observations" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "src" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "QuestionnaireResponse" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "processexam" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "examGroup" ] ;
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '214880328197')" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "processdossier" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "examGroup" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "dossierGroup" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '305831246173')" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractheight" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dossierGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "heightItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '4846902346416')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "heightobsentry" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "heightItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "obsEntry" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "createheightobs" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "obsEntry" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "obs" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Observation" ]
                 ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obsid" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "obsId" ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obsEntry" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "obsId" ]
                   ]
                 ]
               ], [
                 fhir:index 2 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obsmeta" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
                   ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "obsprofile" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-observation-body-height" ]
                     ]
                   ]
                 ]
               ], [
                 fhir:index 3 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obsstatus" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "status" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "final" ]
                   ]
                 ]
               ], [
                 fhir:index 4 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obscategory" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "category" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://terminology.hl7.org/CodeSystem/observation-category" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "vital-signs" ]
                   ]
                 ]
               ], [
                 fhir:index 5 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obscode" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://loinc.org" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "8302-2" ]
                   ], [
                     fhir:index 2 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Body height" ]
                   ]
                 ]
               ], [
                 fhir:index 6 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setsubject" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
                   ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "patId" ]
                 ], [
                   fhir:index 2 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient/" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patId" ]
                   ]
                 ]
               ], [
                 fhir:index 7 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setvalue" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtObsVal" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueQuantity" ]
                   ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "tgtObsVal" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueQuantity.unit" ]
                   ]
                 ], [
                   fhir:index 2 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "tgtObsVal" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://unitsofmeasure.org" ]
                   ]
                 ]
               ], [
                 fhir:index 8 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "extracteffective" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "dateItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '941821315470')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "navDateAns" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "dateItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "dateAns" ]
                   ] ;
                   fhir:StructureMap.group.rule.rule [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "seteffective" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "dateAns" ] ;
                       fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
                       fhir:StructureMap.group.rule.source.variable [ fhir:value "val" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "effective" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "cast" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "val" ]
                       ], [
                         fhir:index 1 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "dateTime" ]
                       ]
                     ]
                   ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractweight" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dossierGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "weightItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '451513217936')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "weightobsentry" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "weightItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "obsEntry" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "createweightobs" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "obsEntry" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "obs" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Observation" ]
                 ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obsid" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "obsId" ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obsEntry" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "obsId" ]
                   ]
                 ]
               ], [
                 fhir:index 2 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obsmeta" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
                   ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "obsprofile" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-observation-body-weight" ]
                     ]
                   ]
                 ]
               ], [
                 fhir:index 3 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obsstatus" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "status" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "final" ]
                   ]
                 ]
               ], [
                 fhir:index 4 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obscategory" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "category" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://terminology.hl7.org/CodeSystem/observation-category" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "vital-signs" ]
                   ]
                 ]
               ], [
                 fhir:index 5 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "obscode" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://loinc.org" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "29463-7" ]
                   ], [
                     fhir:index 2 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Body weight" ]
                   ]
                 ]
               ], [
                 fhir:index 6 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setsubject" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
                   ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "patId" ]
                 ], [
                   fhir:index 2 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient/" ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patId" ]
                   ]
                 ]
               ], [
                 fhir:index 7 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "setvalue" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtObsVal" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueQuantity" ]
                   ]
                 ], [
                   fhir:index 1 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "tgtObsVal" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueQuantity.unit" ]
                   ]
                 ], [
                   fhir:index 2 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "tgtObsVal" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                   fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                   fhir:StructureMap.group.rule.target.parameter [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://unitsofmeasure.org" ]
                   ]
                 ]
               ], [
                 fhir:index 8 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "extracteffective" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "dateItem" ] ;
                   fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '151269044052')" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "navDateAns" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "dateItem" ] ;
                     fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                     fhir:StructureMap.group.rule.source.variable [ fhir:value "dateAns" ]
                   ] ;
                   fhir:StructureMap.group.rule.rule [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "seteffective" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "dateAns" ] ;
                       fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
                       fhir:StructureMap.group.rule.source.variable [ fhir:value "val" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "effective" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "cast" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "val" ]
                       ], [
                         fhir:index 1 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "dateTime" ]
                       ]
                     ]
                   ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractbloodpressure" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "dossierGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "sysItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '4160905247955')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "processsystolic" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "sysItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "sysAns" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "extractdiastolic" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "dossierGroup" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "diaItem" ] ;
                 fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '848797127998')" ]
               ] ;
               fhir:StructureMap.group.rule.rule [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.name [ fhir:value "bpobsentr" ] ;
                 fhir:StructureMap.group.rule.source [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.source.context [ fhir:value "diaItem" ] ;
                   fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                   fhir:StructureMap.group.rule.source.variable [ fhir:value "diaAns" ]
                 ] ;
                 fhir:StructureMap.group.rule.target [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
                   fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                   fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
                   fhir:StructureMap.group.rule.target.variable [ fhir:value "obsEntry" ]
                 ] ;
                 fhir:StructureMap.group.rule.rule [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.name [ fhir:value "createbpobs" ] ;
                   fhir:StructureMap.group.rule.source [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                   ] ;
                   fhir:StructureMap.group.rule.target [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.target.context [ fhir:value "obsEntry" ] ;
                     fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                     fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
                     fhir:StructureMap.group.rule.target.variable [ fhir:value "obs" ] ;
                     fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                     fhir:StructureMap.group.rule.target.parameter [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Observation" ]
                     ]
                   ] ;
                   fhir:StructureMap.group.rule.rule [
                     fhir:index 0 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "obsid" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
                     ]
                   ], [
                     fhir:index 1 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                       fhir:StructureMap.group.rule.target.variable [ fhir:value "obsId" ]
                     ], [
                       fhir:index 1 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obsEntry" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
                       ], [
                         fhir:index 1 ;
                         fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "obsId" ]
                       ]
                     ]
                   ], [
                     fhir:index 2 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "obsmeta" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
                       fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
                       ]
                     ] ;
                     fhir:StructureMap.group.rule.rule [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.name [ fhir:value "obsprofile" ] ;
                       fhir:StructureMap.group.rule.source [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                       ] ;
                       fhir:StructureMap.group.rule.target [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/edsh-observation-blood-pressure" ]
                         ]
                       ]
                     ]
                   ], [
                     fhir:index 3 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "obsstatus" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "status" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "final" ]
                       ]
                     ]
                   ], [
                     fhir:index 4 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "obscategory" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "category" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://terminology.hl7.org/CodeSystem/observation-category" ]
                       ], [
                         fhir:index 1 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "vital-signs" ]
                       ]
                     ]
                   ], [
                     fhir:index 5 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "obscode" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://loinc.org" ]
                       ], [
                         fhir:index 1 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "85354-9" ]
                       ], [
                         fhir:index 2 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Blood pressure panel" ]
                       ]
                     ]
                   ], [
                     fhir:index 6 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "setsubject" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ] ;
                       fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
                       ]
                     ], [
                       fhir:index 1 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
                       fhir:StructureMap.group.rule.target.variable [ fhir:value "patId" ]
                     ], [
                       fhir:index 2 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
                       fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
                       fhir:StructureMap.group.rule.target.parameter [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient/" ]
                       ], [
                         fhir:index 1 ;
                         fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patId" ]
                       ]
                     ]
                   ], [
                     fhir:index 7 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "setsystolic" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "component" ] ;
                       fhir:StructureMap.group.rule.target.variable [ fhir:value "sysComp" ]
                     ] ;
                     fhir:StructureMap.group.rule.rule [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.name [ fhir:value "syscode" ] ;
                       fhir:StructureMap.group.rule.source [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                       ] ;
                       fhir:StructureMap.group.rule.target [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "sysComp" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://loinc.org" ]
                         ], [
                           fhir:index 1 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "8480-6" ]
                         ], [
                           fhir:index 2 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Systolic blood pressure" ]
                         ]
                       ]
                     ], [
                       fhir:index 1 ;
                       fhir:StructureMap.group.rule.name [ fhir:value "sysvalue" ] ;
                       fhir:StructureMap.group.rule.source [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ]
                       ] ;
                       fhir:StructureMap.group.rule.target [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "sysComp" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                         fhir:StructureMap.group.rule.target.variable [ fhir:value "sysVal" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%sysAns.valueQuantity" ]
                         ]
                       ], [
                         fhir:index 1 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "sysVal" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%sysAns.valueQuantity.unit" ]
                         ]
                       ], [
                         fhir:index 2 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "sysVal" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://unitsofmeasure.org" ]
                         ]
                       ]
                     ]
                   ], [
                     fhir:index 8 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "setdiastolic" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "diaAns" ]
                     ] ;
                     fhir:StructureMap.group.rule.target [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                       fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                       fhir:StructureMap.group.rule.target.element [ fhir:value "component" ] ;
                       fhir:StructureMap.group.rule.target.variable [ fhir:value "diaComp" ]
                     ] ;
                     fhir:StructureMap.group.rule.rule [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.name [ fhir:value "diacode" ] ;
                       fhir:StructureMap.group.rule.source [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.source.context [ fhir:value "diaAns" ]
                       ] ;
                       fhir:StructureMap.group.rule.target [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "diaComp" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "cc" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://loinc.org" ]
                         ], [
                           fhir:index 1 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "8462-4" ]
                         ], [
                           fhir:index 2 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Diastolic blood pressure" ]
                         ]
                       ]
                     ], [
                       fhir:index 1 ;
                       fhir:StructureMap.group.rule.name [ fhir:value "diavalue" ] ;
                       fhir:StructureMap.group.rule.source [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.source.context [ fhir:value "diaAns" ]
                       ] ;
                       fhir:StructureMap.group.rule.target [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "diaComp" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                         fhir:StructureMap.group.rule.target.variable [ fhir:value "diaVal" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%diaAns.valueQuantity" ]
                         ]
                       ], [
                         fhir:index 1 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "diaVal" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%diaAns.valueQuantity.unit" ]
                         ]
                       ], [
                         fhir:index 2 ;
                         fhir:StructureMap.group.rule.target.context [ fhir:value "diaVal" ] ;
                         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                         fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                         fhir:StructureMap.group.rule.target.parameter [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://unitsofmeasure.org" ]
                         ]
                       ]
                     ]
                   ], [
                     fhir:index 9 ;
                     fhir:StructureMap.group.rule.name [ fhir:value "navDate" ] ;
                     fhir:StructureMap.group.rule.source [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.source.context [ fhir:value "sysAns" ] ;
                       fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
                       fhir:StructureMap.group.rule.source.variable [ fhir:value "sysDateItem" ] ;
                       fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '987654638442')" ]
                     ] ;
                     fhir:StructureMap.group.rule.rule [
                       fhir:index 0 ;
                       fhir:StructureMap.group.rule.name [ fhir:value "navDateAns" ] ;
                       fhir:StructureMap.group.rule.source [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.source.context [ fhir:value "sysDateItem" ] ;
                         fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                         fhir:StructureMap.group.rule.source.variable [ fhir:value "dateAns" ]
                       ] ;
                       fhir:StructureMap.group.rule.rule [
                         fhir:index 0 ;
                         fhir:StructureMap.group.rule.name [ fhir:value "seteffective" ] ;
                         fhir:StructureMap.group.rule.source [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.source.context [ fhir:value "dateAns" ] ;
                           fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
                           fhir:StructureMap.group.rule.source.variable [ fhir:value "val" ]
                         ] ;
                         fhir:StructureMap.group.rule.target [
                           fhir:index 0 ;
                           fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
                           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                           fhir:StructureMap.group.rule.target.element [ fhir:value "effective" ] ;
                           fhir:StructureMap.group.rule.target.transform [ fhir:value "cast" ] ;
                           fhir:StructureMap.group.rule.target.parameter [
                             fhir:index 0 ;
                             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "val" ]
                           ], [
                             fhir:index 1 ;
                             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "dateTime" ]
                           ]
                         ]
                       ]
                     ]
                   ]
                 ]
               ]
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 9 ;
     fhir:StructureMap.group.name [ fhir:value "CreateLaboratoryObservations" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Group: Create Laboratory Observations" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "src" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "QuestionnaireResponse" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "processbiology" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "src" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "bioGroup" ] ;
         fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '7702944131447')" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "processrenal" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "bioGroup" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "renalGroup" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '5241323453538')" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extracturea" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "renalGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "ureaItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '7169026818760')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createureaobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "ureaItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "ureaItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractcreat" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "renalGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "creatItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '500408205043')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createcreatobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "creatItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "creatItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractdfg" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "renalGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "dfgItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '786621340679')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createdfgobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "dfgItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "dfgItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ]
       ], [
         fhir:index 1 ;
         fhir:StructureMap.group.rule.name [ fhir:value "processhemo" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "bioGroup" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "hemoGroup" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '419282985970')" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractleuko" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "leukoItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '210077225604')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createleukoobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "leukoItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "leukoItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extracthemo" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "hemoItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '304159088493')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createhemoobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "hemoItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "hemoItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extracthemat" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "hematItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '813863316705')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createhematobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "hematItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "hematItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 3 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractery" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "eryItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '459731866614')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createeryobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "eryItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "eryItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 4 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractvgm" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "vgmItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '163624088831')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createvgmobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "vgmItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "vgmItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 5 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractplat" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "platItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '794156787471')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createplatobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "platItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "platItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 6 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractneut" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "neutItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '961905168477')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createneutobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "neutItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "neutItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 7 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractlymph" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "lymphItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '695150914696')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createlymphobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "lymphItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "lymphItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 8 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extracteosi" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "eosiItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '700490326748')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createeosiobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "eosiItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "eosiItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 9 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractmono" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "monoItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '168661900522')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createmonoobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "monoItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "monoItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 10 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extracttp" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "tpItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '658898841893')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createtpobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "tpItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "tpItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 11 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extracttca" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "hemoGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "tcaItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '795145096241')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createtcaobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "tcaItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "tcaItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ]
       ], [
         fhir:index 2 ;
         fhir:StructureMap.group.rule.name [ fhir:value "processliver" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "bioGroup" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "liverGroup" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '796308115381')" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractasat" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "liverGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "asatItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '715226319725')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createasatobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "asatItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "asatItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractalat" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "liverGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "alatItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '876439410327')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createalatobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "alatItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "alatItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractggt" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "liverGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "ggtItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '287545455976')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createggtobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "ggtItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "ggtItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 3 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractpal" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "liverGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "palItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '508269571594')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createpalobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "palItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "palItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 4 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractbiltot" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "liverGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "bilTotItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '927344090061')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createbiltotobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "bilTotItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "bilTotItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 5 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractbilconj" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "liverGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "bilConjItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '208196328453')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createbilconjobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "bilConjItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "bilConjItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ]
       ], [
         fhir:index 3 ;
         fhir:StructureMap.group.rule.name [ fhir:value "processglucose" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "bioGroup" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "glucoseGroup" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '334039497382')" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractglyc" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "glucoseGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "glycItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '273778921448')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createglycobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "glycItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "glycItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extracthba1c" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "glucoseGroup" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "hba1cItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(linkId = '632894677152')" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "createhba1cobs" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "hba1cItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ]
             ] ;
             fhir:StructureMap.group.rule.dependent [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.dependent.name [ fhir:value "CreateLabObservation" ] ;
               fhir:StructureMap.group.rule.dependent.variable [
                 fhir:value "ans" ;
                 fhir:index 0
               ], [
                 fhir:value "hba1cItem" ;
                 fhir:index 1
               ], [
                 fhir:value "patient" ;
                 fhir:index 2
               ], [
                 fhir:value "bundle" ;
                 fhir:index 3
               ]
             ]
           ]
         ]
       ]
     ]
  ], [
     fhir:index 10 ;
     fhir:StructureMap.group.name [ fhir:value "CreateLabObservation" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Helper: Create a single Laboratory Observation" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "ans" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "parentItem" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.input.name [ fhir:value "patient" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Patient" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ], [
       fhir:index 3 ;
       fhir:StructureMap.group.input.name [ fhir:value "bundle" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "Bundle" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "obsentry" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bundle" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "entry" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "obsEntry" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "createobs" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "obsEntry" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "resource" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "obs" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Observation" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "obsid" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "uuid" ]
           ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setfullUrl" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "obsId" ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "obsEntry" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "fullUrl" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "urn:uuid:" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "obsId" ]
             ]
           ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "obsmeta" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "meta" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "meta" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Meta" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "obsprofile" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "meta" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "profile" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://aphp.github.io/IG-FHIR-EDSH-SOCLE-COMMUN/StructureDefinition/dm-observation-laboratory-generic" ]
               ]
             ]
           ]
         ], [
           fhir:index 3 ;
           fhir:StructureMap.group.rule.name [ fhir:value "obsstatus" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "status" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "final" ]
             ]
           ]
         ], [
           fhir:index 4 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setcategory" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "category" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "cat" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "CodeableConcept" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setcategorycoding" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "cat" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "coding" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Coding" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "catsystem" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://terminology.hl7.org/CodeSystem/observation-category" ]
                 ]
               ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.name [ fhir:value "catcode" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "laboratory" ]
                 ]
               ]
             ]
           ]
         ], [
           fhir:index 5 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setsubject" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "subject" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "create" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Reference" ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "patient" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "patId" ]
           ], [
             fhir:index 2 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "ref" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "reference" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "append" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "Patient/" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "patId" ]
             ]
           ]
         ], [
           fhir:index 6 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setvalue" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtObsVal" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueQuantity" ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtObsVal" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueQuantity.unit" ]
             ]
           ], [
             fhir:index 2 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtObsVal" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://unitsofmeasure.org" ]
             ]
           ]
         ], [
           fhir:index 7 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extractloinc" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "loincItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(text.contains('code loinc'))" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "setloinccoding" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "loincItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "loincAns" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "code" ]
             ], [
               fhir:index 1 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "code" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "coding" ] ;
               fhir:StructureMap.group.rule.target.variable [ fhir:value "coding" ]
             ], [
               fhir:index 2 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "coding" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%loincAns.valueString" ]
               ]
             ]
           ]
         ], [
           fhir:index 8 ;
           fhir:StructureMap.group.rule.name [ fhir:value "extracteffective" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "dateItem" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "(text.contains('Date et heure du prélèvement'))" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "seteffective" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "dateItem" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "dateAns" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "effective" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%dateAns.valueDateTime" ]
               ]
             ]
           ]
         ], [
           fhir:index 9 ;
           fhir:StructureMap.group.rule.name [ fhir:value "setrefrange" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "obs" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "referenceRange" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "refRange" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "extractlow" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "lowItem" ] ;
               fhir:StructureMap.group.rule.source.condition [ fhir:value "(text.contains('Borne inférieure'))" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "setlow" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "lowItem" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "lowAns" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "refRange" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "low" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtLow" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%lowAns.valueQuantity" ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "tgtLow" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueQuantity.unit" ]
                 ]
               ], [
                 fhir:index 2 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "tgtLow" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://unitsofmeasure.org" ]
                 ]
               ]
             ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.name [ fhir:value "extracthigh" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "ans" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "highItem" ] ;
               fhir:StructureMap.group.rule.source.condition [ fhir:value "(text.contains('Borne supérieure'))" ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "sethigh" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "highItem" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "answer" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "highAns" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "refRange" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "high" ] ;
                 fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtHigh" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%highAns.valueQuantity" ]
                 ]
               ], [
                 fhir:index 1 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "tgtHigh" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "evaluate" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "%ans.valueQuantity.unit" ]
                 ]
               ], [
                 fhir:index 2 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "tgtHigh" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "http://unitsofmeasure.org" ]
                 ]
               ]
             ]
           ]
         ]
       ]
     ]
  ] .

# - ontology header ------------------------------------------------------------

<http://hl7.org/fhir/StructureMap/Q2FSL.ttl> a owl:Ontology ;
  owl:imports fhir:fhir.ttl ;
  owl:versionIRI <http://build.fhir.org/StructureMap/Q2FSL.ttl> .