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

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

StructureMap: PatientToRegistration

Official URL: https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/Patient-Registration Version: 0.1.0
Draft as of 2026-06-10 Computable Name: PatientToRegistration

map "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureMap/Patient-Registration" = "PatientToRegistration"

uses "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-Patient" alias Patient as source
uses "https://metadata.phase2.scip.synanetics.cloud/fhir/r4/StructureDefinition/MODS-RegistrationStatus" alias RegistrationStatus as target

group PatientRegistration(source src : Patient, target tgt : RegistrationStatus) {
  src -> tgt.subjectOfCareId = evaluate(src, id) "867e3c30-bdfe-4f6e-b5fe-bf0957312f58";
  src ->  tgt.meta as meta,  meta.dataClass as dataClass then {
    src -> dataClass.name = 'Registration' "7806cf8c-72e4-46dc-bdbd-32c5c9e5d5f8";
  } "setDataClassName";
  src.meta as meta then {
    src -> tgt.updatedAt = evaluate(meta, lastUpdated) "06106e07-df65-4c3b-8bb2-8ada21e43815";
  } "setUpdatedAt";
  src.meta as meta, meta.tag as tag where $this.system='https://yhcr.nhs.uk/pix/registration/status'and$this.code!='success' then {
    src -> tgt.status = evaluate(tag, code) "c67d24be-4560-4104-89b2-5c01159d990e";
    src -> tgt.reason = evaluate(tag, display) "5d59340c-e41f-4358-a227-786b904b3bae";
  } "setStatusAndReason";
  src.contained as contained, contained as oo where $this.resourceType='OperationOutcome' then {
    oo.issue as issue -> tgt.diagnostics = evaluate(issue, diagnostics);
  } "setErrorDiagnostics";
  src.meta as meta, meta.tag as tag where $this.system='https://yhcr.nhs.uk/pix/registration/status'and$this.code='success' then {
    src -> tgt.status = 'success' "65554b50-2cbe-4b3d-b585-d65e38066bad";
  } "setSuccessStatus";
  tgt where $this.status.exists().not() then {
    tgt -> tgt.status = 'unknown' "e08b0daa-a19a-4992-96f0-d124a86933b6";
  } "da470550-add5-4098-bdf4-d7d4d145d626";
  "setUnknownStatus" "7fb80f03-3e33-4d80-8faa-35b2cb9a7d14";
}