Open hnnesv opened 11 years ago
Q:
The current flow seems to prioritise patientIdentifierTypes:
e.g. in EncounterServiceAdvice:
if (getPatientIdentifierByIdentifierType(patient, nid) != null) { clientId = nid + ... } else if (getPatientIdentifierByIdentifierType(patient, rama) != null) { clientId = rama + ... } else if (getPatientIdentifierByIdentifierType(patient, mutuelle) != null) { clientId = mutuelle + ... } else if (getPatientIdentifierByIdentifierType(patient, primaryCare) != null) { clientId = "OMRS" + ... }
Is it possible for a patient to have >1 of these Ids, such as an NID and a Primary Care ID? In this case, clientId is set according to a priority here: NID > Rama > Mutuelle > Primary Care.
Is this priority intentional? This is useful in looking at moving the patientIdentifierTypes to config.
Pull Request submitted #18
Hey Dan, yes the priority is intentional there. A patient could have more than 1 of these identifiers but only the first identifier found in this priority order is used. The order is because these identifier have an impact on how easily the client registry can match the patient to an existing record.
Thanks for clarifying this Ryan :)
Fixed by Daniel
This shouldn't be closed as the branch hasn't been merged.
See https://github.com/jembi/rhea-poc-adapter/blob/compatible_1_6_5/AdapterModule/api/src/main/java/org/openmrs/module/rheapocadapter/advice/EncounterServiceAdvice.java#L142
We should rather read in the id types from config, like the encounter types, rather than using hardcoded strings.