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

Improve user experience by offloading unnecessary repeat biometrics c… #40

Merged
merged 2 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>registrationcore</artifactId>
<version>2.1.0</version>
<version>2.2.0-SNAPSHOT</version>
</parent>

<artifactId>registrationcore-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
package org.openmrs.module.registrationcore.api;

import org.dcm4chee.xds2.common.exception.XDSException;
import org.openmrs.Location;
import org.openmrs.Patient;
import org.openmrs.Relationship;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,7 @@ public String importMpiPatient(String patientIdentifier, String patientIdentifie
public PatientAndMatchQuality fetchMpiFpMatch(String patientIdentifier, String patientIdentifierTypeUuid) {
MpiPatient foundPatient = fetchMpiPatientWithObservations(patientIdentifier, patientIdentifierTypeUuid);
if(foundPatient != null){
PatientAndMatchQuality patientMatch = new PatientAndMatchQuality(foundPatient,null,null,
foundPatient.getSourceLocation());
PatientAndMatchQuality patientMatch = new PatientAndMatchQuality(foundPatient,null,null,foundPatient.getSourceLocation());
return patientMatch;
}
return null;
Expand Down Expand Up @@ -554,27 +553,13 @@ public BiometricEngine getBiometricEngine() {

@Override
public BiometricData saveBiometricsForPatient(Patient patient, BiometricData biometricData) {
// Only dealing with the subject IDs..no need to poll the engines
BiometricSubject subject = biometricData.getSubject();
if (subject == null) {
log.debug("There are no biometrics to save for patient");
}
else {
if (!isBiometricEngineEnabled()) {
throw new IllegalStateException("Unable to save biometrics, as no biometrics engine is enabled");
}
BiometricEngine biometricEngine = getBiometricEngine();
log.error("Using biometric engine: " + biometricEngine.getClass().getSimpleName());

}else {
PatientIdentifierType idType = biometricData.getIdentifierType();
log.error("There are no biometrics to save for patient:"+ idType.getName()+ "UUID:"+idType.getUuid()+"ID:"+subject.getSubjectId());
if (idType != null) {
log.debug("Saving biometrics as a patient identifier of type: " + idType.getName());
//Currently, lookup checks if identifier exists only in local fingerprint server, but this method will be used also by national ids
//BiometricSubject existingSubject = (subject.getSubjectId() == null ? null : biometricEngine.lookup(subject.getSubjectId()));
//if (existingSubject == null) {
// throw new IllegalArgumentException("The subject doesn't exist in m2Sys. Did you call m2Sys enroll method?") ;
//}

// If patient does not already have an identifier that references this subject, add one
boolean identifierExists = false;
for (PatientIdentifier identifier : patient.getPatientIdentifiers(idType)) {
Expand All @@ -586,16 +571,12 @@ public BiometricData saveBiometricsForPatient(Patient patient, BiometricData bio
log.debug("Identifier already exists for patient");
} else {

log.error("New patient identifier saved for patient avant: ");
log.info("Saving new patient Identifier.....: ");
PatientIdentifier identifier = identifierBuilder.createIdentifier(idType.getUuid(), subject.getSubjectId(), null);
log.error("New patient identifier saved for patient apres: " + identifier);
log.info("New patient identifier saved for patient...: " + identifier);
patient.addIdentifier(identifier);
patientService.savePatientIdentifier(identifier);
log.debug("New patient identifier saved for patient: " + identifier);

//registrationService.registerLocally(subject);


}
} else {
// TODO: In the future we could add additional support for different storage options - eg. as person attributes
Expand Down
2 changes: 1 addition & 1 deletion omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>registrationcore</artifactId>
<version>2.1.0</version>
<version>2.2.0-SNAPSHOT</version>
</parent>

<artifactId>registrationcore-omod</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.openmrs.module</groupId>
<artifactId>registrationcore</artifactId>
<version>2.1.0</version>
<version>2.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Registration Core Module</name>
<description>Provides core utilities and services for patient registration.</description>
Expand Down