WD: SETUP ID ADDED

update_flutter_3.24_vida_plus_episode_MDS
taha.alam 1 year ago
parent ad29dd41f4
commit 3af6248d13

@ -67,10 +67,12 @@ class SOAPService extends LookupService {
List<GetHopiDetails> hopiDetails = []; List<GetHopiDetails> hopiDetails = [];
List<GetChiefComplaintVidaPlus> patientChiefComplaintListVidaPlus = []; List<GetChiefComplaintVidaPlus> patientChiefComplaintListVidaPlus = [];
List<SearchChiefComplaint> searchChiefComplaintListVidaPlus = []; List<SearchChiefComplaint> searchChiefComplaintListVidaPlus = [];
List<EpisodeByChiefComplaintVidaPlus> episodeByChiefComplaintListVidaPlus = []; List<EpisodeByChiefComplaintVidaPlus> episodeByChiefComplaintListVidaPlus =
[];
List<GetHomeMedicationList> getHomeMedicationList = []; List<GetHomeMedicationList> getHomeMedicationList = [];
List<GetSearchCurrentMedication> getSearchCurrentMedication = []; List<GetSearchCurrentMedication> getSearchCurrentMedication = [];
List<GetSearchCurrentMedicationDetails> getSearchCurrentMedicationDetails = []; List<GetSearchCurrentMedicationDetails> getSearchCurrentMedicationDetails =
[];
List<PatientPreviousDiagnosis> patientPreviousDiagnosisList = []; List<PatientPreviousDiagnosis> patientPreviousDiagnosisList = [];
List<PatientPreviousDiagnosis> patientDiagnosisList = []; List<PatientPreviousDiagnosis> patientDiagnosisList = [];
List<FavoriteDiseaseDetails> favoriteDiagnosisDetailsList = []; List<FavoriteDiseaseDetails> favoriteDiagnosisDetailsList = [];
@ -412,24 +414,25 @@ class SOAPService extends LookupService {
}, body: request); }, body: request);
} }
Future getEditAllergies(int allergyId) async { Future getEditAllergies(int allergyId) async {
hasError = false; hasError = false;
await baseAppClient.post(GET_EDIT_ALLERGIES, await baseAppClient.post(GET_EDIT_ALLERGIES,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
searchAllergiesList.clear(); searchAllergiesList.clear();
response['List_SearchAllergies']['resultData'].forEach((v) {
searchAllergiesList.add(AllergiesListVidaPlus.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {"allergyId": allergyId, "setupId": await sharedPref.getString(DOCTOR_SETUP_ID)});
}
response['List_SearchAllergies']['resultData'].forEach((v) {
searchAllergiesList.add(AllergiesListVidaPlus.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"allergyId": allergyId,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
});
}
Future searchAllergies(String searchKey) async { Future searchAllergies(String searchKey) async {
hasError = false; hasError = false;
@ -481,7 +484,7 @@ class SOAPService extends LookupService {
await baseAppClient.post(POST_ALLERGIES, await baseAppClient.post(POST_ALLERGIES,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast("Allergies Saved Successfully"); DrAppToastMsg.showSuccesToast("Allergies Saved Successfully");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -492,10 +495,8 @@ class SOAPService extends LookupService {
Future resolveAllergies( Future resolveAllergies(
PatientAllergiesVidaPlus allergy, PatiantInformtion patientInfo) async { PatientAllergiesVidaPlus allergy, PatiantInformtion patientInfo) async {
/*changed request parameters based on the vida plus requested */ /*changed request parameters based on the vida plus requested */
var doctorProfile = await sharedPref.getObj(LOGGED_IN_USER); var doctorProfile = await sharedPref.getObj(LOGGED_IN_USER);
List<PatientsAllergyReactionsDTOs>? reaction = List<PatientsAllergyReactionsDTOs>? reaction =
allergy.patientsAllergyReactionsDTOs!; allergy.patientsAllergyReactionsDTOs!;
@ -519,7 +520,7 @@ class SOAPService extends LookupService {
"allergyTypeName": allergy.allergyTypeName, "allergyTypeName": allergy.allergyTypeName,
"assessmentId": 0, "assessmentId": 0,
"isActive": allergy.isActivePatientsAllergy, "isActive": allergy.isActivePatientsAllergy,
"patientsAllergyReactionsDTOs":reactionRequest, "patientsAllergyReactionsDTOs": reactionRequest,
"dbCRUDOperation": 2, "dbCRUDOperation": 2,
"allergyID": allergy.allergyID, "allergyID": allergy.allergyID,
"allergyName": allergy.allergyName, "allergyName": allergy.allergyName,
@ -532,7 +533,7 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(RESOLVE_ALLERGIES, await baseAppClient.post(RESOLVE_ALLERGIES,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast("Resolved Successfully"); DrAppToastMsg.showSuccesToast("Resolved Successfully");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -543,10 +544,9 @@ class SOAPService extends LookupService {
Future updateAllergies( Future updateAllergies(
PatientAllergiesVidaPlus allergy, PatiantInformtion patientInfo) async { PatientAllergiesVidaPlus allergy, PatiantInformtion patientInfo) async {
var doctorProfile = await sharedPref.getObj(LOGGED_IN_USER); var doctorProfile = await sharedPref.getObj(LOGGED_IN_USER);
List<PatientsAllergyReactionsDTOs>? reaction = List<PatientsAllergyReactionsDTOs>? reaction =
allergy.patientsAllergyReactionsDTOs!; allergy.patientsAllergyReactionsDTOs!;
List<AllergyReactionDTOs>? reactionRequest = []; List<AllergyReactionDTOs>? reactionRequest = [];
reaction.forEach((value) { reaction.forEach((value) {
reactionRequest.add(AllergyReactionDTOs( reactionRequest.add(AllergyReactionDTOs(
@ -568,7 +568,7 @@ class SOAPService extends LookupService {
"assessmentId": 0, "assessmentId": 0,
"isActive": allergy.isActivePatientsAllergy, "isActive": allergy.isActivePatientsAllergy,
"isActivePatientsAllergy": allergy.isActivePatientsAllergy, "isActivePatientsAllergy": allergy.isActivePatientsAllergy,
"patientsAllergyReactionsDTOs":reactionRequest, "patientsAllergyReactionsDTOs": reactionRequest,
"dbCRUDOperation": 2, "dbCRUDOperation": 2,
"allergyID": allergy.allergyID, "allergyID": allergy.allergyID,
"allergyName": allergy.allergyName, "allergyName": allergy.allergyName,
@ -583,7 +583,7 @@ class SOAPService extends LookupService {
await baseAppClient.post(UPDATE_ALLERGIES, await baseAppClient.post(UPDATE_ALLERGIES,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast("Allergies Updated Successfully"); DrAppToastMsg.showSuccesToast("Allergies Updated Successfully");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -608,7 +608,7 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(CREATE_HOPI, await baseAppClient.post(CREATE_HOPI,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast("History Saved Successfully"); DrAppToastMsg.showSuccesToast("History Saved Successfully");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -645,7 +645,8 @@ class SOAPService extends LookupService {
patientChiefComplaintListVidaPlus.clear(); patientChiefComplaintListVidaPlus.clear();
response['ListChiefComplaintDetails']['resultData'].forEach((v) { response['ListChiefComplaintDetails']['resultData'].forEach((v) {
patientChiefComplaintListVidaPlus.add(GetChiefComplaintVidaPlus.fromJson(v)); patientChiefComplaintListVidaPlus
.add(GetChiefComplaintVidaPlus.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -770,9 +771,11 @@ class SOAPService extends LookupService {
PatiantInformtion patient, PatiantInformtion patient,
String patientProblemRevisionID, String patientProblemRevisionID,
) async { ) async {
print('the setup id is ${await sharedPref.getString(DOCTOR_SETUP_ID)}');
Map<String, dynamic> request = { Map<String, dynamic> request = {
"patientProblemRevisionId": patientProblemRevisionID, "patientProblemRevisionId": patientProblemRevisionID,
"ProjectID": patient.projectId "ProjectID": patient.projectId,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
}; };
hasError = false; hasError = false;
auditDiagnosislist.clear(); auditDiagnosislist.clear();
@ -858,13 +861,15 @@ class SOAPService extends LookupService {
// "patientId": patientInfo.patientId, // "patientId": patientInfo.patientId,
// "problemId": problemId, // "problemId": problemId,
// "deletedRemarks": deletedRemarks, // "deletedRemarks": deletedRemarks,
// "ProjectID": patientInfo.projectId // "ProjectID": patientInfo.projectId,
// "setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
//todo just for the test as the create diagnosis is still not working //todo just for the test as the create diagnosis is still not working
"patientProblemId": 13691, "patientProblemId": 13691,
"patientId": 70010986, "patientId": 70010986,
"problemId": 41698, "problemId": 41698,
"deletedRemarks": "kethees test", "deletedRemarks": "kethees test",
"ProjectID": 313 "ProjectID": 313,
"setupId": 105
}; };
hasError = false; hasError = false;
patientPreviousDiagnosisList.clear(); patientPreviousDiagnosisList.clear();
@ -924,7 +929,8 @@ class SOAPService extends LookupService {
"pomrId": patientInfo.pomrId, "pomrId": patientInfo.pomrId,
"hospitalId": patientInfo.projectId, "hospitalId": patientInfo.projectId,
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID), "hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"ProjectID": patientInfo.projectId "ProjectID": patientInfo.projectId,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
}; };
hasError = false; hasError = false;
patientPhysicalExaminationList.clear(); patientPhysicalExaminationList.clear();
@ -948,6 +954,7 @@ class SOAPService extends LookupService {
Map<String, dynamic> request = { Map<String, dynamic> request = {
"ProjectID": patientInfo.projectId, "ProjectID": patientInfo.projectId,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"listCreatPhysicalExam": jsonListOfPhysicalExamination "listCreatPhysicalExam": jsonListOfPhysicalExamination
}; };
hasError = false; hasError = false;
@ -1190,6 +1197,7 @@ class SOAPService extends LookupService {
"appointmentId": diagnosis.appointmentId, "appointmentId": diagnosis.appointmentId,
"problemId": diagnosis.problemId, "problemId": diagnosis.problemId,
"diagnosisType": diagnosis.diagnosisType, "diagnosisType": diagnosis.diagnosisType,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
}; };
var success = false; var success = false;
await baseAppClient.post(RESOLVE_DIAGNOSIS, await baseAppClient.post(RESOLVE_DIAGNOSIS,
@ -1212,13 +1220,12 @@ class SOAPService extends LookupService {
} }
Future<bool> getClinic() async { Future<bool> getClinic() async {
Map<String,dynamic> request = {}; Map<String, dynamic> request = {};
var success = false; var success = false;
await baseAppClient.post(GET_CLINIC, await baseAppClient.post(GET_CLINIC,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['ListDoctorClinics'].forEach((v) => response['ListDoctorClinics'].forEach((v) => v['categories']
v['categories'].forEach( .forEach((cat) => clinicsList.add(Clinic.fromJson(cat))));
(cat) => clinicsList.add(Clinic.fromJson(cat))));
success = false; success = false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
success = false; success = false;
@ -1229,59 +1236,57 @@ class SOAPService extends LookupService {
return success; return success;
} }
continueEpisodeVidaPlus( continueEpisodeVidaPlus(
PatiantInformtion patient, List<PatientPomrs> chiefComplaint) async { PatiantInformtion patient, List<PatientPomrs> chiefComplaint) async {
List<Map<String, dynamic>> chiefComplaintList=[]; List<Map<String, dynamic>> chiefComplaintList = [];
chiefComplaint.forEach((action){ chiefComplaint.forEach((action) {
action.chiefComplains!.forEach((action2){ action.chiefComplains!.forEach((action2) {
chiefComplaintList.add({"chiefComplain": action2.chiefComplain,"chiefComplainTemplateId": action!.chiefComplainTemplateId}); chiefComplaintList.add({
"chiefComplain": action2.chiefComplain,
"chiefComplainTemplateId": action!.chiefComplainTemplateId
});
}); });
}); });
Map<String, dynamic> request = { Map<String, dynamic> request = {
"appointmentId": patient.appointmentNo, "appointmentId": patient.appointmentNo,
"projectId": patient.projectId, "projectId": patient.projectId,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID), "setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"chiefComplain":chiefComplaintList "chiefComplain": chiefComplaintList
}; };
hasError = false; hasError = false;
await baseAppClient.post(CONTINUE_EPISODE_VP, await baseAppClient.post(CONTINUE_EPISODE_VP,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: request); }, body: request);
} }
updateChiefComplaintVidaPlus( updateChiefComplaintVidaPlus(PatiantInformtion patient,
PatiantInformtion patient, GetChiefComplaintVidaPlus chiefComplaint) async { GetChiefComplaintVidaPlus chiefComplaint) async {
Map<String, dynamic> request = { Map<String, dynamic> request = {
"AppointmentNo": patient.appointmentNo, "AppointmentNo": patient.appointmentNo,
"pomrId": patient.pomrId, "pomrId": patient.pomrId,
"PatientMRN": patient.patientMRN, "PatientMRN": patient.patientMRN,
"PatientName":patient.firstName! + ' '+ patient.lastName! , "PatientName": patient.firstName! + ' ' + patient.lastName!,
"addedChiefComplaintCreateDtos": [ "addedChiefComplaintCreateDtos": [],
"removedChiefComplaintIds": [chiefComplaint.chiefComplainId]
],
"removedChiefComplaintIds":[chiefComplaint.chiefComplainId]
}; };
hasError = false; hasError = false;
await baseAppClient.post(UPDATE_CHIEF_COMPLAINT, await baseAppClient.post(UPDATE_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
DrAppToastMsg.showErrorToast(response['List_UpdateChiefComplaint']['message']); DrAppToastMsg.showErrorToast(
}, onFailure: (String error, int statusCode) { response['List_UpdateChiefComplaint']['message']);
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: request); }, body: request);
} }
episodeByChiefComplaint(
PatiantInformtion patient) async { episodeByChiefComplaint(PatiantInformtion patient) async {
Map<String, dynamic> request = { Map<String, dynamic> request = {
"patientId": patient.patientId, "patientId": patient.patientId,
"clinicId": patient.clinicId, "clinicId": patient.clinicId,
@ -1289,120 +1294,103 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(EPISODE_BY_CHIEF_COMPLAINT, await baseAppClient.post(EPISODE_BY_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
episodeByChiefComplaintListVidaPlus.clear(); episodeByChiefComplaintListVidaPlus.clear();
response['EpisodeByChiefcomplaint']['resultData'].forEach((v) { response['EpisodeByChiefcomplaint']['resultData'].forEach((v) {
episodeByChiefComplaintListVidaPlus.add(EpisodeByChiefComplaintVidaPlus.fromJson(v)); episodeByChiefComplaintListVidaPlus
}); .add(EpisodeByChiefComplaintVidaPlus.fromJson(v));
}, onFailure: (String error, int statusCode) { });
hasError = true; }, onFailure: (String error, int statusCode) {
super.error = error; hasError = true;
}, body: request); super.error = error;
}, body: request);
} }
getHomeMedication( getHomeMedication(PatiantInformtion patient) async {
PatiantInformtion patient) async {
Map<String, dynamic> request = { Map<String, dynamic> request = {
"patientId": patient.patientId, "patientId": patient.patientId,
}; };
hasError = false; hasError = false;
await baseAppClient.post(GET_HOME_MEDICATION, await baseAppClient.post(GET_HOME_MEDICATION,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
getHomeMedicationList.clear(); getHomeMedicationList.clear();
response['ListHomeMedication']['resultData'].forEach((v) { response['ListHomeMedication']['resultData'].forEach((v) {
getHomeMedicationList.add(GetHomeMedicationList.fromJson(v)); getHomeMedicationList.add(GetHomeMedicationList.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: request); }, body: request);
} }
searchCurrentMedication( searchCurrentMedication(String query) async {
String query Map<String, dynamic> request = {"SearchKey": query};
) async {
Map<String, dynamic> request = {
"SearchKey": query
};
hasError = false; hasError = false;
await baseAppClient.post(SEARCH_CURRENT_MEDICATION, await baseAppClient.post(SEARCH_CURRENT_MEDICATION,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
getSearchCurrentMedication.clear(); getSearchCurrentMedication.clear();
response['ListFormulatorySearch']['resultData'].forEach((v) { response['ListFormulatorySearch']['resultData'].forEach((v) {
getSearchCurrentMedication.add(GetSearchCurrentMedication.fromJson(v)); getSearchCurrentMedication.add(GetSearchCurrentMedication.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: request); }, body: request);
} }
getCurrentMedicationDetails(String id) async {
getCurrentMedicationDetails( Map<String, dynamic> request = {"genericFormularyId": id};
String id
) async {
Map<String, dynamic> request = {
"genericFormularyId": id
};
hasError = false; hasError = false;
await baseAppClient.post(SEARCH_CURRENT_MEDICATION_DETAILS, await baseAppClient.post(SEARCH_CURRENT_MEDICATION_DETAILS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
getSearchCurrentMedicationDetails.clear(); getSearchCurrentMedicationDetails.clear();
response['ListFormularyMaster']['resultData'].forEach((v) { response['ListFormularyMaster']['resultData'].forEach((v) {
getSearchCurrentMedicationDetails.add(GetSearchCurrentMedicationDetails.fromJson(v)); getSearchCurrentMedicationDetails
}); .add(GetSearchCurrentMedicationDetails.fromJson(v));
}, onFailure: (String error, int statusCode) { });
hasError = true; }, onFailure: (String error, int statusCode) {
super.error = error; hasError = true;
}, body: request); super.error = error;
}, body: request);
} }
removeCurrentMedicationVidaPlus( removeCurrentMedicationVidaPlus(String medicationID) async {
String medicationID) async { Map<String, dynamic> request = {"homeMedicationId": medicationID};
Map<String, dynamic> request = {
"homeMedicationId":medicationID
};
hasError = false; hasError = false;
await baseAppClient.post(REMOVE_CURRENT_MEDICATION, await baseAppClient.post(REMOVE_CURRENT_MEDICATION,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true;
hasError = true; super.error = error;
super.error = error; }, body: request);
}, body: request);
} }
addCurrentMedicationVidaPlus( addCurrentMedicationVidaPlus(
Map<String, dynamic> request, PatiantInformtion patientInfo) async { Map<String, dynamic> request, PatiantInformtion patientInfo) async {
var doctorProfile = await sharedPref.getObj(LOGGED_IN_USER); var doctorProfile = await sharedPref.getObj(LOGGED_IN_USER);
Map<String, dynamic> genericRequest ={ Map<String, dynamic> genericRequest = {
"patientId": patientInfo.patientId, "patientId": patientInfo.patientId,
"patientPomrId": patientInfo.pomrId, "patientPomrId": patientInfo.pomrId,
"hospitalId": patientInfo.projectId, "hospitalId": patientInfo.projectId,
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID), "hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"clinicGroupId": patientInfo.clinicGroupId, "clinicGroupId": patientInfo.clinicGroupId,
"clinicId": patientInfo.clinicId, "clinicId": patientInfo.clinicId,
"appointmentId": patientInfo.appointmentNo, "appointmentId": patientInfo.appointmentNo,
"created_by": patientInfo.doctorId, "created_by": patientInfo.doctorId,
"loginUserId": doctorProfile['List_MemberInformation'][0]['MemberID'], "loginUserId": doctorProfile['List_MemberInformation'][0]['MemberID'],
}; };
Map<String, dynamic> finalRequest = {} Map<String, dynamic> finalRequest = {}
..addAll(request) ..addAll(request)
..addAll(genericRequest); ..addAll(genericRequest);
hasError = false; hasError = false;
await baseAppClient.post(ADD_CURRENT_MEDICATION, await baseAppClient.post(ADD_CURRENT_MEDICATION,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { hasError = true;
super.error = error;
hasError = true; }, body: finalRequest);
super.error = error;
}, body: finalRequest);
} }
} }

Loading…
Cancel
Save