# Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles - Data Management with FHIR v0.1.0

 ![](assets/images/aphp-logo.png) 

*  [Accueil](index.md) 
*  [Dictionnaire des données](data-dictionary.md) 
*  [Variables du socle commun **** ](#) 
*  [Acquisition des variables](use-core-variables-acquisition.md) 
*  [Formalisation des variables](use-core-variables-formalization.md) 
*  [Standardisation des variables](use-core-variables-standardization.md) 
 
*  [Health Data Platform **** ](#) 
*  [Architecture fonctionnelle](data-platform-functional-architecture.md) 
*  [Raw layer](data-platform-raw-layer.md) 
*  [Transform layer](data-platform-transform-layer.md) 
*  [Semantic layer](data-platform-semantic-layer.md) 
*  [Share layer](data-platform-share-layer.md) 
 
*  [Guide **** ](#) 
*  [Gestion des données](https://interop.aphp.fr/ig/fhir/core/data-management.html) 
*  [Bonnes pratiques](https://interop.aphp.fr/ig/fhir/core/best-practice.html) 
*  [Processus de standardisation des données](https://interop.aphp.fr/ig/fhir/core/standardization-process.html) 
 
*  [Ressources de conformité](artifacts.md) 
*  [Autres **** ](#) 
*  [Aide](help.md) 
*  [Notes de version](changelog.md) 
*  [Glossaire](glossary.md) 
*  [Télécharger spécifications](downloads.md) 
 

* [Accueil](index.md)
* [Dictionnaire des données](data-dictionary.md)
* [Usages](use-case.md)
* [Variables socles pour les EDSH](use-core-variables.md)
* [Standardisation de données au format FHIR](use-core-variables-process.md)
* [Acquisition des variables](use-core-variables-acquisition.md)
* [Formalisation des variables](use-core-variables-formalization.md)
* [Standardisation des variables](use-core-variables-standardization.md)
* [Evaluation](use-core-variables-evaluation.md)
* [Health Data Platform (démo)](data-platform.md)
* [Architecture fonctionnelle](data-platform-functional-architecture.md)
* [Raw layer](data-platform-raw-layer.md)
* [Transform layer](data-platform-transform-layer.md)
* [Semantic layer](data-platform-semantic-layer.md)
* [Share layer](data-platform-share-layer.md)
* [Autre](other.md)
* [Aide](help.md)
* [Notes de version](changelog.md)
* [Glossaire](glossary.md)
* [Télécharger les spécifications](downloads.md)
* [Artifacts Summary](artifacts.md)
* [CareSite OMOP Table](StructureDefinition-OMOPCareSite.md)
* [Concept OMOP Table](StructureDefinition-OMOPConcept.md)
* [Condition Era OMOP Table](StructureDefinition-OMOPConditionEra.md)
* [Condition Occurrence OMOP Table](StructureDefinition-OMOPConditionOccurrence.md)
* [Cost OMOP Table](StructureDefinition-OMOPCost.md)
* [Death OMOP Table](StructureDefinition-OMOPDeath.md)
* [Device Exposure OMOP Table](StructureDefinition-OMOPDeviceExposure.md)
* [Dose Era OMOP Table](StructureDefinition-OMOPDoseEra.md)
* [Drug Era OMOP Table](StructureDefinition-OMOPDrugEra.md)
* [Drug Occurrence OMOP Table](StructureDefinition-OMOPDrugExposure.md)
* [Electronic Health Record Data Model](StructureDefinition-ehr.md)
* [Episode Event OMOP Table](StructureDefinition-OMOPEpisodeEvent.md)
* [Episode OMOP Table](StructureDefinition-OMOPEpisode.md)
* [Fact Relationship OMOP Table](StructureDefinition-OMOPFactRelationship.md)
* [Location OMOP Table](StructureDefinition-OMOPLocation.md)
* [LogicalBundle](StructureDefinition-LogicalBundle.md)
* [Measurement OMOP Table](StructureDefinition-OMOPMeasurement.md)
* [Note NLP OMOP Table](StructureDefinition-OMOPNoteNLP.md)
* [Note OMOP Table](StructureDefinition-OMOPNote.md)
* [Observation OMOP Table](StructureDefinition-OMOPObservation.md)
* [Observation Period OMOP Table](StructureDefinition-OMOPObservationPeriod.md)
* [Payer Plan Period OMOP Table](StructureDefinition-OMOPPayerPlanPeriod.md)
* [Person OMOP Table](StructureDefinition-OMOPPerson.md)
* [Procedure Occurrence OMOP Table](StructureDefinition-OMOPProcedureOccurrence.md)
* [Provider OMOP Table](StructureDefinition-OMOPProvider.md)
* [Specimen OMOP Table](StructureDefinition-OMOPSpecimen.md)
* [Visit Detail OMOP Table](StructureDefinition-OMOPVisitDetail.md)
* [Visit Occurrence OMOP Table](StructureDefinition-OMOPVisitOccurrence.md)
* [Questionnaire usage Variables socles pour les EDSH](Questionnaire-UsageCore.md)
* [Profil de Claim pour le champ MCO du PMSI](StructureDefinition-DMClaimPMSIMCO.md)
* [Profil de Claim pour le PMSI](StructureDefinition-DMClaimPMSI.md)
* [Résultat de laboratoire](StructureDefinition-DMObservationLaboratoryGeneric.md)
* [Activité physique](StructureDefinition-DMObservationExerciceStatus.md)
* [Alanine aminotransférase (ALAT)](StructureDefinition-DMObservationLaboratoryALAT.md)
* [Aspartate aminotransférase (ASAT)](StructureDefinition-DMObservationLaboratoryASAT.md)
* [Bilirubine conjuguée](StructureDefinition-DMObservationLaboratoryBilirubineConjuguee.md)
* [Bilirubine totale](StructureDefinition-DMObservationLaboratoryBilirubineTotale.md)
* [Condition](StructureDefinition-DMCondition.md)
* [Consommation d'alcool](StructureDefinition-DMObservationAlcoholUseStatus.md)
* [Consommation d'autres drogues](StructureDefinition-DMObservationSubstanceUseStatus.md)
* [Consommation de tabac](StructureDefinition-DMObservationSmokingStatus.md)
* [Encounter](StructureDefinition-DMEncounter.md)
* [Eosinophiles](StructureDefinition-DMObservationLaboratoryEosinophiles.md)
* [Episode of care](StructureDefinition-DMEpisodeOfCare.md)
* [Erythrocytes](StructureDefinition-DMObservationLaboratoryErythrocytes.md)
* [Fonction rénale](StructureDefinition-DMObservationLaboratoryFonctionRenale.md)
* [French branded name Medication](StructureDefinition-FrMedicationUcd.md)
* [French compound Medication](StructureDefinition-FrMedicationCompound.md)
* [French non proprietary name Medication](StructureDefinition-FrMedicationNonproprietaryName.md)
* [French Ucd Part Medication](StructureDefinition-FrMedicationUcdPart.md)
* [Gamma-glutamyl transférase (GGT)](StructureDefinition-DMObservationLaboratoryGGT.md)
* [Glycémie à jeun](StructureDefinition-DMObservationLaboratoryGlycemieAJeun.md)
* [Hématocrite](StructureDefinition-DMObservationLaboratoryHematocrite.md)
* [Hémoglobine](StructureDefinition-DMObservationLaboratoryHemoglobine.md)
* [Hémoglobine glyquée](StructureDefinition-DMObservationLaboratoryHbA1c.md)
* [Leucocytes](StructureDefinition-DMObservationLaboratoryLeucocytes.md)
* [Location](StructureDefinition-DMLocation.md)
* [Lymphocytes](StructureDefinition-DMObservationLaboratoryLymphocytes.md)
* [Monocytes](StructureDefinition-DMObservationLaboratoryMonocytes.md)
* [Neutrophiles](StructureDefinition-DMObservationLaboratoryNeutrophiles.md)
* [Organization](StructureDefinition-DMOrganization.md)
* [Patient](StructureDefinition-DMPatient.md)
* [Phosphatases alcaline](StructureDefinition-DMObservationLaboratoryPAL.md)
* [Plaquettes](StructureDefinition-DMObservationLaboratoryPlaquettes.md)
* [Poids du patient](StructureDefinition-DMObservationBodyWeight.md)
* [Practitioner](StructureDefinition-DMPractitioner.md)
* [PractitionerRole](StructureDefinition-DMPractitionerRole.md)
* [Prescription de médicaments](StructureDefinition-DMMedicationRequest.md)
* [Pression artérielle](StructureDefinition-DMObservationBloodPressure.md)
* [Prise de médicaments](StructureDefinition-DMMedicationAdministration.md)
* [Procedure](StructureDefinition-DMProcedure.md)
* [RUM du PMSI MCO](StructureDefinition-DMClaimRUM.md)
* [Taille du patient](StructureDefinition-DMObservationBodyHeight.md)
* [Taux prothrombine (TP)](StructureDefinition-DMObservationLaboratoryTP.md)
* [Temps de céphaline activée (TCA)](StructureDefinition-DMObservationLaboratoryTCA.md)
* [Urée](StructureDefinition-DMObservationLaboratoryUremie.md)
* [Volume globulaire moyen](StructureDefinition-DMObservationLaboratoryVGM.md)
* [Address](StructureDefinition-DMAddress.md)
* [Range with UCUM quantity units](StructureDefinition-FrRangeUcum.md)
* [Ratio with UCUM quantity units](StructureDefinition-FrRatioUcum.md)
* [SimpleQuantity with UCUM quantity unit](StructureDefinition-FrSimpleQuantityUcum.md)
* [Codage géographique du lieu de résidence pour les RSA du PMSI](StructureDefinition-PmsiCodeGeo.md)
* [Groupe Homogène de Malade](StructureDefinition-DRG.md)
* [Ordre des Item dans un claim](StructureDefinition-ItemRank.md)
* [Source ayant fournie l'information de décès](StructureDefinition-DeathSource.md)
* [Actes CCAM pour le PMSI](ValueSet-CcamVS.md)
* [Blood Pressure Measurement Body Location Precoordinated](ValueSet-BloodPressureMeasurementBodyLocationPrecoodinated.md)
* [Blood Pressure Measurement Method](ValueSet-BloodPressureMeasurementMethod.md)
* [Categorisation des items de claim pour le PMSI MCO](ValueSet-FrMCOClaimItemCategory.md)
* [Exercice Status Type](ValueSet-DMExerciceStatusType.md)
* [French Medicinal product Dose form](ValueSet-FrMpDoseForm.md)
* [French Medicinal Product only](ValueSet-FrMedicinalProductOnly.md)
* [French Route of Administration](ValueSet-FrRouteOfAdministration.md)
* [Height Length Measurement Method](ValueSet-HeightLengthMeasurementMethod.md)
* [Liste des analyses biologiques socle des EDS](ValueSet-DMLaboratory.md)
* [Liste des analyses correspondant à l'estimation du DFG - socle des EDS](ValueSet-DMLaboratoryEstimatedDFG.md)
* [Liste des diagnostiques CIM-10 acceptable en DA pour les PMSI MCO et HAD](ValueSet-CIM10PMSIDA.md)
* [Liste des diagnostiques CIM-10 acceptable en DP pour les PMSI MCO et HAD](ValueSet-CIM10PMSIDP.md)
* [Liste des diagnostiques CIM-10 acceptable en DR pour les PMSI MCO et HAD](ValueSet-CIM10PMSIDR.md)
* [Liste des diagnostiques CIM-10 OMS](ValueSet-CIM10.md)
* [Liste des diagnostiques CIM-10 pour le PMSI](ValueSet-CIM10PMSI.md)
* [Liste des GHM pour le PMSI MCO](ValueSet-GHMVS.md)
* [Liste des status pour l'Observation de consommation de tabac](ValueSet-DMObservationSmokingStatusStatus.md)
* [Liste des unités possibles pour une estimation du débit de filtration glomérulaire - socle des EDS](ValueSet-DMLaboratoryEstimatedDFGUnit.md)
* [Mode d'entré du PMSI MCO](ValueSet-PMSIMCOMDEVS.md)
* [Mode de sortie du PMSI MCO](ValueSet-PMSIMCOMDSVS.md)
* [Smoking status comprehensive](ValueSet-DMSmokingStatusComprehensive.md)
* [Smoking Status Pack Years SCT](ValueSet-DMSmokingStatusPackYearsSCT.md)
* [Smoking Status Type](ValueSet-DMSmokingStatusType.md)
* [Smoking Status Type from LOINC](ValueSet-DMSmokingStatusTypeLOINC.md)
* [ValueSet des codes géographiques de résidence du PMSI](ValueSet-PmsiCodeGeoVs.md)
* [ValueSet des modes d'entrée du DPI](ValueSet-DpiModeIn.md)
* [ValueSet des modes de sortie du DPI](ValueSet-DpiModeOut.md)
* [ValueSet des Sexe administratif du DPI](ValueSet-DpiGenderVS.md)
* [ValueSet des sources d'informations fr sur le statut vital](ValueSet-DeathSourcesVs.md)
* [ValueSet des type fr des claims](ValueSet-FrClaimType.md)
* [ValueSet des type fr des claims](ValueSet-FrMCOClaimSubType.md)
* [ValueSet des types de séjour du DPI](ValueSet-DpiEncounterTypeVS.md)
* [ValueSet of gender of OHDSI](ValueSet-OMOPGender.md)
* [Weight Measurement Method](ValueSet-WeightMeasurementMethod.md)
* [Cadre de facturation dans la réglementation française](CodeSystem-FrClaimType.md)
* [Categorie d'information pour les supporting information](CodeSystem-FrClaimSupInfoCategoryPMSIMCO.md)
* [Categorisation des items de claim pour le PMSI MCO](CodeSystem-FrMCOClaimItemCategory.md)
* [CCAM illustrative](CodeSystem-Ccam.md)
* [CIM 10 PMSI](CodeSystem-CIM10.md)
* [Classification des GHM utilisée pour le groupage des séjours dans le PMSI MCO.](CodeSystem-GHM.md)
* [CodeSystem des lieux de résidence géographique au sens du PMSI](CodeSystem-PmsiCodeGeo.md)
* [DPI Gender](CodeSystem-DpiGender.md)
* [Dpi Mode d'entrée](CodeSystem-DpiModeIn.md)
* [Dpi Mode de sortie](CodeSystem-DpiModeOut.md)
* [DPI Type de séjour](CodeSystem-DpiEncounterType.md)
* [Mode d'entré du PMSI MCO](CodeSystem-PMSIMCOMDE.md)
* [Mode de sortie du PMSI MCO](CodeSystem-PMSIMCOMDS.md)
* [mode PMSI](CodeSystem-FrClaimMode.md)
* [Observational Medical Outcomes Partnership (OMOP)](CodeSystem-dm-omop-cdm-v20240229.md)
* [SNOMED CT Solor Extension Temporary](CodeSystem-SolorTemporary.md)
* [Sources susceptibles d'informer sur le statu vital des patients](CodeSystem-DeathSources.md)
* [Specialités médicales au sens de la Fédération des Spécialités Médicales (FSM)](CodeSystem-SpecialitesMedicalesFSM.md)
* [type de diagnostic du PMSI MCO](CodeSystem-PMSIMCODiagType.md)
* [Transforms EHR logical model data to FHIR Semantic Layer resources using Bundle as container](StructureMap-EHR2FSL.md)
* [Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles](StructureMap-Q2FSL.md)
* [Alignement de l''expression de besoin vers le modèle physique du DPI dans le cadre de l''usage Core](StructureMap-CoreBusiness2Physical.md)
* [Cette ressource présente les spécifications de l''alignement entre les ressources FHIR vers les tables correspodantes du CDM OMOP.](StructureMap-CoreFHIR2OMOP.md)
* [Mapping FHIR Patient resource to OMOP Death](StructureMap-CoreFHIR2OMOPDeath.md)
* [Mapping Patient resource to Location OMOP Domain](StructureMap-CoreFHIR2OMOPLocation.md)
* [Mapping Observation laboratory resources to Measurement OMOP Domain](StructureMap-CoreFHIR2OMOPMeasurement.md)
* [Mapping FHIR Patient resource to OMOP Person](StructureMap-CoreFHIR2OMOPPerson.md)
* [Cette ressource présente les spécifications de l''alignement entre la ressource `Patient` vers les tables correspodantes du CDM OMOP.](StructureMap-CoreFHIRPatient2OMOP.md)
* [Alignement de l''usage Core du modèle physique du DPI vers les ressources FHIR](StructureMap-CorePhysical2FHIR.md)
* [Mapping simple Observation laboratory resources to Measurement OMOP Domain](StructureMap-CoreSimpleObservation2OMOPMeasurement.md)
* [DPI (local) Gender to HL7 Gender](ConceptMap-dpi-gender-2-hl7-gender.md)
* [DPI Encounter type to Semantic layer](ConceptMap-dpi-encounter-type-2-semantic-layer-encounter-class.md)
* [HL7 Gender to OHDSI Gender](ConceptMap-hl7-gender-to-ohdsi-gender.md)
* [Administration d'albumine de Madame Blanc](MedicationAdministration-albumine-j1-cas-9.md)
* [Administration à J1 de furosemide de Madame Blanc](MedicationAdministration-furosemide-j1-cas-9.md)
* [Administration à J1 de spironolactone de Madame Blanc](MedicationAdministration-spironolactone-j1-cas-9.md)
* [Administration à J2 de furosemide de Madame Blanc](MedicationAdministration-furosemide-j2-cas-9.md)
* [Administration à J2 de spironolactone de Madame Blanc](MedicationAdministration-spironolactone-j2-cas-9.md)
* [ALAT de Madame Blanc](Observation-alat-cas-9.md)
* [Albumine](Medication-albumine.md)
* [ASAT de Madame Blanc](Observation-asat-cas-9.md)
* [Ascite de Madame Blanc](Condition-ascite-cas-9.md)
* [Bilirubine totale de Madame Blanc](Observation-bilirubine-totale-cas-9.md)
* [Cirrhose de Madame Blanc](Condition-cirrhose-cas-9.md)
* [Consommation d'alcool de Madame Blanc](Observation-alcool-cas-9.md)
* [de Madame Blanc](Patient-cas-9.md)
* [Exemple complet (FSL)](Bundle-df9c9a9c-854b-46f4-9687-1fbe40c06540.md)
* [Exemple simple](QuestionnaireResponse-test-usage-core.md)
* [Fibroscopie oeso-gastroduodénale de Madame Blanc](Procedure-fogd-cas-9.md)
* [Furosémide](Medication-furosemide.md)
* [GGT de Madame Blanc](Observation-ggt-cas-9.md)
* [Patient 1 - Madame Dupont](QuestionnaireResponse-cas-1-usage-core.md)
* [Patient 10 - Monsieur David](QuestionnaireResponse-cas-10-usage-core.md)
* [Patient 11 - Madame Doré](QuestionnaireResponse-cas-11-usage-core.md)
* [Patient 2 - Monsieur Martin](QuestionnaireResponse-cas-2-usage-core.md)
* [Patient 3 - Madame Leroy](QuestionnaireResponse-cas-3-usage-core.md)
* [Patient 4 - Monsieur Moreau](QuestionnaireResponse-cas-4-usage-core.md)
* [Patient 5 - Madame Simon](QuestionnaireResponse-cas-5-usage-core.md)
* [Patient 6 - Monsieur Petit](QuestionnaireResponse-cas-6-usage-core.md)
* [Patient 7 - Madame Garcia](QuestionnaireResponse-cas-7-usage-core.md)
* [Patient 8 - Monsieur Roux](QuestionnaireResponse-cas-8-usage-core.md)
* [Patient 9 - Madame Blanc](QuestionnaireResponse-cas-9-usage-core.md)
* [Patient test (Bundle)](Bundle-5616f9ad-61b0-4279-9f41-777228d04665.md)
* [Patient test (Ressource)](Patient-8f005d60-b59b-47f7-b04a-f877378f8d68.md)
* [Phosphatases alcalines de Madame Blanc](Observation-phosphatases-alcalines-cas-9.md)
* [Poids de Madame Blanc](Observation-poids-cas-9.md)
* [Ponction évacuatrice de Madame Blanc](Procedure-ponction-cas-9.md)
* [Prescription d'albumine de Madame Blanc](MedicationRequest-albumine-cas-9.md)
* [Prescription de furosémide de Madame Blanc](MedicationRequest-furosemide-cas-9.md)
* [Prescription de furosémide de Madame Blanc](MedicationRequest-spironolactone-cas-9.md)
* [Spironolactone](Medication-spironolactone.md)
* [Séjour de Madame Blanc](Encounter-sejour-cas-9.md)
* [Taux de prothrombine de Madame Blanc](Observation-tp-cas-9.md)
* [Test simple](Bundle-2abf7f4c-bd1f-431f-a4c8-667cfa425baf.md)
* [Exigences des variables socles pour les Entrepôts de Données de Santé Hospitalier (EDSH)](DocumentReference-CoreExigences.md)

Data Management with FHIR
0.1.0 - ci-build

## StructureMap: Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles 

| | |
| :--- | :--- |
| *Official URL*:https://interop.aphp.fr/ig/fhir/dm/StructureMap/Q2FSL | *Version*:0.1.0 |
| Draft as of 2026-04-16 | *Computable Name*:Q2FSL |

 
Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles 



## Resource Content

```json
{
  "resourceType" : "StructureMap",
  "id" : "Q2FSL",
  "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureMap/Q2FSL",
  "version" : "0.1.0",
  "name" : "Q2FSL",
  "title" : "Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles",
  "status" : "draft",
  "date" : "2026-04-16T14:35:38+00:00",
  "publisher" : "AP-HP",
  "contact" : [{
    "name" : "AP-HP",
    "telecom" : [{
      "system" : "url",
      "value" : "https://aphp.fr"
    }]
  }],
  "description" : "Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "urn:iso:std:iso:3166",
      "code" : "FR"
    }]
  }],
  "structure" : [{
    "url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
    "mode" : "source",
    "alias" : "QuestionnaireResponse"
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
    "mode" : "target",
    "alias" : "Bundle"
  }],
  "group" : [{
    "name" : "QuestionnaireResponseToBundle",
    "typeMode" : "none",
    "documentation" : "Main entry point: Transform QuestionnaireResponse to Bundle",
    "input" : [{
      "name" : "src",
      "type" : "QuestionnaireResponse",
      "mode" : "source"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "bundleid",
      "source" : [{
        "context" : "src"
      }],
      "target" : [{
        "context" : "bundle",
        "contextType" : "variable",
        "element" : "id",
        "transform" : "uuid"
      }]
    },
    {
      "name" : "bundletype",
      "source" : [{
        "context" : "src"
      }],
      "target" : [{
        "context" : "bundle",
        "contextType" : "variable",
        "element" : "type",
        "transform" : "copy",
        "parameter" : [{
          "valueString" : "collection"
        }]
      }]
    },
    {
      "name" : "setTimestamp",
      "source" : [{
        "context" : "src"
      }],
      "target" : [{
        "context" : "bundle",
        "contextType" : "variable",
        "element" : "timestamp",
        "transform" : "evaluate",
        "parameter" : [{
          "valueString" : "now()"
        }]
      }]
    },
    {
      "name" : "patiententry",
      "source" : [{
        "context" : "src"
      }],
      "target" : [{
        "context" : "bundle",
        "contextType" : "variable",
        "element" : "entry",
        "variable" : "patientEntry"
      }],
      "rule" : [{
        "name" : "createpatientresource",
        "source" : [{
          "context" : "src"
        }],
        "target" : [{
          "context" : "patientEntry",
          "contextType" : "variable",
          "element" : "resource",
          "variable" : "patient",
          "transform" : "create",
          "parameter" : [{
            "valueString" : "Patient"
          }]
        }],
        "rule" : [{
          "name" : "createpatient",
          "source" : [{
            "context" : "src"
          }],
          "dependent" : [{
            "name" : "CreatePatient",
            "variable" : ["src", "patient"]
          }]
        },
        {
          "name" : "setfullUrl",
          "source" : [{
            "context" : "src"
          }],
          "target" : [{
            "context" : "patient",
            "contextType" : "variable",
            "element" : "id",
            "variable" : "patientId"
          },
          {
            "context" : "patientEntry",
            "contextType" : "variable",
            "element" : "fullUrl",
            "transform" : "append",
            "parameter" : [{
              "valueString" : "urn:uuid:"
            },
            {
              "valueId" : "patientId"
            }]
          }]
        },
        {
          "name" : "createencounters",
          "source" : [{
            "context" : "src"
          }],
          "dependent" : [{
            "name" : "CreateEncounters",
            "variable" : ["src", "patient", "bundle"]
          }]
        },
        {
          "name" : "createlabobservations",
          "source" : [{
            "context" : "src"
          }],
          "dependent" : [{
            "name" : "CreateLaboratoryObservations",
            "variable" : ["src", "patient", "bundle"]
          }]
        },
        {
          "name" : "createmedicationrequests",
          "source" : [{
            "context" : "src"
          }],
          "dependent" : [{
            "name" : "CreateMedicationRequests",
            "variable" : ["src", "patient", "bundle"]
          }]
        },
        {
          "name" : "createmedicationadministrations",
          "source" : [{
            "context" : "src"
          }],
          "dependent" : [{
            "name" : "CreateMedicationAdministrations",
            "variable" : ["src", "patient", "bundle"]
          }]
        },
        {
          "name" : "createvitalsigns",
          "source" : [{
            "context" : "src"
          }],
          "dependent" : [{
            "name" : "CreateVitalSignObservations",
            "variable" : ["src", "patient", "bundle"]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreatePatient",
    "typeMode" : "none",
    "documentation" : "Group: Create Patient from QuestionnaireResponse",
    "input" : [{
      "name" : "src",
      "type" : "QuestionnaireResponse",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "patientid",
      "source" : [{
        "context" : "src"
      }],
      "target" : [{
        "context" : "patient",
        "contextType" : "variable",
        "element" : "id",
        "transform" : "uuid"
      }]
    },
    {
      "name" : "patientmeta",
      "source" : [{
        "context" : "src"
      }],
      "target" : [{
        "context" : "patient",
        "contextType" : "variable",
        "element" : "meta",
        "variable" : "meta",
        "transform" : "create",
        "parameter" : [{
          "valueString" : "Meta"
        }]
      }],
      "rule" : [{
        "name" : "patientprofile",
        "source" : [{
          "context" : "src"
        }],
        "target" : [{
          "context" : "meta",
          "contextType" : "variable",
          "element" : "profile",
          "transform" : "copy",
          "parameter" : [{
            "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMPatient"
          }]
        }]
      }]
    },
    {
      "name" : "processsociodemographics",
      "source" : [{
        "context" : "src",
        "element" : "item",
        "variable" : "socioDemo",
        "condition" : "(linkId = '4647259356106')"
      }],
      "rule" : [{
        "name" : "processidentity",
        "source" : [{
          "context" : "socioDemo",
          "element" : "item",
          "variable" : "identity",
          "condition" : "(linkId = '2958000860428')"
        }],
        "rule" : [{
          "name" : "setname",
          "source" : [{
            "context" : "identity"
          }],
          "target" : [{
            "context" : "patient",
            "contextType" : "variable",
            "element" : "name",
            "variable" : "name",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "HumanName"
            }]
          }],
          "rule" : [{
            "name" : "extractfamily",
            "source" : [{
              "context" : "identity",
              "element" : "item",
              "variable" : "familyItem",
              "condition" : "(linkId = '8605698058770')"
            }],
            "rule" : [{
              "name" : "setfamily",
              "source" : [{
                "context" : "familyItem",
                "element" : "answer",
                "variable" : "ans"
              }],
              "target" : [{
                "context" : "name",
                "contextType" : "variable",
                "element" : "family",
                "transform" : "evaluate",
                "parameter" : [{
                  "valueString" : "ans.valueString"
                }]
              }]
            }]
          },
          {
            "name" : "extractgiven",
            "source" : [{
              "context" : "identity",
              "element" : "item",
              "variable" : "givenItem",
              "condition" : "(linkId = '6214879623503')"
            }],
            "rule" : [{
              "name" : "setgiven",
              "source" : [{
                "context" : "givenItem",
                "element" : "answer",
                "variable" : "ans"
              }],
              "target" : [{
                "context" : "name",
                "contextType" : "variable",
                "element" : "given",
                "transform" : "evaluate",
                "parameter" : [{
                  "valueString" : "ans.valueString"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractnir",
          "source" : [{
            "context" : "identity",
            "element" : "item",
            "variable" : "nirItem",
            "condition" : "(linkId = '5711960356160')"
          }],
          "rule" : [{
            "name" : "setnir",
            "source" : [{
              "context" : "nirItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "patient",
              "contextType" : "variable",
              "element" : "identifier",
              "variable" : "nir",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Identifier"
              }]
            }],
            "rule" : [{
              "name" : "nirsystem",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "nir",
                "contextType" : "variable",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "urn:oid:1.2.250.1.213.1.4.8"
                }]
              }]
            },
            {
              "name" : "nirvalue",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "nir",
                "contextType" : "variable",
                "element" : "value",
                "transform" : "evaluate",
                "parameter" : [{
                  "valueString" : "ans.valueString"
                }]
              }]
            },
            {
              "name" : "nirtype",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "nir",
                "contextType" : "variable",
                "element" : "type",
                "transform" : "cc",
                "parameter" : [{
                  "valueString" : "http://interopsante.org/fhir/CodeSystem/fr-v2-0203"
                },
                {
                  "valueString" : "NIR"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractins",
          "source" : [{
            "context" : "identity",
            "element" : "item",
            "variable" : "insItem",
            "condition" : "(linkId = '3764723550987')"
          }],
          "rule" : [{
            "name" : "setins",
            "source" : [{
              "context" : "insItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "patient",
              "contextType" : "variable",
              "element" : "identifier",
              "variable" : "ins",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Identifier"
              }]
            }],
            "rule" : [{
              "name" : "inssystem",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "ins",
                "contextType" : "variable",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "urn:oid:1.2.250.1.213.1.4.10"
                }]
              }]
            },
            {
              "name" : "insvalue",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "ins",
                "contextType" : "variable",
                "element" : "value",
                "transform" : "evaluate",
                "parameter" : [{
                  "valueString" : "ans.valueString"
                }]
              }]
            },
            {
              "name" : "instype",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "ins",
                "contextType" : "variable",
                "element" : "type",
                "transform" : "cc",
                "parameter" : [{
                  "valueString" : "http://interopsante.org/fhir/CodeSystem/fr-v2-0203"
                },
                {
                  "valueString" : "INS-C"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractbirthdate",
          "source" : [{
            "context" : "identity",
            "element" : "item",
            "variable" : "birthItem",
            "condition" : "(linkId = '5036133558154')"
          }],
          "rule" : [{
            "name" : "setbirthdate",
            "source" : [{
              "context" : "birthItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "patient",
              "contextType" : "variable",
              "element" : "birthDate",
              "transform" : "evaluate",
              "parameter" : [{
                "valueString" : "ans.valueDate"
              }]
            }]
          }]
        },
        {
          "name" : "extractdeath",
          "source" : [{
            "context" : "identity",
            "element" : "item",
            "variable" : "deathItem",
            "condition" : "(linkId = '5633552097315')"
          }],
          "rule" : [{
            "name" : "setdeceaseddate",
            "source" : [{
              "context" : "deathItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "patient",
              "contextType" : "variable",
              "element" : "deceased",
              "transform" : "evaluate",
              "parameter" : [{
                "valueString" : "ans.valueDate"
              }]
            }]
          },
          {
            "name" : "extractdeathsource",
            "source" : [{
              "context" : "deathItem",
              "element" : "item",
              "variable" : "deathSource",
              "condition" : "(linkId = '9098810065693')"
            }],
            "rule" : [{
              "name" : "setdeathsourceext",
              "source" : [{
                "context" : "deathSource",
                "element" : "answer",
                "variable" : "sourceAns"
              }],
              "target" : [{
                "context" : "patient",
                "contextType" : "variable",
                "element" : "extension",
                "variable" : "ext",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "Extension"
                }]
              }],
              "rule" : [{
                "name" : "deathsourceurl",
                "source" : [{
                  "context" : "sourceAns"
                }],
                "target" : [{
                  "context" : "ext",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/death-source"
                  }]
                }]
              },
              {
                "name" : "deathsourcevalue",
                "source" : [{
                  "context" : "sourceAns"
                }],
                "target" : [{
                  "context" : "ext",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "evaluate",
                  "parameter" : [{
                    "valueString" : "sourceAns.valueCoding"
                  }]
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractmultiplebirth",
          "source" : [{
            "context" : "identity",
            "element" : "item",
            "variable" : "multipleItem",
            "condition" : "(linkId = '6931296968515')"
          }],
          "rule" : [{
            "name" : "navigatevalue",
            "source" : [{
              "context" : "multipleItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "rule" : [{
              "name" : "setmultiplebirth",
              "source" : [{
                "context" : "ans",
                "element" : "valueInteger",
                "variable" : "valueInteger"
              }],
              "target" : [{
                "context" : "patient",
                "contextType" : "variable",
                "element" : "multipleBirth",
                "transform" : "copy",
                "parameter" : [{
                  "valueId" : "valueInteger"
                }]
              }]
            }]
          }]
        }]
      },
      {
        "name" : "extractpmsidemographics",
        "source" : [{
          "context" : "src",
          "element" : "item",
          "variable" : "pmsiGroup",
          "condition" : "(linkId = '2825244231605')"
        }],
        "rule" : [{
          "name" : "extractgender",
          "source" : [{
            "context" : "pmsiGroup",
            "element" : "item",
            "variable" : "sexItem",
            "condition" : "(linkId = '3894630481120')"
          }],
          "rule" : [{
            "name" : "valueCoding",
            "source" : [{
              "context" : "sexItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "rule" : [{
              "name" : "setgender",
              "source" : [{
                "context" : "ans",
                "element" : "valueCoding",
                "variable" : "valueCoding"
              }],
              "target" : [{
                "context" : "patient",
                "contextType" : "variable",
                "element" : "gender",
                "transform" : "translate",
                "parameter" : [{
                  "valueId" : "valueCoding"
                },
                {
                  "valueString" : "https://interop.aphp.fr/ig/fhir/dm/ConceptMap/dpi-gender-2-hl7-gender"
                },
                {
                  "valueString" : "code"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractcodegeo",
          "source" : [{
            "context" : "pmsiGroup",
            "element" : "item",
            "variable" : "codeGeoItem",
            "condition" : "(linkId = '2446369196222')"
          }],
          "rule" : [{
            "name" : "setaddress",
            "source" : [{
              "context" : "codeGeoItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "patient",
              "contextType" : "variable",
              "element" : "address",
              "variable" : "addr",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Address"
              }]
            }],
            "rule" : [{
              "name" : "setcodegeoext",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "addr",
                "contextType" : "variable",
                "element" : "extension",
                "variable" : "ext",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "Extension"
                }]
              }],
              "rule" : [{
                "name" : "codegeourl",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "ext",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/pmsi-code-geo"
                  }]
                }]
              },
              {
                "name" : "codegeovalue",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "ext",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "evaluate",
                  "parameter" : [{
                    "valueString" : "ans.valueCoding"
                  }]
                }]
              }]
            }]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreateLocations",
    "typeMode" : "none",
    "documentation" : "Group: Create Locations from geocoding and IRIS data",
    "input" : [{
      "name" : "src",
      "type" : "QuestionnaireResponse",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "processsociodemographicslocation",
      "source" : [{
        "context" : "src",
        "element" : "item",
        "variable" : "socioDemo",
        "condition" : "(linkId = '4647259356106')"
      }],
      "rule" : [{
        "name" : "processenvironment",
        "source" : [{
          "context" : "socioDemo",
          "element" : "item",
          "variable" : "environment",
          "condition" : "(linkId = '5491974639955')"
        }],
        "rule" : [{
          "name" : "geocodinglocationentry",
          "source" : [{
            "context" : "environment",
            "element" : "item",
            "variable" : "geocodingItem",
            "condition" : "(linkId = '3816475533472')"
          }],
          "target" : [{
            "context" : "bundle",
            "contextType" : "variable",
            "element" : "entry",
            "variable" : "locationEntry"
          }],
          "rule" : [{
            "name" : "createlocation",
            "source" : [{
              "context" : "geocodingItem"
            }],
            "target" : [{
              "context" : "locationEntry",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "location",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Location"
              }]
            }],
            "rule" : [{
              "name" : "locationid",
              "source" : [{
                "context" : "geocodingItem"
              }],
              "target" : [{
                "context" : "location",
                "contextType" : "variable",
                "element" : "id",
                "transform" : "uuid"
              }]
            },
            {
              "name" : "locationmeta",
              "source" : [{
                "context" : "geocodingItem"
              }],
              "target" : [{
                "context" : "location",
                "contextType" : "variable",
                "element" : "meta",
                "variable" : "meta",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "Meta"
                }]
              }],
              "rule" : [{
                "name" : "locationprofile",
                "source" : [{
                  "context" : "geocodingItem"
                }],
                "target" : [{
                  "context" : "meta",
                  "contextType" : "variable",
                  "element" : "profile",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMLocation"
                  }]
                }]
              }]
            },
            {
              "name" : "setposition",
              "source" : [{
                "context" : "geocodingItem"
              }],
              "target" : [{
                "context" : "location",
                "contextType" : "variable",
                "element" : "position",
                "variable" : "pos",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "LocationPosition"
                }]
              }],
              "rule" : [{
                "name" : "extractlatitude",
                "source" : [{
                  "context" : "geocodingItem",
                  "element" : "item",
                  "variable" : "latItem",
                  "condition" : "(linkId = '3709843054556')"
                }],
                "rule" : [{
                  "name" : "setlatitude",
                  "source" : [{
                    "context" : "latItem",
                    "element" : "answer",
                    "variable" : "ans"
                  }],
                  "target" : [{
                    "context" : "pos",
                    "contextType" : "variable",
                    "element" : "latitude",
                    "transform" : "evaluate",
                    "parameter" : [{
                      "valueString" : "ans.valueDecimal"
                    }]
                  }]
                }]
              },
              {
                "name" : "extractlongitude",
                "source" : [{
                  "context" : "geocodingItem",
                  "element" : "item",
                  "variable" : "longItem",
                  "condition" : "(linkId = '7651448032665')"
                }],
                "rule" : [{
                  "name" : "setlongitude",
                  "source" : [{
                    "context" : "longItem",
                    "element" : "answer",
                    "variable" : "ans"
                  }],
                  "target" : [{
                    "context" : "pos",
                    "contextType" : "variable",
                    "element" : "longitude",
                    "transform" : "evaluate",
                    "parameter" : [{
                      "valueString" : "ans.valueDecimal"
                    }]
                  }]
                }]
              }]
            },
            {
              "name" : "setrequest",
              "source" : [{
                "context" : "location"
              }],
              "target" : [{
                "context" : "locationEntry",
                "contextType" : "variable",
                "element" : "request",
                "variable" : "request"
              }],
              "rule" : [{
                "name" : "setmethod",
                "source" : [{
                  "context" : "location"
                }],
                "target" : [{
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "POST"
                  }]
                }]
              },
              {
                "name" : "seturl",
                "source" : [{
                  "context" : "location"
                }],
                "target" : [{
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Location"
                  }]
                }]
              }]
            },
            {
              "name" : "setfullUrl",
              "source" : [{
                "context" : "location",
                "element" : "id",
                "variable" : "locId"
              }],
              "target" : [{
                "context" : "locationEntry",
                "contextType" : "variable",
                "element" : "fullUrl",
                "transform" : "append",
                "parameter" : [{
                  "valueString" : "urn:uuid:"
                },
                {
                  "valueId" : "locId"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "processiris",
          "source" : [{
            "context" : "environment",
            "element" : "item",
            "variable" : "irisItem",
            "condition" : "(linkId = '7621032273792')"
          }],
          "rule" : [{
            "name" : "irislocationentry",
            "source" : [{
              "context" : "irisItem",
              "element" : "answer",
              "variable" : "irisAnswer"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "locationEntry"
            }],
            "rule" : [{
              "name" : "createirislocation",
              "source" : [{
                "context" : "irisAnswer"
              }],
              "target" : [{
                "context" : "locationEntry",
                "contextType" : "variable",
                "element" : "resource",
                "variable" : "location",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "Location"
                }]
              }],
              "rule" : [{
                "name" : "locationid",
                "source" : [{
                  "context" : "irisAnswer"
                }],
                "target" : [{
                  "context" : "location",
                  "contextType" : "variable",
                  "element" : "id",
                  "transform" : "uuid"
                }]
              },
              {
                "name" : "locationmeta",
                "source" : [{
                  "context" : "irisAnswer"
                }],
                "target" : [{
                  "context" : "location",
                  "contextType" : "variable",
                  "element" : "meta",
                  "variable" : "meta",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "Meta"
                  }]
                }],
                "rule" : [{
                  "name" : "locationprofile",
                  "source" : [{
                    "context" : "irisAnswer"
                  }],
                  "target" : [{
                    "context" : "meta",
                    "contextType" : "variable",
                    "element" : "profile",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMLocation"
                    }]
                  }]
                }]
              },
              {
                "name" : "setirisidentifier",
                "source" : [{
                  "context" : "irisAnswer"
                }],
                "target" : [{
                  "context" : "location",
                  "contextType" : "variable",
                  "element" : "identifier",
                  "variable" : "identifier",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "Identifier"
                  }]
                }],
                "rule" : [{
                  "name" : "irissystem",
                  "source" : [{
                    "context" : "irisAnswer"
                  }],
                  "target" : [{
                    "context" : "identifier",
                    "contextType" : "variable",
                    "element" : "system",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "urn:oid:2.16.840.1.113883.2.8.1.5.5"
                    }]
                  }]
                },
                {
                  "name" : "irisvalue",
                  "source" : [{
                    "context" : "irisAnswer"
                  }],
                  "target" : [{
                    "context" : "identifier",
                    "contextType" : "variable",
                    "element" : "value",
                    "transform" : "evaluate",
                    "parameter" : [{
                      "valueString" : "irisAnswer.valueCoding.code"
                    }]
                  }]
                }]
              },
              {
                "name" : "setrequest",
                "source" : [{
                  "context" : "location"
                }],
                "target" : [{
                  "context" : "locationEntry",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request"
                }],
                "rule" : [{
                  "name" : "setmethod",
                  "source" : [{
                    "context" : "location"
                  }],
                  "target" : [{
                    "context" : "request",
                    "contextType" : "variable",
                    "element" : "method",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "POST"
                    }]
                  }]
                },
                {
                  "name" : "seturl",
                  "source" : [{
                    "context" : "location"
                  }],
                  "target" : [{
                    "context" : "request",
                    "contextType" : "variable",
                    "element" : "url",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "Location"
                    }]
                  }]
                }]
              },
              {
                "name" : "setfullUrl",
                "source" : [{
                  "context" : "location",
                  "element" : "id",
                  "variable" : "locId"
                }],
                "target" : [{
                  "context" : "locationEntry",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [{
                    "valueString" : "urn:uuid:"
                  },
                  {
                    "valueId" : "locId"
                  }]
                }]
              }]
            }]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreateEncounters",
    "typeMode" : "none",
    "documentation" : "Group: Create Encounters from PMSI data",
    "input" : [{
      "name" : "src",
      "type" : "QuestionnaireResponse",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "encounterentry",
      "source" : [{
        "context" : "src",
        "element" : "item",
        "variable" : "pmsiItem",
        "condition" : "(linkId = '2825244231605')"
      }],
      "target" : [{
        "context" : "bundle",
        "contextType" : "variable",
        "element" : "entry",
        "variable" : "encounterEntry"
      }],
      "rule" : [{
        "name" : "createencounter",
        "source" : [{
          "context" : "pmsiItem"
        }],
        "target" : [{
          "context" : "encounterEntry",
          "contextType" : "variable",
          "element" : "resource",
          "variable" : "encounter",
          "transform" : "create",
          "parameter" : [{
            "valueString" : "Encounter"
          }]
        }],
        "rule" : [{
          "name" : "encounterid",
          "source" : [{
            "context" : "pmsiItem"
          }],
          "target" : [{
            "context" : "encounter",
            "contextType" : "variable",
            "element" : "id",
            "transform" : "uuid"
          }]
        },
        {
          "name" : "encountermeta",
          "source" : [{
            "context" : "pmsiItem"
          }],
          "target" : [{
            "context" : "encounter",
            "contextType" : "variable",
            "element" : "meta",
            "variable" : "meta",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Meta"
            }]
          }],
          "rule" : [{
            "name" : "encounterprofile",
            "source" : [{
              "context" : "pmsiItem"
            }],
            "target" : [{
              "context" : "meta",
              "contextType" : "variable",
              "element" : "profile",
              "transform" : "copy",
              "parameter" : [{
                "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMEncounter"
              }]
            }]
          }]
        },
        {
          "name" : "setsubject",
          "source" : [{
            "context" : "src"
          }],
          "target" : [{
            "context" : "encounter",
            "contextType" : "variable",
            "element" : "subject",
            "variable" : "ref",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Reference"
            }]
          },
          {
            "context" : "patient",
            "contextType" : "variable",
            "element" : "id",
            "variable" : "patId"
          },
          {
            "context" : "ref",
            "contextType" : "variable",
            "element" : "reference",
            "transform" : "append",
            "parameter" : [{
              "valueString" : "Patient/"
            },
            {
              "valueId" : "patId"
            }]
          }]
        },
        {
          "name" : "setperiod",
          "source" : [{
            "context" : "pmsiItem"
          }],
          "target" : [{
            "context" : "encounter",
            "contextType" : "variable",
            "element" : "period",
            "variable" : "period",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Period"
            }]
          }],
          "rule" : [{
            "name" : "extractstart",
            "source" : [{
              "context" : "pmsiItem",
              "element" : "item",
              "variable" : "startItem",
              "condition" : "(linkId = '5991443718282')"
            }],
            "rule" : [{
              "name" : "setstart",
              "source" : [{
                "context" : "startItem",
                "element" : "answer",
                "variable" : "ans"
              }],
              "target" : [{
                "context" : "period",
                "contextType" : "variable",
                "element" : "start",
                "transform" : "evaluate",
                "parameter" : [{
                  "valueString" : "ans.valueDate"
                }]
              }]
            }]
          },
          {
            "name" : "extractend",
            "source" : [{
              "context" : "pmsiItem",
              "element" : "item",
              "variable" : "endItem",
              "condition" : "(linkId = '6114780320846')"
            }],
            "rule" : [{
              "name" : "setend",
              "source" : [{
                "context" : "endItem",
                "element" : "answer",
                "variable" : "ans"
              }],
              "target" : [{
                "context" : "period",
                "contextType" : "variable",
                "element" : "end",
                "transform" : "evaluate",
                "parameter" : [{
                  "valueString" : "ans.valueDate"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractmodein",
          "source" : [{
            "context" : "pmsiItem",
            "element" : "item",
            "variable" : "modeInItem",
            "condition" : "(linkId = '6172398101212')"
          }]
        },
        {
          "name" : "extractmodeout",
          "source" : [{
            "context" : "pmsiItem",
            "element" : "item",
            "variable" : "modeOutItem",
            "condition" : "(linkId = '3354867075704')"
          }]
        },
        {
          "name" : "setfullUrl",
          "source" : [{
            "context" : "src"
          }],
          "target" : [{
            "context" : "encounter",
            "contextType" : "variable",
            "element" : "id",
            "variable" : "encId"
          },
          {
            "context" : "encounterEntry",
            "contextType" : "variable",
            "element" : "fullUrl",
            "transform" : "append",
            "parameter" : [{
              "valueString" : "urn:uuid:"
            },
            {
              "valueId" : "encId"
            }]
          }]
        },
        {
          "name" : "createconditions",
          "source" : [{
            "context" : "pmsiItem"
          }],
          "dependent" : [{
            "name" : "CreateConditions",
            "variable" : ["pmsiItem", "patient", "encounter", "bundle"]
          }]
        },
        {
          "name" : "createprocedures",
          "source" : [{
            "context" : "pmsiItem"
          }],
          "dependent" : [{
            "name" : "CreateProcedures",
            "variable" : ["pmsiItem", "patient", "encounter", "bundle"]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreateConditions",
    "typeMode" : "none",
    "documentation" : "Group: Create Conditions from nested diagnostics",
    "input" : [{
      "name" : "pmsiItem",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    },
    {
      "name" : "encounter",
      "type" : "Encounter",
      "mode" : "target"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "conditionentry",
      "source" : [{
        "context" : "pmsiItem",
        "element" : "item",
        "variable" : "diagGroup",
        "condition" : "(linkId = '9391816419630')"
      }],
      "target" : [{
        "context" : "bundle",
        "contextType" : "variable",
        "element" : "entry",
        "variable" : "conditionEntry"
      }],
      "rule" : [{
        "name" : "createcondition",
        "source" : [{
          "context" : "diagGroup"
        }],
        "target" : [{
          "context" : "conditionEntry",
          "contextType" : "variable",
          "element" : "resource",
          "variable" : "condition",
          "transform" : "create",
          "parameter" : [{
            "valueString" : "Condition"
          }]
        }],
        "rule" : [{
          "name" : "conditionid",
          "source" : [{
            "context" : "diagGroup"
          }],
          "target" : [{
            "context" : "condition",
            "contextType" : "variable",
            "element" : "id",
            "transform" : "uuid"
          }]
        },
        {
          "name" : "conditionmeta",
          "source" : [{
            "context" : "diagGroup"
          }],
          "target" : [{
            "context" : "condition",
            "contextType" : "variable",
            "element" : "meta",
            "variable" : "meta",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Meta"
            }]
          }],
          "rule" : [{
            "name" : "conditionprofile",
            "source" : [{
              "context" : "diagGroup"
            }],
            "target" : [{
              "context" : "meta",
              "contextType" : "variable",
              "element" : "profile",
              "transform" : "copy",
              "parameter" : [{
                "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMCondition"
              }]
            }]
          }]
        },
        {
          "name" : "setsubject",
          "source" : [{
            "context" : "diagGroup"
          }],
          "target" : [{
            "context" : "condition",
            "contextType" : "variable",
            "element" : "subject",
            "variable" : "ref",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Reference"
            }]
          },
          {
            "context" : "patient",
            "contextType" : "variable",
            "element" : "id",
            "variable" : "patId"
          },
          {
            "context" : "ref",
            "contextType" : "variable",
            "element" : "reference",
            "transform" : "append",
            "parameter" : [{
              "valueString" : "Patient/"
            },
            {
              "valueId" : "patId"
            }]
          }]
        },
        {
          "name" : "setencounter",
          "source" : [{
            "context" : "diagGroup"
          }],
          "target" : [{
            "context" : "encounter",
            "contextType" : "variable",
            "element" : "id",
            "variable" : "encId"
          },
          {
            "context" : "condition",
            "contextType" : "variable",
            "element" : "encounter",
            "variable" : "ref",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Reference"
            }]
          },
          {
            "context" : "ref",
            "contextType" : "variable",
            "element" : "reference",
            "transform" : "append",
            "parameter" : [{
              "valueString" : "Encounter/"
            },
            {
              "valueId" : "encId"
            }]
          }]
        },
        {
          "name" : "extractdiagcode",
          "source" : [{
            "context" : "diagGroup",
            "element" : "item",
            "variable" : "diagCodeItem",
            "condition" : "(linkId = '5505101189372')"
          }],
          "rule" : [{
            "name" : "setcode",
            "source" : [{
              "context" : "diagCodeItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "condition",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "code",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "CodeableConcept"
              }]
            }],
            "rule" : [{
              "name" : "setcoding",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "code",
                "contextType" : "variable",
                "element" : "coding",
                "transform" : "evaluate",
                "parameter" : [{
                  "valueString" : "ans.valueCoding"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractdiagtype",
          "source" : [{
            "context" : "diagGroup",
            "element" : "item",
            "variable" : "diagTypeItem",
            "condition" : "(linkId = '6427586743735')"
          }],
          "rule" : [{
            "name" : "setcategory",
            "source" : [{
              "context" : "diagTypeItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "condition",
              "contextType" : "variable",
              "element" : "category",
              "variable" : "category",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "CodeableConcept"
              }]
            }],
            "rule" : [{
              "name" : "setcategorycoding",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "category",
                "contextType" : "variable",
                "element" : "coding",
                "variable" : "coding",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "Coding"
                }]
              }],
              "rule" : [{
                "name" : "diagtypesystem",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "coding",
                  "contextType" : "variable",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "https://interop.aphp.fr/ig/fhir/dm/CodeSystem/pmsi-mco-diag-type"
                  }]
                }]
              },
              {
                "name" : "diagtypecode",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "coding",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "evaluate",
                  "parameter" : [{
                    "valueString" : "ans.valueCoding.code"
                  }]
                }]
              },
              {
                "name" : "diagtypedisplay",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "coding",
                  "contextType" : "variable",
                  "element" : "display",
                  "transform" : "evaluate",
                  "parameter" : [{
                    "valueString" : "ans.valueCoding.display"
                  }]
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractrecordeddate",
          "source" : [{
            "context" : "diagGroup",
            "element" : "item",
            "variable" : "dateItem",
            "condition" : "(linkId = '7114466839467')"
          }],
          "rule" : [{
            "name" : "setrecordeddate",
            "source" : [{
              "context" : "dateItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "condition",
              "contextType" : "variable",
              "element" : "recordedDate",
              "transform" : "evaluate",
              "parameter" : [{
                "valueString" : "ans.valueDate"
              }]
            }]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreateProcedures",
    "typeMode" : "none",
    "documentation" : "Group: Create Procedures from nested actes",
    "input" : [{
      "name" : "pmsiItem",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    },
    {
      "name" : "encounter",
      "type" : "Encounter",
      "mode" : "target"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "procedureentry",
      "source" : [{
        "context" : "pmsiItem",
        "element" : "item",
        "variable" : "acteGroup",
        "condition" : "(linkId = '591926901726')"
      }],
      "target" : [{
        "context" : "bundle",
        "contextType" : "variable",
        "element" : "entry",
        "variable" : "procedureEntry"
      }],
      "rule" : [{
        "name" : "createprocedure",
        "source" : [{
          "context" : "acteGroup"
        }],
        "target" : [{
          "context" : "procedureEntry",
          "contextType" : "variable",
          "element" : "resource",
          "variable" : "procedure",
          "transform" : "create",
          "parameter" : [{
            "valueString" : "Procedure"
          }]
        }],
        "rule" : [{
          "name" : "procedureid",
          "source" : [{
            "context" : "acteGroup"
          }],
          "target" : [{
            "context" : "procedure",
            "contextType" : "variable",
            "element" : "id",
            "transform" : "uuid"
          }]
        },
        {
          "name" : "proceduremeta",
          "source" : [{
            "context" : "acteGroup"
          }],
          "target" : [{
            "context" : "procedure",
            "contextType" : "variable",
            "element" : "meta",
            "variable" : "meta",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Meta"
            }]
          }],
          "rule" : [{
            "name" : "procedureprofile",
            "source" : [{
              "context" : "acteGroup"
            }],
            "target" : [{
              "context" : "meta",
              "contextType" : "variable",
              "element" : "profile",
              "transform" : "copy",
              "parameter" : [{
                "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMProcedure"
              }]
            }]
          }]
        },
        {
          "name" : "setsubject",
          "source" : [{
            "context" : "acteGroup"
          }],
          "target" : [{
            "context" : "procedure",
            "contextType" : "variable",
            "element" : "subject",
            "variable" : "ref",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Reference"
            }]
          },
          {
            "context" : "patient",
            "contextType" : "variable",
            "element" : "id",
            "variable" : "patId"
          },
          {
            "context" : "ref",
            "contextType" : "variable",
            "element" : "reference",
            "transform" : "append",
            "parameter" : [{
              "valueString" : "Patient/"
            },
            {
              "valueId" : "patId"
            }]
          }]
        },
        {
          "name" : "setencounter",
          "source" : [{
            "context" : "acteGroup"
          }],
          "target" : [{
            "context" : "encounter",
            "contextType" : "variable",
            "element" : "id",
            "variable" : "encId"
          },
          {
            "context" : "procedure",
            "contextType" : "variable",
            "element" : "encounter",
            "variable" : "ref",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Reference"
            }]
          },
          {
            "context" : "ref",
            "contextType" : "variable",
            "element" : "reference",
            "transform" : "append",
            "parameter" : [{
              "valueString" : "Encounter/"
            },
            {
              "valueId" : "encId"
            }]
          }]
        },
        {
          "name" : "extractactecode",
          "source" : [{
            "context" : "acteGroup",
            "element" : "item",
            "variable" : "acteCodeItem",
            "condition" : "(linkId = '7758110033600')"
          }],
          "rule" : [{
            "name" : "setcode",
            "source" : [{
              "context" : "acteCodeItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "procedure",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "code",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "CodeableConcept"
              }]
            }],
            "rule" : [{
              "name" : "setcoding",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "code",
                "contextType" : "variable",
                "element" : "coding",
                "transform" : "evaluate",
                "parameter" : [{
                  "valueString" : "ans.valueCoding"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractperformeddate",
          "source" : [{
            "context" : "acteGroup",
            "element" : "item",
            "variable" : "dateItem",
            "condition" : "(linkId = '5066866286682')"
          }],
          "rule" : [{
            "name" : "setperformed",
            "source" : [{
              "context" : "dateItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "procedure",
              "contextType" : "variable",
              "element" : "performed",
              "transform" : "evaluate",
              "parameter" : [{
                "valueString" : "ans.valueDateTime"
              }]
            }]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreateMedicationRequests",
    "typeMode" : "none",
    "documentation" : "Group: Create Medication Requests",
    "input" : [{
      "name" : "src",
      "type" : "QuestionnaireResponse",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "processmedexpo",
      "source" : [{
        "context" : "src",
        "element" : "item",
        "variable" : "medExpoGroup",
        "condition" : "(linkId = '817801935685')"
      }],
      "rule" : [{
        "name" : "medreqentry",
        "source" : [{
          "context" : "medExpoGroup",
          "element" : "item",
          "variable" : "prescribedGroup",
          "condition" : "(linkId = '156631794800')"
        }],
        "target" : [{
          "context" : "bundle",
          "contextType" : "variable",
          "element" : "entry",
          "variable" : "medReqEntry"
        }],
        "rule" : [{
          "name" : "createmedreq",
          "source" : [{
            "context" : "prescribedGroup"
          }],
          "target" : [{
            "context" : "medReqEntry",
            "contextType" : "variable",
            "element" : "resource",
            "variable" : "medReq",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "MedicationRequest"
            }]
          }],
          "rule" : [{
            "name" : "medreqid",
            "source" : [{
              "context" : "prescribedGroup"
            }],
            "target" : [{
              "context" : "medReq",
              "contextType" : "variable",
              "element" : "id",
              "transform" : "uuid"
            }]
          },
          {
            "name" : "medreqmeta",
            "source" : [{
              "context" : "prescribedGroup"
            }],
            "target" : [{
              "context" : "medReq",
              "contextType" : "variable",
              "element" : "meta",
              "variable" : "meta",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Meta"
              }]
            }],
            "rule" : [{
              "name" : "medreqprofile",
              "source" : [{
                "context" : "prescribedGroup"
              }],
              "target" : [{
                "context" : "meta",
                "contextType" : "variable",
                "element" : "profile",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMMedicationRequest"
                }]
              }]
            }]
          },
          {
            "name" : "setsubject",
            "source" : [{
              "context" : "prescribedGroup"
            }],
            "target" : [{
              "context" : "medReq",
              "contextType" : "variable",
              "element" : "subject",
              "variable" : "ref",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Reference"
              }]
            },
            {
              "context" : "patient",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "patId"
            },
            {
              "context" : "ref",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "append",
              "parameter" : [{
                "valueString" : "Patient/"
              },
              {
                "valueId" : "patId"
              }]
            }]
          },
          {
            "name" : "setstatus",
            "source" : [{
              "context" : "prescribedGroup"
            }],
            "target" : [{
              "context" : "medReq",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [{
                "valueString" : "active"
              }]
            }]
          },
          {
            "name" : "setintent",
            "source" : [{
              "context" : "prescribedGroup"
            }],
            "target" : [{
              "context" : "medReq",
              "contextType" : "variable",
              "element" : "intent",
              "transform" : "copy",
              "parameter" : [{
                "valueString" : "order"
              }]
            }]
          },
          {
            "name" : "medicationentry",
            "source" : [{
              "context" : "prescribedGroup"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "medEntry"
            }],
            "rule" : [{
              "name" : "createmedication",
              "source" : [{
                "context" : "prescribedGroup"
              }],
              "target" : [{
                "context" : "medEntry",
                "contextType" : "variable",
                "element" : "resource",
                "variable" : "medication",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "Medication"
                }]
              }],
              "rule" : [{
                "name" : "medid",
                "source" : [{
                  "context" : "prescribedGroup"
                }],
                "target" : [{
                  "context" : "medication",
                  "contextType" : "variable",
                  "element" : "id",
                  "transform" : "uuid"
                }]
              },
              {
                "name" : "extractatc",
                "source" : [{
                  "context" : "prescribedGroup",
                  "element" : "item",
                  "variable" : "atcItem",
                  "condition" : "(linkId.contains('ATC'))"
                }],
                "rule" : [{
                  "name" : "setmedcode",
                  "source" : [{
                    "context" : "atcItem",
                    "element" : "answer",
                    "variable" : "ans"
                  }],
                  "target" : [{
                    "context" : "medication",
                    "contextType" : "variable",
                    "element" : "code",
                    "variable" : "code",
                    "transform" : "create",
                    "parameter" : [{
                      "valueString" : "CodeableConcept"
                    }]
                  }],
                  "rule" : [{
                    "name" : "setatccoding",
                    "source" : [{
                      "context" : "ans"
                    }],
                    "target" : [{
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "evaluate",
                      "parameter" : [{
                        "valueString" : "ans.valueCoding"
                      }]
                    }]
                  }]
                }]
              },
              {
                "name" : "setfullUrl",
                "source" : [{
                  "context" : "prescribedGroup"
                }],
                "target" : [{
                  "context" : "medication",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "medId"
                },
                {
                  "context" : "medEntry",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [{
                    "valueString" : "urn:uuid:"
                  },
                  {
                    "valueId" : "medId"
                  }]
                }]
              },
              {
                "name" : "setmedicationreference",
                "source" : [{
                  "context" : "prescribedGroup"
                }],
                "target" : [{
                  "context" : "medication",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "medId"
                },
                {
                  "context" : "medReq",
                  "contextType" : "variable",
                  "element" : "medication",
                  "variable" : "ref",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "Reference"
                  }]
                },
                {
                  "context" : "ref",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "append",
                  "parameter" : [{
                    "valueString" : "Medication/"
                  },
                  {
                    "valueId" : "medId"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "setdosage",
            "source" : [{
              "context" : "prescribedGroup"
            }],
            "target" : [{
              "context" : "medReq",
              "contextType" : "variable",
              "element" : "dosageInstruction",
              "variable" : "dosage",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Dosage"
              }]
            }],
            "rule" : [{
              "name" : "extractroute",
              "source" : [{
                "context" : "prescribedGroup",
                "element" : "item",
                "variable" : "routeItem",
                "condition" : "(linkId.contains('voie'))"
              }],
              "rule" : [{
                "name" : "setroute",
                "source" : [{
                  "context" : "routeItem",
                  "element" : "answer",
                  "variable" : "ans"
                }],
                "target" : [{
                  "context" : "dosage",
                  "contextType" : "variable",
                  "element" : "route",
                  "variable" : "route",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "CodeableConcept"
                  }]
                }],
                "rule" : [{
                  "name" : "setroutecoding",
                  "source" : [{
                    "context" : "ans"
                  }],
                  "target" : [{
                    "context" : "route",
                    "contextType" : "variable",
                    "element" : "coding",
                    "transform" : "evaluate",
                    "parameter" : [{
                      "valueString" : "ans.valueCoding"
                    }]
                  }]
                }]
              }]
            },
            {
              "name" : "extracttiming",
              "source" : [{
                "context" : "prescribedGroup",
                "element" : "item",
                "variable" : "timingItem",
                "condition" : "(linkId.contains('timing') or linkId.contains('fréquence'))"
              }],
              "rule" : [{
                "name" : "settimingstructure",
                "source" : [{
                  "context" : "timingItem",
                  "element" : "answer",
                  "variable" : "ans"
                }],
                "target" : [{
                  "context" : "dosage",
                  "contextType" : "variable",
                  "element" : "timing",
                  "variable" : "timing",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "Timing"
                  }]
                }],
                "rule" : [{
                  "name" : "settiming",
                  "source" : [{
                    "context" : "ans"
                  }],
                  "target" : [{
                    "context" : "timing",
                    "contextType" : "variable",
                    "element" : "repeat",
                    "variable" : "repeat",
                    "transform" : "create",
                    "parameter" : [{
                      "valueString" : "TimingRepeat"
                    }]
                  }]
                }]
              }]
            }]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreateMedicationAdministrations",
    "typeMode" : "none",
    "documentation" : "Group: Create Medication Administrations",
    "input" : [{
      "name" : "src",
      "type" : "QuestionnaireResponse",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "processmedexpoadmin",
      "source" : [{
        "context" : "src",
        "element" : "item",
        "variable" : "medExpoGroup",
        "condition" : "(linkId = '817801935685')"
      }],
      "rule" : [{
        "name" : "medadminentry",
        "source" : [{
          "context" : "medExpoGroup",
          "element" : "item",
          "variable" : "adminGroup",
          "condition" : "(linkId = '266852453304')"
        }],
        "target" : [{
          "context" : "bundle",
          "contextType" : "variable",
          "element" : "entry",
          "variable" : "medAdminEntry"
        }],
        "rule" : [{
          "name" : "createmedadmin",
          "source" : [{
            "context" : "adminGroup"
          }],
          "target" : [{
            "context" : "medAdminEntry",
            "contextType" : "variable",
            "element" : "resource",
            "variable" : "medAdmin",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "MedicationAdministration"
            }]
          }],
          "rule" : [{
            "name" : "medadminid",
            "source" : [{
              "context" : "adminGroup"
            }],
            "target" : [{
              "context" : "medAdmin",
              "contextType" : "variable",
              "element" : "id",
              "transform" : "uuid"
            }]
          },
          {
            "name" : "medadminmeta",
            "source" : [{
              "context" : "adminGroup"
            }],
            "target" : [{
              "context" : "medAdmin",
              "contextType" : "variable",
              "element" : "meta",
              "variable" : "meta",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Meta"
              }]
            }],
            "rule" : [{
              "name" : "medadminprofile",
              "source" : [{
                "context" : "adminGroup"
              }],
              "target" : [{
                "context" : "meta",
                "contextType" : "variable",
                "element" : "profile",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMMedicationAdministration"
                }]
              }]
            }]
          },
          {
            "name" : "setsubject",
            "source" : [{
              "context" : "adminGroup"
            }],
            "target" : [{
              "context" : "medAdmin",
              "contextType" : "variable",
              "element" : "subject",
              "variable" : "ref",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Reference"
              }]
            },
            {
              "context" : "patient",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "patId"
            },
            {
              "context" : "ref",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "append",
              "parameter" : [{
                "valueString" : "Patient/"
              },
              {
                "valueId" : "patId"
              }]
            }]
          },
          {
            "name" : "setstatus",
            "source" : [{
              "context" : "adminGroup"
            }],
            "target" : [{
              "context" : "medAdmin",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [{
                "valueString" : "completed"
              }]
            }]
          },
          {
            "name" : "medicationentry",
            "source" : [{
              "context" : "adminGroup"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "medEntry"
            }],
            "rule" : [{
              "name" : "createmedication",
              "source" : [{
                "context" : "adminGroup"
              }],
              "target" : [{
                "context" : "medEntry",
                "contextType" : "variable",
                "element" : "resource",
                "variable" : "medication",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "Medication"
                }]
              }],
              "rule" : [{
                "name" : "medid",
                "source" : [{
                  "context" : "adminGroup"
                }],
                "target" : [{
                  "context" : "medication",
                  "contextType" : "variable",
                  "element" : "id",
                  "transform" : "uuid"
                }]
              },
              {
                "name" : "extractatc",
                "source" : [{
                  "context" : "adminGroup",
                  "element" : "item",
                  "variable" : "atcItem",
                  "condition" : "(linkId.contains('ATC'))"
                }],
                "rule" : [{
                  "name" : "setmedcode",
                  "source" : [{
                    "context" : "atcItem",
                    "element" : "answer",
                    "variable" : "ans"
                  }],
                  "target" : [{
                    "context" : "medication",
                    "contextType" : "variable",
                    "element" : "code",
                    "variable" : "code",
                    "transform" : "create",
                    "parameter" : [{
                      "valueString" : "CodeableConcept"
                    }]
                  }],
                  "rule" : [{
                    "name" : "setatccoding",
                    "source" : [{
                      "context" : "ans"
                    }],
                    "target" : [{
                      "context" : "code",
                      "contextType" : "variable",
                      "element" : "coding",
                      "transform" : "evaluate",
                      "parameter" : [{
                        "valueString" : "ans.valueCoding"
                      }]
                    }]
                  }]
                }]
              },
              {
                "name" : "setfullUrl",
                "source" : [{
                  "context" : "adminGroup"
                }],
                "target" : [{
                  "context" : "medication",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "medId"
                },
                {
                  "context" : "medEntry",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [{
                    "valueString" : "Medication/"
                  },
                  {
                    "valueId" : "medId"
                  }]
                }]
              },
              {
                "name" : "setmedicationreference",
                "source" : [{
                  "context" : "adminGroup"
                }],
                "target" : [{
                  "context" : "medication",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "medId"
                },
                {
                  "context" : "medAdmin",
                  "contextType" : "variable",
                  "element" : "medication",
                  "variable" : "ref",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "Reference"
                  }]
                },
                {
                  "context" : "ref",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "append",
                  "parameter" : [{
                    "valueString" : "urn:uuid:"
                  },
                  {
                    "valueId" : "medId"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "seteffective",
            "source" : [{
              "context" : "adminGroup"
            }],
            "target" : [{
              "context" : "medAdmin",
              "contextType" : "variable",
              "element" : "effective",
              "variable" : "period",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Period"
              }]
            }],
            "rule" : [{
              "name" : "extractstart",
              "source" : [{
                "context" : "adminGroup",
                "element" : "item",
                "variable" : "startItem",
                "condition" : "(linkId.contains('début'))"
              }],
              "rule" : [{
                "name" : "setstart",
                "source" : [{
                  "context" : "startItem",
                  "element" : "answer",
                  "variable" : "ans"
                }],
                "target" : [{
                  "context" : "period",
                  "contextType" : "variable",
                  "element" : "start",
                  "transform" : "evaluate",
                  "parameter" : [{
                    "valueString" : "ans.valueDateTime"
                  }]
                }]
              }]
            },
            {
              "name" : "extractend",
              "source" : [{
                "context" : "adminGroup",
                "element" : "item",
                "variable" : "endItem",
                "condition" : "(linkId.contains('fin'))"
              }],
              "rule" : [{
                "name" : "setend",
                "source" : [{
                  "context" : "endItem",
                  "element" : "answer",
                  "variable" : "ans"
                }],
                "target" : [{
                  "context" : "period",
                  "contextType" : "variable",
                  "element" : "end",
                  "transform" : "evaluate",
                  "parameter" : [{
                    "valueString" : "ans.valueDateTime"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "setdosage",
            "source" : [{
              "context" : "adminGroup"
            }],
            "target" : [{
              "context" : "medAdmin",
              "contextType" : "variable",
              "element" : "dosage",
              "variable" : "dosage",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Dosage"
              }]
            }],
            "rule" : [{
              "name" : "extractroute",
              "source" : [{
                "context" : "adminGroup",
                "element" : "item",
                "variable" : "routeItem",
                "condition" : "(linkId.contains('voie'))"
              }],
              "rule" : [{
                "name" : "setroute",
                "source" : [{
                  "context" : "routeItem",
                  "element" : "answer",
                  "variable" : "ans"
                }],
                "target" : [{
                  "context" : "dosage",
                  "contextType" : "variable",
                  "element" : "route",
                  "variable" : "route",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "CodeableConcept"
                  }]
                }],
                "rule" : [{
                  "name" : "setroutecoding",
                  "source" : [{
                    "context" : "ans"
                  }],
                  "target" : [{
                    "context" : "route",
                    "contextType" : "variable",
                    "element" : "coding",
                    "transform" : "evaluate",
                    "parameter" : [{
                      "valueString" : "ans.valueCoding"
                    }]
                  }]
                }]
              }]
            },
            {
              "name" : "extractdose",
              "source" : [{
                "context" : "adminGroup",
                "element" : "item",
                "variable" : "doseItem",
                "condition" : "(linkId.contains('dose'))"
              }],
              "rule" : [{
                "name" : "setdose",
                "source" : [{
                  "context" : "doseItem",
                  "element" : "answer",
                  "variable" : "ans"
                }],
                "target" : [{
                  "context" : "dosage",
                  "contextType" : "variable",
                  "element" : "dose",
                  "transform" : "evaluate",
                  "parameter" : [{
                    "valueString" : "ans.valueQuantity"
                  }]
                }]
              }]
            }]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreateVitalSignObservations",
    "typeMode" : "none",
    "documentation" : "Group: Create Vital Sign Observations",
    "input" : [{
      "name" : "src",
      "type" : "QuestionnaireResponse",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "processexam",
      "source" : [{
        "context" : "src",
        "element" : "item",
        "variable" : "examGroup",
        "condition" : "(linkId = '214880328197')"
      }],
      "rule" : [{
        "name" : "processdossier",
        "source" : [{
          "context" : "examGroup",
          "element" : "item",
          "variable" : "dossierGroup",
          "condition" : "(linkId = '305831246173')"
        }],
        "rule" : [{
          "name" : "extractheight",
          "source" : [{
            "context" : "dossierGroup",
            "element" : "item",
            "variable" : "heightItem",
            "condition" : "(linkId = '4846902346416')"
          }],
          "rule" : [{
            "name" : "heightobsentry",
            "source" : [{
              "context" : "heightItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "obsEntry"
            }],
            "rule" : [{
              "name" : "createheightobs",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "obsEntry",
                "contextType" : "variable",
                "element" : "resource",
                "variable" : "obs",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "Observation"
                }]
              }],
              "rule" : [{
                "name" : "obsid",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "id",
                  "transform" : "uuid"
                }]
              },
              {
                "name" : "setfullUrl",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "obsId"
                },
                {
                  "context" : "obsEntry",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [{
                    "valueString" : "urn:uuid:"
                  },
                  {
                    "valueId" : "obsId"
                  }]
                }]
              },
              {
                "name" : "obsmeta",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "meta",
                  "variable" : "meta",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "Meta"
                  }]
                }],
                "rule" : [{
                  "name" : "obsprofile",
                  "source" : [{
                    "context" : "ans"
                  }],
                  "target" : [{
                    "context" : "meta",
                    "contextType" : "variable",
                    "element" : "profile",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMObservationBodyHeight"
                    }]
                  }]
                }]
              },
              {
                "name" : "obsstatus",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "final"
                  }]
                }]
              },
              {
                "name" : "obscategory",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "category",
                  "transform" : "cc",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  },
                  {
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "obscode",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "cc",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  },
                  {
                    "valueString" : "8302-2"
                  },
                  {
                    "valueString" : "Body height"
                  }]
                }]
              },
              {
                "name" : "setsubject",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "ref",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "Reference"
                  }]
                },
                {
                  "context" : "patient",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "patId"
                },
                {
                  "context" : "ref",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "append",
                  "parameter" : [{
                    "valueString" : "Patient/"
                  },
                  {
                    "valueId" : "patId"
                  }]
                }]
              },
              {
                "name" : "setvalue",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "evaluate",
                  "parameter" : [{
                    "valueString" : "ans.valueQuantity"
                  }]
                }]
              },
              {
                "name" : "extracteffective",
                "source" : [{
                  "context" : "heightItem",
                  "element" : "item",
                  "variable" : "dateItem",
                  "condition" : "(linkId.contains('Date'))"
                }],
                "rule" : [{
                  "name" : "seteffective",
                  "source" : [{
                    "context" : "dateItem",
                    "element" : "answer",
                    "variable" : "dateAns"
                  }],
                  "target" : [{
                    "context" : "obs",
                    "contextType" : "variable",
                    "element" : "effective",
                    "transform" : "evaluate",
                    "parameter" : [{
                      "valueString" : "dateAns.valueDate"
                    }]
                  }]
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractweight",
          "source" : [{
            "context" : "dossierGroup",
            "element" : "item",
            "variable" : "weightItem",
            "condition" : "(linkId = '451513217936')"
          }],
          "rule" : [{
            "name" : "weightobsentry",
            "source" : [{
              "context" : "weightItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "obsEntry"
            }],
            "rule" : [{
              "name" : "createweightobs",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "obsEntry",
                "contextType" : "variable",
                "element" : "resource",
                "variable" : "obs",
                "transform" : "create",
                "parameter" : [{
                  "valueString" : "Observation"
                }]
              }],
              "rule" : [{
                "name" : "obsid",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "id",
                  "transform" : "uuid"
                }]
              },
              {
                "name" : "setfullUrl",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "obsId"
                },
                {
                  "context" : "obsEntry",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [{
                    "valueString" : "urn:uuid:"
                  },
                  {
                    "valueId" : "obsId"
                  }]
                }]
              },
              {
                "name" : "obsmeta",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "meta",
                  "variable" : "meta",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "Meta"
                  }]
                }],
                "rule" : [{
                  "name" : "obsprofile",
                  "source" : [{
                    "context" : "ans"
                  }],
                  "target" : [{
                    "context" : "meta",
                    "contextType" : "variable",
                    "element" : "profile",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMObservationBodyWeight"
                    }]
                  }]
                }]
              },
              {
                "name" : "obsstatus",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "final"
                  }]
                }]
              },
              {
                "name" : "obscategory",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "category",
                  "transform" : "cc",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  },
                  {
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "obscode",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "cc",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  },
                  {
                    "valueString" : "29463-7"
                  },
                  {
                    "valueString" : "Body weight"
                  }]
                }]
              },
              {
                "name" : "setsubject",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "ref",
                  "transform" : "create",
                  "parameter" : [{
                    "valueString" : "Reference"
                  }]
                },
                {
                  "context" : "patient",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "patId"
                },
                {
                  "context" : "ref",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "append",
                  "parameter" : [{
                    "valueString" : "Patient/"
                  },
                  {
                    "valueId" : "patId"
                  }]
                }]
              },
              {
                "name" : "setvalue",
                "source" : [{
                  "context" : "ans"
                }],
                "target" : [{
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "evaluate",
                  "parameter" : [{
                    "valueString" : "ans.valueQuantity"
                  }]
                }]
              },
              {
                "name" : "extracteffective",
                "source" : [{
                  "context" : "weightItem",
                  "element" : "item",
                  "variable" : "dateItem",
                  "condition" : "(linkId.contains('Date'))"
                }],
                "rule" : [{
                  "name" : "seteffective",
                  "source" : [{
                    "context" : "dateItem",
                    "element" : "answer",
                    "variable" : "dateAns"
                  }],
                  "target" : [{
                    "context" : "obs",
                    "contextType" : "variable",
                    "element" : "effective",
                    "transform" : "evaluate",
                    "parameter" : [{
                      "valueString" : "dateAns.valueDate"
                    }]
                  }]
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extractbloodpressure",
          "source" : [{
            "context" : "dossierGroup",
            "element" : "item",
            "variable" : "sysItem",
            "condition" : "(linkId = '4160905247955')"
          }],
          "rule" : [{
            "name" : "processsystolic",
            "source" : [{
              "context" : "sysItem",
              "element" : "answer",
              "variable" : "sysAns"
            }],
            "rule" : [{
              "name" : "extractdiastolic",
              "source" : [{
                "context" : "dossierGroup",
                "element" : "item",
                "variable" : "diaItem",
                "condition" : "(linkId = '848797127998')"
              }],
              "rule" : [{
                "name" : "bpobsentr",
                "source" : [{
                  "context" : "diaItem",
                  "element" : "answer",
                  "variable" : "diaAns"
                }],
                "target" : [{
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "obsEntry"
                }],
                "rule" : [{
                  "name" : "createbpobs",
                  "source" : [{
                    "context" : "sysAns"
                  }],
                  "target" : [{
                    "context" : "obsEntry",
                    "contextType" : "variable",
                    "element" : "resource",
                    "variable" : "obs",
                    "transform" : "create",
                    "parameter" : [{
                      "valueString" : "Observation"
                    }]
                  }],
                  "rule" : [{
                    "name" : "obsid",
                    "source" : [{
                      "context" : "sysAns"
                    }],
                    "target" : [{
                      "context" : "obs",
                      "contextType" : "variable",
                      "element" : "id",
                      "transform" : "uuid"
                    }]
                  },
                  {
                    "name" : "setfullUrl",
                    "source" : [{
                      "context" : "sysAns"
                    }],
                    "target" : [{
                      "context" : "obs",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "obsId"
                    },
                    {
                      "context" : "obsEntry",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [{
                        "valueString" : "urn:uuid:"
                      },
                      {
                        "valueId" : "obsId"
                      }]
                    }]
                  },
                  {
                    "name" : "obsmeta",
                    "source" : [{
                      "context" : "sysAns"
                    }],
                    "target" : [{
                      "context" : "obs",
                      "contextType" : "variable",
                      "element" : "meta",
                      "variable" : "meta",
                      "transform" : "create",
                      "parameter" : [{
                        "valueString" : "Meta"
                      }]
                    }],
                    "rule" : [{
                      "name" : "obsprofile",
                      "source" : [{
                        "context" : "sysAns"
                      }],
                      "target" : [{
                        "context" : "meta",
                        "contextType" : "variable",
                        "element" : "profile",
                        "transform" : "copy",
                        "parameter" : [{
                          "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMObservationBloodPressure"
                        }]
                      }]
                    }]
                  },
                  {
                    "name" : "obsstatus",
                    "source" : [{
                      "context" : "sysAns"
                    }],
                    "target" : [{
                      "context" : "obs",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [{
                        "valueString" : "final"
                      }]
                    }]
                  },
                  {
                    "name" : "obscategory",
                    "source" : [{
                      "context" : "sysAns"
                    }],
                    "target" : [{
                      "context" : "obs",
                      "contextType" : "variable",
                      "element" : "category",
                      "transform" : "cc",
                      "parameter" : [{
                        "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                      },
                      {
                        "valueString" : "vital-signs"
                      }]
                    }]
                  },
                  {
                    "name" : "obscode",
                    "source" : [{
                      "context" : "sysAns"
                    }],
                    "target" : [{
                      "context" : "obs",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "cc",
                      "parameter" : [{
                        "valueString" : "http://loinc.org"
                      },
                      {
                        "valueString" : "85354-9"
                      },
                      {
                        "valueString" : "Blood pressure panel"
                      }]
                    }]
                  },
                  {
                    "name" : "setsubject",
                    "source" : [{
                      "context" : "sysAns"
                    }],
                    "target" : [{
                      "context" : "obs",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "ref",
                      "transform" : "create",
                      "parameter" : [{
                        "valueString" : "Reference"
                      }]
                    },
                    {
                      "context" : "patient",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "patId"
                    },
                    {
                      "context" : "ref",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "append",
                      "parameter" : [{
                        "valueString" : "Patient/"
                      },
                      {
                        "valueId" : "patId"
                      }]
                    }]
                  },
                  {
                    "name" : "setsystolic",
                    "source" : [{
                      "context" : "sysAns"
                    }],
                    "target" : [{
                      "context" : "obs",
                      "contextType" : "variable",
                      "element" : "component",
                      "variable" : "sysComp",
                      "transform" : "create",
                      "parameter" : [{
                        "valueString" : "Observation"
                      }]
                    }],
                    "rule" : [{
                      "name" : "syscode",
                      "source" : [{
                        "context" : "sysAns"
                      }],
                      "target" : [{
                        "context" : "sysComp",
                        "contextType" : "variable",
                        "element" : "code",
                        "transform" : "cc",
                        "parameter" : [{
                          "valueString" : "http://loinc.org"
                        },
                        {
                          "valueString" : "8480-6"
                        },
                        {
                          "valueString" : "Systolic blood pressure"
                        }]
                      }]
                    },
                    {
                      "name" : "sysvalue",
                      "source" : [{
                        "context" : "sysAns"
                      }],
                      "target" : [{
                        "context" : "sysComp",
                        "contextType" : "variable",
                        "element" : "value",
                        "transform" : "evaluate",
                        "parameter" : [{
                          "valueString" : "sysAns.valueQuantity"
                        }]
                      }]
                    }]
                  },
                  {
                    "name" : "setdiastolic",
                    "source" : [{
                      "context" : "diaAns"
                    }],
                    "target" : [{
                      "context" : "obs",
                      "contextType" : "variable",
                      "element" : "component",
                      "variable" : "diaComp",
                      "transform" : "create",
                      "parameter" : [{
                        "valueString" : "Observation"
                      }]
                    }],
                    "rule" : [{
                      "name" : "diacode",
                      "source" : [{
                        "context" : "diaAns"
                      }],
                      "target" : [{
                        "context" : "diaComp",
                        "contextType" : "variable",
                        "element" : "code",
                        "transform" : "cc",
                        "parameter" : [{
                          "valueString" : "http://loinc.org"
                        },
                        {
                          "valueString" : "8462-4"
                        },
                        {
                          "valueString" : "Diastolic blood pressure"
                        }]
                      }]
                    },
                    {
                      "name" : "diavalue",
                      "source" : [{
                        "context" : "diaAns"
                      }],
                      "target" : [{
                        "context" : "diaComp",
                        "contextType" : "variable",
                        "element" : "value",
                        "transform" : "evaluate",
                        "parameter" : [{
                          "valueString" : "diaAns.valueQuantity"
                        }]
                      }]
                    }]
                  },
                  {
                    "name" : "extracteffective",
                    "source" : [{
                      "context" : "sysItem",
                      "element" : "item",
                      "variable" : "dateItem",
                      "condition" : "(linkId.contains('Date'))"
                    }],
                    "rule" : [{
                      "name" : "seteffective",
                      "source" : [{
                        "context" : "dateItem",
                        "element" : "answer",
                        "variable" : "dateAns"
                      }],
                      "target" : [{
                        "context" : "obs",
                        "contextType" : "variable",
                        "element" : "effective",
                        "transform" : "evaluate",
                        "parameter" : [{
                          "valueString" : "dateAns.valueDate"
                        }]
                      }]
                    }]
                  }]
                }]
              }]
            }]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreateLaboratoryObservations",
    "typeMode" : "none",
    "documentation" : "Group: Create Laboratory Observations",
    "input" : [{
      "name" : "src",
      "type" : "QuestionnaireResponse",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "processbiology",
      "source" : [{
        "context" : "src",
        "element" : "item",
        "variable" : "bioGroup",
        "condition" : "(linkId = '7702944131447')"
      }],
      "rule" : [{
        "name" : "processrenal",
        "source" : [{
          "context" : "bioGroup",
          "element" : "item",
          "variable" : "renalGroup",
          "condition" : "(linkId = '5241323453538')"
        }],
        "rule" : [{
          "name" : "extracturea",
          "source" : [{
            "context" : "renalGroup",
            "element" : "item",
            "variable" : "ureaItem",
            "condition" : "(linkId = '7169026818760')"
          }],
          "rule" : [{
            "name" : "createureaobs",
            "source" : [{
              "context" : "ureaItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "ureaItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractcreat",
          "source" : [{
            "context" : "renalGroup",
            "element" : "item",
            "variable" : "creatItem",
            "condition" : "(linkId = '500408205043')"
          }],
          "rule" : [{
            "name" : "createcreatobs",
            "source" : [{
              "context" : "creatItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "creatItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractdfg",
          "source" : [{
            "context" : "renalGroup",
            "element" : "item",
            "variable" : "dfgItem",
            "condition" : "(linkId = '786621340679')"
          }],
          "rule" : [{
            "name" : "createdfgobs",
            "source" : [{
              "context" : "dfgItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "dfgItem", "patient", "bundle"]
            }]
          }]
        }]
      },
      {
        "name" : "processhemo",
        "source" : [{
          "context" : "bioGroup",
          "element" : "item",
          "variable" : "hemoGroup",
          "condition" : "(linkId = '419282985970')"
        }],
        "rule" : [{
          "name" : "extractleuko",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "leukoItem",
            "condition" : "(linkId = '210077225604')"
          }],
          "rule" : [{
            "name" : "createleukoobs",
            "source" : [{
              "context" : "leukoItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "leukoItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extracthemo",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "hemoItem",
            "condition" : "(linkId = '304159088493')"
          }],
          "rule" : [{
            "name" : "createhemoobs",
            "source" : [{
              "context" : "hemoItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "hemoItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extracthemat",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "hematItem",
            "condition" : "(linkId = '5687959006070')"
          }],
          "rule" : [{
            "name" : "createhematobs",
            "source" : [{
              "context" : "hematItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "hematItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractery",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "eryItem",
            "condition" : "(linkId = '8697447896867')"
          }],
          "rule" : [{
            "name" : "createeryobs",
            "source" : [{
              "context" : "eryItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "eryItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractvgm",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "vgmItem",
            "condition" : "(linkId = '5584978899134')"
          }],
          "rule" : [{
            "name" : "createvgmobs",
            "source" : [{
              "context" : "vgmItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "vgmItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractplat",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "platItem",
            "condition" : "(linkId = '2881119993430')"
          }],
          "rule" : [{
            "name" : "createplatobs",
            "source" : [{
              "context" : "platItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "platItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractneut",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "neutItem",
            "condition" : "(linkId = '7408951746270')"
          }],
          "rule" : [{
            "name" : "createneutobs",
            "source" : [{
              "context" : "neutItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "neutItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractlymph",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "lymphItem",
            "condition" : "(linkId = '809808816195')"
          }],
          "rule" : [{
            "name" : "createlymphobs",
            "source" : [{
              "context" : "lymphItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "lymphItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extracteosi",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "eosiItem",
            "condition" : "(linkId = '6451887990893')"
          }],
          "rule" : [{
            "name" : "createeosiobs",
            "source" : [{
              "context" : "eosiItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "eosiItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractmono",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "monoItem",
            "condition" : "(linkId = '7935935816936')"
          }],
          "rule" : [{
            "name" : "createmonoobs",
            "source" : [{
              "context" : "monoItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "monoItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extracttp",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "tpItem",
            "condition" : "(linkId = '2055949655770')"
          }],
          "rule" : [{
            "name" : "createtpobs",
            "source" : [{
              "context" : "tpItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "tpItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extracttca",
          "source" : [{
            "context" : "hemoGroup",
            "element" : "item",
            "variable" : "tcaItem",
            "condition" : "(linkId = '2527095476817')"
          }],
          "rule" : [{
            "name" : "createtcaobs",
            "source" : [{
              "context" : "tcaItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "tcaItem", "patient", "bundle"]
            }]
          }]
        }]
      },
      {
        "name" : "processliver",
        "source" : [{
          "context" : "bioGroup",
          "element" : "item",
          "variable" : "liverGroup",
          "condition" : "(linkId = '3893612773040')"
        }],
        "rule" : [{
          "name" : "extractasat",
          "source" : [{
            "context" : "liverGroup",
            "element" : "item",
            "variable" : "asatItem",
            "condition" : "(linkId = '3028330976100')"
          }],
          "rule" : [{
            "name" : "createasatobs",
            "source" : [{
              "context" : "asatItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "asatItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractalat",
          "source" : [{
            "context" : "liverGroup",
            "element" : "item",
            "variable" : "alatItem",
            "condition" : "(linkId = '8486813893880')"
          }],
          "rule" : [{
            "name" : "createalatobs",
            "source" : [{
              "context" : "alatItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "alatItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractggt",
          "source" : [{
            "context" : "liverGroup",
            "element" : "item",
            "variable" : "ggtItem",
            "condition" : "(linkId = '3663296044037')"
          }],
          "rule" : [{
            "name" : "createggtobs",
            "source" : [{
              "context" : "ggtItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "ggtItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractpal",
          "source" : [{
            "context" : "liverGroup",
            "element" : "item",
            "variable" : "palItem",
            "condition" : "(linkId = '2690026606933')"
          }],
          "rule" : [{
            "name" : "createpalobs",
            "source" : [{
              "context" : "palItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "palItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractbiltot",
          "source" : [{
            "context" : "liverGroup",
            "element" : "item",
            "variable" : "bilTotItem",
            "condition" : "(linkId = '9068831071023')"
          }],
          "rule" : [{
            "name" : "createbiltotobs",
            "source" : [{
              "context" : "bilTotItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "bilTotItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extractbilconj",
          "source" : [{
            "context" : "liverGroup",
            "element" : "item",
            "variable" : "bilConjItem",
            "condition" : "(linkId = '8893717988787')"
          }],
          "rule" : [{
            "name" : "createbilconjobs",
            "source" : [{
              "context" : "bilConjItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "bilConjItem", "patient", "bundle"]
            }]
          }]
        }]
      },
      {
        "name" : "processglucose",
        "source" : [{
          "context" : "bioGroup",
          "element" : "item",
          "variable" : "glucoseGroup",
          "condition" : "(linkId = '8929068894076')"
        }],
        "rule" : [{
          "name" : "extractglyc",
          "source" : [{
            "context" : "glucoseGroup",
            "element" : "item",
            "variable" : "glycItem",
            "condition" : "(linkId = '8193929027997')"
          }],
          "rule" : [{
            "name" : "createglycobs",
            "source" : [{
              "context" : "glycItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "glycItem", "patient", "bundle"]
            }]
          }]
        },
        {
          "name" : "extracthba1c",
          "source" : [{
            "context" : "glucoseGroup",
            "element" : "item",
            "variable" : "hba1cItem",
            "condition" : "(linkId = '7063892830923')"
          }],
          "rule" : [{
            "name" : "createhba1cobs",
            "source" : [{
              "context" : "hba1cItem",
              "element" : "answer",
              "variable" : "ans"
            }],
            "target" : [{
              "context" : "bundle",
              "contextType" : "variable"
            }],
            "dependent" : [{
              "name" : "CreateLabObservation",
              "variable" : ["ans", "hba1cItem", "patient", "bundle"]
            }]
          }]
        }]
      }]
    }]
  },
  {
    "name" : "CreateLabObservation",
    "typeMode" : "none",
    "documentation" : "Helper: Create a single Laboratory Observation",
    "input" : [{
      "name" : "ans",
      "mode" : "source"
    },
    {
      "name" : "parentItem",
      "mode" : "source"
    },
    {
      "name" : "patient",
      "type" : "Patient",
      "mode" : "target"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "obsentry",
      "source" : [{
        "context" : "ans"
      }],
      "target" : [{
        "context" : "bundle",
        "contextType" : "variable",
        "element" : "entry",
        "variable" : "obsEntry"
      }],
      "rule" : [{
        "name" : "createobs",
        "source" : [{
          "context" : "ans"
        }],
        "target" : [{
          "context" : "obsEntry",
          "contextType" : "variable",
          "element" : "resource",
          "variable" : "obs",
          "transform" : "create",
          "parameter" : [{
            "valueString" : "Observation"
          }]
        }],
        "rule" : [{
          "name" : "obsid",
          "source" : [{
            "context" : "ans"
          }],
          "target" : [{
            "context" : "obs",
            "contextType" : "variable",
            "element" : "id",
            "transform" : "uuid"
          }]
        },
        {
          "name" : "setfullUrl",
          "source" : [{
            "context" : "ans"
          }],
          "target" : [{
            "context" : "obs",
            "contextType" : "variable",
            "element" : "id",
            "variable" : "obsId"
          },
          {
            "context" : "obsEntry",
            "contextType" : "variable",
            "element" : "fullUrl",
            "transform" : "append",
            "parameter" : [{
              "valueString" : "urn:uuid:"
            },
            {
              "valueId" : "obsId"
            }]
          }]
        },
        {
          "name" : "obsmeta",
          "source" : [{
            "context" : "ans"
          }],
          "target" : [{
            "context" : "obs",
            "contextType" : "variable",
            "element" : "meta",
            "variable" : "meta",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Meta"
            }]
          }],
          "rule" : [{
            "name" : "obsprofile",
            "source" : [{
              "context" : "ans"
            }],
            "target" : [{
              "context" : "meta",
              "contextType" : "variable",
              "element" : "profile",
              "transform" : "copy",
              "parameter" : [{
                "valueString" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/dm-observation-laboratory-generic"
              }]
            }]
          }]
        },
        {
          "name" : "obsstatus",
          "source" : [{
            "context" : "ans"
          }],
          "target" : [{
            "context" : "obs",
            "contextType" : "variable",
            "element" : "status",
            "transform" : "copy",
            "parameter" : [{
              "valueString" : "final"
            }]
          }]
        },
        {
          "name" : "setcategory",
          "source" : [{
            "context" : "ans"
          }],
          "target" : [{
            "context" : "obs",
            "contextType" : "variable",
            "element" : "category",
            "variable" : "cat",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "CodeableConcept"
            }]
          }],
          "rule" : [{
            "name" : "setcategorycoding",
            "source" : [{
              "context" : "ans"
            }],
            "target" : [{
              "context" : "cat",
              "contextType" : "variable",
              "element" : "coding",
              "variable" : "coding",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "Coding"
              }]
            }],
            "rule" : [{
              "name" : "catsystem",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "coding",
                "contextType" : "variable",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                }]
              }]
            },
            {
              "name" : "catcode",
              "source" : [{
                "context" : "ans"
              }],
              "target" : [{
                "context" : "coding",
                "contextType" : "variable",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "laboratory"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "setsubject",
          "source" : [{
            "context" : "ans"
          }],
          "target" : [{
            "context" : "obs",
            "contextType" : "variable",
            "element" : "subject",
            "variable" : "ref",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Reference"
            }]
          },
          {
            "context" : "patient",
            "contextType" : "variable",
            "element" : "id",
            "variable" : "patId"
          },
          {
            "context" : "ref",
            "contextType" : "variable",
            "element" : "reference",
            "transform" : "append",
            "parameter" : [{
              "valueString" : "Patient/"
            },
            {
              "valueId" : "patId"
            }]
          }]
        },
        {
          "name" : "setvalue",
          "source" : [{
            "context" : "ans"
          }],
          "target" : [{
            "context" : "obs",
            "contextType" : "variable",
            "element" : "value",
            "transform" : "evaluate",
            "parameter" : [{
              "valueString" : "ans.valueQuantity"
            }]
          }]
        },
        {
          "name" : "extractloinc",
          "source" : [{
            "context" : "parentItem",
            "element" : "item",
            "variable" : "loincItem",
            "condition" : "(linkId.contains('code loinc'))"
          }],
          "rule" : [{
            "name" : "setcode",
            "source" : [{
              "context" : "loincItem",
              "element" : "answer",
              "variable" : "loincAns"
            }],
            "target" : [{
              "context" : "obs",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "code",
              "transform" : "create",
              "parameter" : [{
                "valueString" : "CodeableConcept"
              }]
            }],
            "rule" : [{
              "name" : "setloinccoding",
              "source" : [{
                "context" : "loincAns"
              }],
              "target" : [{
                "context" : "code",
                "contextType" : "variable",
                "element" : "coding",
                "transform" : "evaluate",
                "parameter" : [{
                  "valueString" : "loincAns.valueCoding"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "extracteffective",
          "source" : [{
            "context" : "parentItem",
            "element" : "item",
            "variable" : "dateItem",
            "condition" : "(linkId.contains('Date et heure du prélèvement'))"
          }],
          "rule" : [{
            "name" : "seteffective",
            "source" : [{
              "context" : "dateItem",
              "element" : "answer",
              "variable" : "dateAns"
            }],
            "target" : [{
              "context" : "obs",
              "contextType" : "variable",
              "element" : "effective",
              "transform" : "evaluate",
              "parameter" : [{
                "valueString" : "dateAns.valueDateTime"
              }]
            }]
          }]
        }]
      }]
    }]
  }]
}

```
