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

BAH-3052 | Refactor. search using extraIdentiervalues and display configured identifier in patientList #603

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SanoferSameera
Copy link
Contributor

@SanoferSameera SanoferSameera commented Jun 12, 2023

No description provided.

@SanoferSameera SanoferSameera changed the title BAH-3052 | Refactor. search using extraIdentiervalues and display con… BAH-3052 | Refactor. search using extraIdentiervalues and display configured identifier in patientList Jun 12, 2023
angshu
angshu previously approved these changes Jun 13, 2023
@@ -207,6 +207,17 @@ angular.module('bahmni.common.patientSearch')
});
}
};
$scope.getIdentifierValue = function (patient) {
if (preferredExtraIdInPatientList !== null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be better written as
if (preferredExtraIdInPatientList && patient.extraIdentifiers) { ... }

if (preferredExtraIdInPatientList !== null) {
var identifierIndex = patient.extraIdentifiers !== undefined ? patient.extraIdentifiers.split(",").indexOf(preferredExtraIdInPatientList) : -1;
if (identifierIndex >= 0) {
if (patient.extraIdentifierVal !== undefined && patient.extraIdentifierVal) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just check
if (patient.extraIdentifierVal) { .. }

@angshu angshu dismissed their stale review June 13, 2023 14:30

this happened by mistake

@angshu
Copy link
Member

angshu commented Jun 13, 2023

@SanoferSameera I think there is a bigger question here

  • you are now returning more fields: extraIdentifierVal and extraIdentifiers. Before we were only returning "uuid, name, identifier, activeVisitUuid, hasBeenAdmitted" fields.
  • The additional fields are not documented. This actually is an enhancement to our "patient lists". This is not an one-off, we must document the usage of the fields and let implementers know that beyond primary identifier, other identifiers are also searchable in the patient lists from now on.
  • "extraIdentifiers" is basically list of "identifier type name". I am not sure thats required - it can be simple textual search. We don't have to match identifier type name. Do we? If thats the case, then just return another field "additionalIdentifiers" (better than extraIdentifiers?)
  • we need to document that bahmni patient list queries can now also "additionalIdentifiers" in the custom query that they write.
  • have we tested the same query on say "bahmni demo"? whether ommitting the extra fields would throw any error? we have to be backward compatible?

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.

2 participants