Skip to content

Ap 84 - Add "age", "gender" and "patient identifiers" to Patient map #91

Open
icrc-toliveira wants to merge 2 commits intoBahmni:masterfrom
icrc-toliveira:AP-84-V2
Open

Ap 84 - Add "age", "gender" and "patient identifiers" to Patient map #91
icrc-toliveira wants to merge 2 commits intoBahmni:masterfrom
icrc-toliveira:AP-84-V2

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

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