# Alignement de l''expression de besoin vers le modèle physique du DPI dans le cadre de l''usage Core - Data Management with FHIR v0.1.0

* [**Table of Contents**](toc.md)
* [**Artifacts Summary**](artifacts.md)
* **Alignement de l''expression de besoin vers le modèle physique du DPI dans le cadre de l''usage Core**

## StructureMap: Alignement de l''expression de besoin vers le modèle physique du DPI dans le cadre de l''usage Core 

| | |
| :--- | :--- |
| *Official URL*:https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreBusiness2Physical | *Version*:0.1.0 |
| Draft as of 2025-10-23 | *Computable Name*:CoreBusiness2Physical |

 
Alignement de l''expression de besoin vers le modèle physique du DPI dans le cadre de l''usage Core 

```

map "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreBusiness2Physical" = "CoreBusiness2Physical"

// Alignement de l''expression de besoin vers le modèle physique du DPI dans le cadre de l''usage Core

uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QR as source
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreDataSet" alias DataSet as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CorePatient" alias PatientTable as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreAddress" alias AddressTable as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreSejour" alias SejourTable as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreBiology" alias BiologyTable as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreClinical" alias ClinicalTable as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreDiag" alias DiagTable as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreActe" alias ActeTable as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreMedicationAdm" alias MedicationAdmTable as target
uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreMedicationPre" alias MedicationPreTable as target

group init(source srcQR : QR, target tgtDS : DataSet) <<types>> {
  srcQR -> tgtDS.logicalId = uuid() "setId";
  srcQR ->  tgtDS.patient as tgtPatient,  tgtDS.sejour as tgtSejour,  tgtDS.biology as tgtBiol,  tgtDS.clinical as tgtClin,  tgtDS.medicationPre as tgtMedPre,  tgtDS.medicationAdm as tgtMedAdm then {
    srcQR.subject as srcSubject then {
      srcSubject.identifier as srcSubjectIdentifier where system = 'https://dpi.exemple/Patient/PatientNi' then {
        srcSubjectIdentifier.value as srcSubjectId then {
          srcQR.item as srcSocioDemoDataItem where linkId = '4647259356106' then {
            srcSocioDemoDataItem -> tgtDS.patient = create('PatientTable') as newPatient then Patient(srcSubjectId, srcSocioDemoDataItem, newPatient) "setPatient";
            srcSocioDemoDataItem.item as srcEnvItem where linkId = '5491974639955' -> tgtDS.address = create('AddressTable') as newAddress then Environement(srcSubjectId, srcEnvItem, newAddress) "setEnvironnement";
          } "navigationToSocioDemoData";
          srcQR.item as srcPMSIDataItem where linkId = '2825244231605' then {
            srcPMSIDataItem.item as srcPMSISexeItem where linkId = '3894630481120' then {
              srcPMSISexeItem.answer as srcPMSISexeAnswer then {
                srcPMSISexeAnswer.value : Coding as srcPMSISexeValueCoding -> tgtPatient.gender = (%srcPMSISexeValueCoding.code) "SetPMSISexeValue";
              } "SetPMSISexeAnswer";
            } "setPMSISexe";
            srcPMSIDataItem.item as srcPMSIDiagItem where linkId = '9391816419630' -> tgtDS.diag = create('DiagTable') as newDiag then PMSIDiag(srcSubjectId, srcPMSIDiagItem, newDiag) "navigationToPMSIDiag";
            srcPMSIDataItem.item as srcPMSIActeItem where linkId = '591926901726' -> tgtDS.acte = create('ActeTable') as newActe then PMSIActe(srcSubjectId, srcPMSIActeItem, newActe) "navigationToPMSIDiag";
          } "navigationToPMSIData";
        } "setIdentifierValue";
      } "selectPatientIdentifier";
    } "setPatientId";
  } "setTgtVar";
}

group Patient(source srcSubjectId, source srcSocioDemoDataItem, target newPatient : PatientTable) {
  srcSocioDemoDataItem.item as srcPatientIdItem where linkId = '2958000860428' then {
    srcPatientIdItem.item as srcNomItem where linkId = '8605698058770' then {
      srcNomItem.answer as srcNomAnswer then {
        srcNomAnswer.value : string as srcNomValue -> newPatient.name = srcNomValue "SetNomValue";
      } "setNomAnswer";
    } "setNom";
    srcPatientIdItem.item as srcPrenomItem where linkId = '6214879623503' then {
      srcPrenomItem.answer as srcPrenomAnswer then {
        srcPrenomAnswer.value : string as srcPrenomValue -> newPatient.firstName = srcPrenomValue "SetPrenomValue";
      } "setPrenomAnswer";
    } "setPrenom";
    srcPatientIdItem.item as srcNIRItem where linkId = '5711960356160' then {
      srcNIRItem.answer as srcNIRAnswer then {
        srcNIRAnswer.value : string as srcNIRValue -> newPatient.nir = srcNIRValue "SetNIRValue";
      } "setNIRAnswer";
    } "setNIR";
    srcPatientIdItem.item as srcDDNItem where linkId = '5036133558154' then {
      srcDDNItem.answer as srcDDNAnswer then {
        srcDDNAnswer.value : date as srcDDNValue -> newPatient.birthDate = srcDDNValue "SetDDNValue";
      } "setDDNAnswer";
    } "setDDN";
    srcPatientIdItem.item as srcDDDItem where linkId = '5036133558154' then {
      srcDDDItem.answer as srcDDDAnswer then {
        srcDDDAnswer.value : date as srcDDDValue "SetDDDValue";
      } "setDDDAnswer";
      srcDDDItem.item as srcDDDSourceItem where linkId = '9098810065693' then {
        srcDDDSourceItem.answer as srcDDDSourceAnswer then {
          srcDDDSourceAnswer.value : Coding as srcDDDSourceValue "SetDDDSourceValue";
        } "setDDDSourceAnswer";
      } "setDDDSource";
    } "setDDD";
    srcPatientIdItem.item as srcGemRankItem where linkId = '6931296968515' then {
      srcGemRankItem.answer as srcGemRankAnswer then {
        srcGemRankAnswer.value : integer as srcGemRankValue "SetGemRankValue";
      } "SetGemRankAnswer";
    } "SetGemRank";
  } "navigationToPatientId";
}

group Environement(source srcSubjectId, source srcEnvItem, target newAddress : AddressTable) {
  srcEnvItem.item as srcGeocodItem where linkId = '3816475533472' -> newAddress.patientNi as newAddressPatient then {
    srcGeocodItem -> newAddressPatient.reference = ('PatientCore/' + %srcSubjectId.toString()) "setAddressPatientRef";
    srcGeocodItem.item as srcLatItem where linkId = '3709843054556' then {
      srcLatItem.answer as srcLatAnswer then {
        srcLatAnswer.value : decimal as srcLatValue -> newAddress.latitude = srcLatValue "SetLatValue";
      } "setLatAnswer";
    } "setLat";
    srcGeocodItem.item as srcLongItem where linkId = '7651448032665' then {
      srcLongItem.answer as srcLongAnswer then {
        srcLongAnswer.value : decimal as srcLongValue -> newAddress.longitude = srcLongValue "SetLongValue";
      } "setLongAnswer";
    } "setLong";
    srcGeocodItem.item as srcGeocodDateItem where linkId = '1185653257776' then {
      srcGeocodDateItem.answer as srcGeocodDateAnswer then {
        srcGeocodDateAnswer.value : date as srcGeocodDateValue "SetGeocodDateValue";
      } "setGeocodDateAnswer";
    } "setGeocodDate";
  } "navigationToGeocod";
  srcEnvItem.item as srcIrisItem where linkId = '7621032273792' then {
    srcIrisItem.answer as srcIrisAnswer then {
      srcIrisAnswer.value : Coding as srcIrisValue "SetIrisValue";
    } "setIrisAnswer";
    srcIrisItem.item as srcIrisDateItem where linkId = '4999580038872' then {
      srcIrisDateItem.answer as srcIrisDateAnswer then {
        srcIrisDateAnswer.value : date as srcIrisDateValue "SetIrisDateValue";
      } "setIrisDateAnswer";
    } "setIrisDate";
  } "setIris";
}

group PMSIDiag(source srcSubjectId, source srcPMSIDiagItem, target newDiag : DiagTable) {
  srcPMSIDiagItem -> newDiag.patientNi as newDiagPatient then {
    srcPMSIDiagItem -> newDiagPatient.reference = ('PatientCore/' + %srcSubjectId.toString()) "setDiagPatientRef";
  } "setDiagPatient";
  srcPMSIDiagItem.item as srcPMSIDiagDateItem where linkId = '7114466839467' then {
    srcPMSIDiagDateItem.answer as srcPMSIDiagDateAnswer then {
      srcPMSIDiagDateAnswer.value : date as srcPMSIDiagDateValue "SetPMSIDiagDateValue";
    } "SetPMSIDiagDateAnswer";
  } "SetPMSIDiagDate";
  srcPMSIDiagItem.item as srcPMSIDiagTypeItem where linkId = '6427586743735' then {
    srcPMSIDiagTypeItem.answer as srcPMSIDiagTypeAnswer then {
      srcPMSIDiagTypeAnswer.value : Coding as srcPMSIDiagTypeValueCoding -> newDiag.codeType = (%srcPMSIDiagTypeValueCoding.display) "SetPMSIDiagTypeValue";
    } "SetPMSIDiagTypeAnswer";
  } "SetPMSIDiagType";
  srcPMSIDiagItem.item as srcPMSIDiagCodeItem where linkId = '5505101189372' then {
    srcPMSIDiagCodeItem.answer as srcPMSIDiagCodeAnswer then {
      srcPMSIDiagCodeAnswer.value : Coding as srcPMSIDiagCodeValueCoding -> newDiag.code = (%srcPMSIDiagCodeValueCoding.code) "SetPMSIDiagCodeValue";
    } "SetPMSIDiagCodeAnswer";
  } "SetPMSIDiagCode";
}

group PMSIActe(source srcSubjectId, source srcPMSIActeItem, target newActe : ActeTable) {
  srcPMSIActeItem -> newActe.patientNi as newActePatient then {
    srcPMSIActeItem -> newActePatient.reference = ('PatientCore/' + %srcSubjectId.toString()) "setActePatientRef";
  } "setActePatient";
  srcPMSIActeItem.item as srcPMSIActeDateRecItem where linkId = '9436509453137' then {
    srcPMSIActeDateRecItem.answer as srcPMSIActeDateRecAnswer then {
      srcPMSIActeDateRecAnswer.value : date as srcPMSIActeDateRecValue "SetPMSIActeDateRecValue";
    } "SetPMSIActeDateRecAnswer";
  } "SetPMSIActeDateRec";
  srcPMSIActeItem.item as srcPMSIActeDateItem where linkId = '5066866286682' then {
    srcPMSIActeDateItem.answer as srcPMSIActeDateAnswer then {
      srcPMSIActeDateAnswer.value : dateTime as srcPMSIActeDateValue ->  newActe.dateStart = srcPMSIActeDateValue,  newActe.dateEnd = srcPMSIActeDateValue "SetPMSIActeDateValue";
    } "SetPMSIActeDateAnswer";
  } "SetPMSIActeDate";
  srcPMSIActeItem.item as srcPMSIActeCodeItem where linkId = '7758110033600' then {
    srcPMSIActeCodeItem.answer as srcPMSIActeCodeAnswer then {
      srcPMSIActeCodeAnswer.value : Coding as srcPMSIActeCodeValueCoding -> newActe.code = (%srcPMSIActeCodeValueCoding.code) "SetPMSIActeCodeValue";
    } "SetPMSIActeCodeAnswer";
  } "SetPMSIActeCode";
}


```



## Resource Content

```json
{
  "resourceType" : "StructureMap",
  "id" : "CoreBusiness2Physical",
  "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreBusiness2Physical",
  "version" : "0.1.0",
  "name" : "CoreBusiness2Physical",
  "title" : "Alignement de l''expression de besoin vers le modèle physique du DPI dans le cadre de l''usage Core",
  "status" : "draft",
  "date" : "2025-10-23T20:49:03+00:00",
  "publisher" : "AP-HP",
  "contact" : [
    {
      "name" : "AP-HP",
      "telecom" : [
        {
          "system" : "url",
          "value" : "https://aphp.fr"
        }
      ]
    }
  ],
  "description" : "Alignement de l''expression de besoin vers le modèle physique du DPI dans le cadre de l''usage Core",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "urn:iso:std:iso:3166",
          "code" : "FR",
          "display" : "France"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
      "mode" : "source",
      "alias" : "QR"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreDataSet",
      "mode" : "target",
      "alias" : "DataSet"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CorePatient",
      "mode" : "target",
      "alias" : "PatientTable"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreAddress",
      "mode" : "target",
      "alias" : "AddressTable"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreSejour",
      "mode" : "target",
      "alias" : "SejourTable"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreBiology",
      "mode" : "target",
      "alias" : "BiologyTable"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreClinical",
      "mode" : "target",
      "alias" : "ClinicalTable"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreDiag",
      "mode" : "target",
      "alias" : "DiagTable"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreActe",
      "mode" : "target",
      "alias" : "ActeTable"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreMedicationAdm",
      "mode" : "target",
      "alias" : "MedicationAdmTable"
    },
    {
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/CoreMedicationPre",
      "mode" : "target",
      "alias" : "MedicationPreTable"
    }
  ],
  "group" : [
    {
      "name" : "init",
      "typeMode" : "types",
      "input" : [
        {
          "name" : "srcQR",
          "type" : "QR",
          "mode" : "source"
        },
        {
          "name" : "tgtDS",
          "type" : "DataSet",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "setId",
          "source" : [
            {
              "context" : "srcQR"
            }
          ],
          "target" : [
            {
              "context" : "tgtDS",
              "contextType" : "variable",
              "element" : "logicalId",
              "transform" : "uuid"
            }
          ]
        },
        {
          "name" : "setTgtVar",
          "source" : [
            {
              "context" : "srcQR"
            }
          ],
          "target" : [
            {
              "context" : "tgtDS",
              "contextType" : "variable",
              "element" : "patient",
              "variable" : "tgtPatient"
            },
            {
              "context" : "tgtDS",
              "contextType" : "variable",
              "element" : "sejour",
              "variable" : "tgtSejour"
            },
            {
              "context" : "tgtDS",
              "contextType" : "variable",
              "element" : "biology",
              "variable" : "tgtBiol"
            },
            {
              "context" : "tgtDS",
              "contextType" : "variable",
              "element" : "clinical",
              "variable" : "tgtClin"
            },
            {
              "context" : "tgtDS",
              "contextType" : "variable",
              "element" : "medicationPre",
              "variable" : "tgtMedPre"
            },
            {
              "context" : "tgtDS",
              "contextType" : "variable",
              "element" : "medicationAdm",
              "variable" : "tgtMedAdm"
            }
          ],
          "rule" : [
            {
              "name" : "setPatientId",
              "source" : [
                {
                  "context" : "srcQR",
                  "element" : "subject",
                  "variable" : "srcSubject"
                }
              ],
              "rule" : [
                {
                  "name" : "selectPatientIdentifier",
                  "source" : [
                    {
                      "context" : "srcSubject",
                      "element" : "identifier",
                      "variable" : "srcSubjectIdentifier",
                      "condition" : "system = 'https://dpi.exemple/Patient/PatientNi'"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "setIdentifierValue",
                      "source" : [
                        {
                          "context" : "srcSubjectIdentifier",
                          "element" : "value",
                          "variable" : "srcSubjectId"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "navigationToSocioDemoData",
                          "source" : [
                            {
                              "context" : "srcQR",
                              "element" : "item",
                              "variable" : "srcSocioDemoDataItem",
                              "condition" : "linkId = '4647259356106'"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "setPatient",
                              "source" : [
                                {
                                  "context" : "srcSocioDemoDataItem"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgtDS",
                                  "contextType" : "variable",
                                  "element" : "patient",
                                  "variable" : "newPatient",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "PatientTable"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "Patient",
                                  "variable" : ["srcSubjectId", "srcSocioDemoDataItem", "newPatient"]
                                }
                              ]
                            },
                            {
                              "name" : "setEnvironnement",
                              "source" : [
                                {
                                  "context" : "srcSocioDemoDataItem",
                                  "element" : "item",
                                  "variable" : "srcEnvItem",
                                  "condition" : "linkId = '5491974639955'"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgtDS",
                                  "contextType" : "variable",
                                  "element" : "address",
                                  "variable" : "newAddress",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "AddressTable"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "Environement",
                                  "variable" : ["srcSubjectId", "srcEnvItem", "newAddress"]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "navigationToPMSIData",
                          "source" : [
                            {
                              "context" : "srcQR",
                              "element" : "item",
                              "variable" : "srcPMSIDataItem",
                              "condition" : "linkId = '2825244231605'"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "setPMSISexe",
                              "source" : [
                                {
                                  "context" : "srcPMSIDataItem",
                                  "element" : "item",
                                  "variable" : "srcPMSISexeItem",
                                  "condition" : "linkId = '3894630481120'"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "SetPMSISexeAnswer",
                                  "source" : [
                                    {
                                      "context" : "srcPMSISexeItem",
                                      "element" : "answer",
                                      "variable" : "srcPMSISexeAnswer"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "SetPMSISexeValue",
                                      "source" : [
                                        {
                                          "context" : "srcPMSISexeAnswer",
                                          "type" : "Coding",
                                          "element" : "value",
                                          "variable" : "srcPMSISexeValueCoding"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "tgtPatient",
                                          "contextType" : "variable",
                                          "element" : "gender",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "%srcPMSISexeValueCoding.code"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "navigationToPMSIDiag",
                              "source" : [
                                {
                                  "context" : "srcPMSIDataItem",
                                  "element" : "item",
                                  "variable" : "srcPMSIDiagItem",
                                  "condition" : "linkId = '9391816419630'"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgtDS",
                                  "contextType" : "variable",
                                  "element" : "diag",
                                  "variable" : "newDiag",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "DiagTable"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "PMSIDiag",
                                  "variable" : ["srcSubjectId", "srcPMSIDiagItem", "newDiag"]
                                }
                              ]
                            },
                            {
                              "name" : "navigationToPMSIDiag",
                              "source" : [
                                {
                                  "context" : "srcPMSIDataItem",
                                  "element" : "item",
                                  "variable" : "srcPMSIActeItem",
                                  "condition" : "linkId = '591926901726'"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgtDS",
                                  "contextType" : "variable",
                                  "element" : "acte",
                                  "variable" : "newActe",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "ActeTable"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "PMSIActe",
                                  "variable" : ["srcSubjectId", "srcPMSIActeItem", "newActe"]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "Patient",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "srcSubjectId",
          "mode" : "source"
        },
        {
          "name" : "srcSocioDemoDataItem",
          "mode" : "source"
        },
        {
          "name" : "newPatient",
          "type" : "PatientTable",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "navigationToPatientId",
          "source" : [
            {
              "context" : "srcSocioDemoDataItem",
              "element" : "item",
              "variable" : "srcPatientIdItem",
              "condition" : "linkId = '2958000860428'"
            }
          ],
          "rule" : [
            {
              "name" : "setNom",
              "source" : [
                {
                  "context" : "srcPatientIdItem",
                  "element" : "item",
                  "variable" : "srcNomItem",
                  "condition" : "linkId = '8605698058770'"
                }
              ],
              "rule" : [
                {
                  "name" : "setNomAnswer",
                  "source" : [
                    {
                      "context" : "srcNomItem",
                      "element" : "answer",
                      "variable" : "srcNomAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetNomValue",
                      "source" : [
                        {
                          "context" : "srcNomAnswer",
                          "type" : "string",
                          "element" : "value",
                          "variable" : "srcNomValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "newPatient",
                          "contextType" : "variable",
                          "element" : "name",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "srcNomValue"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setPrenom",
              "source" : [
                {
                  "context" : "srcPatientIdItem",
                  "element" : "item",
                  "variable" : "srcPrenomItem",
                  "condition" : "linkId = '6214879623503'"
                }
              ],
              "rule" : [
                {
                  "name" : "setPrenomAnswer",
                  "source" : [
                    {
                      "context" : "srcPrenomItem",
                      "element" : "answer",
                      "variable" : "srcPrenomAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetPrenomValue",
                      "source" : [
                        {
                          "context" : "srcPrenomAnswer",
                          "type" : "string",
                          "element" : "value",
                          "variable" : "srcPrenomValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "newPatient",
                          "contextType" : "variable",
                          "element" : "firstName",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "srcPrenomValue"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setNIR",
              "source" : [
                {
                  "context" : "srcPatientIdItem",
                  "element" : "item",
                  "variable" : "srcNIRItem",
                  "condition" : "linkId = '5711960356160'"
                }
              ],
              "rule" : [
                {
                  "name" : "setNIRAnswer",
                  "source" : [
                    {
                      "context" : "srcNIRItem",
                      "element" : "answer",
                      "variable" : "srcNIRAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetNIRValue",
                      "source" : [
                        {
                          "context" : "srcNIRAnswer",
                          "type" : "string",
                          "element" : "value",
                          "variable" : "srcNIRValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "newPatient",
                          "contextType" : "variable",
                          "element" : "nir",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "srcNIRValue"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setDDN",
              "source" : [
                {
                  "context" : "srcPatientIdItem",
                  "element" : "item",
                  "variable" : "srcDDNItem",
                  "condition" : "linkId = '5036133558154'"
                }
              ],
              "rule" : [
                {
                  "name" : "setDDNAnswer",
                  "source" : [
                    {
                      "context" : "srcDDNItem",
                      "element" : "answer",
                      "variable" : "srcDDNAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetDDNValue",
                      "source" : [
                        {
                          "context" : "srcDDNAnswer",
                          "type" : "date",
                          "element" : "value",
                          "variable" : "srcDDNValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "newPatient",
                          "contextType" : "variable",
                          "element" : "birthDate",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "srcDDNValue"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setDDD",
              "source" : [
                {
                  "context" : "srcPatientIdItem",
                  "element" : "item",
                  "variable" : "srcDDDItem",
                  "condition" : "linkId = '5036133558154'"
                }
              ],
              "rule" : [
                {
                  "name" : "setDDDAnswer",
                  "source" : [
                    {
                      "context" : "srcDDDItem",
                      "element" : "answer",
                      "variable" : "srcDDDAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetDDDValue",
                      "source" : [
                        {
                          "context" : "srcDDDAnswer",
                          "type" : "date",
                          "element" : "value",
                          "variable" : "srcDDDValue"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "setDDDSource",
                  "source" : [
                    {
                      "context" : "srcDDDItem",
                      "element" : "item",
                      "variable" : "srcDDDSourceItem",
                      "condition" : "linkId = '9098810065693'"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "setDDDSourceAnswer",
                      "source" : [
                        {
                          "context" : "srcDDDSourceItem",
                          "element" : "answer",
                          "variable" : "srcDDDSourceAnswer"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "SetDDDSourceValue",
                          "source" : [
                            {
                              "context" : "srcDDDSourceAnswer",
                              "type" : "Coding",
                              "element" : "value",
                              "variable" : "srcDDDSourceValue"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetGemRank",
              "source" : [
                {
                  "context" : "srcPatientIdItem",
                  "element" : "item",
                  "variable" : "srcGemRankItem",
                  "condition" : "linkId = '6931296968515'"
                }
              ],
              "rule" : [
                {
                  "name" : "SetGemRankAnswer",
                  "source" : [
                    {
                      "context" : "srcGemRankItem",
                      "element" : "answer",
                      "variable" : "srcGemRankAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetGemRankValue",
                      "source" : [
                        {
                          "context" : "srcGemRankAnswer",
                          "type" : "integer",
                          "element" : "value",
                          "variable" : "srcGemRankValue"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "Environement",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "srcSubjectId",
          "mode" : "source"
        },
        {
          "name" : "srcEnvItem",
          "mode" : "source"
        },
        {
          "name" : "newAddress",
          "type" : "AddressTable",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "navigationToGeocod",
          "source" : [
            {
              "context" : "srcEnvItem",
              "element" : "item",
              "variable" : "srcGeocodItem",
              "condition" : "linkId = '3816475533472'"
            }
          ],
          "target" : [
            {
              "context" : "newAddress",
              "contextType" : "variable",
              "element" : "patientNi",
              "variable" : "newAddressPatient"
            }
          ],
          "rule" : [
            {
              "name" : "setAddressPatientRef",
              "source" : [
                {
                  "context" : "srcGeocodItem"
                }
              ],
              "target" : [
                {
                  "context" : "newAddressPatient",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'PatientCore/' + %srcSubjectId.toString()"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setLat",
              "source" : [
                {
                  "context" : "srcGeocodItem",
                  "element" : "item",
                  "variable" : "srcLatItem",
                  "condition" : "linkId = '3709843054556'"
                }
              ],
              "rule" : [
                {
                  "name" : "setLatAnswer",
                  "source" : [
                    {
                      "context" : "srcLatItem",
                      "element" : "answer",
                      "variable" : "srcLatAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetLatValue",
                      "source" : [
                        {
                          "context" : "srcLatAnswer",
                          "type" : "decimal",
                          "element" : "value",
                          "variable" : "srcLatValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "newAddress",
                          "contextType" : "variable",
                          "element" : "latitude",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "srcLatValue"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setLong",
              "source" : [
                {
                  "context" : "srcGeocodItem",
                  "element" : "item",
                  "variable" : "srcLongItem",
                  "condition" : "linkId = '7651448032665'"
                }
              ],
              "rule" : [
                {
                  "name" : "setLongAnswer",
                  "source" : [
                    {
                      "context" : "srcLongItem",
                      "element" : "answer",
                      "variable" : "srcLongAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetLongValue",
                      "source" : [
                        {
                          "context" : "srcLongAnswer",
                          "type" : "decimal",
                          "element" : "value",
                          "variable" : "srcLongValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "newAddress",
                          "contextType" : "variable",
                          "element" : "longitude",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "srcLongValue"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setGeocodDate",
              "source" : [
                {
                  "context" : "srcGeocodItem",
                  "element" : "item",
                  "variable" : "srcGeocodDateItem",
                  "condition" : "linkId = '1185653257776'"
                }
              ],
              "rule" : [
                {
                  "name" : "setGeocodDateAnswer",
                  "source" : [
                    {
                      "context" : "srcGeocodDateItem",
                      "element" : "answer",
                      "variable" : "srcGeocodDateAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetGeocodDateValue",
                      "source" : [
                        {
                          "context" : "srcGeocodDateAnswer",
                          "type" : "date",
                          "element" : "value",
                          "variable" : "srcGeocodDateValue"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "setIris",
          "source" : [
            {
              "context" : "srcEnvItem",
              "element" : "item",
              "variable" : "srcIrisItem",
              "condition" : "linkId = '7621032273792'"
            }
          ],
          "rule" : [
            {
              "name" : "setIrisAnswer",
              "source" : [
                {
                  "context" : "srcIrisItem",
                  "element" : "answer",
                  "variable" : "srcIrisAnswer"
                }
              ],
              "rule" : [
                {
                  "name" : "SetIrisValue",
                  "source" : [
                    {
                      "context" : "srcIrisAnswer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "srcIrisValue"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setIrisDate",
              "source" : [
                {
                  "context" : "srcIrisItem",
                  "element" : "item",
                  "variable" : "srcIrisDateItem",
                  "condition" : "linkId = '4999580038872'"
                }
              ],
              "rule" : [
                {
                  "name" : "setIrisDateAnswer",
                  "source" : [
                    {
                      "context" : "srcIrisDateItem",
                      "element" : "answer",
                      "variable" : "srcIrisDateAnswer"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetIrisDateValue",
                      "source" : [
                        {
                          "context" : "srcIrisDateAnswer",
                          "type" : "date",
                          "element" : "value",
                          "variable" : "srcIrisDateValue"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "PMSIDiag",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "srcSubjectId",
          "mode" : "source"
        },
        {
          "name" : "srcPMSIDiagItem",
          "mode" : "source"
        },
        {
          "name" : "newDiag",
          "type" : "DiagTable",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "setDiagPatient",
          "source" : [
            {
              "context" : "srcPMSIDiagItem"
            }
          ],
          "target" : [
            {
              "context" : "newDiag",
              "contextType" : "variable",
              "element" : "patientNi",
              "variable" : "newDiagPatient"
            }
          ],
          "rule" : [
            {
              "name" : "setDiagPatientRef",
              "source" : [
                {
                  "context" : "srcPMSIDiagItem"
                }
              ],
              "target" : [
                {
                  "context" : "newDiagPatient",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'PatientCore/' + %srcSubjectId.toString()"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetPMSIDiagDate",
          "source" : [
            {
              "context" : "srcPMSIDiagItem",
              "element" : "item",
              "variable" : "srcPMSIDiagDateItem",
              "condition" : "linkId = '7114466839467'"
            }
          ],
          "rule" : [
            {
              "name" : "SetPMSIDiagDateAnswer",
              "source" : [
                {
                  "context" : "srcPMSIDiagDateItem",
                  "element" : "answer",
                  "variable" : "srcPMSIDiagDateAnswer"
                }
              ],
              "rule" : [
                {
                  "name" : "SetPMSIDiagDateValue",
                  "source" : [
                    {
                      "context" : "srcPMSIDiagDateAnswer",
                      "type" : "date",
                      "element" : "value",
                      "variable" : "srcPMSIDiagDateValue"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetPMSIDiagType",
          "source" : [
            {
              "context" : "srcPMSIDiagItem",
              "element" : "item",
              "variable" : "srcPMSIDiagTypeItem",
              "condition" : "linkId = '6427586743735'"
            }
          ],
          "rule" : [
            {
              "name" : "SetPMSIDiagTypeAnswer",
              "source" : [
                {
                  "context" : "srcPMSIDiagTypeItem",
                  "element" : "answer",
                  "variable" : "srcPMSIDiagTypeAnswer"
                }
              ],
              "rule" : [
                {
                  "name" : "SetPMSIDiagTypeValue",
                  "source" : [
                    {
                      "context" : "srcPMSIDiagTypeAnswer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "srcPMSIDiagTypeValueCoding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "newDiag",
                      "contextType" : "variable",
                      "element" : "codeType",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "%srcPMSIDiagTypeValueCoding.display"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetPMSIDiagCode",
          "source" : [
            {
              "context" : "srcPMSIDiagItem",
              "element" : "item",
              "variable" : "srcPMSIDiagCodeItem",
              "condition" : "linkId = '5505101189372'"
            }
          ],
          "rule" : [
            {
              "name" : "SetPMSIDiagCodeAnswer",
              "source" : [
                {
                  "context" : "srcPMSIDiagCodeItem",
                  "element" : "answer",
                  "variable" : "srcPMSIDiagCodeAnswer"
                }
              ],
              "rule" : [
                {
                  "name" : "SetPMSIDiagCodeValue",
                  "source" : [
                    {
                      "context" : "srcPMSIDiagCodeAnswer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "srcPMSIDiagCodeValueCoding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "newDiag",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "%srcPMSIDiagCodeValueCoding.code"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "PMSIActe",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "srcSubjectId",
          "mode" : "source"
        },
        {
          "name" : "srcPMSIActeItem",
          "mode" : "source"
        },
        {
          "name" : "newActe",
          "type" : "ActeTable",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "setActePatient",
          "source" : [
            {
              "context" : "srcPMSIActeItem"
            }
          ],
          "target" : [
            {
              "context" : "newActe",
              "contextType" : "variable",
              "element" : "patientNi",
              "variable" : "newActePatient"
            }
          ],
          "rule" : [
            {
              "name" : "setActePatientRef",
              "source" : [
                {
                  "context" : "srcPMSIActeItem"
                }
              ],
              "target" : [
                {
                  "context" : "newActePatient",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'PatientCore/' + %srcSubjectId.toString()"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetPMSIActeDateRec",
          "source" : [
            {
              "context" : "srcPMSIActeItem",
              "element" : "item",
              "variable" : "srcPMSIActeDateRecItem",
              "condition" : "linkId = '9436509453137'"
            }
          ],
          "rule" : [
            {
              "name" : "SetPMSIActeDateRecAnswer",
              "source" : [
                {
                  "context" : "srcPMSIActeDateRecItem",
                  "element" : "answer",
                  "variable" : "srcPMSIActeDateRecAnswer"
                }
              ],
              "rule" : [
                {
                  "name" : "SetPMSIActeDateRecValue",
                  "source" : [
                    {
                      "context" : "srcPMSIActeDateRecAnswer",
                      "type" : "date",
                      "element" : "value",
                      "variable" : "srcPMSIActeDateRecValue"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetPMSIActeDate",
          "source" : [
            {
              "context" : "srcPMSIActeItem",
              "element" : "item",
              "variable" : "srcPMSIActeDateItem",
              "condition" : "linkId = '5066866286682'"
            }
          ],
          "rule" : [
            {
              "name" : "SetPMSIActeDateAnswer",
              "source" : [
                {
                  "context" : "srcPMSIActeDateItem",
                  "element" : "answer",
                  "variable" : "srcPMSIActeDateAnswer"
                }
              ],
              "rule" : [
                {
                  "name" : "SetPMSIActeDateValue",
                  "source" : [
                    {
                      "context" : "srcPMSIActeDateAnswer",
                      "type" : "dateTime",
                      "element" : "value",
                      "variable" : "srcPMSIActeDateValue"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "newActe",
                      "contextType" : "variable",
                      "element" : "dateStart",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "srcPMSIActeDateValue"
                        }
                      ]
                    },
                    {
                      "context" : "newActe",
                      "contextType" : "variable",
                      "element" : "dateEnd",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "srcPMSIActeDateValue"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetPMSIActeCode",
          "source" : [
            {
              "context" : "srcPMSIActeItem",
              "element" : "item",
              "variable" : "srcPMSIActeCodeItem",
              "condition" : "linkId = '7758110033600'"
            }
          ],
          "rule" : [
            {
              "name" : "SetPMSIActeCodeAnswer",
              "source" : [
                {
                  "context" : "srcPMSIActeCodeItem",
                  "element" : "answer",
                  "variable" : "srcPMSIActeCodeAnswer"
                }
              ],
              "rule" : [
                {
                  "name" : "SetPMSIActeCodeValue",
                  "source" : [
                    {
                      "context" : "srcPMSIActeCodeAnswer",
                      "type" : "Coding",
                      "element" : "value",
                      "variable" : "srcPMSIActeCodeValueCoding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "newActe",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "%srcPMSIActeCodeValueCoding.code"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

```
