post procedure

pull/201/head
hussam al-habibeh 5 years ago
parent b2aade9b2b
commit 0c18d96ba2

@ -78,7 +78,7 @@ class BaseAppClient {
'Accept': 'application/json'
});
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 ) {
if (statusCode < 200 || statusCode >= 400) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
@ -89,7 +89,7 @@ class BaseAppClient {
// helpers.showErrorToast('Your session expired Please login agian');
// } else
if (parsed['MessageStatus'] == 1) {
if(!parsed['IsAuthenticated'])
if (!parsed['IsAuthenticated'])
onFailure(getError(parsed), statusCode);
else
onSuccess(parsed, statusCode);
@ -106,21 +106,19 @@ class BaseAppClient {
}
}
String getError(parsed){
String getError(parsed) {
//TODO change this fun
String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'];
if (parsed["ValidationErrors"] != null) {
error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n";
if (parsed["ValidationErrors"]["ValidationErrors"] != null &&
parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
for (var i = 0;
i < parsed["ValidationErrors"]["ValidationErrors"].length;
i++) {
i < parsed["ValidationErrors"]["ValidationErrors"].length;
i++) {
error = error +
parsed["ValidationErrors"]["ValidationErrors"][i]
["Messages"][0] +
parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +
"\n";
}
}

@ -120,11 +120,13 @@ const GET_MASTER_LOOKUP_LIST =
'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies';
const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory';
const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
const POST_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE =
'/Services/DoctorApplication.svc/REST/PostProgressNote';
const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetCategories';

Loading…
Cancel
Save