ProxyForSubjectOfCare-RelatedPerson
type: StructureMap
node role: treeRoot
id:
  v: ProxyForSubjectOfCare-RelatedPerson
text:
  status:
    v: generated
  div:
    v: Generated Narrative: StructureMap ProxyForSubjectOfCare-RelatedPerson #xD; map "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/ProxyForSubjectOfCare-RelatedPerson" = "ProxyForSubjectOfCareToRelatedPerson"#xD; #xD; uses "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-ProxyForSubjectOfCare" alias Proxy as source#xD; uses "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-RelatedPerson" alias RelatedPerson as target#xD; #xD; group RelatedPerson(source src : Proxy, target tgt : RelatedPerson) {#xD; src -> tgt.id = evaluate(src, id) "setRelatedPersonId";#xD; src.organisation as careProvider -> tgt.extension as careProviderExt then {#xD; src -> careProviderExt.url = 'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonCareProvider' "84e82c22-a3b9-499d-94e4-65cbc8cf09bd";#xD; src -> careProviderExt.valueReference as careProviderReference then {#xD; src -> careProviderReference.reference = evaluate(careProvider, 'Organization/'+id) "10f19978-1a3b-4330-a464-e00e74022603";#xD; src -> careProviderReference.display = evaluate(careProvider, display) "9e1f7105-7878-4767-9ba7-b34630c3cc19";#xD; src -> careProviderReference.identifier as careProviderReferenceIdentifier then {#xD; src -> careProviderReferenceIdentifier.value = evaluate(careProvider, id) "fe9135e9-76d2-46b0-8ed6-5fbe0978c07b";#xD; } "b5a04295-4c12-4a37-880b-c9ddf5df3891";#xD; } "80515323-a2f5-4454-a056-a66f29d8a9bb";#xD; } "setRelatedPersonOrganization";#xD; src.subjectOfCare as subjectOfCare then {#xD; src -> tgt.patient as patient then {#xD; src -> patient.reference = evaluate(subjectOfCare, 'Patient/'+id) "8c477486-b778-4ec4-81dd-561aae6b2c5a";#xD; src -> patient.display = evaluate(subjectOfCare, display) "a0061ba6-78b4-4dd6-99cc-91a9b04bc2a7";#xD; } "eea3c368-1db6-4d5e-9f38-7e1d597a1d75";#xD; } "setRelatedPersonPatient";#xD; src.relationship as relationship -> tgt.relationship as rel then {#…
url:
  v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/ProxyForSubjectOfCare-RelatedPerson
  l: ProxyForSubjectOfCare-RelatedPerson
version:
  v: 0.1.0
name:
  v: ProxyForSubjectOfCareToRelatedPerson
status:
  v: draft
date:
  v: 2026-03-24T16:18:08+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-ProxyForSubjectOfCare
    l: MODS-ProxyForSubjectOfCare
  mode:
    v: source
  alias:
    v: Proxy
structure:
  url:
    v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-RelatedPerson
    l: MODS-RelatedPerson
  mode:
    v: target
  alias:
    v: RelatedPerson
group:
  name:
    v: RelatedPerson
  type mode:
    v: none
  input:
    name:
      v: src
    type:
      v: Proxy
    mode:
      v: source
  input:
    name:
      v: tgt
    type:
      v: RelatedPerson
    mode:
      v: target
  rule:
    name:
      v: setRelatedPersonId
    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: setRelatedPersonOrganization
    source:
      context:
        v: src
      element:
        v: organisation
      variable:
        v: careProvider
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: extension
      variable:
        v: careProviderExt
  rule:
    name:
      v: setRelatedPersonPatient
    source:
      context:
        v: src
      element:
        v: subjectOfCare
      variable:
        v: subjectOfCare
  rule:
    name:
      v: relationship
    source:
      context:
        v: src
      element:
        v: relationship
      variable:
        v: relationship
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: relationship
      variable:
        v: rel
    rule:
      name:
        v: setRelationship
    rule:
      name:
        v: setRelatedPersonName
    rule:
      name:
        v: contactDetails

Id
v: src

String
v: id

v: src

v: careProviderExt

v: variable

v: url

v: copy

v: src

v: careProviderExt

v: variable

v: valueReference

v: careProviderReference

context:
  v: src

context:
  v: careProviderReference
context type:
  v: variable
element:
  v: reference
transform:
  v: evaluate
parameter:
  value: Id
    v: careProvider
parameter:
  value: String
    v: 'Organization/'+id

context:
  v: src

context:
  v: careProviderReference
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: careProvider
parameter:
  value: String
    v: display

context:
  v: src

context:
  v: careProviderReference
context type:
  v: variable
element:
  v: identifier
variable:
  v: careProviderReferenceIdentifier

source:
  context:
    v: src
target:
  context:
    v: careProviderReferenceIdentifier
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: Id
      v: careProvider
  parameter:
    value: String
      v: id

v: src

v: tgt

v: variable

v: patient

v: patient

context:
  v: src

context:
  v: patient
context type:
  v: variable
element:
  v: reference
transform:
  v: evaluate
parameter:
  value: Id
    v: subjectOfCare
parameter:
  value: String
    v: 'Patient/'+id

context:
  v: src

context:
  v: patient
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: subjectOfCare
parameter:
  value: String
    v: display

v: src

v: rel

v: variable

v: coding

v: coding

context:
  v: src

context:
  v: coding
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole

context:
  v: src

context:
  v: coding
context type:
  v: variable
element:
  v: code
transform:
  v: evaluate
parameter:
  value: Id
    v: relationship
parameter:
  value: String
    v: code

context:
  v: src

context:
  v: coding
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: relationship
parameter:
  value: String
    v: display

v: src

v: tgt

v: variable

v: name

v: name

context:
  v: src

context:
  v: name
context type:
  v: variable
element:
  v: given
transform:
  v: evaluate
parameter:
  value: Id
    v: src
parameter:
  value: String
    v: name.given

context:
  v: src

context:
  v: name
context type:
  v: variable
element:
  v: family
transform:
  v: evaluate
parameter:
  value: Id
    v: src
parameter:
  value: String
    v: name.family

v: src

v: contactDetails

v: emailContactDetails

v: setRelatedPersonEmailAddress

context:
  v: emailContactDetails
element:
  v: emailAddressDetails
variable:
  v: emailAddressDetails

context:
  v: tgt
context type:
  v: variable
element:
  v: telecom
variable:
  v: telecom

source:
  context:
    v: src
target:
  context:
    v: telecom
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: String
      v: email

source:
  context:
    v: src
target:
  context:
    v: telecom
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: Id
      v: emailAddressDetails
  parameter:
    value: String
      v: emailAddress

source:
  context:
    v: src
target:
  context:
    v: telecom
  context type:
    v: variable
  element:
    v: rank
  transform:
    v: evaluate
  parameter:
    value: Id
      v: emailAddressDetails
  parameter:
    value: String
      v: preferredOrder

source:
  context:
    v: src
target:
  context:
    v: src
  context type:
    v: variable
  element:
    v: emailAddressType
  variable:
    v: etvt
  transform:
    v: create
  parameter:
    value: String
      v: Coding
rule:
  source:
    context:
      v: src
  target:
    context:
      v: etvt
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: https://data.digitisingsocialcare.co.uk/mods/v1/person-email-address-type
rule:
  source:
    context:
      v: src
  target:
    context:
      v: etvt
    context type:
      v: variable
    element:
      v: code
    transform:
      v: evaluate
    parameter:
      value: Id
        v: emailAddressDetails
    parameter:
      value: String
        v: type.code
rule:
  source:
    context:
      v: src
  target:
    context:
      v: telecom
    context type:
      v: variable
    element:
      v: use
    transform:
      v: translate
    parameter:
      value: Id
        v: etvt
    parameter:
      value: String
        v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIREmailContactPointUse-1
    parameter:
      value: String
        v: code
rule:
  source:
    context:
      v: src
  target:
    context:
      v: telecom
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: emailTypeExt
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: emailTypeExt
      context type:
        v: variable
      element:
        v: url
      transform:
        v: copy
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: emailTypeExt
      context type:
        v: variable
      element:
        v: valueCoding
      variable:
        v: emailTypeValueCoding

v: src

v: emailTypeValueCoding

v: variable

v: system

v: copy

v: src

v: emailTypeValueCoding

v: variable

v: code

v: evaluate

value: Id
  v: emailAddressDetails

value: String
  v: type.code

v: src

v: emailTypeValueCoding

v: variable

v: display

v: evaluate

value: Id
  v: emailAddressDetails

value: String
  v: type.display

v: contactDetails

context:
  v: src
element:
  v: contactDetails
variable:
  v: telephoneContactDetails

name:
  v: setRelatedPersonTelephone
source:
  context:
    v: telephoneContactDetails
  element:
    v: telephoneDetails
  variable:
    v: telephoneNumberDetails
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: telecom
  variable:
    v: telecom
rule:
  source:
    context:
      v: src
  target:
    context:
      v: telecom
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: phone
rule:
  source:
    context:
      v: src
  target:
    context:
      v: telecom
    context type:
      v: variable
    element:
      v: value
    transform:
      v: evaluate
    parameter:
      value: Id
        v: telephoneNumberDetails
    parameter:
      value: String
        v: telephoneNumber
rule:
  source:
    context:
      v: src
  target:
    context:
      v: telecom
    context type:
      v: variable
    element:
      v: rank
    transform:
      v: evaluate
    parameter:
      value: Id
        v: telephoneNumberDetails
    parameter:
      value: String
        v: preferredOrder
rule:
  source:
    context:
      v: src
  target:
    context:
      v: src
    context type:
      v: variable
    element:
      v: telephoneType
    variable:
      v: ttvt
    transform:
      v: create
    parameter:
      value: String
        v: Coding
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: ttvt
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: ttvt
      context type:
        v: variable
      element:
        v: code
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: telecom
      context type:
        v: variable
      element:
        v: use
      transform:
        v: translate
      parameter:
        value: Id
      parameter:
        value: String
      parameter:
        value: String
rule:
  source:
    context:
      v: src
  target:
    context:
      v: telecom
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: telephoneTypeExt
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: telephoneTypeExt
      context type:
        v: variable
      element:
        v: url
      transform:
        v: copy
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: telephoneTypeExt
      context type:
        v: variable
      element:
        v: valueCoding
      variable:
        v: telephoneNumberTypeCoding

Id
v: telephoneNumberDetails

String
v: type.code

Id
v: ttvt

String
v: code

v: src

v: telephoneNumberTypeCoding

v: variable

v: system

v: copy

v: src

v: telephoneNumberTypeCoding

v: variable

v: code

v: evaluate

value: Id
  v: telephoneNumberDetails

value: String
  v: type.code

v: src

v: telephoneNumberTypeCoding

v: variable

v: display

v: evaluate

value: Id
  v: telephoneNumberDetails

value: String
  v: type.display

name:
  v: setRelatedPersonAddressWithCountry
source:
  context:
    v: src
  element:
    v: address
  variable:
    v: address
  condition:
    v: $this.country.empty().not()
target:
  context:
    v: src
  context type:
    v: variable
  element:
    v: addresses
  variable:
    v: addresses
rule:
  source:
    context:
      v: addresses
    variable:
      v: addr
  rule:
    source:
      context:
        v: address
    target:
      context:
        v: addr
      context type:
        v: variable
      element:
        v: line
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: address
    target:
      context:
        v: addr
      context type:
        v: variable
      element:
        v: line
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: address
    target:
      context:
        v: addr
      context type:
        v: variable
      element:
        v: line
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: address
    target:
      context:
        v: addr
      context type:
        v: variable
      element:
        v: line
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: address
    target:
      context:
        v: addr
      context type:
        v: variable
      element:
        v: postalCode
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: address
    target:
      context:
        v: addr
      context type:
        v: variable
      element:
        v: country
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: address
    target:
      context:
        v: addr
      context type:
        v: variable
      element:
        v: extension
      variable:
        v: extension
rule:
  source:
    context:
      v: addresses
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: address

Id
v: address

String
v: addressEntry1

Id
v: address

String
v: addressEntry2

Id
v: address

String
v: addressEntry3

Id
v: address

String
v: addressEntry4

Id
v: address

String
v: postCode

Id
v: address

String
v: country.display

v: address

v: extension

v: variable

v: url

v: copy

v: address

v: extension

v: variable

v: valueCoding

v: countryCoding

context:
  v: address

context:
  v: countryCoding
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/CodeSystem/MODS-Country-1

context:
  v: address

context:
  v: countryCoding
context type:
  v: variable
element:
  v: code
transform:
  v: evaluate
parameter:
  value: Id
    v: address
parameter:
  value: String
    v: country.code

context:
  v: address

context:
  v: countryCoding
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: address
parameter:
  value: String
    v: country.display