jembi / rhea-poc-adapter

RHEA Point Of Care Adapter
0 stars 2 forks source link

Remove hardcoded patient id types #12

Open hnnesv opened 11 years ago

hnnesv commented 11 years ago

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.

danfuterman commented 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.

danfuterman commented 11 years ago

Pull Request submitted #18

rcrichton commented 11 years ago

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.

danfuterman commented 11 years ago

Thanks for clarifying this Ryan :)

fiston commented 10 years ago

Fixed by Daniel

rcrichton commented 10 years ago

This shouldn't be closed as the branch hasn't been merged.