Social Care Interoperability Platform FHIR Implementation Guide
Version: 0.1.0, Status: draft

Social Care Interoperability Platform FHIR Implementation Guide - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

: RegistrationToPatient - XML Representation

Draft as of 2026-06-10

Raw xml | Download


<StructureMap xmlns="http://hl7.org/fhir">
  <id value="Registration-Patient"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap Registration-Patient</b></p><a name="Registration-Patient"> </a><a name="hcRegistration-Patient"> </a><pre class="fml">
<b>map</b><span style="color: navy"> &quot;</span>https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/Registration-Patient<span style="color: navy">&quot; = &quot;</span>RegistrationToPatient<span style="color: navy">&quot;

</span><b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-MODS-SubjectOfCareRegistration.html" title="MODS Subject of Care Registration">https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-SubjectOfCareRegistration</a><span style="color: navy">&quot; </span><b>alias </b>Registration <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-MODS-Patient.html" title="MODS Patient">https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-Patient</a><span style="color: navy">&quot; </span><b>alias </b>Patient <b>as </b><b>target</b>

<b>group </b>RegistrationPatient<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>Registration, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Patient<span style="color: navy">)</span><span style="color: navy"> {
</span>  src<span style="color: navy"><b> -&gt; </b></span>tgt.id = evaluate<span style="color: navy">(</span>src<span style="color: navy">, </span>subjectOfCareId<span style="color: navy">)</span> <i>&quot;00e9f63a-468b-4175-abc3-425edb549da1&quot;</i><span style="color: navy">;</span>
  src.sex<b> as </b><span style="color: maroon">sex</span><span style="color: navy">, </span>sex.code<b> as </b><span style="color: maroon">sexCode</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>src.sex = <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">sxvt</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>sxvt.code = <span style="color: maroon">sexCode</span> <i>&quot;c52db195-f186-48a1-933f-6a375e486853&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>sxvt.system = <span style="color: blue">'https://data.digitisingsocialcare.co.uk/mods/v1/person-sex'</span> <i>&quot;128d701d-9bb2-4aa9-a6dc-1ce75928002c&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>tgt.extension<b> as </b><span style="color: maroon">birthSexExt</span><b> then</b><span style="color: navy"> {
</span>        src<span style="color: navy"><b> -&gt; </b></span>birthSexExt.url = <span style="color: blue">'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex'</span> <i>&quot;8a0d3b39-8704-4f01-b2e6-62eb860f2548&quot;</i><span style="color: navy">;</span>
        src<span style="color: navy"><b> -&gt; </b></span>birthSexExt.valueCodeableConcept = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">sxvt</span><span style="color: navy">, </span><span style="color: blue">'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRBirthSex-1'</span><span style="color: navy">, </span><span style="color: blue">'CodeableConcept'</span><span style="color: navy">)</span> <i>&quot;76144650-bd83-480b-ba62-8f1a27bc3d64&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;9f7da33c-8344-4704-91c2-0b57ef007b68&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;7d587212-b486-4a2c-b645-57388f72da76&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setPatientBirthSex&quot;</i><span style="color: navy">;</span>
  src.genderIdentity<b> as </b><span style="color: maroon">genderIdentity</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>tgt.extension<b> as </b><span style="color: maroon">genderIdentityExt</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>genderIdentityExt.url = <span style="color: blue">'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonGenderIdentity'</span> <i>&quot;b86ee800-a7b3-4b6c-8b0a-e4b74a8da793&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>genderIdentityExt.valueCodeableConcept<b> as </b><span style="color: maroon">genderIdentityCode</span><b> then</b><span style="color: navy"> {
</span>        src<span style="color: navy"><b> -&gt; </b></span>genderIdentityCode.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span>          src<span style="color: navy"><b> -&gt; </b></span>coding.system = <span style="color: blue">'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-PersonGenderIdentityCode-1'</span> <i>&quot;471a74e1-4d16-48c3-adb5-6dd9403cdf03&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.code = evaluate<span style="color: navy">(</span>genderIdentity<span style="color: navy">, </span>code<span style="color: navy">)</span> <i>&quot;d5ef49e5-6c57-447f-9de2-e055041d7881&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.display = evaluate<span style="color: navy">(</span>genderIdentity<span style="color: navy">, </span>display<span style="color: navy">)</span> <i>&quot;e5a014da-130e-4496-a9bd-276391634ab7&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;9317e171-7bb6-4a17-b555-85e8ae068abe&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;70d24b7d-08a0-47f8-b0c6-8cd12bc5db69&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;7cabef6e-d447-4163-a30e-fcaa8d609684&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setGenderIdentity&quot;</i><span style="color: navy">;</span>
  src.ethnicity<b> as </b><span style="color: maroon">ethnicity</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>tgt.extension<b> as </b><span style="color: maroon">ethnicityExt</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>ethnicityExt.url = <span style="color: blue">'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory'</span> <i>&quot;e0d8ae9b-6278-4eec-9c10-98b3dd3a1817&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>ethnicityExt.valueCodeableConcept<b> as </b><span style="color: maroon">ethnicCategory</span><b> then</b><span style="color: navy"> {
</span>        src<span style="color: navy"><b> -&gt; </b></span>ethnicCategory.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span>          src<span style="color: navy"><b> -&gt; </b></span>coding.system = <span style="color: blue">'https://fhir.hl7.org.uk/CodeSystem/UKCore-EthnicCategoryEngland'</span> <i>&quot;1474ddfc-6586-45cc-b540-9c68116b8314&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.code = evaluate<span style="color: navy">(</span>ethnicity<span style="color: navy">, </span>code<span style="color: navy">)</span> <i>&quot;b2331ab1-2f78-435a-9edc-f56e4cbbd91e&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.display = evaluate<span style="color: navy">(</span>ethnicity<span style="color: navy">, </span>display<span style="color: navy">)</span> <i>&quot;84e9148b-6a7a-4893-a095-4dbf191acd5f&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;42214afe-5a03-49f4-890b-8ee3b98db43d&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;0e9fe38e-4162-4245-9c27-403b9c496b7b&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;ef28cd78-9d21-4ae1-833f-706c456229e9&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setPatientEthnicity&quot;</i><span style="color: navy">;</span>
  src.religion<b> as </b><span style="color: maroon">religion</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>tgt.extension<b> as </b><span style="color: maroon">religionExt</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>religionExt.url = <span style="color: blue">'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonReligiousAffiliation'</span> <i>&quot;17ec9060-a1d9-48bf-b366-727208c2868a&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>religionExt.valueCodeableConcept<b> as </b><span style="color: maroon">ethnicCategory</span><b> then</b><span style="color: navy"> {
</span>        src<span style="color: navy"><b> -&gt; </b></span>ethnicCategory.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span>          src<span style="color: navy"><b> -&gt; </b></span>coding.system = <span style="color: blue">'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-PersonReligionCode-1'</span> <i>&quot;1d8f0381-738b-4b3f-9a34-ad5092bfa80a&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.code = evaluate<span style="color: navy">(</span>religion<span style="color: navy">, </span>code<span style="color: navy">)</span> <i>&quot;7dfb7972-d926-4152-ac31-72600f055196&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.display = evaluate<span style="color: navy">(</span>religion<span style="color: navy">, </span>display<span style="color: navy">)</span> <i>&quot;a70f09c6-7e3d-4c16-801f-92643f80701d&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;f68dbcd8-6074-47e1-860b-e8ee5a635e82&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;fc88e5fc-2c0f-4bd5-9ac0-834ff55662f0&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;68091bd6-0439-4363-b00d-22fd5e412d36&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setPatientReligion&quot;</i><span style="color: navy">;</span>
  src.sexualOrientation<b> as </b><span style="color: maroon">sexualOrientation</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>tgt.extension<b> as </b><span style="color: maroon">sexualOrientationExt</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>sexualOrientationExt.url = <span style="color: blue">'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonSexualOrientation'</span> <i>&quot;7c361efe-dab9-400b-b8c0-7156638e315f&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>sexualOrientationExt.valueCodeableConcept<b> as </b><span style="color: maroon">sexualOrientationCode</span><b> then</b><span style="color: navy"> {
</span>        src<span style="color: navy"><b> -&gt; </b></span>sexualOrientationCode.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span>          src<span style="color: navy"><b> -&gt; </b></span>coding.system = <span style="color: blue">'http://snomed.info/ct'</span> <i>&quot;b1e7d3a7-c725-43fd-b1c8-4605003c63dc&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.code = evaluate<span style="color: navy">(</span>sexualOrientation<span style="color: navy">, </span>code<span style="color: navy">)</span> <i>&quot;43f81d80-fbea-4d34-9dbc-be6769829e79&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.display = evaluate<span style="color: navy">(</span>sexualOrientation<span style="color: navy">, </span>display<span style="color: navy">)</span> <i>&quot;01541caa-5251-4da2-a1bc-b4fec6ca6042&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;2843a89d-3428-4b03-b6e9-4ef3f5252d4c&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;5cf21372-9aaf-48c6-a31c-9901eb4c9b7a&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;f3827207-622c-4204-90fa-7c4932b33a90&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setPatientSexualOrientation&quot;</i><span style="color: navy">;</span>
  src<span style="color: navy"><b> -&gt; </b></span>tgt.name<b> as </b><span style="color: maroon">name</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>name.given = evaluate<span style="color: navy">(</span>src<span style="color: navy">, </span>name.given<span style="color: navy">)</span> <i>&quot;33148443-014d-4b2e-9664-91371189e7e8&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>name.family = evaluate<span style="color: navy">(</span>src<span style="color: navy">, </span>name.family<span style="color: navy">)</span> <i>&quot;4b733097-8d89-4f65-9f53-2cae271dc983&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setPatientName&quot;</i><span style="color: navy">;</span>
  src.nhsNumber<span style="color: navy"><b> -&gt; </b></span>tgt.identifier<b> as </b><span style="color: maroon">identifier</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>identifier.use = <span style="color: blue">'official'</span> <i>&quot;573aa6d2-e287-4c7f-9384-6ed32cec632b&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>identifier.system = <span style="color: blue">'https://fhir.nhs.uk/Id/nhs-number'</span> <i>&quot;9cd57652-c970-49db-b18f-47fa45fb0a4c&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>identifier.value = evaluate<span style="color: navy">(</span>src<span style="color: navy">, </span>nhsNumber.value<span style="color: navy">)</span> <i>&quot;fe123ed3-ce6e-4002-ac19-559779b0a7b3&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>identifier.extension<b> as </b><span style="color: maroon">extension</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>extension.url = <span style="color: blue">'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus'</span> <i>&quot;9987c016-c7e0-4ba5-b06d-c85de0e59322&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>extension.valueCodeableConcept<b> as </b><span style="color: maroon">cc</span><b> then</b><span style="color: navy"> {
</span>        src<span style="color: navy"><b> -&gt; </b></span>cc.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span>          src<span style="color: navy"><b> -&gt; </b></span>coding.system = <span style="color: blue">'https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland'</span> <i>&quot;d893cec9-c410-4293-a466-b169183536ec&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.code = evaluate<span style="color: navy">(</span>src<span style="color: navy">, </span>nhsNumber.statusIndicator.code<span style="color: navy">)</span> <i>&quot;dd735001-5d09-4a94-8cb1-449e1605b376&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>coding.display = evaluate<span style="color: navy">(</span>src<span style="color: navy">, </span>nhsNumber.statusIndicator.display<span style="color: navy">)</span> <i>&quot;d553d674-ecc8-4db5-93aa-e6d02d52e5a8&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;fad70144-5c22-47f1-b8d9-772bb8d9c10b&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;2cc64160-b0e1-42b0-bc94-d7205fb7fbf8&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;fd0f942f-748d-4eba-b3be-2698c0c536c8&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setPatientNHSNumber&quot;</i><span style="color: navy">;</span>
  src.nationalInsuranceNumber<b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>tgt.identifier<b> as </b><span style="color: maroon">id</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>id.system = <span style="color: blue">'https://fhir.hl7.org.uk/Id/nino'</span> <i>&quot;af99e76d-a473-45df-9554-fab9b6e2db70&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>id.value = evaluate<span style="color: navy">(</span>src<span style="color: navy">, </span>nationalInsuranceNumber<span style="color: navy">)</span> <i>&quot;8bb8bee1-c411-4737-a6c4-206df83420bd&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;d98a25d4-6e0a-436c-88d5-c2aed2a5f808&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setNationalInsuranceNumber&quot;</i><span style="color: navy">;</span>
  src.otherIdentifier<b> as </b><span style="color: maroon">otherIdentifier</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>tgt.identifier<b> as </b><span style="color: maroon">id</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>id.system = evaluate<span style="color: navy">(</span>otherIdentifier<span style="color: navy">, </span>system<span style="color: navy">)</span> <i>&quot;d347873f-b4bf-4e69-809f-5c2c7ba24d4b&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>id.value = evaluate<span style="color: navy">(</span>otherIdentifier<span style="color: navy">, </span>value<span style="color: navy">)</span> <i>&quot;b0d25559-a31f-41d7-9ea9-bcfece6b05a3&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;f9550172-88f7-406a-bc70-3e9c2a8e1366&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setOtherPatientIdentifier&quot;</i><span style="color: navy">;</span>
  src.dateOfBirth<span style="color: navy"><b> -&gt; </b></span>tgt.birthDate <i>&quot;setPatientBirthDate&quot;</i><span style="color: navy">;</span>
  src.genderIdentity<b> as </b><span style="color: maroon">genderIdentity</span><span style="color: navy">, </span>genderIdentity.code<b> as </b><span style="color: maroon">genderIdentityCode</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>src.genderIdentity = <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">givt</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>givt.code = <span style="color: maroon">genderIdentityCode</span> <i>&quot;2c2eb2c2-e116-4813-854b-c0303a8ed669&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>givt.system = <span style="color: blue">'https://data.digitisingsocialcare.co.uk/mods/v1/person-gender-identity'</span> <i>&quot;37db9c93-e35e-41c3-bd16-71f7db7076b6&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>tgt.gender = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">givt</span><span style="color: navy">, </span><span style="color: blue">'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRGenderIdentity-1'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span> <i>&quot;c73e52e2-26db-452e-b753-8dec5de29f62&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;f52f22ab-1fdc-49cc-80b6-89df56379917&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setPatientGender&quot;</i><span style="color: navy">;</span>
  src.maritalStatus<b> as </b><span style="color: maroon">maritalStatus</span><span style="color: navy">, </span>maritalStatus.code<b> as </b><span style="color: maroon">maritalStatusCode</span><span style="color: navy">, </span>maritalStatus.display<b> as </b><span style="color: maroon">maritalStatusDisplay</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span> tgt.maritalStatus = <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">msvt</span><span style="color: navy">, </span> msvt.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">maritalStatusCoding</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>maritalStatusCoding.system = <span style="color: blue">'https://fhir.hl7.org.uk/CodeSystem/UKCore-PersonMaritalStatusEngland'</span> <i>&quot;ab18a1f6-745b-42c4-b400-38e6d05c56d0&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>maritalStatusCoding.code = <span style="color: maroon">maritalStatusCode</span> <i>&quot;72816b02-924e-4d89-98c7-785d2441d31b&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>maritalStatusCoding.display = <span style="color: maroon">maritalStatusDisplay</span> <i>&quot;484279ce-793c-4f99-87b6-bf2ff3d8146e&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;189232f8-2b7d-4a39-9cc6-84adb84f99cc&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setPatientMaritalStatus&quot;</i><span style="color: navy">;</span>
  src.homeAddress<b> as </b><span style="color: maroon">address</span><b> where </b>$this.country.empty().not()<span style="color: navy"><b> -&gt; </b></span>tgt.address<b> as </b><span style="color: maroon">addr</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>addr.line = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>addressEntry1<span style="color: navy">)</span> <i>&quot;4fba9702-9a20-4c00-b648-92280ab14dc7&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.line = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>addressEntry2<span style="color: navy">)</span> <i>&quot;06f68e76-bfd1-45c3-9755-98cf21ec13d6&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.line = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>addressEntry3<span style="color: navy">)</span> <i>&quot;b92088b6-c7f1-49e4-9844-1dd096e9adb1&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.line = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>addressEntry4<span style="color: navy">)</span> <i>&quot;cf465f0f-f5ac-40a1-8d2b-76d6e7f60e55&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.postalCode = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>postCode<span style="color: navy">)</span> <i>&quot;b9fde70f-e324-41b1-b4b8-d52da30aef6f&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.country = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>country.display<span style="color: navy">)</span> <i>&quot;d28de831-c35b-471b-8840-8ed66ff15072&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.extension<b> as </b><span style="color: maroon">extension</span><b> then</b><span style="color: navy"> {
</span>      src<span style="color: navy"><b> -&gt; </b></span>extension.url = <span style="color: blue">'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-AddressCountry'</span> <i>&quot;c1d8a98c-fb31-46f1-b788-92d6ea7a28e5&quot;</i><span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>extension.valueCoding<b> as </b><span style="color: maroon">countryCoding</span><b> then</b><span style="color: navy"> {
</span>        src<span style="color: navy"><b> -&gt; </b></span>countryCoding.system = <span style="color: blue">'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-Country-1'</span> <i>&quot;fec84c6b-7457-49db-9220-c2d159ec1f4c&quot;</i><span style="color: navy">;</span>
        src<span style="color: navy"><b> -&gt; </b></span>countryCoding.code = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>country.code<span style="color: navy">)</span> <i>&quot;e9b214b1-21a7-448a-b4f2-b3ac053025f0&quot;</i><span style="color: navy">;</span>
        src<span style="color: navy"><b> -&gt; </b></span>countryCoding.display = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>country.display<span style="color: navy">)</span> <i>&quot;38236b3c-20a0-4bd6-bd71-ceeec9892684&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;c9d395c8-d66e-43ea-978f-2845ad8ec6cb&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;35cd9065-54d7-41ce-88d2-1219c4140f80&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setExtendedPatientAddress&quot;</i><span style="color: navy">;</span>
  src.homeAddress<b> as </b><span style="color: maroon">address</span><b> where </b>$this.country.empty()<span style="color: navy"><b> -&gt; </b></span>tgt.address<b> as </b><span style="color: maroon">addr</span><b> then</b><span style="color: navy"> {
</span>    src<span style="color: navy"><b> -&gt; </b></span>addr.line = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>addressEntry1<span style="color: navy">)</span> <i>&quot;c98b2bba-177b-4fe2-bc52-4f44dbc3c9f4&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.line = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>addressEntry2<span style="color: navy">)</span> <i>&quot;4fff75a4-23c2-4c35-9f77-8589de7f71d8&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.line = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>addressEntry3<span style="color: navy">)</span> <i>&quot;43620999-78ac-449f-b3d7-5bbad9e8cb26&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.line = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>addressEntry4<span style="color: navy">)</span> <i>&quot;00caee37-21ea-4bde-92e5-08a685c280c4&quot;</i><span style="color: navy">;</span>
    src<span style="color: navy"><b> -&gt; </b></span>addr.postalCode = evaluate<span style="color: navy">(</span>address<span style="color: navy">, </span>postCode<span style="color: navy">)</span> <i>&quot;38fe9452-ee4b-4cbf-b645-460a714c7d53&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;setPatientAddress&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <url
       value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/Registration-Patient"/>
  <version value="0.1.0"/>
  <name value="RegistrationToPatient"/>
  <status value="draft"/>
  <date value="2026-06-10T19:05:58+00:00"/>
  <publisher
             value="Synanetics Ltd on behalf of DHSC/Social Care Interoperability Platform"/>
  <contact>
    <name
          value="Synanetics Ltd on behalf of DHSC/Social Care Interoperability Platform"/>
    <telecom>
      <system value="url"/>
      <value value="https://synanetics.com"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="info@synanetics.com"/>
    </telecom>
  </contact>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="GB"/>
      <display value="United Kingdom of Great Britain and Northern Ireland"/>
    </coding>
  </jurisdiction>
  <structure>
    <url
         value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-SubjectOfCareRegistration"/>
    <mode value="source"/>
    <alias value="Registration"/>
  </structure>
  <structure>
    <url
         value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-Patient"/>
    <mode value="target"/>
    <alias value="Patient"/>
  </structure>
  <group>
    <name value="RegistrationPatient"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="Registration"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="Patient"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="00e9f63a-468b-4175-abc3-425edb549da1"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="evaluate"/>
        <parameter>
          <valueId value="src"/>
        </parameter>
        <parameter>
          <valueString value="subjectOfCareId"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="setPatientBirthSex"/>
      <source>
        <context value="src"/>
        <element value="sex"/>
        <variable value="sex"/>
      </source>
      <source>
        <context value="sex"/>
        <element value="code"/>
        <variable value="sexCode"/>
      </source>
      <rule>
        <name value="7d587212-b486-4a2c-b645-57388f72da76"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="src"/>
          <contextType value="variable"/>
          <element value="sex"/>
          <variable value="sxvt"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Coding"/>
          </parameter>
        </target>
        <rule>
          <name value="c52db195-f186-48a1-933f-6a375e486853"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="sxvt"/>
            <contextType value="variable"/>
            <element value="code"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="sexCode"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="128d701d-9bb2-4aa9-a6dc-1ce75928002c"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="sxvt"/>
            <contextType value="variable"/>
            <element value="system"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://data.digitisingsocialcare.co.uk/mods/v1/person-sex"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="9f7da33c-8344-4704-91c2-0b57ef007b68"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="extension"/>
            <variable value="birthSexExt"/>
          </target>
          <rule>
            <name value="8a0d3b39-8704-4f01-b2e6-62eb860f2548"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="birthSexExt"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="copy"/>
              <parameter>
                <valueString
                             value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="76144650-bd83-480b-ba62-8f1a27bc3d64"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="birthSexExt"/>
              <contextType value="variable"/>
              <element value="valueCodeableConcept"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="sxvt"/>
              </parameter>
              <parameter>
                <valueString
                             value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRBirthSex-1"/>
              </parameter>
              <parameter>
                <valueString value="CodeableConcept"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setGenderIdentity"/>
      <source>
        <context value="src"/>
        <element value="genderIdentity"/>
        <variable value="genderIdentity"/>
      </source>
      <rule>
        <name value="7cabef6e-d447-4163-a30e-fcaa8d609684"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="genderIdentityExt"/>
        </target>
        <rule>
          <name value="b86ee800-a7b3-4b6c-8b0a-e4b74a8da793"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="genderIdentityExt"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonGenderIdentity"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="70d24b7d-08a0-47f8-b0c6-8cd12bc5db69"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="genderIdentityExt"/>
            <contextType value="variable"/>
            <element value="valueCodeableConcept"/>
            <variable value="genderIdentityCode"/>
          </target>
          <rule>
            <name value="9317e171-7bb6-4a17-b555-85e8ae068abe"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="genderIdentityCode"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
            </target>
            <rule>
              <name value="471a74e1-4d16-48c3-adb5-6dd9403cdf03"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-PersonGenderIdentityCode-1"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="d5ef49e5-6c57-447f-9de2-e055041d7881"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="genderIdentity"/>
                </parameter>
                <parameter>
                  <valueString value="code"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="e5a014da-130e-4496-a9bd-276391634ab7"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="display"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="genderIdentity"/>
                </parameter>
                <parameter>
                  <valueString value="display"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setPatientEthnicity"/>
      <source>
        <context value="src"/>
        <element value="ethnicity"/>
        <variable value="ethnicity"/>
      </source>
      <rule>
        <name value="ef28cd78-9d21-4ae1-833f-706c456229e9"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="ethnicityExt"/>
        </target>
        <rule>
          <name value="e0d8ae9b-6278-4eec-9c10-98b3dd3a1817"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="ethnicityExt"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="0e9fe38e-4162-4245-9c27-403b9c496b7b"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="ethnicityExt"/>
            <contextType value="variable"/>
            <element value="valueCodeableConcept"/>
            <variable value="ethnicCategory"/>
          </target>
          <rule>
            <name value="42214afe-5a03-49f4-890b-8ee3b98db43d"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="ethnicCategory"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
            </target>
            <rule>
              <name value="1474ddfc-6586-45cc-b540-9c68116b8314"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="https://fhir.hl7.org.uk/CodeSystem/UKCore-EthnicCategoryEngland"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="b2331ab1-2f78-435a-9edc-f56e4cbbd91e"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="ethnicity"/>
                </parameter>
                <parameter>
                  <valueString value="code"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="84e9148b-6a7a-4893-a095-4dbf191acd5f"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="display"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="ethnicity"/>
                </parameter>
                <parameter>
                  <valueString value="display"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setPatientReligion"/>
      <source>
        <context value="src"/>
        <element value="religion"/>
        <variable value="religion"/>
      </source>
      <rule>
        <name value="68091bd6-0439-4363-b00d-22fd5e412d36"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="religionExt"/>
        </target>
        <rule>
          <name value="17ec9060-a1d9-48bf-b366-727208c2868a"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="religionExt"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonReligiousAffiliation"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="fc88e5fc-2c0f-4bd5-9ac0-834ff55662f0"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="religionExt"/>
            <contextType value="variable"/>
            <element value="valueCodeableConcept"/>
            <variable value="ethnicCategory"/>
          </target>
          <rule>
            <name value="f68dbcd8-6074-47e1-860b-e8ee5a635e82"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="ethnicCategory"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
            </target>
            <rule>
              <name value="1d8f0381-738b-4b3f-9a34-ad5092bfa80a"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-PersonReligionCode-1"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="7dfb7972-d926-4152-ac31-72600f055196"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="religion"/>
                </parameter>
                <parameter>
                  <valueString value="code"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="a70f09c6-7e3d-4c16-801f-92643f80701d"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="display"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="religion"/>
                </parameter>
                <parameter>
                  <valueString value="display"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setPatientSexualOrientation"/>
      <source>
        <context value="src"/>
        <element value="sexualOrientation"/>
        <variable value="sexualOrientation"/>
      </source>
      <rule>
        <name value="f3827207-622c-4204-90fa-7c4932b33a90"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="sexualOrientationExt"/>
        </target>
        <rule>
          <name value="7c361efe-dab9-400b-b8c0-7156638e315f"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="sexualOrientationExt"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonSexualOrientation"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="5cf21372-9aaf-48c6-a31c-9901eb4c9b7a"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="sexualOrientationExt"/>
            <contextType value="variable"/>
            <element value="valueCodeableConcept"/>
            <variable value="sexualOrientationCode"/>
          </target>
          <rule>
            <name value="2843a89d-3428-4b03-b6e9-4ef3f5252d4c"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="sexualOrientationCode"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
            </target>
            <rule>
              <name value="b1e7d3a7-c725-43fd-b1c8-4605003c63dc"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="http://snomed.info/ct"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="43f81d80-fbea-4d34-9dbc-be6769829e79"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="sexualOrientation"/>
                </parameter>
                <parameter>
                  <valueString value="code"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="01541caa-5251-4da2-a1bc-b4fec6ca6042"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="display"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="sexualOrientation"/>
                </parameter>
                <parameter>
                  <valueString value="display"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setPatientName"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="name"/>
        <variable value="name"/>
      </target>
      <rule>
        <name value="33148443-014d-4b2e-9664-91371189e7e8"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="name"/>
          <contextType value="variable"/>
          <element value="given"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="src"/>
          </parameter>
          <parameter>
            <valueString value="name.given"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="4b733097-8d89-4f65-9f53-2cae271dc983"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="name"/>
          <contextType value="variable"/>
          <element value="family"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="src"/>
          </parameter>
          <parameter>
            <valueString value="name.family"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="setPatientNHSNumber"/>
      <source>
        <context value="src"/>
        <element value="nhsNumber"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="identifier"/>
      </target>
      <rule>
        <name value="573aa6d2-e287-4c7f-9384-6ed32cec632b"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="identifier"/>
          <contextType value="variable"/>
          <element value="use"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="official"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="9cd57652-c970-49db-b18f-47fa45fb0a4c"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="identifier"/>
          <contextType value="variable"/>
          <element value="system"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="https://fhir.nhs.uk/Id/nhs-number"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="fe123ed3-ce6e-4002-ac19-559779b0a7b3"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="identifier"/>
          <contextType value="variable"/>
          <element value="value"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="src"/>
          </parameter>
          <parameter>
            <valueString value="nhsNumber.value"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="fd0f942f-748d-4eba-b3be-2698c0c536c8"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="identifier"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="extension"/>
        </target>
        <rule>
          <name value="9987c016-c7e0-4ba5-b06d-c85de0e59322"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="extension"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="2cc64160-b0e1-42b0-bc94-d7205fb7fbf8"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="extension"/>
            <contextType value="variable"/>
            <element value="valueCodeableConcept"/>
            <variable value="cc"/>
          </target>
          <rule>
            <name value="fad70144-5c22-47f1-b8d9-772bb8d9c10b"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="cc"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
            </target>
            <rule>
              <name value="d893cec9-c410-4293-a466-b169183536ec"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="dd735001-5d09-4a94-8cb1-449e1605b376"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="src"/>
                </parameter>
                <parameter>
                  <valueString value="nhsNumber.statusIndicator.code"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="d553d674-ecc8-4db5-93aa-e6d02d52e5a8"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="display"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueId value="src"/>
                </parameter>
                <parameter>
                  <valueString value="nhsNumber.statusIndicator.display"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setNationalInsuranceNumber"/>
      <source>
        <context value="src"/>
        <element value="nationalInsuranceNumber"/>
      </source>
      <rule>
        <name value="d98a25d4-6e0a-436c-88d5-c2aed2a5f808"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="identifier"/>
          <variable value="id"/>
        </target>
        <rule>
          <name value="af99e76d-a473-45df-9554-fab9b6e2db70"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="id"/>
            <contextType value="variable"/>
            <element value="system"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="https://fhir.hl7.org.uk/Id/nino"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="8bb8bee1-c411-4737-a6c4-206df83420bd"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="id"/>
            <contextType value="variable"/>
            <element value="value"/>
            <transform value="evaluate"/>
            <parameter>
              <valueId value="src"/>
            </parameter>
            <parameter>
              <valueString value="nationalInsuranceNumber"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setOtherPatientIdentifier"/>
      <source>
        <context value="src"/>
        <element value="otherIdentifier"/>
        <variable value="otherIdentifier"/>
      </source>
      <rule>
        <name value="f9550172-88f7-406a-bc70-3e9c2a8e1366"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="identifier"/>
          <variable value="id"/>
        </target>
        <rule>
          <name value="d347873f-b4bf-4e69-809f-5c2c7ba24d4b"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="id"/>
            <contextType value="variable"/>
            <element value="system"/>
            <transform value="evaluate"/>
            <parameter>
              <valueId value="otherIdentifier"/>
            </parameter>
            <parameter>
              <valueString value="system"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="b0d25559-a31f-41d7-9ea9-bcfece6b05a3"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="id"/>
            <contextType value="variable"/>
            <element value="value"/>
            <transform value="evaluate"/>
            <parameter>
              <valueId value="otherIdentifier"/>
            </parameter>
            <parameter>
              <valueString value="value"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setPatientBirthDate"/>
      <source>
        <context value="src"/>
        <element value="dateOfBirth"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="birthDate"/>
      </target>
    </rule>
    <rule>
      <name value="setPatientGender"/>
      <source>
        <context value="src"/>
        <element value="genderIdentity"/>
        <variable value="genderIdentity"/>
      </source>
      <source>
        <context value="genderIdentity"/>
        <element value="code"/>
        <variable value="genderIdentityCode"/>
      </source>
      <rule>
        <name value="f52f22ab-1fdc-49cc-80b6-89df56379917"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="src"/>
          <contextType value="variable"/>
          <element value="genderIdentity"/>
          <variable value="givt"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Coding"/>
          </parameter>
        </target>
        <rule>
          <name value="2c2eb2c2-e116-4813-854b-c0303a8ed669"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="givt"/>
            <contextType value="variable"/>
            <element value="code"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="genderIdentityCode"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="37db9c93-e35e-41c3-bd16-71f7db7076b6"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="givt"/>
            <contextType value="variable"/>
            <element value="system"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://data.digitisingsocialcare.co.uk/mods/v1/person-gender-identity"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="c73e52e2-26db-452e-b753-8dec5de29f62"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="gender"/>
            <transform value="translate"/>
            <parameter>
              <valueId value="givt"/>
            </parameter>
            <parameter>
              <valueString
                           value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRGenderIdentity-1"/>
            </parameter>
            <parameter>
              <valueString value="code"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setPatientMaritalStatus"/>
      <source>
        <context value="src"/>
        <element value="maritalStatus"/>
        <variable value="maritalStatus"/>
      </source>
      <source>
        <context value="maritalStatus"/>
        <element value="code"/>
        <variable value="maritalStatusCode"/>
      </source>
      <source>
        <context value="maritalStatus"/>
        <element value="display"/>
        <variable value="maritalStatusDisplay"/>
      </source>
      <rule>
        <name value="189232f8-2b7d-4a39-9cc6-84adb84f99cc"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="maritalStatus"/>
          <variable value="msvt"/>
          <transform value="create"/>
          <parameter>
            <valueString value="CodeableConcept"/>
          </parameter>
        </target>
        <target>
          <context value="msvt"/>
          <contextType value="variable"/>
          <element value="coding"/>
          <variable value="maritalStatusCoding"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Coding"/>
          </parameter>
        </target>
        <rule>
          <name value="ab18a1f6-745b-42c4-b400-38e6d05c56d0"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="maritalStatusCoding"/>
            <contextType value="variable"/>
            <element value="system"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://fhir.hl7.org.uk/CodeSystem/UKCore-PersonMaritalStatusEngland"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="72816b02-924e-4d89-98c7-785d2441d31b"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="maritalStatusCoding"/>
            <contextType value="variable"/>
            <element value="code"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="maritalStatusCode"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="484279ce-793c-4f99-87b6-bf2ff3d8146e"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="maritalStatusCoding"/>
            <contextType value="variable"/>
            <element value="display"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="maritalStatusDisplay"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setExtendedPatientAddress"/>
      <source>
        <context value="src"/>
        <element value="homeAddress"/>
        <variable value="address"/>
        <condition value="$this.country.empty().not()"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="address"/>
        <variable value="addr"/>
      </target>
      <rule>
        <name value="4fba9702-9a20-4c00-b648-92280ab14dc7"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="line"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="addressEntry1"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="06f68e76-bfd1-45c3-9755-98cf21ec13d6"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="line"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="addressEntry2"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="b92088b6-c7f1-49e4-9844-1dd096e9adb1"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="line"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="addressEntry3"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="cf465f0f-f5ac-40a1-8d2b-76d6e7f60e55"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="line"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="addressEntry4"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="b9fde70f-e324-41b1-b4b8-d52da30aef6f"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="postalCode"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="postCode"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="d28de831-c35b-471b-8840-8ed66ff15072"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="country"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="country.display"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="35cd9065-54d7-41ce-88d2-1219c4140f80"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="extension"/>
        </target>
        <rule>
          <name value="c1d8a98c-fb31-46f1-b788-92d6ea7a28e5"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="extension"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-AddressCountry"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="c9d395c8-d66e-43ea-978f-2845ad8ec6cb"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="extension"/>
            <contextType value="variable"/>
            <element value="valueCoding"/>
            <variable value="countryCoding"/>
          </target>
          <rule>
            <name value="fec84c6b-7457-49db-9220-c2d159ec1f4c"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="countryCoding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="copy"/>
              <parameter>
                <valueString
                             value="https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-Country-1"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="e9b214b1-21a7-448a-b4f2-b3ac053025f0"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="countryCoding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="evaluate"/>
              <parameter>
                <valueId value="address"/>
              </parameter>
              <parameter>
                <valueString value="country.code"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="38236b3c-20a0-4bd6-bd71-ceeec9892684"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="countryCoding"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="evaluate"/>
              <parameter>
                <valueId value="address"/>
              </parameter>
              <parameter>
                <valueString value="country.display"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="setPatientAddress"/>
      <source>
        <context value="src"/>
        <element value="homeAddress"/>
        <variable value="address"/>
        <condition value="$this.country.empty()"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="address"/>
        <variable value="addr"/>
      </target>
      <rule>
        <name value="c98b2bba-177b-4fe2-bc52-4f44dbc3c9f4"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="line"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="addressEntry1"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="4fff75a4-23c2-4c35-9f77-8589de7f71d8"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="line"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="addressEntry2"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="43620999-78ac-449f-b3d7-5bbad9e8cb26"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="line"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="addressEntry3"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="00caee37-21ea-4bde-92e5-08a685c280c4"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="line"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="addressEntry4"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="38fe9452-ee4b-4cbf-b645-460a714c7d53"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="addr"/>
          <contextType value="variable"/>
          <element value="postalCode"/>
          <transform value="evaluate"/>
          <parameter>
            <valueId value="address"/>
          </parameter>
          <parameter>
            <valueString value="postCode"/>
          </parameter>
        </target>
      </rule>
    </rule>
  </group>
</StructureMap>