Where I used the term subject_id, I just mean any of those external ids. I think you are using subject_id as the reliable id of a single master instance of a patient’s entry in the demographics system. In that case, your EHR index service DB table needs to be:
- subject_id
- ehr_id
- external_id / patient_id / whatever (potentially N of these)
- location info
- other meta-data
Yes, true - but my knowledge of real hospital systems and contexts tells me that it’s hard (maybe impossible) to escape 100% from this. There always has to be this merge / demerge function in the system.