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

'Patient Identifier column' #414

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,19 @@ function PatientSearchWidget(configuration){
}
});
}
/* Added Identifier type for the patient list in the main dashboard */
else {
const identifiersFiltered = patient.identifiers.filter(i => i.identifierType.uuid === "ffbd60fb-599a-4a57-b2f1-4b55847cd938" || i.identifierType.uuid === "3fa0990e-900d-4a80-a4c1-dcf01a0d4f9c");
if (identifiersFiltered.length > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

So, unfortunately, we can't add hardcoded identifier type uuids here because this is a shared OpenMRS module, not specific to PIH.

But I think there's potentially a way forward... if I understand it, we want to have a single column that could show one of two identifier types?

We do currently have functionality to display custom identifier types via the config. This was implemented earlier this year, see this ticket:

https://issues.openmrs.org/browse/RA-1890

We could create a new ticket about added a feature of allowing multiple identifier types configured for a column, for example, isntead of just supporting this:

 {
      "type": "identifier",
      "label": "DNI",
      "value": "${patientIdentifierType.DNI.uuid}",
      "width": "80px"
    },
    {
      "type": "identifier",
      "label": "Passport",
      "value": "${patientIdentifierType.Passport.uuid}",
      "width": "80px"
    },

We could support something like this:

 {
      "type": "identifier",
      "label": "Identifier",
      "value": "${patientIdentifierType.DNI.uuid},${patientIdentifierType.Passport.uuid}",
      "width": "80px"
    },

I think this would be implemented by modifying the existing code near patientSearchWidget.js:311

Thoughts @MiguelAHPpih @brandones ?

If we want to take this approach, let's create a ticket in the OpenMRS RA project...

Copy link
Author

Choose a reason for hiding this comment

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

I spoke with Aldo about this, we agree on this approach.

Copy link
Member

Choose a reason for hiding this comment

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

Great!

I added a new ticket in OpenMRS Jira for this:
https://issues.openmrs.org/browse/RA-1941

Shall we close this PR and then open a new one labelled with that ticket number once you have an updated commit?

const identifierFiltered = identifiersFiltered[0];
if (column.type === "identifierType") {
columnValue = identifierFiltered.identifierType.name;
}
else if (column.type === "identifierNumber") {
columnValue = identifierFiltered.identifier;
}
}
}
if (index === 0) {
if(_.contains(initialPatientUuids, patient.uuid)){
columnValue += "<span class='recent-lozenge'>" + config.messages.recent + "</span>";
Expand Down