diff --git a/app/src/main/java/org/thousandsmiles/tscharts_lib/PatientData.java b/app/src/main/java/org/thousandsmiles/tscharts_lib/PatientData.java index 61772f6..67396f6 100755 --- a/app/src/main/java/org/thousandsmiles/tscharts_lib/PatientData.java +++ b/app/src/main/java/org/thousandsmiles/tscharts_lib/PatientData.java @@ -554,7 +554,7 @@ public int fromJSONObject(JSONObject o) return ret; } - public JSONObject toJSONObject() + public JSONObject toJSONObject(Context ctx) { JSONObject data = new JSONObject(); try { @@ -567,7 +567,7 @@ public JSONObject toJSONObject() data.put("maternal_last", getMotherLast()); data.put("first", getFirst()); data.put("middle", getMiddle()); - data.put("dob", fromDobMilitary(null, getDob())); + data.put("dob", fromDobMilitary(ctx, getDob())); data.put("gender", getGender()); data.put("street1", getStreet1()); data.put("street2", getStreet2()); diff --git a/app/src/main/java/org/thousandsmiles/tscharts_lib/PatientREST.java b/app/src/main/java/org/thousandsmiles/tscharts_lib/PatientREST.java index 4577582..491fd77 100644 --- a/app/src/main/java/org/thousandsmiles/tscharts_lib/PatientREST.java +++ b/app/src/main/java/org/thousandsmiles/tscharts_lib/PatientREST.java @@ -190,7 +190,7 @@ public Object createPatient(PatientData pd) { RequestQueue queue = volley.getQueue(); - JSONObject data = pd.toJSONObject(); + JSONObject data = pd.toJSONObject(getContext()); String url = String.format("%s://%s:%s/tscharts/v1/patient/", getProtocol(), getIP(), getPort()); @@ -363,7 +363,7 @@ public Object findPatientsByNameAndClinicId(String name, int clinicId, int categ return m_lock; } - public Object updatePatient(PatientData pd) { + public Object updatePatient(Context ctx, PatientData pd) { VolleySingleton volley = VolleySingleton.getInstance(); @@ -371,7 +371,7 @@ public Object updatePatient(PatientData pd) { RequestQueue queue = volley.getQueue(); - JSONObject data = pd.toJSONObject(); + JSONObject data = pd.toJSONObject(ctx); String url = String.format("%s://%s:%s/tscharts/v1/patient/%d/", getProtocol(), getIP(), getPort(), pd.getId());