nmrs-nigeria / openmrs-module-nigeriaemr

NMRS NDR Extration Module for NigeriaMRS
1 stars 15 forks source link

PepfarID of a lot of patients are not showing on the XML #133

Closed brightoibe closed 3 years ago

brightoibe commented 4 years ago

Hello Team,

I noticed that PepfarID of lots of patients are not showing on the XML file. Your PEPFAR ID will not show if the DA did not check it as the Preferred ID. I believe this will cause a lot of problems. I was able to narrow the problem down to where it occured on the source code.

https://github.com/nmrs-nigeria/openmrs-module-nigeriaemr/blob/f8a41a4227c3a95d2628d0ffb27020c48bcec921/omod/src/main/java/org/openmrs/module/nigeriaemr/ndrfactory/NDRCommonQuestionsDictionary.java#L175

The line

pepfarid = allPidentifiers.stream().filter(x-> x.isPreferred()).findFirst().get();

Should be changed to

pepfarid = pts.getPatientIdentifier(Utils.PEPFAR_IDENTIFIER_INDEX);

Since the PEPFAR_IDENTIFIER_INDEX in all NMRS instances is always 4.

@wandechris @talk2morris @wonderfulguru1 please consider

caniekwe commented 4 years ago

Thank you @brightoibe for bringing this up. @wonderfulguru1 please look into this. Also confirm that this code is not picking any preferred ID to be the pepfarid in the latest release version. If it is, I think the code suggestion by @brightoibe should resolve this.

dkayiwa commented 4 years ago

Great to see activity again on this module. 😊

wonderfulguru1 commented 4 years ago

Hello Team,

I noticed that PepfarID of lots of patients are not showing on the XML file. Your PEPFAR ID will not show if the DA did not check it as the Preferred ID. I believe this will cause a lot of problems. I was able to narrow the problem down to where it occured on the source code.

https://github.com/nmrs-nigeria/openmrs-module-nigeriaemr/blob/f8a41a4227c3a95d2628d0ffb27020c48bcec921/omod/src/main/java/org/openmrs/module/nigeriaemr/ndrfactory/NDRCommonQuestionsDictionary.java#L175

The line

pepfarid = allPidentifiers.stream().filter(x-> x.isPreferred()).findFirst().get();

Should be changed to

pepfarid = pts.getPatientIdentifier(Utils.PEPFAR_IDENTIFIER_INDEX);

Since the PEPFAR_IDENTIFIER_INDEX in all NMRS instances is always 4.

@wandechris @talk2morris @wonderfulguru1 please consider

@brightoibe thanks for your observation I will look into this and revert the line you specified can't be changed to what you specified as we are pulling deleted and non deleted patients and this service pts.getPatientIdentifier(Utils.PEPFAR_IDENTIFIER_INDEX) doesn't offer that.

wonderfulguru1 commented 4 years ago

Hello Team, I noticed that PepfarID of lots of patients are not showing on the XML file. Your PEPFAR ID will not show if the DA did not check it as the Preferred ID. I believe this will cause a lot of problems. I was able to narrow the problem down to where it occured on the source code. https://github.com/nmrs-nigeria/openmrs-module-nigeriaemr/blob/f8a41a4227c3a95d2628d0ffb27020c48bcec921/omod/src/main/java/org/openmrs/module/nigeriaemr/ndrfactory/NDRCommonQuestionsDictionary.java#L175

The line pepfarid = allPidentifiers.stream().filter(x-> x.isPreferred()).findFirst().get(); Should be changed to pepfarid = pts.getPatientIdentifier(Utils.PEPFAR_IDENTIFIER_INDEX); Since the PEPFAR_IDENTIFIER_INDEX in all NMRS instances is always 4. @wandechris @talk2morris @wonderfulguru1 please consider

@brightoibe thanks for your observation I will look into this and revert the line you specified can't be changed to what you specified as we are pulling deleted and non deleted patients and this service pts.getPatientIdentifier(Utils.PEPFAR_IDENTIFIER_INDEX) doesn't offer that.

@caniekwe I will also what to suggest we have Is_Preferred flag on the schema to distinguish the preferred ID from other ID'S this will solve the issue totally as we can't say which IP prefer which ID

wandechris commented 4 years ago

Great to see activity again on this module. 😊

Hi @dkayiwa how can I contact you?

dkayiwa commented 4 years ago

Just like you have done. 😊

wandechris commented 4 years ago

@dkayiwa ...lol, I wanted to ask how we can get access to publish our artifact to openmrs nexus repo

dkayiwa commented 4 years ago

Feel free to ask on OpenMRS Talk.

caniekwe commented 4 years ago

Hello Team, I noticed that PepfarID of lots of patients are not showing on the XML file. Your PEPFAR ID will not show if the DA did not check it as the Preferred ID. I believe this will cause a lot of problems. I was able to narrow the problem down to where it occured on the source code.

  openmrs-module-nigeriaemr/omod/src/main/java/org/openmrs/module/nigeriaemr/ndrfactory/NDRCommonQuestionsDictionary.java

     Line 175
  in
  f8a41a4

       pepfarid = allPidentifiers.stream().filter(x-> x.isPreferred()).findFirst().get(); 

The line pepfarid = allPidentifiers.stream().filter(x-> x.isPreferred()).findFirst().get(); Should be changed to pepfarid = pts.getPatientIdentifier(Utils.PEPFAR_IDENTIFIER_INDEX); Since the PEPFAR_IDENTIFIER_INDEX in all NMRS instances is always 4. @wandechris @talk2morris @wonderfulguru1 please consider

@brightoibe thanks for your observation I will look into this and revert the line you specified can't be changed to what you specified as we are pulling deleted and non deleted patients and this service pts.getPatientIdentifier(Utils.PEPFAR_IDENTIFIER_INDEX) doesn't offer that.

@caniekwe I will also what to suggest we have Is_Preferred flag on the schema to distinguish the preferred ID from other ID'S this will solve the issue totally as we can't say which IP prefer which ID

My understanding is that the Is_Preferred flag shouldn't be have any effect on this. Irrespective of what people prefer, hospital number is still hospital number and ART number/PEPFAR id is still ART number/pepfar number.

wandechris commented 3 years ago

@wonderfulguru1 what's the status on this?