InSync encodes a patient's MRN inside the FHIR long-form patient id: the
segment after the . is the MRN (a.k.a. e-RIN), and the prefix is the
partition/facility id — e.g. 166000000000200.0000034346 -> 0000034346.
We persist the long-form id as external_patient_id and derive the MRN on
demand with this helper rather than storing it in its own column. The MRN is
the key RPA later uses to attach clinical documents to the right patient.
InSync encodes a patient's MRN inside the FHIR long-form patient id: the segment after the
.is the MRN (a.k.a. e-RIN), and the prefix is the partition/facility id — e.g.166000000000200.0000034346->0000034346.We persist the long-form id as
external_patient_idand derive the MRN on demand with this helper rather than storing it in its own column. The MRN is the key RPA later uses to attach clinical documents to the right patient.