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

Match fp id to isanteplusid #42

Merged
merged 2 commits into from
Aug 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
public enum EnrollmentStatus {
SUCCESS,
ALREADY_REGISTERED,
NOT_REGISTERED,
ERROR,
}
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ public BiometricEngine getBiometricEngine() {

@Override
public BiometricData saveBiometricsForPatient(Patient patient, BiometricData biometricData) {
// Only dealing with the subject IDs..no need to poll the engines
// Only dealing with the subject IDs...Need to update the local FP id thought to match patient ID
BiometricSubject subject = biometricData.getSubject();
if (subject == null) {
log.debug("There are no biometrics to save for patient");
Expand All @@ -570,13 +570,22 @@ public BiometricData saveBiometricsForPatient(Patient patient, BiometricData bio
if (identifierExists) {
log.debug("Identifier already exists for patient");
} else {


// Patient ID already formed at this stage, match the local fingerprint ID
if(idType.getUuid().equals(RegistrationCoreConstants.GP_BIOMETRICS_PERSON_IDENTIFIER_TYPE_UUID)){
try{
subject = getBiometricEngine().updateSubjectId(biometricData.getSubject().getSubjectId(), patient.getPatientIdentifier().getIdentifier());
}catch(Exception e){
log.error("Identifier update error....will proceed with the UUID");
}
}

log.info("Saving new patient Identifier.....: ");
PatientIdentifier identifier = identifierBuilder.createIdentifier(idType.getUuid(), subject.getSubjectId(), null);
log.info("New patient identifier saved for patient...: " + identifier);
patient.addIdentifier(identifier);
patientService.savePatientIdentifier(identifier);
log.debug("New patient identifier saved for patient: " + identifier);
log.debug("New patient identifier saved for patient: " + identifier);
}
} else {
// TODO: In the future we could add additional support for different storage options - eg. as person attributes
Expand Down