Patient-SubjectOfCare
type: StructureMap
node role: treeRoot
id:
  v: Patient-SubjectOfCare
text:
  status:
    v: generated
  div:
    v: Generated Narrative: StructureMap Patient-SubjectOfCare #xD; map "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/Patient-SubjectOfCare" = "PatientToSubjectOfCare"#xD; #xD; uses "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-Patient" alias Patient as source#xD; uses "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-SubjectOfCare" alias SubjectOfCare as target#xD; #xD; group SubjectOfCare(source src : Patient, target tgt : SubjectOfCare) {#xD; src -> tgt.id = evaluate(src, id) "151e72fc-9cb8-4f02-84b3-1228d026033e";#xD; "setSubjectOfCareId" "bf3b89b6-d6de-44b9-8312-232ff9d202b8";#xD; src -> tgt.meta as meta, meta.dataClass as dataClass then {#xD; src -> dataClass.name = 'Subject of Care' "0732af00-5582-4eff-bfd9-f2b7354a3438";#xD; } "setDataClassName";#xD; src -> tgt.name as name then {#xD; src.name as humanName then {#xD; src -> name.given = evaluate(humanName, given[0]) "c1dd2823-0470-451d-9846-6c3e1f7dfb04";#xD; src -> name.family = evaluate(humanName, family) "3a5d78ac-bd46-4d13-a624-9f0ee429df68";#xD; } "setFamilyAndGivenName";#xD; } "setName";#xD; src -> tgt.identification as identification then {#xD; src -> identification.nhsNumber as nhsNumber then {#xD; src.identifier as nhsNumberIdentifier where $this.system='https://fhir.nhs.uk/Id/nhs-number', nhsNumberIdentifier.value as nhsNumberValue, nhsNumberIdentifier.extension as nhsNumberTraceStatusExt then {#xD; src -> nhsNumber.value = nhsNumberValue "9aeb4c5c-ff43-4fc1-86c7-14790e7dcc52";#xD; src -> nhsNumber.statusIndicator as statusIndicator then {#xD; src -> statusIndicator.system = 'https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland' "15384b37-b8e8-4a6f-9595-e70a2eec1479";#xD; src -> statusIndicator.code = evaluate(nhsNumberTraceStatusExt, valueCodeableConcept.coding[0].code) "60146fef-d9e1-4289-972f-78b3f445a77a";#xD; src -> statusIndicator.display = evaluate(nhsNumberTraceStatusExt, valueCodeableConc…
url:
  v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/Patient-SubjectOfCare
  l: Patient-SubjectOfCare
version:
  v: 0.1.0
name:
  v: PatientToSubjectOfCare
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-Patient
    l: MODS-Patient
  mode:
    v: source
  alias:
    v: Patient
structure:
  url:
    v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-SubjectOfCare
    l: MODS-SubjectOfCare
  mode:
    v: target
  alias:
    v: SubjectOfCare
group:
  name:
    v: SubjectOfCare
  type mode:
    v: none
  input:
    name:
      v: src
    type:
      v: Patient
    mode:
      v: source
  input:
    name:
      v: tgt
    type:
      v: SubjectOfCare
    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:
    source:
      context:
        v: "setSubjectOfCareId"
  rule:
    name:
      v: setDataClassName
    source:
      context:
        v: src
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: meta
      variable:
        v: meta
    target:
      context:
        v: meta
      context type:
        v: variable
      element:
        v: dataClass
      variable:
        v: dataClass
  rule:
    name:
      v: setName
    source:
      context:
        v: src
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: name
      variable:
        v: name
    rule:
      name:
        v: setFamilyAndGivenName
  rule:
    name:
      v: setIdentification
    source:
      context:
        v: src
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: identification
      variable:
        v: identification
    rule:
      name:
        v: setNHSNumber
    rule:
      name:
        v: setOtherIdentifier
  rule:
    name:
      v: setDemographics
    source:
      context:
        v: src
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: demographics
      variable:
        v: demographics
    rule:
      name:
        v: setDateOfBirth
    rule:
      name:
        v: setBirthSex
    rule:
      name:
        v: setMaritalStatus
    rule:
      name:
        v: setEthnicity
    rule:
      name:
        v: setGenderIdentity
    rule:
      name:
        v: setReligion
    rule:
      name:
        v: setFirstLanguage
    rule:
      name:
        v: setOtherLanguage
    rule:
      name:
        v: setInterpreterRequired

Id
v: src

String
v: id

v: src

v: dataClass

v: variable

v: name

v: copy

value: String
  v: Subject of Care

v: src

v: 1

v: 1

v: name

v: humanName

context:
  v: src

context:
  v: name
context type:
  v: variable
element:
  v: given
transform:
  v: evaluate
parameter:
  value: Id
    v: humanName
parameter:
  value: String
    v: given[0]

context:
  v: src

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

v: src

v: identification

v: variable

v: nhsNumber

v: nhsNumber

v: identifier

context:
  v: src
element:
  v: identifier
variable:
  v: nhsNumberIdentifier
condition:
  v: $this.system='https://fhir.nhs.uk/Id/nhs-number'

context:
  v: nhsNumberIdentifier
element:
  v: value
variable:
  v: nhsNumberValue

context:
  v: nhsNumberIdentifier
element:
  v: extension
variable:
  v: nhsNumberTraceStatusExt

source:
  context:
    v: src
target:
  context:
    v: nhsNumber
  context type:
    v: variable
  element:
    v: value
  transform:
    v: copy
  parameter:
    value: Id
      v: nhsNumberValue

source:
  context:
    v: src
target:
  context:
    v: nhsNumber
  context type:
    v: variable
  element:
    v: statusIndicator
  variable:
    v: statusIndicator
rule:
  source:
    context:
      v: src
  target:
    context:
      v: statusIndicator
    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: statusIndicator
    context type:
      v: variable
    element:
      v: code
    transform:
      v: evaluate
    parameter:
      value: Id
        v: nhsNumberTraceStatusExt
    parameter:
      value: String
        v: valueCodeableConcept.coding[0].code
rule:
  source:
    context:
      v: src
  target:
    context:
      v: statusIndicator
    context type:
      v: variable
    element:
      v: display
    transform:
      v: evaluate
    parameter:
      value: Id
        v: nhsNumberTraceStatusExt
    parameter:
      value: String
        v: valueCodeableConcept.coding[0].display

v: src

v: identifier

v: otherPersonIdentifier

v: $this.system!='https://fhir.nhs.uk/Id/nhs-number'

v: identification

v: variable

v: otherIdentifier

v: otherIdentifier

v: src

v: demographics

v: variable

v: dateOfBirth

v: evaluate

value: Id
  v: src

value: String
  v: birthDate

v: src

v: extension

v: birthSexExt

v: $this.url='https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex'

v: birthSexExt

v: valueCodeableConcept

v: birthSex

context:
  v: src

context:
  v: demographics
context type:
  v: variable
element:
  v: sex
transform:
  v: translate
parameter:
  value: Id
    v: birthSex
parameter:
  value: String
    v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRBirthSex-1
parameter:
  value: String
    v: Coding

v: src

v: maritalStatus

v: maritalStatusCodeableConcept

context:
  v: src

context:
  v: demographics
context type:
  v: variable
element:
  v: maritalStatus
variable:
  v: maritalStatus

source:
  context:
    v: src
target:
  context:
    v: maritalStatus
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: String
      v: https://data.digitisingsocialcare.co.uk/mods/v1/person-marital-status

source:
  context:
    v: src
target:
  context:
    v: maritalStatus
  context type:
    v: variable
  element:
    v: code
  transform:
    v: evaluate
  parameter:
    value: Id
      v: maritalStatusCodeableConcept
  parameter:
    value: String
      v: coding.code

source:
  context:
    v: src
target:
  context:
    v: maritalStatus
  context type:
    v: variable
  element:
    v: display
  transform:
    v: evaluate
  parameter:
    value: Id
      v: maritalStatusCodeableConcept
  parameter:
    value: String
      v: coding.display

context:
  v: "setMaritalStatusCoding"

v: src

v: extension

v: ethnicityExt

v: $this.url='https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory'

v: ethnicityExt

v: valueCodeableConcept

v: ethnicCategory

v: setEthnicityCoding

context:
  v: src

context:
  v: demographics
context type:
  v: variable
element:
  v: ethnicity
variable:
  v: ethnicity

source:
  context:
    v: src
target:
  context:
    v: ethnicity
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: String
      v: https://data.digitisingsocialcare.co.uk/mods/v1/person-ethnicity

source:
  context:
    v: src
target:
  context:
    v: ethnicity
  context type:
    v: variable
  element:
    v: code
  transform:
    v: evaluate
  parameter:
    value: Id
      v: ethnicCategory
  parameter:
    value: String
      v: coding.code

source:
  context:
    v: src
target:
  context:
    v: ethnicity
  context type:
    v: variable
  element:
    v: display
  transform:
    v: evaluate
  parameter:
    value: Id
      v: ethnicCategory
  parameter:
    value: String
      v: coding.display

v: src

v: gender

v: genderCode

context:
  v: src

context:
  v: src
context type:
  v: variable
element:
  v: genderIdentity
variable:
  v: givt
transform:
  v: create
parameter:
  value: String
    v: Coding

source:
  context:
    v: src
target:
  context:
    v: givt
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: String
      v: http://hl7.org/fhir/R4/codesystem-administrative-gender

source:
  context:
    v: src
target:
  context:
    v: givt
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: Id
      v: genderCode

source:
  context:
    v: src
target:
  context:
    v: demographics
  context type:
    v: variable
  element:
    v: genderIdentity
  transform:
    v: translate
  parameter:
    value: Id
      v: givt
  parameter:
    value: String
      v: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRGenderIdentity-1
  parameter:
    value: String
      v: Coding

v: src

v: extension

v: religionExt

v: $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonReligiousAffiliation'

v: religionExt

v: valueCodeableConcept

v: religiousAffiliation

v: setReligionCoding

context:
  v: src

context:
  v: demographics
context type:
  v: variable
element:
  v: religion
variable:
  v: religion

source:
  context:
    v: src
target:
  context:
    v: religion
  context type:
    v: variable
  element:
    v: code
  transform:
    v: evaluate
  parameter:
    value: Id
      v: religiousAffiliation
  parameter:
    value: String
      v: coding.code

source:
  context:
    v: src
target:
  context:
    v: religion
  context type:
    v: variable
  element:
    v: display
  transform:
    v: evaluate
  parameter:
    value: Id
      v: religiousAffiliation
  parameter:
    value: String
      v: coding.display

source:
  context:
    v: src
target:
  context:
    v: religion
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: String
      v: https://data.digitisingsocialcare.co.uk/mods/v1/person-religion

v: src

v: 1

v: 1

v: communication

v: communication

v: $this.preferred=true

v: communication

v: language

v: language

context:
  v: src

context:
  v: demographics
context type:
  v: variable
element:
  v: firstLanguage
variable:
  v: firstLanguage

source:
  context:
    v: src
target:
  context:
    v: firstLanguage
  context type:
    v: variable
  element:
    v: code
  transform:
    v: evaluate
  parameter:
    value: Id
      v: language
  parameter:
    value: String
      v: coding.code

source:
  context:
    v: src
target:
  context:
    v: firstLanguage
  context type:
    v: variable
  element:
    v: display
  transform:
    v: evaluate
  parameter:
    value: Id
      v: language
  parameter:
    value: String
      v: coding.display

source:
  context:
    v: src
target:
  context:
    v: firstLanguage
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: String
      v: https://data.digitisingsocialcare.co.uk/mods/v1/person-language

v: src

v: 1

v: 1

v: communication

v: communication

v: $this.preferred.exists().not()or$this.preferred=false

v: communication

v: language

v: language

context:
  v: src

context:
  v: demographics
context type:
  v: variable
element:
  v: otherLanguage
variable:
  v: otherLanguage

source:
  context:
    v: src
target:
  context:
    v: otherLanguage
  context type:
    v: variable
  element:
    v: code
  transform:
    v: evaluate
  parameter:
    value: Id
      v: language
  parameter:
    value: String
      v: coding.code

source:
  context:
    v: src
target:
  context:
    v: otherLanguage
  context type:
    v: variable
  element:
    v: display
  transform:
    v: evaluate
  parameter:
    value: Id
      v: language
  parameter:
    value: String
      v: coding.display

source:
  context:
    v: src
target:
  context:
    v: otherLanguage
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: String
      v: https://data.digitisingsocialcare.co.uk/mods/v1/person-language

context:
  v: src
element:
  v: extension
variable:
  v: interpreterRequiredExt
condition:
  v: $this.url='http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired'

source:
  context:
    v: src
target:
  context:
    v: demographics
  context type:
    v: variable
  element:
    v: interpreterRequired
  transform:
    v: evaluate
  parameter:
    value: Id
      v: interpreterRequiredExt
  parameter:
    value: String
      v: iif(valueBoolean,'Yes','No')

name:
  v: setSexualOrientation
source:
  context:
    v: src
  element:
    v: extension
  variable:
    v: sexualOrientationExt
  condition:
    v: $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonSexualOrientation'
source:
  context:
    v: sexualOrientationExt
  element:
    v: valueCodeableConcept
  variable:
    v: sexualOrientation
rule:
  name:
    v: setSexualOrientationCoding
  source:
    context:
      v: src
  target:
    context:
      v: demographics
    context type:
      v: variable
    element:
      v: sexualOrientation
    variable:
      v: orientation
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: orientation
      context type:
        v: variable
      element:
        v: code
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: orientation
      context type:
        v: variable
      element:
        v: display
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: orientation
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String

Id
v: sexualOrientation

String
v: coding.code

Id
v: sexualOrientation

String
v: coding.display

name:
  v: setAddress
source:
  context:
    v: src
  element:
    v: address
  variable:
    v: address
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: addressEntry1
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: line[0]
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: addressEntry2
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: line[1]
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: addressEntry3
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: line[2]
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: addressEntry4
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: line[3]
rule:
  source:
    context:
      v: src
  target:
    context:
      v: addr
    context type:
      v: variable
    element:
      v: postCode
    transform:
      v: evaluate
    parameter:
      value: Id
        v: address
    parameter:
      value: String
        v: postalCode
rule:
  name:
    v: extension
  source:
    context:
      v: address
    element:
      v: extension
    variable:
      v: countryExt
    condition:
      v: $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-AddressCountry'
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: addr
      context type:
        v: variable
      element:
        v: country
      variable:
        v: country

v: src

v: country

v: variable

v: system

v: copy

v: src

v: country

v: variable

v: code

v: evaluate

value: Id
  v: countryExt

value: String
  v: valueCoding.code

v: src

v: country

v: variable

v: display

v: evaluate

value: Id
  v: countryExt

value: String
  v: valueCoding.display

name:
  v: setContactDetails
source:
  context:
    v: src
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: contactDetails
  variable:
    v: contactDetails
rule:
  name:
    v: telecom
  source:
    context:
      v: src
    element:
      v: telecom
    variable:
      v: emailAddress
    condition:
      v: $this.system='email'
  target:
    context:
      v: contactDetails
    context type:
      v: variable
    element:
      v: emailAddressDetails
    variable:
      v: emailAddressDetails
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: emailAddressDetails
      context type:
        v: variable
      element:
        v: emailAddress
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: emailAddressDetails
      context type:
        v: variable
      element:
        v: preferredOrder
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    name:
      v: extension
    source:
      context:
        v: emailAddress
      element:
        v: extension
      variable:
        v: emailAddressTypeExt
      condition:
        v: $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonEmailAddressType'
rule:
  name:
    v: telecom
  source:
    context:
      v: src
    element:
      v: telecom
    variable:
      v: telephoneNumber
    condition:
      v: $this.system='phone'
  target:
    context:
      v: contactDetails
    context type:
      v: variable
    element:
      v: telephoneDetails
    variable:
      v: telephoneNumberDetails
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: telephoneNumberDetails
      context type:
        v: variable
      element:
        v: telephoneNumber
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: telephoneNumberDetails
      context type:
        v: variable
      element:
        v: preferredOrder
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    name:
      v: extension
    source:
      context:
        v: telephoneNumber
      element:
        v: extension
      variable:
        v: telephoneNumberExt
      condition:
        v: $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonTelephoneNumberType'

Id
v: emailAddress

String
v: value

Id
v: emailAddress

String
v: rank

v: src

v: emailAddressDetails

v: variable

v: type

v: emailAddressType

context:
  v: src

context:
  v: emailAddressType
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

context:
  v: src

context:
  v: emailAddressType
context type:
  v: variable
element:
  v: code
transform:
  v: evaluate
parameter:
  value: Id
    v: emailAddressTypeExt
parameter:
  value: String
    v: valueCoding.code

context:
  v: src

context:
  v: emailAddressType
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: emailAddressTypeExt
parameter:
  value: String
    v: valueCoding.display

Id
v: telephoneNumber

String
v: value

Id
v: telephoneNumber

String
v: rank

v: src

v: telephoneNumberDetails

v: variable

v: type

v: telephoneNumberType

context:
  v: src

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

context:
  v: src

context:
  v: telephoneNumberType
context type:
  v: variable
element:
  v: code
transform:
  v: evaluate
parameter:
  value: Id
    v: telephoneNumberExt
parameter:
  value: String
    v: valueCoding.code

context:
  v: src

context:
  v: telephoneNumberType
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: telephoneNumberExt
parameter:
  value: String
    v: valueCoding.display

name:
  v: setDeathDetails
source:
  context:
    v: src
  element:
    v: extension
  variable:
    v: deathDetailsExt
  condition:
    v: $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonDeathDetails'
rule:
  source:
    context:
      v: src
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: deathDetails
    variable:
      v: deathDetails
  rule:
    name:
      v: setPersonDeathCauseIdentificationMethod
    source:
      context:
        v: deathDetailsExt
      element:
        v: extension
      variable:
        v: deathCauseIdentificationMethodExt
      condition:
        v: $this.url='deathCauseIdentificationMethod'
    source:
      context:
        v: deathCauseIdentificationMethodExt
      element:
        v: valueCoding
      variable:
        v: deathCauseIdentificationMethodCoding
  rule:
    name:
      v: setPersonDeathLocationType
    source:
      context:
        v: deathDetailsExt
      element:
        v: extension
      variable:
        v: deathLocationTypeExt
      condition:
        v: $this.url='deathLocationType'
    source:
      context:
        v: deathLocationTypeExt
      element:
        v: valueCoding
      variable:
        v: deathLocationTypeCoding
  rule:
    name:
      v: setPersonDeathNotAtPreferredLocationReason
    source:
      context:
        v: deathDetailsExt
      element:
        v: extension
      variable:
        v: deathNotAtPreferredLocationReasonExt
      condition:
        v: $this.url='deathNotAtPreferredLocationReason'
    source:
      context:
        v: deathNotAtPreferredLocationReasonExt
      element:
        v: valueCoding
      variable:
        v: deathNotAtPreferredLocationReasonCoding
  rule:
    name:
      v: setPersonAtRiskOfUnexpectedDeath
    source:
      context:
        v: deathDetailsExt
      element:
        v: extension
      variable:
        v: personAtRiskOfUnexpectedDeathExt
      condition:
        v: $this.url='personAtRiskOfUnexpectedDeath'
    source:
      context:
        v: personAtRiskOfUnexpectedDeathExt
      element:
        v: valueCoding
      variable:
        v: personAtRiskOfUnexpectedDeathCoding
  rule:
    name:
      v: setPreferredLocationOfDeathDiscussed
    source:
      context:
        v: deathDetailsExt
      element:
        v: extension
      variable:
        v: preferredLocationOfDeathDiscussedExt
      condition:
        v: $this.url='preferredLocationOfDeathDiscussed'
    source:
      context:
        v: preferredLocationOfDeathDiscussedExt
      element:
        v: valueCoding
      variable:
        v: preferredLocationOfDeathDiscussedCoding
  rule:
    name:
      v: setPersonDeathTime
    source:
      context:
        v: deathDetailsExt
      element:
        v: extension
      variable:
        v: personDateOfDeathExt
      condition:
        v: $this.url='personDateOfDeath'
  rule:
    name:
      v: setPersonDeathTime
    source:
      context:
        v: deathDetailsExt
      element:
        v: extension
      variable:
        v: personTimeOfDeathExt
      condition:
        v: $this.url='personTimeOfDeath'

v: src

v: deathDetails

v: variable

v: deathCauseIdentificationMethod

v: deathCauseIdentificationMethod

context:
  v: src

context:
  v: deathCauseIdentificationMethod
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: https://data.digitisingsocialcare.co.uk/mods/v1/person-death-cause-identification-method

context:
  v: src

context:
  v: deathCauseIdentificationMethod
context type:
  v: variable
element:
  v: code
transform:
  v: evaluate
parameter:
  value: Id
    v: deathCauseIdentificationMethodCoding
parameter:
  value: String
    v: code

context:
  v: src

context:
  v: deathCauseIdentificationMethod
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: deathCauseIdentificationMethodCoding
parameter:
  value: String
    v: display

v: src

v: deathDetails

v: variable

v: deathLocationType

v: deathLocationType

context:
  v: src

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

context:
  v: src

context:
  v: deathLocationType
context type:
  v: variable
element:
  v: code
transform:
  v: evaluate
parameter:
  value: Id
    v: deathLocationTypeCoding
parameter:
  value: String
    v: code

context:
  v: src

context:
  v: deathLocationType
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: deathLocationTypeCoding
parameter:
  value: String
    v: display

v: src

v: deathDetails

v: variable

v: deathNotAtPreferredLocationReason

v: deathNotAtPreferredLocationReason

context:
  v: src

context:
  v: deathNotAtPreferredLocationReason
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: https://data.digitisingsocialcare.co.uk/mods/v1/person-death-not-at-preferred-location-reason-code

context:
  v: src

context:
  v: deathNotAtPreferredLocationReason
context type:
  v: variable
element:
  v: code
transform:
  v: evaluate
parameter:
  value: Id
    v: deathNotAtPreferredLocationReasonCoding
parameter:
  value: String
    v: code

context:
  v: src

context:
  v: deathNotAtPreferredLocationReason
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: deathNotAtPreferredLocationReasonCoding
parameter:
  value: String
    v: display

v: src

v: deathDetails

v: variable

v: personAtRiskOfUnexpectedDeath

v: personAtRiskOfUnexpectedDeath

context:
  v: src

context:
  v: personAtRiskOfUnexpectedDeath
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: https://data.digitisingsocialcare.co.uk/mods/v1/person-at-risk-of-unexpected-death-indicator

context:
  v: src

context:
  v: personAtRiskOfUnexpectedDeath
context type:
  v: variable
element:
  v: code
transform:
  v: evaluate
parameter:
  value: Id
    v: personAtRiskOfUnexpectedDeathCoding
parameter:
  value: String
    v: code

context:
  v: src

context:
  v: personAtRiskOfUnexpectedDeath
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: personAtRiskOfUnexpectedDeathCoding
parameter:
  value: String
    v: display

v: src

v: deathDetails

v: variable

v: preferredDeathLocationDiscussed

v: preferredDeathLocationDiscussed

context:
  v: src

context:
  v: preferredDeathLocationDiscussed
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: https://data.digitisingsocialcare.co.uk/mods/v1/person-death-location-discussed-indicator

context:
  v: src

context:
  v: preferredDeathLocationDiscussed
context type:
  v: variable
element:
  v: code
transform:
  v: evaluate
parameter:
  value: Id
    v: preferredLocationOfDeathDiscussedCoding
parameter:
  value: String
    v: code

context:
  v: src

context:
  v: preferredDeathLocationDiscussed
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: Id
    v: preferredLocationOfDeathDiscussedCoding
parameter:
  value: String
    v: display

v: src

v: deathDetails

v: variable

v: personDeathDate

v: evaluate

value: Id
  v: personDateOfDeathExt

value: String
  v: valueDate

v: src

v: deathDetails

v: variable

v: personDeathTime

v: evaluate

value: Id
  v: personTimeOfDeathExt

value: String
  v: valueTime

name:
  v: setCareProvider
source:
  context:
    v: src
  element:
    v: extension
  variable:
    v: careProviderExt
  condition:
    v: $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonCareProvider'
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: careProvider
  variable:
    v: careProvider
rule:
  name:
    v: valueReference
  source:
    context:
      v: careProviderExt
    element:
      v: valueReference
    variable:
      v: careProviderReference
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: careProvider
      context type:
        v: variable
      element:
        v: id
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: careProvider
      context type:
        v: variable
      element:
        v: type
      transform:
        v: copy
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: careProvider
      context type:
        v: variable
      element:
        v: display
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String

Id
v: careProviderReference

String
v: identifier.value

String
v: CareOrganisation

Id
v: careProviderReference

String
v: display

name:
  v: setGeneralPractitioner
source:
  context:
    v: src
  min:
    v: 1
  max:
    v: 1
  element:
    v: generalPractitioner
  variable:
    v: generalPractitioner
source:
  context:
    v: generalPractitioner
  element:
    v: identifier
  variable:
    v: generalPractitionerIdentifier
rule:
  source:
    context:
      v: src
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: generalPractice
    variable:
      v: generalPractice
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: generalPractice
      context type:
        v: variable
      element:
        v: id
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: generalPractice
      context type:
        v: variable
      element:
        v: type
      transform:
        v: copy
      parameter:
        value: String
  rule:
    source:
      context:
        v: src
    target:
      context:
        v: generalPractice
      context type:
        v: variable
      element:
        v: display
      transform:
        v: evaluate
      parameter:
        value: Id
      parameter:
        value: String

Id
v: generalPractitionerIdentifier

String
v: value

String
v: CareOrganisation

Id
v: generalPractitioner

String
v: display