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, valueCodeableConcept.coding[0].display) "1b6b4aaa-ceb5-4eae-97d9-018e676df272";#xD; } "c0469836-8323-4a43-99d1-b8bcabe26557";#xD; } "identifier";#xD; } "setNHSNumber";#xD; src.identifier where $this.system!='https://fhir.nhs.uk/Id/nhs-number' -> identification.otherIdentifier "setOtherIdentifier";#xD; } "setIdentification";#xD; src -> tgt.demographics as demographics then {#xD; src -> demographics.dateOfBirth = evaluate(src, birthDate) "setDateOfBirth";#xD; src.extension as birthSexExt where $this.url='https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BirthSex', birthSexExt.valueCodeableConcept as birthSex then {#xD; src -> demographics.sex = translate(birthSex, 'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRBirthSex-1', 'Coding') "707b2ba6-c4aa-4be0-aedc-04bcbad0713d";#xD; } "setBirthSex";#xD; src.maritalStatus as maritalStatusCodeableConcept then {#xD; src -> demographics.maritalStatus as maritalStatus then {#xD; src -> maritalStatus.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-marital-status' "7b9ed651-cea9-46b2-bc57-7264683bbe19";#xD; src -> maritalStatus.code = evaluate(maritalStatusCodeableConcept, coding.code) "a0ef89bb-7e8f-4db8-9df0-112743334a6f";#xD; src -> maritalStatus.display = evaluate(maritalStatusCodeableConcept, coding.display) "27c4c111-f8d3-421f-9178-9f4a77e6a7e0";#xD; } "b496a92b-22c1-4661-839a-97f184afd6d0";#xD; "setMaritalStatusCoding" "2c8166a7-0d1e-4fa1-9209-c76e68d91975";#xD; } "setMaritalStatus";#xD; src.extension as ethnicityExt where $this.url='https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory', ethnicityExt.valueCodeableConcept as ethnicCategory then {#xD; src -> demographics.ethnicity as ethnicity then {#xD; src -> ethnicity.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-ethnicity' "3b37fb5e-2e83-4cce-8e65-5e4cc91e312b";#xD; src -> ethnicity.code = evaluate(ethnicCategory, coding.code) "68e82e0c-e728-4eab-973a-969cf226d0ec";#xD; src -> ethnicity.display = evaluate(ethnicCategory, coding.display) "b0446528-160e-4fca-bae4-af90163db1ef";#xD; } "setEthnicityCoding";#xD; } "setEthnicity";#xD; src.gender as genderCode then {#xD; src -> src.genderIdentity = create('Coding') as givt then {#xD; src -> givt.system = 'http://hl7.org/fhir/R4/codesystem-administrative-gender' "bca3b9da-1b57-4529-8bca-8a175a39a132";#xD; src -> givt.code = genderCode "d395d81e-e259-40d8-af72-9537e3e6bbd8";#xD; src -> demographics.genderIdentity = translate(givt, 'https://metadata.phase2.scip.synanetics.cloud/fhir/r4/ConceptMap/MODS-FHIRGenderIdentity-1', 'Coding') "b9de8d60-45a1-4e03-b8b9-1c516e2b6199";#xD; } "2a381668-3b86-4439-963d-83311f984f54";#xD; } "setGenderIdentity";#xD; src.extension as religionExt where $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonReligiousAffiliation', religionExt.valueCodeableConcept as religiousAffiliation then {#xD; src -> demographics.religion as religion then {#xD; src -> religion.code = evaluate(religiousAffiliation, coding.code) "88e490e7-3f31-430e-aab0-d76cba708ad1";#xD; src -> religion.display = evaluate(religiousAffiliation, coding.display) "06c9e054-6e71-48c3-9763-b02dbc6e7630";#xD; src -> religion.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-religion' "2af659f9-f1b6-4b6a-8cbc-188d4dc6830b";#xD; } "setReligionCoding";#xD; } "setReligion";#xD; src.communication as communication where $this.preferred=true, communication.language as language then {#xD; src -> demographics.firstLanguage as firstLanguage then {#xD; src -> firstLanguage.code = evaluate(language, coding.code) "21af66d5-46e6-400f-9443-ba8fc7b32b19";#xD; src -> firstLanguage.display = evaluate(language, coding.display) "47a5e1c7-8372-4af6-b13a-c69779fcc6da";#xD; src -> firstLanguage.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-language' "1d70b412-064e-4fd4-9748-fd9d86207d17";#xD; } "c6273fae-d859-43ae-94d6-93b77e72941b";#xD; } "setFirstLanguage";#xD; src.communication as communication where $this.preferred.exists().not()or$this.preferred=false, communication.language as language then {#xD; src -> demographics.otherLanguage as otherLanguage then {#xD; src -> otherLanguage.code = evaluate(language, coding.code) "bbfa5d5a-bff6-4045-ab40-5745a5c0282d";#xD; src -> otherLanguage.display = evaluate(language, coding.display) "e20858a5-4fd0-40fc-83ea-ec1a24798594";#xD; src -> otherLanguage.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-language' "41d38585-b154-44e3-af7f-cc60b629f40b";#xD; } "0514913d-4c87-4b9c-9de9-b5baf7b9e913";#xD; } "setOtherLanguage";#xD; src.extension as interpreterRequiredExt where $this.url='http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired' then {#xD; src -> demographics.interpreterRequired = evaluate(interpreterRequiredExt, iif(valueBoolean,'Yes','No')) "923bade9-9be3-4694-98af-3d881345584f";#xD; } "setInterpreterRequired";#xD; src.extension as sexualOrientationExt where $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonSexualOrientation', sexualOrientationExt.valueCodeableConcept as sexualOrientation then {#xD; src -> demographics.sexualOrientation as orientation then {#xD; src -> orientation.code = evaluate(sexualOrientation, coding.code) "a4f4f82d-067f-41cc-ac52-1383e173c5c8";#xD; src -> orientation.display = evaluate(sexualOrientation, coding.display) "d3f9eb6a-8c3f-4103-8835-c9a7c4c469e5";#xD; src -> orientation.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-sexual-orientation' "0c9c73cb-7d58-4bf1-aa1b-ccd83b6a73c7";#xD; } "setSexualOrientationCoding";#xD; } "setSexualOrientation";#xD; } "setDemographics";#xD; src.address as address -> tgt.address as addr then {#xD; src -> addr.addressEntry1 = evaluate(address, line[0]) "95432416-4785-4291-8f45-effd574787da";#xD; src -> addr.addressEntry2 = evaluate(address, line[1]) "593c5458-e865-4cc1-bfee-defe7c961cef";#xD; src -> addr.addressEntry3 = evaluate(address, line[2]) "754956fd-2c03-4981-8575-6a7a8c16d8a9";#xD; src -> addr.addressEntry4 = evaluate(address, line[3]) "c0b49511-d2e2-48b7-9623-6d9c998e5dcf";#xD; src -> addr.postCode = evaluate(address, postalCode) "b30d5798-757a-4886-8ed3-cca0230bab90";#xD; address.extension as countryExt where $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-AddressCountry' then {#xD; src -> addr.country as country then {#xD; src -> country.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/country' "d9072b37-e118-46bf-a7e3-1b208bf70fa2";#xD; src -> country.code = evaluate(countryExt, valueCoding.code) "e84087b8-1a49-4025-8fdd-b5d75c89fb93";#xD; src -> country.display = evaluate(countryExt, valueCoding.display) "f9805ba3-df96-4a47-9fb8-5ddcf7b75b02";#xD; } "80fe4365-9c9c-4545-b477-58016d00def9";#xD; };#xD; } "setAddress";#xD; src -> tgt.contactDetails as contactDetails then {#xD; src.telecom as emailAddress where $this.system='email' -> contactDetails.emailAddressDetails as emailAddressDetails then {#xD; src -> emailAddressDetails.emailAddress = evaluate(emailAddress, value) "67ad906f-1a85-4b7f-92bb-03b0922277a1";#xD; src -> emailAddressDetails.preferredOrder = evaluate(emailAddress, rank) "43e0d11a-4301-4000-b3b9-7b7b2134aab6";#xD; emailAddress.extension as emailAddressTypeExt where $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonEmailAddressType' then {#xD; src -> emailAddressDetails.type as emailAddressType then {#xD; src -> emailAddressType.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-email-address-type' "951232f8-dcc4-4b5d-beba-2e2077610a73";#xD; src -> emailAddressType.code = evaluate(emailAddressTypeExt, valueCoding.code) "79f6f6d2-0393-4c4f-b7d5-b8e49c1910ed";#xD; src -> emailAddressType.display = evaluate(emailAddressTypeExt, valueCoding.display) "2d40b5a5-d0cb-4c49-a1a7-87c6f2f3a6af";#xD; } "369074a4-1c99-4d96-842d-463a50c6c609";#xD; };#xD; };#xD; src.telecom as telephoneNumber where $this.system='phone' -> contactDetails.telephoneDetails as telephoneNumberDetails then {#xD; src -> telephoneNumberDetails.telephoneNumber = evaluate(telephoneNumber, value) "07be6470-6f99-41c8-bcd5-32f74708b3b1";#xD; src -> telephoneNumberDetails.preferredOrder = evaluate(telephoneNumber, rank) "c4cf0def-3e23-4c8f-a9d4-456bdc257862";#xD; telephoneNumber.extension as telephoneNumberExt where $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonTelephoneNumberType' then {#xD; src -> telephoneNumberDetails.type as telephoneNumberType then {#xD; src -> telephoneNumberType.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-telephone-type' "5310bd0f-2104-48b3-a3a8-fb065b75a1de";#xD; src -> telephoneNumberType.code = evaluate(telephoneNumberExt, valueCoding.code) "3503123e-f245-4d1c-8285-bcbab47c6b55";#xD; src -> telephoneNumberType.display = evaluate(telephoneNumberExt, valueCoding.display) "85f41bb5-e8a1-4b89-8a07-726d574ef7f3";#xD; } "a74495d1-058d-48d8-9d62-c3757502c851";#xD; };#xD; };#xD; } "setContactDetails";#xD; src.extension as deathDetailsExt where $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonDeathDetails' then {#xD; src -> tgt.deathDetails as deathDetails then {#xD; deathDetailsExt.extension as deathCauseIdentificationMethodExt where $this.url='deathCauseIdentificationMethod', deathCauseIdentificationMethodExt.valueCoding as deathCauseIdentificationMethodCoding then {#xD; src -> deathDetails.deathCauseIdentificationMethod as deathCauseIdentificationMethod then {#xD; src -> deathCauseIdentificationMethod.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-death-cause-identification-method' "a4e54425-1be9-4d75-87f1-670a2a50f11e";#xD; src -> deathCauseIdentificationMethod.code = evaluate(deathCauseIdentificationMethodCoding, code) "79b27933-27cc-4246-aa2f-40e1ecdd856e";#xD; src -> deathCauseIdentificationMethod.display = evaluate(deathCauseIdentificationMethodCoding, display) "78d73d39-7771-412b-b3f2-d13e58967b5f";#xD; } "0c5c4818-d666-48e4-92e5-f1bb55f921ba";#xD; } "setPersonDeathCauseIdentificationMethod";#xD; deathDetailsExt.extension as deathLocationTypeExt where $this.url='deathLocationType', deathLocationTypeExt.valueCoding as deathLocationTypeCoding then {#xD; src -> deathDetails.deathLocationType as deathLocationType then {#xD; src -> deathLocationType.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-death-location-type' "4ede752b-80f0-4597-9fd6-7d3efb1ce391";#xD; src -> deathLocationType.code = evaluate(deathLocationTypeCoding, code) "acd83a15-090f-460c-b034-7db7688d04ad";#xD; src -> deathLocationType.display = evaluate(deathLocationTypeCoding, display) "05912dfb-b237-469f-9acc-6868de1d05c1";#xD; } "33de70ac-0b3f-4a45-adef-c664707ec290";#xD; } "setPersonDeathLocationType";#xD; deathDetailsExt.extension as deathNotAtPreferredLocationReasonExt where $this.url='deathNotAtPreferredLocationReason', deathNotAtPreferredLocationReasonExt.valueCoding as deathNotAtPreferredLocationReasonCoding then {#xD; src -> deathDetails.deathNotAtPreferredLocationReason as deathNotAtPreferredLocationReason then {#xD; src -> deathNotAtPreferredLocationReason.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-death-not-at-preferred-location-reason-code' "f17aeb1c-f7ae-4097-aee5-355f7d633800";#xD; src -> deathNotAtPreferredLocationReason.code = evaluate(deathNotAtPreferredLocationReasonCoding, code) "f85cd3bf-f028-4be1-82b3-163c246a5eb2";#xD; src -> deathNotAtPreferredLocationReason.display = evaluate(deathNotAtPreferredLocationReasonCoding, display) "a1147b42-98e6-4e7a-8049-c0c1d1264358";#xD; } "b8823f41-f895-41c9-8a5f-4fa20c40cf03";#xD; } "setPersonDeathNotAtPreferredLocationReason";#xD; deathDetailsExt.extension as personAtRiskOfUnexpectedDeathExt where $this.url='personAtRiskOfUnexpectedDeath', personAtRiskOfUnexpectedDeathExt.valueCoding as personAtRiskOfUnexpectedDeathCoding then {#xD; src -> deathDetails.personAtRiskOfUnexpectedDeath as personAtRiskOfUnexpectedDeath then {#xD; src -> personAtRiskOfUnexpectedDeath.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-at-risk-of-unexpected-death-indicator' "3c034992-69a9-4952-9774-c1993266a742";#xD; src -> personAtRiskOfUnexpectedDeath.code = evaluate(personAtRiskOfUnexpectedDeathCoding, code) "22c381c4-e90c-4e48-9e72-293b93fd74c2";#xD; src -> personAtRiskOfUnexpectedDeath.display = evaluate(personAtRiskOfUnexpectedDeathCoding, display) "c337baba-b43c-4856-9bf3-8245a7641f74";#xD; } "8656778d-a6a7-4b2c-a052-5d0ceb4bf5b2";#xD; } "setPersonAtRiskOfUnexpectedDeath";#xD; deathDetailsExt.extension as preferredLocationOfDeathDiscussedExt where $this.url='preferredLocationOfDeathDiscussed', preferredLocationOfDeathDiscussedExt.valueCoding as preferredLocationOfDeathDiscussedCoding then {#xD; src -> deathDetails.preferredDeathLocationDiscussed as preferredDeathLocationDiscussed then {#xD; src -> preferredDeathLocationDiscussed.system = 'https://data.digitisingsocialcare.co.uk/mods/v1/person-death-location-discussed-indicator' "788b4cba-370e-46d2-8516-e78b837b672a";#xD; src -> preferredDeathLocationDiscussed.code = evaluate(preferredLocationOfDeathDiscussedCoding, code) "14b41539-f313-438c-9777-0527a62c58b3";#xD; src -> preferredDeathLocationDiscussed.display = evaluate(preferredLocationOfDeathDiscussedCoding, display) "05dc6068-4ee9-40bb-9b29-b9b84a9226dc";#xD; } "093f7a55-6019-4714-9ba1-5083938473e2";#xD; } "setPreferredLocationOfDeathDiscussed";#xD; deathDetailsExt.extension as personDateOfDeathExt where $this.url='personDateOfDeath' then {#xD; src -> deathDetails.personDeathDate = evaluate(personDateOfDeathExt, valueDate) "bc39d76b-dc34-4fd2-bed9-258723fa840d";#xD; } "setPersonDeathTime";#xD; deathDetailsExt.extension as personTimeOfDeathExt where $this.url='personTimeOfDeath' then {#xD; src -> deathDetails.personDeathTime = evaluate(personTimeOfDeathExt, valueTime) "8c3f173f-d9ec-41db-9c48-16687e7a4bac";#xD; } "setPersonDeathTime";#xD; } "c448219c-e93c-485a-8ad0-ecd8a1cbe465";#xD; } "setDeathDetails";#xD; src.extension as careProviderExt where $this.url='https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/Extension-MODS-PersonCareProvider' -> tgt.careProvider as careProvider then {#xD; careProviderExt.valueReference as careProviderReference then {#xD; src -> careProvider.id = evaluate(careProviderReference, identifier.value) "8c4ea278-3846-413b-9cc2-7501d495f79a";#xD; src -> careProvider.type = 'CareOrganisation' "ad36c453-f79f-4a53-937d-ac2247ba2b4a";#xD; src -> careProvider.display = evaluate(careProviderReference, display) "2b97e017-4ab9-46d9-a509-cb3cd3f5c339";#xD; };#xD; } "setCareProvider";#xD; src.generalPractitioner as generalPractitioner, generalPractitioner.identifier as generalPractitionerIdentifier then {#xD; src -> tgt.generalPractice as generalPractice then {#xD; src -> generalPractice.id = evaluate(generalPractitionerIdentifier, value) "3f7a4d90-6ea5-4be6-958d-ddfb8a89a2d3";#xD; src -> generalPractice.type = 'CareOrganisation' "dcfa5550-f50e-4527-b997-3c04c9a2935b";#xD; src -> generalPractice.display = evaluate(generalPractitioner, display) "738a6d9f-d778-4c75-b194-dea270aeff50";#xD; } "125eccb4-2cad-49aa-80a7-eb926eeaa7e5";#xD; } "setGeneralPractitioner";#xD; }#xD; #xD;
Synanetics Ltd on behalf of DHSC/Social Care Interoperability Platform
United Kingdom of Great Britain and Northern Ireland