Starter FHIR Implementation Guide
1.0.1 - draft International flag

Starter FHIR Implementation Guide, published by Jembi Health Systems. This guide is not an authorized publication; it is the continuous build for version 1.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/jembi/Starter-FHIR-IG/ and changes regularly. See the Directory of published versions

: Map CHT Patient to FHIR Patient - JSON Representation

Draft as of 2024-11-08

Raw json | Download

{
  "resourceType" : "StructureMap",
  "id" : "CHTPatientToFHIRR4Patient",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap CHTPatientToFHIRR4Patient</b></p><a name=\"CHTPatientToFHIRR4Patient\"> </a><a name=\"hcCHTPatientToFHIRR4Patient\"> </a><a name=\"CHTPatientToFHIRR4Patient-en-US\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>http://jembi.org/fhir/StructureMap/CHTPatientToFHIRR4Patient<span style=\"color: navy\">&quot; = &quot;</span>CHTPatientToFHIRR4Patient<span style=\"color: navy\">&quot;\r\n\r\n</span><b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"StructureDefinition-CHTPatientLogicalModel.html\" title=\"CHT Patient Logical Model\">http://jembi.org/fhir/StructureDefinition/CHTPatientLogicalModel</a><span style=\"color: navy\">&quot; </span><b>as </b><b>source</b>\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>as </b><b>target</b>\r\n\r\n<b>group </b>CHTPatientToFHIRR4Patient<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>CHTPatientLogicalModel, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>Patient<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.id = <span style=\"color: maroon\">srcID</span> <i>&quot;SetPatientResourceId&quot;</i><span style=\"color: navy\">;</span>\r\n  src.name<b> as </b><span style=\"color: maroon\">srcName</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.name<b> as </b><span style=\"color: maroon\">pName</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    srcName<span style=\"color: navy\"><b> -&gt; </b></span>pName.text = <span style=\"color: maroon\">srcName</span> <i>&quot;SetPatientFullName&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n  src.phone<b> as </b><span style=\"color: maroon\">srcPhoneNumber</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.telecom<b> as </b><span style=\"color: maroon\">pTelecom</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    srcPhoneNumber<span style=\"color: navy\"><b> -&gt; </b></span>pTelecom.system = <span style=\"color: blue\">'phone'</span> <i>&quot;SetPatientTelecomCodeAsPhone&quot;</i><span style=\"color: navy\">;</span>\r\n    srcPhoneNumber<span style=\"color: navy\"><b> -&gt; </b></span>pTelecom.value = <span style=\"color: maroon\">srcPhoneNumber</span> <i>&quot;SetPatientTelecomValue&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n  src.date_of_birth<b> as </b><span style=\"color: maroon\">dob</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.birthDate = <span style=\"color: maroon\">dob</span> <i>&quot;SetPatientBirthDate&quot;</i><span style=\"color: navy\">;</span>\r\n  src.sex<b> as </b><span style=\"color: maroon\">sex</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.gender = <span style=\"color: maroon\">sex</span> <i>&quot;SetPatientGender&quot;</i><span style=\"color: navy\">;</span>\r\n  src.patient_id<b> as </b><span style=\"color: maroon\">srcBusinessID</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.identifier<b> as </b><span style=\"color: maroon\">tgtBusinessID</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    srcBusinessID<span style=\"color: navy\"><b> -&gt; </b></span>tgtBusinessID.value = <span style=\"color: maroon\">srcBusinessID</span> <i>&quot;SetBusinessIDValue&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;patientId&quot;</i><span style=\"color: navy\">;</span>\r\n  src.nationality<b> as </b><span style=\"color: maroon\">nationality</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">nationalityExt</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    nationality<span style=\"color: navy\"><b> -&gt; </b></span>nationalityExt.url = <span style=\"color: blue\">'http://hl7.org/fhir/StructureDefinition/patient-nationality'</span> <i>&quot;SetNationalityUrl&quot;</i><span style=\"color: navy\">;</span>\r\n    nationality<span style=\"color: navy\"><b> -&gt; </b></span>nationalityExt.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">countryCodeExtension</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      nationality<span style=\"color: navy\"><b> -&gt; </b></span>countryCodeExtension.url = <span style=\"color: blue\">'code'</span> <i>&quot;SetCountryCodeUrl&quot;</i><span style=\"color: navy\">;</span>\r\n      nationality<span style=\"color: navy\"><b> -&gt; </b></span>countryCodeExtension.value = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">countryCode</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        nationality<span style=\"color: navy\"><b> -&gt; </b></span>countryCode.coding = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Coding'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">coding</span><b> then</b><span style=\"color: navy\"> {\r\n</span>          nationality<span style=\"color: navy\"><b> -&gt; </b></span>coding.system = <span style=\"color: blue\">'urn:iso:std:iso:3166'</span> <i>&quot;SetCountryCodeSystem&quot;</i><span style=\"color: navy\">;</span>\r\n          nationality<span style=\"color: navy\"><b> -&gt; </b></span>coding.code = <span style=\"color: maroon\">nationality</span> <i>&quot;SetCountryCodeCode&quot;</i><span style=\"color: navy\">;</span>\r\n        <span style=\"color: navy\">}</span> <i>&quot;SetCountryCodeCoding&quot;</i><span style=\"color: navy\">;</span>\r\n      <span style=\"color: navy\">}</span> <i>&quot;ProcessCountryCodeCodeableConcept&quot;</i><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;ProcessCountryCode&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" : "http://jembi.org/fhir/StructureMap/CHTPatientToFHIRR4Patient",
  "version" : "1.0.1",
  "name" : "CHTPatientToFHIRR4Patient",
  "status" : "draft",
  "date" : "2024-11-08T15:08:21+02:00",
  "publisher" : "Jembi Health Systems",
  "contact" : [
    {
      "name" : "Jembi Health Systems",
      "telecom" : [
        {
          "system" : "url",
          "value" : "https://www.jembi.org/"
        },
        {
          "system" : "email",
          "value" : "info@jembi.org"
        }
      ]
    },
    {
      "name" : "Richard Langford",
      "telecom" : [
        {
          "system" : "email",
          "value" : "richard.langford@jembi.org",
          "use" : "work"
        }
      ]
    }
  ],
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code" : "001",
          "display" : "World"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://jembi.org/fhir/StructureDefinition/CHTPatientLogicalModel",
      "mode" : "source"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Patient",
      "mode" : "target"
    }
  ],
  "group" : [
    {
      "name" : "CHTPatientToFHIRR4Patient",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "CHTPatientLogicalModel",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "type" : "Patient",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "SetPatientResourceId",
          "source" : [
            {
              "context" : "src",
              "element" : "_id",
              "variable" : "srcID"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "id",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueId" : "srcID"
                }
              ]
            }
          ]
        },
        {
          "name" : "name",
          "source" : [
            {
              "context" : "src",
              "element" : "name",
              "variable" : "srcName"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "name",
              "variable" : "pName"
            }
          ],
          "rule" : [
            {
              "name" : "SetPatientFullName",
              "source" : [
                {
                  "context" : "srcName"
                }
              ],
              "target" : [
                {
                  "context" : "pName",
                  "contextType" : "variable",
                  "element" : "text",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "srcName"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "phone",
          "source" : [
            {
              "context" : "src",
              "element" : "phone",
              "variable" : "srcPhoneNumber"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "telecom",
              "variable" : "pTelecom"
            }
          ],
          "rule" : [
            {
              "name" : "SetPatientTelecomCodeAsPhone",
              "source" : [
                {
                  "context" : "srcPhoneNumber"
                }
              ],
              "target" : [
                {
                  "context" : "pTelecom",
                  "contextType" : "variable",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "phone"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetPatientTelecomValue",
              "source" : [
                {
                  "context" : "srcPhoneNumber"
                }
              ],
              "target" : [
                {
                  "context" : "pTelecom",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "srcPhoneNumber"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetPatientBirthDate",
          "source" : [
            {
              "context" : "src",
              "element" : "date_of_birth",
              "variable" : "dob"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "birthDate",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueId" : "dob"
                }
              ]
            }
          ]
        },
        {
          "name" : "SetPatientGender",
          "source" : [
            {
              "context" : "src",
              "element" : "sex",
              "variable" : "sex"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "gender",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueId" : "sex"
                }
              ]
            }
          ]
        },
        {
          "name" : "patientId",
          "source" : [
            {
              "context" : "src",
              "element" : "patient_id",
              "variable" : "srcBusinessID"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "identifier",
              "variable" : "tgtBusinessID"
            }
          ],
          "rule" : [
            {
              "name" : "SetBusinessIDValue",
              "source" : [
                {
                  "context" : "srcBusinessID"
                }
              ],
              "target" : [
                {
                  "context" : "tgtBusinessID",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "srcBusinessID"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "nationality",
          "source" : [
            {
              "context" : "src",
              "element" : "nationality",
              "variable" : "nationality"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "extension",
              "variable" : "nationalityExt",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Extension"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "SetNationalityUrl",
              "source" : [
                {
                  "context" : "nationality"
                }
              ],
              "target" : [
                {
                  "context" : "nationalityExt",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "http://hl7.org/fhir/StructureDefinition/patient-nationality"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "ProcessCountryCode",
              "source" : [
                {
                  "context" : "nationality"
                }
              ],
              "target" : [
                {
                  "context" : "nationalityExt",
                  "contextType" : "variable",
                  "element" : "extension",
                  "variable" : "countryCodeExtension",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Extension"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "SetCountryCodeUrl",
                  "source" : [
                    {
                      "context" : "nationality"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "countryCodeExtension",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "code"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "ProcessCountryCodeCodeableConcept",
                  "source" : [
                    {
                      "context" : "nationality"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "countryCodeExtension",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "countryCode",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "CodeableConcept"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "SetCountryCodeCoding",
                      "source" : [
                        {
                          "context" : "nationality"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "countryCode",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "coding",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Coding"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "SetCountryCodeSystem",
                          "source" : [
                            {
                              "context" : "nationality"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "urn:iso:std:iso:3166"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "SetCountryCodeCode",
                          "source" : [
                            {
                              "context" : "nationality"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "nationality"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}