WD:hopi details clear before making a call.

update_flutter_3.24_vida_plus_episode
taha.alam 11 months ago
parent fd4dacee83
commit 4de8cb4554

@ -645,10 +645,9 @@ class SOAPService extends LookupService {
"pomrId": patient.pomrId, "pomrId": patient.pomrId,
}; };
hasError = false; hasError = false;
hopiDetails.clear();
await baseAppClient.post(HOPI_DETAILS, await baseAppClient.post(HOPI_DETAILS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
hopiDetails.clear();
response['DetailHOPI']['resultData'].forEach((v) { response['DetailHOPI']['resultData'].forEach((v) {
hopiDetails.add(GetHopiDetails.fromJson(v)); hopiDetails.add(GetHopiDetails.fromJson(v));
}); });
@ -1044,17 +1043,17 @@ class SOAPService extends LookupService {
var result = response['ListDiagnosisAddFavourite']['resultData']; var result = response['ListDiagnosisAddFavourite']['resultData'];
isFavoriteAdded = true; isFavoriteAdded = true;
if ((result is List) && (result as List).isEmpty) { if ((result is List) && (result as List).isEmpty) {
if(response['ListDiagnosisAddFavourite']['message'] != null) if (response['ListDiagnosisAddFavourite']['message'] != null)
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
response['ListDiagnosisAddFavourite']['message']); response['ListDiagnosisAddFavourite']['message']);
else
else DrAppToastMsg.showErrorToast("Unable to Add"); DrAppToastMsg.showErrorToast("Unable to Add");
} else { } else {
if(response['ListDiagnosisAddFavourite']['message'] != null) if (response['ListDiagnosisAddFavourite']['message'] != null)
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
response['ListDiagnosisAddFavourite']['message']); response['ListDiagnosisAddFavourite']['message']);
else DrAppToastMsg.showErrorToast("Diagnosis Added To Favorite"); else
DrAppToastMsg.showErrorToast("Diagnosis Added To Favorite");
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -1347,13 +1346,21 @@ class SOAPService extends LookupService {
success = true; success = true;
return; return;
} }
if(response['ValidatinErrorsCSI']!= null){ if (response['ValidatinErrorsCSI'] != null) {
if(response['ValidatinErrorsCSI']['errors']!= null && (response['ValidatinErrorsCSI']['errors'] as List).isNotEmpty ){ if (response['ValidatinErrorsCSI']['errors'] != null &&
if(response['ValidatinErrorsCSI']['errors']['Validations']!= null && (response['ValidatinErrorsCSI']['errors']['Validations'] as List).isNotEmpty ) { (response['ValidatinErrorsCSI']['errors'] as List).isNotEmpty) {
if((response['ValidatinErrorsCSI']['errors']['Validations'] as List).first!['Error'] != null ) if (response['ValidatinErrorsCSI']['errors']['Validations'] != null &&
DrAppToastMsg.showErrorToast((response['ValidatinErrorsCSI']['errors']['Validations'] as List).first!['Error']); (response['ValidatinErrorsCSI']['errors']['Validations'] as List)
.isNotEmpty) {
}} if ((response['ValidatinErrorsCSI']['errors']['Validations']
as List)
.first!['Error'] !=
null)
DrAppToastMsg.showErrorToast((response['ValidatinErrorsCSI']
['errors']['Validations'] as List)
.first!['Error']);
}
}
} }
success = false; success = false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -1481,7 +1488,7 @@ class SOAPService extends LookupService {
"patientId": patient.patientId, "patientId": patient.patientId,
"clinicId": patient.clinicId, "clinicId": patient.clinicId,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID), "setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"pomrId":patient.pomrId "pomrId": patient.pomrId
}; };
hasError = false; hasError = false;
await baseAppClient.post(EPISODE_BY_CHIEF_COMPLAINT, await baseAppClient.post(EPISODE_BY_CHIEF_COMPLAINT,

Loading…
Cancel
Save