Data Management with FHIR
0.1.0 - ci-build

Data Management with FHIR - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

## : Mapping FHIR Patient resource to OMOP Person - JSON Representation

Draft as of 2025-10-23

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "CoreFHIR2OMOPPerson",
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Narratif généré : StructureMap CoreFHIR2OMOPPerson</b></p><a name=\"CoreFHIR2OMOPPerson\"> </a><a name=\"hcCoreFHIR2OMOPPerson\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPPerson<span style=\"color: navy\">&quot; = &quot;</span>CoreFHIR2OMOPPerson<span style=\"color: navy\">&quot;\r\n\r\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Mapping FHIR Patient resource to OMOP Person</span>\r\n\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R4/patient.html\" title=\"Patient\">http://hl7.org/fhir/StructureDefinition/Patient</a><span style=\"color: navy\">&quot; </span><b>alias </b>Patient <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"StructureDefinition-OMOPPerson.html\" title=\"Person OMOP Table\">https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/OMOPPerson</a><span style=\"color: navy\">&quot; </span><b>alias </b>PersonTable <b>as </b><b>target</b>\r\n\r\n<b>group </b>Person<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>Patient, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>PersonTable<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  src.id<b> as </b><span style=\"color: maroon\">srcId</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.person_source_value = <span style=\"color: maroon\">srcId</span><span style=\"color: navy\">;</span>\r\n  src.gender<b> as </b><span style=\"color: maroon\">srcGender</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    srcGender<span style=\"color: navy\"><b> -&gt; </b></span>tgt.gender_concept_id = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtReference</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      srcGender<span style=\"color: navy\"><b> -&gt; </b></span> <b>translate</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">srcGender</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'https://interop.aphp.fr/ig/fhir/dm/ConceptMap/hl7-gender-to-ohdsi-gender'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'code'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">genderCode</span><span style=\"color: navy\">, </span> tgtReference.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Concept/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">genderCode</span><span style=\"color: navy\">)</span> <i>&quot;ref&quot;</i><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;refConcept&quot;</i><span style=\"color: navy\">;</span>\r\n    srcGender<span style=\"color: navy\"><b> -&gt; </b></span>tgt.gender_source_value = <span style=\"color: maroon\">srcGender</span> <i>&quot;sourceGender&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n  src.birthDate<b> as </b><span style=\"color: maroon\">srcBirthDate</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    srcBirthDate<span style=\"color: navy\"><b> -&gt; </b></span>tgt.birth_datetime = <span style=\"color: maroon\">srcBirthDate</span> <i>&quot;dateTime&quot;</i><span style=\"color: navy\">;</span>\r\n    srcBirthDate<span style=\"color: navy\"><b> -&gt; </b></span>tgt.year_of_birth = <span style=\"color: navy\">(</span>%srcBirthDate.toString().substring(0, 4).toInteger()<span style=\"color: navy\">)</span> <i>&quot;year&quot;</i><span style=\"color: navy\">;</span>\r\n    srcBirthDate<span style=\"color: navy\"><b> -&gt; </b></span>tgt.month_of_birth = <span style=\"color: navy\">(</span>%srcBirthDate.toString().substring(5, 2).toInteger()<span style=\"color: navy\">)</span> <i>&quot;month&quot;</i><span style=\"color: navy\">;</span>\r\n    srcBirthDate<span style=\"color: navy\"><b> -&gt; </b></span>tgt.day_of_birth = <span style=\"color: navy\">(</span>%srcBirthDate.toString().substring(8, 2).toInteger()<span style=\"color: navy\">)</span> <i>&quot;day&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
      },
      "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPPerson",
      "version" : "0.1.0",
      "name" : "CoreFHIR2OMOPPerson",
      "title" : "Mapping FHIR Patient resource to OMOP Person",
      "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" : "Mapping FHIR Patient resource to OMOP Person",
      "jurisdiction" : [
        {
          "coding" : [
            {
              "system" : "urn:iso:std:iso:3166",
              "code" : "FR",
              "display" : "France"
            }
          ]
        }
      ],
      "structure" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Patient",
          "mode" : "source",
          "alias" : "Patient"
        },
        {
          "url" : "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/OMOPPerson",
          "mode" : "target",
          "alias" : "PersonTable"
        }
      ],
      "group" : [
        {
          "name" : "Person",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "Patient",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "PersonTable",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "id",
              "source" : [
                {
                  "context" : "src",
                  "element" : "id",
                  "variable" : "srcId"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "person_source_value",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "srcId"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "gender",
              "source" : [
                {
                  "context" : "src",
                  "element" : "gender",
                  "variable" : "srcGender"
                }
              ],
              "rule" : [
                {
                  "name" : "refConcept",
                  "source" : [
                    {
                      "context" : "srcGender"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "gender_concept_id",
                      "variable" : "tgtReference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "ref",
                      "source" : [
                        {
                          "context" : "srcGender"
                        }
                      ],
                      "target" : [
                        {
                          "contextType" : "variable",
                          "variable" : "genderCode",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "srcGender"
                            },
                            {
                              "valueString" : "https://interop.aphp.fr/ig/fhir/dm/ConceptMap/hl7-gender-to-ohdsi-gender"
                            },
                            {
                              "valueString" : "code"
                            }
                          ]
                        },
                        {
                          "context" : "tgtReference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "Concept/"
                            },
                            {
                              "valueId" : "genderCode"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "sourceGender",
                  "source" : [
                    {
                      "context" : "srcGender"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "gender_source_value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "srcGender"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "birthDate",
              "source" : [
                {
                  "context" : "src",
                  "element" : "birthDate",
                  "variable" : "srcBirthDate"
                }
              ],
              "rule" : [
                {
                  "name" : "dateTime",
                  "source" : [
                    {
                      "context" : "srcBirthDate"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "birth_datetime",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "srcBirthDate"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "year",
                  "source" : [
                    {
                      "context" : "srcBirthDate"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "year_of_birth",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "%srcBirthDate.toString().substring(0, 4).toInteger()"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "month",
                  "source" : [
                    {
                      "context" : "srcBirthDate"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "month_of_birth",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "%srcBirthDate.toString().substring(5, 2).toInteger()"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "day",
                  "source" : [
                    {
                      "context" : "srcBirthDate"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "day_of_birth",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "%srcBirthDate.toString().substring(8, 2).toInteger()"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }