mksd
(Dimitri R)
June 19, 2017, 7:37pm
1
Hi all,
I’m referring to this in setIdentifierType(PatientIdentifier, PatientIdentifierType)
:
public void setIdentifierType(PatientIdentifier instance, PatientIdentifierType identifierType) {
String uuid = identifierType.getUuid();
String name = identifierType.getName();
if (name != null && !name.isEmpty()) {
instance.setIdentifierType(Context.getPatientService().getPatientIdentifierTypeByName(name));
} else if (uuid != null && !uuid.isEmpty()) {
instance.setIdentifierType(Context.getPatientService().getPatientIdentifierTypeByUuid(uuid));
}
}
(Q.) Why is this setter prioritizing the name over the UUID when fetching the identifier type before setting it to the identifier?
dkayiwa
(Daniel Kayiwa)
June 19, 2017, 7:54pm
2
mksd
(Dimitri R)
June 19, 2017, 8:02pm
3
Thanks @dkayiwa !
The thread doesn’t make a strong case for the change altogether, it seems to have originated from a design flaw in Bahmni Apps more than anything else.
@raff , do you remember why you chose to prioritize the name over the UUID ?
I’d make an exception and allow referencing by name although it’s possible to first search for PatientIdentifierType by name and then use its uuid.
dkayiwa
(Daniel Kayiwa)
June 19, 2017, 8:14pm
4
I felt exactly the same as you. That is why i could not defend the change but simply point you to the discussion.
mksd
(Dimitri R)
June 20, 2017, 5:26am
5
I reopened the issue, commented on it, and here is the PR #283 .