check for existing

This commit is contained in:
Milos Kozak 2017-08-07 16:13:09 +02:00
parent 2ae0028495
commit 3bfecd6da8

View file

@ -689,6 +689,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
treatment.insulin = trJson.has("insulin") ? trJson.getDouble("insulin") : 0d;
treatment.pumpId = trJson.has("pumpId") ? trJson.getLong("pumpId") : 0;
treatment._id = trJson.getString("_id");
if (trJson.has("isSMB"))
treatment.isSMB = trJson.getBoolean("isSMB");
if (trJson.has("eventType")) {
treatment.mealBolus = !trJson.get("eventType").equals("Correction Bolus");
@ -1267,6 +1268,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
scheduleExtendedBolusChange();
}
}
public ExtendedBolus findExtendedBolusById(String _id) {
try {
QueryBuilder<ExtendedBolus, Long> queryBuilder = null;