Switched back to custom careportal code

This commit is contained in:
TebbeUbben 2018-04-08 18:57:29 +02:00
parent b488e30459
commit 42541fc7e3

View file

@ -160,7 +160,18 @@ class HistoryIntentAdapter {
if (SP.getBoolean("insight_automatic_careportal_events", false)) {
Date date = getDateExtra(intent, HistoryBroadcast.EXTRA_EVENT_TIME);
String alertType = intent.getStringExtra(HistoryBroadcast.EXTRA_ALERT_TYPE);
NSUpload.uploadError(MainApp.instance().getString(getAlertText(alertType)), date);
if (MainApp.getDbHelper().getCareportalEventFromTimestamp(date.getTime()) != null) return;
try {
JSONObject data = new JSONObject();
String enteredBy = SP.getString("careportal_enteredby", "");
if (!enteredBy.equals("")) data.put("enteredBy", enteredBy);
data.put("created_at", DateUtil.toISOString(date));
data.put("eventType", CareportalEvent.NOTE);
data.put("notes", MainApp.instance().getString(getAlertText(alertType)));
NSUpload.uploadCareportalEntryToNS(data);
} catch (JSONException e) {
e.printStackTrace();
}
}
}