Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

icrc-toliveira
Copy link
Contributor

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

@CLAassistant
Copy link

CLAassistant commented Oct 4, 2022

CLA assistant check
All committers have signed the CLA.

@icrc-toliveira
Copy link
Contributor Author

Hi @binduak
Could you take a look to make sure you no longer find the the fields missing

Related PR: Bahmni/openmrs-module-appointments-frontend#230

@CynthiaKamau
Copy link
Contributor

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())));
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants