Commit 5024caa4 authored by Bastien Le Querrec's avatar Bastien Le Querrec
Browse files

add support for recovery certificates

parent 101a4270
......@@ -205,9 +205,10 @@ public class MainActivity extends AppCompatActivity
}
}
if (recoveryGroup != null && !recoveryGroup.isEmpty()) {
Toast.makeText(context, "EU recovery certificates not supported yet.", Toast.LENGTH_SHORT).show();
startCamera();
if (recoveryGroup != null) {
for (RecoveryEntry recovery : recoveryGroup) {
parseEdccRecovery(ca, signatureDate, firstNames, lastName, birthDate, recovery);
}
}
} catch (Exception e) {
Log.w(TAG, e);
......@@ -249,6 +250,19 @@ public class MainActivity extends AppCompatActivity
resultCode, dayAndHour, testingCenter);
}
private void parseEdccRecovery(String ca, String signatureDate, String firstNames, String lastName, String birthDate,
RecoveryEntry recovery)
{
String certId = recovery.getCi();
String country = recovery.getCo();
String analysisCode = "Unknown";
String resultCode = ValueSets.getValueFromKey(ValueSets.COVID19_LAB_RESULT, "260373001");
String dayAndHour = calculateDate(recovery.getFr());
saveVirological(ca, certId, signatureDate, country, firstNames, lastName, birthDate, "U", analysisCode,
resultCode, dayAndHour, "");
}
private void parseCev(String cev) {
Pattern pattern;
Matcher matcher;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment