diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index a18fe7d1..406eb9e6 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -645,10 +645,9 @@ class SOAPService extends LookupService { "pomrId": patient.pomrId, }; hasError = false; + hopiDetails.clear(); await baseAppClient.post(HOPI_DETAILS, onSuccess: (dynamic response, int statusCode) { - hopiDetails.clear(); - response['DetailHOPI']['resultData'].forEach((v) { hopiDetails.add(GetHopiDetails.fromJson(v)); }); @@ -1044,17 +1043,17 @@ class SOAPService extends LookupService { var result = response['ListDiagnosisAddFavourite']['resultData']; isFavoriteAdded = true; if ((result is List) && (result as List).isEmpty) { - if(response['ListDiagnosisAddFavourite']['message'] != null) - DrAppToastMsg.showErrorToast( - response['ListDiagnosisAddFavourite']['message']); - - else DrAppToastMsg.showErrorToast("Unable to Add"); + if (response['ListDiagnosisAddFavourite']['message'] != null) + DrAppToastMsg.showErrorToast( + response['ListDiagnosisAddFavourite']['message']); + else + DrAppToastMsg.showErrorToast("Unable to Add"); } else { - if(response['ListDiagnosisAddFavourite']['message'] != null) - DrAppToastMsg.showSuccesToast( - response['ListDiagnosisAddFavourite']['message']); - else DrAppToastMsg.showErrorToast("Diagnosis Added To Favorite"); - + if (response['ListDiagnosisAddFavourite']['message'] != null) + DrAppToastMsg.showSuccesToast( + response['ListDiagnosisAddFavourite']['message']); + else + DrAppToastMsg.showErrorToast("Diagnosis Added To Favorite"); } }, onFailure: (String error, int statusCode) { hasError = true; @@ -1347,13 +1346,21 @@ class SOAPService extends LookupService { success = true; return; } - if(response['ValidatinErrorsCSI']!= null){ - if(response['ValidatinErrorsCSI']['errors']!= null && (response['ValidatinErrorsCSI']['errors'] as List).isNotEmpty ){ - if(response['ValidatinErrorsCSI']['errors']['Validations']!= null && (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']); - - }} + if (response['ValidatinErrorsCSI'] != null) { + if (response['ValidatinErrorsCSI']['errors'] != null && + (response['ValidatinErrorsCSI']['errors'] as List).isNotEmpty) { + if (response['ValidatinErrorsCSI']['errors']['Validations'] != null && + (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; }, onFailure: (String error, int statusCode) { @@ -1481,7 +1488,7 @@ class SOAPService extends LookupService { "patientId": patient.patientId, "clinicId": patient.clinicId, "setupId": await sharedPref.getString(DOCTOR_SETUP_ID), - "pomrId":patient.pomrId + "pomrId": patient.pomrId }; hasError = false; await baseAppClient.post(EPISODE_BY_CHIEF_COMPLAINT,