GOAL: We want to prevent them from entering the exact same "old patient" more than once. We don't mind if two different patients accidentally have the same "old ID".
Would it be possible to write a call which does "async validation" ... i.e. once the user types in their Old Patient ID on the first page of registration, it will lookup in the background whether that ID is already used?
(i.e do a lookup via REST call to see if there's a conflict, if that old patient ID is already used)
it should show an error in the UI (validation warning)
prevent/warn the user that this ID is already used ... I don't think it should 100% prevent them from creating the patient, because it's almost certain their old system has some duplicates (which are in fact different patients, but just were mistakenly assigned the same #). However, they should probably get a warning and confirm before they accidentally enter a duplicate patient.
you already wrote code which checks if the new patient ID has a collision. Would you know how to solve this one?