-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ap 84 - Add "age", "gender" and "patient identifiers" to Patient map #91
base: master
Are you sure you want to change the base?
Conversation
24ed091
to
2560bbc
Compare
Hi @binduak Related PR: Bahmni/openmrs-module-appointments-frontend#230 |
cc @donaldkibet |
@@ -252,6 +250,9 @@ private Map createPatientMap(Patient p) { | |||
map.put("name", p.getPersonName().getFullName()); | |||
map.put("uuid", p.getUuid()); | |||
map.put("identifier", p.getPatientIdentifier().getIdentifier()); | |||
map.put("age", p.getAge()); | |||
map.put("gender", p.getGender()); | |||
map.putAll(p.getActiveIdentifiers().stream().filter(e -> e.getIdentifierType() != null).collect(Collectors.toMap(e -> e.getIdentifierType().toString().replaceAll("[- ]", ""), e -> e.getIdentifier()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it put in the map?
From the code - seems the key is the "identifier type" and value is the identifier.
Also from the replaceall expression, this seems very specific to your requirements.
Also note, you are using "PatientIdentifierType.toString()" - which is just sending back "identifier" value - this will result in something like "HID101" : "HID101". I am not sure I understand the requirement.
This should not be so, if you want all identifiers, then I prefer you sending as a top level attribute to the patient map object .. maybe call "identifiers" (as we are already sending the primary identifier through patient.identifier).
If you do not require that in the map, kindly remove this line.
Issue: https://bahmni.atlassian.net/browse/AP-84
Note:
In a prior commit, the fields were not added to the listView.
This would break the report and show fields as empty
(As a solution we added this fields to the template)
That being said, one other issue that stem from this, is the need to show a specific auxiliary Identifier.
This is a problem when we have multi auxiliary Identifiers.
To keep it simple, instead of adding a bunch of auxiliary Identifiers, we now add a auxiliaryIdentifier key, containing all the remaining auxiliary Identifiers