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
Libfprint #2
Libfprint #2
Conversation
|
||
@Override | ||
public PatientFingerPrintModel addFingerprintToPatient(String patientWithFingerprint) throws JSONException { | ||
public PatientFingerPrintModel addFingerprintToPatient(String patientUUID,byte[] firstFingerImage,byte[] secondeFingerImage,byte[] thirdFingerImage,Boolean fingerprintAlreadyExist) throws JSONException { | ||
PatientJsonParser patientJsonParser = new PatientJsonParser(); | ||
PatientFingerPrintModel patient = null; | ||
Patient pat = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove unnecessary initialization to null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments for review
@@ -52,6 +52,7 @@ public MuzimaFingerprint findByUuid(String uuid) { | |||
|
|||
@Override | |||
public MuzimaFingerprint findByPatientUUID(String patientUUID) { | |||
System.out.println("findbyPatientUUid ++++++++++++++++++++++++++++++++++++++"+patientUUID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this log still needed?
@@ -0,0 +1,183 @@ | |||
package org.openmrs.module.muzimabiometrics; | |||
|
|||
import javax.swing.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to avoid wildcard imports
oos.writeObject(firstImage); | ||
oos.flush(); | ||
byte[] secondFingerEncodedByteArray = Base64.encodeBase64(secondFingerBO.toByteArray()); | ||
System.out.println("encodedByteArray +++++++++++++++++++"+secondFingerEncodedByteArray); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need this anymore
oos.flush(); | ||
byte[] secondFingerEncodedByteArray = Base64.encodeBase64(secondFingerBO.toByteArray()); | ||
System.out.println("encodedByteArray +++++++++++++++++++"+secondFingerEncodedByteArray); | ||
String url="http://localhost:8080/openmrs/module/muzimabiometrics/enrollFirstImage.form"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to avoid static server url / port? Might not work in case for example the server runs on a different port. Also could it be set globally since it's being initialised repeatedly?
} | ||
} | ||
private void enrollFingerFirstTime(){ | ||
firstCaptureBtn = new JButton("Capture Thumb Finger First Time"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it always be Thumb finger?
controlPanel.add(secondCaptureBtn); | ||
mainFrame.setVisible(true); | ||
} | ||
private void enrollFingerThirdTime(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the three enrollFinger methods could be refactored for reusability since they all do the same thing.
controlPanel.add(thirdCaptureBtn); | ||
mainFrame.setVisible(true); | ||
} | ||
private void exit(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might need to rename exit method and exit button for readability
System.out.println(matchValue); | ||
if (matchValue > JlibFprint.BOZORTH_THRESHOLD) | ||
{ | ||
System.out.println("[OK] The two fingerprints are compatible!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these messages going to be user visible? If not, might need to use commons logging api
catch(ClassNotFoundException e) { | ||
System.err.println("Failed to deserialize as class wasn't found"); | ||
} | ||
catch(IOException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might need to log exceptions to avoid loosing important information
No description provided.