Registration-Patient
type: StructureMap
node role: treeRoot
id:
  v: Registration-Patient
text:
  status:
    v: generated
  div:
    v: Generated Narrative: StructureMap Registration-Patient #xD; map "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/Registration-Patient" = "RegistrationToPatient"#xD; #xD; uses "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-SubjectOfCareRegistration" alias Registration as source#xD; uses "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-Patient" alias Patient as target#xD; #xD; group RegistrationPatient(source src : Registration, target tgt : Patient) {#xD; src -> tgt.id = evaluate(src, subjectOfCareId) "00e9f63a-468b-4175-abc3-425edb549da1";#xD; src.sex as sex, sex.code as sexCode then {#xD; src -> src.sex = create('Coding') as sxvt then {#xD; src -> sxvt.code = sexCode "c52db195-f186-48a1-933f-6a375e486853";#xD; src -> sxvt.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-sex' "128d701d-9bb2-4aa9-a6dc-1ce75928002c";#xD; src -> tgt.extension as birthSexExt then {#xD; src -> birthSexExt.url = 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex' "8a0d3b39-8704-4f01-b2e6-62eb860f2548";#xD; src -> birthSexExt.valueCodeableConcept = translate(sxvt, 'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRBirthSex-1', 'CodeableConcept') "76144650-bd83-480b-ba62-8f1a27bc3d64";#xD; } "9f7da33c-8344-4704-91c2-0b57ef007b68";#xD; } "7d587212-b486-4a2c-b645-57388f72da76";#xD; } "setPatientBirthSex";#xD; src.genderIdentity as genderIdentity then {#xD; src -> tgt.extension as genderIdentityExt then {#xD; src -> genderIdentityExt.url = 'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonGenderIdentity' "b86ee800-a7b3-4b6c-8b0a-e4b74a8da793";#xD; src -> genderIdentityExt.valueCodeableConcept as genderIdentityCode then {#xD; src -> genderIdentityCode.coding as coding then {#xD; src -> coding.system = 'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-PersonGenderIdentityCode-1' "471a74e1-…
url:
  v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/Registration-Patient
  l: Registration-Patient
version:
  v: 0.1.0
name:
  v: RegistrationToPatient
status:
  v: draft
date:
  v: 2026-06-10T19:05:58+00:00
publisher:
  v: Synanetics Ltd on behalf of DHSC/Social Care Interoperability Platform
contact:
  name:
    v: Synanetics Ltd on behalf of DHSC/Social Care Interoperability Platform
  telecom:
    system:
      v: url
    value:
      v: https://synanetics.com
  telecom:
    system:
      v: email
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
      l: 3166
    code:
      v: GB
    display:
      v: United Kingdom of Great Britain and Northern Ireland
structure:
  url:
    v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-SubjectOfCareRegistration
    l: MODS-SubjectOfCareRegistration
  mode:
    v: source
  alias:
    v: Registration
structure:
  url:
    v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-Patient
    l: MODS-Patient
  mode:
    v: target
  alias:
    v: Patient
group:
  name:
    v: RegistrationPatient
  type mode:
    v: none
  input:
    name:
      v: src
    type:
      v: Registration
    mode:
      v: source
  input:
    name:
      v: tgt
    type:
      v: Patient
    mode:
      v: target
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: id
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    name:
      v: setPatientBirthSex
    source:
      context:
        v: src
      element:
        v: sex
      variable:
        v: sex
    source:
      context:
        v: sex
      element:
        v: code
      variable:
        v: sexCode
  rule:
    name:
      v: setGenderIdentity
    source:
      context:
        v: src
      element:
        v: genderIdentity
      variable:
        v: genderIdentity
  rule:
    name:
      v: setPatientEthnicity
    source:
      context:
        v: src
      element:
        v: ethnicity
      variable:
        v: ethnicity
  rule:
    name:
      v: setPatientReligion
    source:
      context:
        v: src
      element:
        v: religion
      variable:
        v: religion
  rule:
    name:
      v: setPatientSexualOrientation
    source:
      context:
        v: src
      element:
        v: sexualOrientation
      variable:
        v: sexualOrientation
  rule:
    name:
      v: setPatientName
    source:
      context:
        v: src
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: name
      variable:
        v: name
  rule:
    name:
      v: setPatientNHSNumber
    source:
      context:
        v: src
      element:
        v: nhsNumber
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: identifier
      variable:
        v: identifier
  rule:
    name:
      v: setNationalInsuranceNumber
    source:
      context:
        v: src
      element:
        v: nationalInsuranceNumber
  rule:
    name:
      v: setOtherPatientIdentifier
    source:
      context:
        v: src
      element:
        v: otherIdentifier
      variable:
        v: otherIdentifier

Id
v: src

String
v: subjectOfCareId

v: src

v: src

v: variable

v: sex

v: sxvt

v: create

value: String
  v: Coding

context:
  v: src

context:
  v: sxvt
context type:
  v: variable
element:
  v: code
transform:
  v: copy
parameter:
  value: Id
    v: sexCode

context:
  v: src

context:
  v: sxvt
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: https://data.digitisingsocialcare.co.uk/mods/v1/person-sex

context:
  v: src

context:
  v: tgt
context type:
  v: variable
element:
  v: extension
variable:
  v: birthSexExt

source:
  context:
    v: src
target:
  context:
    v: birthSexExt
  context type:
    v: variable
  element:
    v: url
  transform:
    v: copy
  parameter:
    value: String
      v: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex

source:
  context:
    v: src
target:
  context:
    v: birthSexExt
  context type:
    v: variable
  element:
    v: valueCodeableConcept
  transform:
    v: translate
  parameter:
    value: Id
      v: sxvt
  parameter:
    value: String
      v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRBirthSex-1
  parameter:
    value: String
      v: CodeableConcept

v: src

v: tgt

v: variable

v: extension

v: genderIdentityExt

context:
  v: src

context:
  v: genderIdentityExt
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonGenderIdentity

context:
  v: src

context:
  v: genderIdentityExt
context type:
  v: variable
element:
  v: valueCodeableConcept
variable:
  v: genderIdentityCode

source:
  context:
    v: src
target:
  context:
    v: genderIdentityCode
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: coding
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-PersonGenderIdentityCode-1
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: evaluate
    parameter:
      value: Id
        v: genderIdentity
    parameter:
      value: String
        v: code
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: display
    transform:
      v: evaluate
    parameter:
      value: Id
        v: genderIdentity
    parameter:
      value: String
        v: display

v: src

v: tgt

v: variable

v: extension

v: ethnicityExt

context:
  v: src

context:
  v: ethnicityExt
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory

context:
  v: src

context:
  v: ethnicityExt
context type:
  v: variable
element:
  v: valueCodeableConcept
variable:
  v: ethnicCategory

source:
  context:
    v: src
target:
  context:
    v: ethnicCategory
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: coding
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: https://fhir.hl7.org.uk/CodeSystem/UKCore-EthnicCategoryEngland
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: evaluate
    parameter:
      value: Id
        v: ethnicity
    parameter:
      value: String
        v: code
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: display
    transform:
      v: evaluate
    parameter:
      value: Id
        v: ethnicity
    parameter:
      value: String
        v: display

v: src

v: tgt

v: variable

v: extension

v: religionExt

context:
  v: src

context:
  v: religionExt
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonReligiousAffiliation

context:
  v: src

context:
  v: religionExt
context type:
  v: variable
element:
  v: valueCodeableConcept
variable:
  v: ethnicCategory

source:
  context:
    v: src
target:
  context:
    v: ethnicCategory
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: coding
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-PersonReligionCode-1
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: evaluate
    parameter:
      value: Id
        v: religion
    parameter:
      value: String
        v: code
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: display
    transform:
      v: evaluate
    parameter:
      value: Id
        v: religion
    parameter:
      value: String
        v: display

v: src

v: tgt

v: variable

v: extension

v: sexualOrientationExt

context:
  v: src

context:
  v: sexualOrientationExt
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonSexualOrientation

context:
  v: src

context:
  v: sexualOrientationExt
context type:
  v: variable
element:
  v: valueCodeableConcept
variable:
  v: sexualOrientationCode

source:
  context:
    v: src
target:
  context:
    v: sexualOrientationCode
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: coding
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: http://snomed.info/ct
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: evaluate
    parameter:
      value: Id
        v: sexualOrientation
    parameter:
      value: String
        v: code
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: display
    transform:
      v: evaluate
    parameter:
      value: Id
        v: sexualOrientation
    parameter:
      value: String
        v: display

v: src

v: name

v: variable

v: given

v: evaluate

value: Id
  v: src

value: String
  v: name.given

v: src

v: name

v: variable

v: family

v: evaluate

value: Id
  v: src

value: String
  v: name.family

v: src

v: identifier

v: variable

v: use

v: copy

value: String
  v: official

v: src

v: identifier

v: variable

v: system

v: copy

v: src

v: identifier

v: variable

v: value

v: evaluate

value: Id
  v: src

value: String
  v: nhsNumber.value

v: src

v: identifier

v: variable

v: extension

v: extension

context:
  v: src

context:
  v: extension
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus

context:
  v: src

context:
  v: extension
context type:
  v: variable
element:
  v: valueCodeableConcept
variable:
  v: cc

source:
  context:
    v: src
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: coding
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: evaluate
    parameter:
      value: Id
        v: src
    parameter:
      value: String
        v: nhsNumber.statusIndicator.code
rule:
  source:
    context:
      v: src
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: display
    transform:
      v: evaluate
    parameter:
      value: Id
        v: src
    parameter:
      value: String
        v: nhsNumber.statusIndicator.display

v: src

v: tgt

v: variable

v: identifier

v: id

context:
  v: src

context:
  v: id
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: https://fhir.hl7.org.uk/Id/nino

context:
  v: src

context:
  v: id
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: Id
    v: src
parameter:
  value: String
    v: nationalInsuranceNumber

v: src

v: tgt

v: variable

v: identifier

v: id

context:
  v: src

context:
  v: id
context type:
  v: variable
element:
  v: system
transform:
  v: evaluate
parameter:
  value: Id
    v: otherIdentifier
parameter:
  value: String
    v: system

context:
  v: src

context:
  v: id
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: Id
    v: otherIdentifier
parameter:
  value: String
    v: value

name:
  v: setPatientBirthDate
source:
  context:
    v: src
  element:
    v: dateOfBirth
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: birthDate

name:
  v: setPatientGender
source:
  context:
    v: src
  element:
    v: genderIdentity
  variable:
    v: genderIdentity
source:
  context:
    v: genderIdentity
  element:
    v: code
  variable:
    v: genderIdentityCode
rule:
  source:
    context:
      v: src
  target:
    context:
      v: src
    context type:
      v: variable
    element:
      v: genderIdentity
    variable:
      v: givt
    transform:
      v: create
    parameter:
      value: String
        v: Coding
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: givt
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: Id
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: givt
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: gender
      transform:
        v: translate
      parameter:
        value: Id
      parameter:
        value: String
      parameter:
        value: String

Id
v: genderIdentityCode

Id
v: givt

String
v: code

name:
  v: setPatientMaritalStatus
source:
  context:
    v: src
  element:
    v: maritalStatus
  variable:
    v: maritalStatus
source:
  context:
    v: maritalStatus
  element:
    v: code
  variable:
    v: maritalStatusCode
source:
  context:
    v: maritalStatus
  element:
    v: display
  variable:
    v: maritalStatusDisplay
rule:
  source:
    context:
      v: src
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: maritalStatus
    variable:
      v: msvt
    transform:
      v: create
    parameter:
      value: String
        v: CodeableConcept
  target:
    context:
      v: msvt
    context type:
      v: variable
    element:
      v: coding
    variable:
      v: maritalStatusCoding
    transform:
      v: create
    parameter:
      value: String
        v: Coding
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: maritalStatusCoding
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: maritalStatusCoding
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: Id
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: maritalStatusCoding
      context type:
        v: variable
      element:
        v: display
      transform:
        v: copy
      parameter:
        value: Id

Id
v: maritalStatusCode

Id
v: maritalStatusDisplay

name:
  v: setExtendedPatientAddress
source:
  context:
    v: src
  element:
    v: homeAddress
  variable:
    v: address
  condition:
    v: $this.country.empty().not()
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: address
  variable:
    v: addr
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: line
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: addressEntry1
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: line
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: addressEntry2
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: line
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: addressEntry3
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: line
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: addressEntry4
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: postalCode
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: postCode
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: country
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: country.display
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: extension
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: extension
      context type:
        v: variable
      element:
        v: url
      transform:
        v: copy
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: extension
      context type:
        v: variable
      element:
        v: valueCoding
      variable:
        v: countryCoding

v: src

v: countryCoding

v: variable

v: system

v: copy

v: src

v: countryCoding

v: variable

v: code

v: evaluate

value: Id
  v: address

value: String
  v: country.code

v: src

v: countryCoding

v: variable

v: display

v: evaluate

value: Id
  v: address

value: String
  v: country.display

name:
  v: setPatientAddress
source:
  context:
    v: src
  element:
    v: homeAddress
  variable:
    v: address
  condition:
    v: $this.country.empty()
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: address
  variable:
    v: addr
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: line
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: addressEntry1
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: line
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: addressEntry2
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: line
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: addressEntry3
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: line
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: addressEntry4
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: postalCode
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: postCode