Switched back to custom careportal code
This commit is contained in:
parent
b488e30459
commit
42541fc7e3
|
@ -160,7 +160,18 @@ class HistoryIntentAdapter {
|
||||||
if (SP.getBoolean("insight_automatic_careportal_events", false)) {
|
if (SP.getBoolean("insight_automatic_careportal_events", false)) {
|
||||||
Date date = getDateExtra(intent, HistoryBroadcast.EXTRA_EVENT_TIME);
|
Date date = getDateExtra(intent, HistoryBroadcast.EXTRA_EVENT_TIME);
|
||||||
String alertType = intent.getStringExtra(HistoryBroadcast.EXTRA_ALERT_TYPE);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue