|
|
|
|
@ -22,15 +22,15 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
|
|
|
|
|
|
|
|
|
|
import 'base/lookup-service.dart';
|
|
|
|
|
import '../../base/lookup-service.dart';
|
|
|
|
|
|
|
|
|
|
class SOAPService extends LookupService {
|
|
|
|
|
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
|
|
|
|
|
List<GetAllergiesResModel> patientAllergiesList = [];
|
|
|
|
|
List<GetHistoryResModel> patientHistoryList = [];
|
|
|
|
|
List<GetPhysicalExamResModel> patientPhysicalExamList = [];
|
|
|
|
|
List<GetPatientProgressNoteResModel> patientProgressNoteList = [];
|
|
|
|
|
List<GetAssessmentResModel> patientAssessmentList = [];
|
|
|
|
|
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
|
|
|
|
|
List<GetAllergiesResModel> patientAllergiesList = [];
|
|
|
|
|
List<GetHistoryResModel> patientHistoryList = [];
|
|
|
|
|
List<GetPhysicalExamResModel> patientPhysicalExamList = [];
|
|
|
|
|
List<GetPatientProgressNoteResModel> patientProgressNoteList = [];
|
|
|
|
|
List<GetAssessmentResModel> patientAssessmentList = [];
|
|
|
|
|
|
|
|
|
|
int episodeID;
|
|
|
|
|
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
|
|
|
|
|
@ -55,13 +55,12 @@ class SOAPService extends LookupService {
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(POST_EPISODE,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
|
|
|
|
|
print("Success");
|
|
|
|
|
episodeID = response['EpisodeID'];
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: postEpisodeReqModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
episodeID = response['EpisodeID'];
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: postEpisodeReqModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
|
|
|
|
|
@ -69,11 +68,11 @@ class SOAPService extends LookupService {
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(POST_ALLERGY,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: postAllergyRequestModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: postAllergyRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future postHistories(
|
|
|
|
|
@ -81,11 +80,11 @@ class SOAPService extends LookupService {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(POST_HISTORY,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: postHistoriesRequestModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: postHistoriesRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future postChiefComplaint(
|
|
|
|
|
@ -93,7 +92,7 @@ class SOAPService extends LookupService {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(POST_CHIEF_COMPLAINT,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
@ -136,18 +135,16 @@ class SOAPService extends LookupService {
|
|
|
|
|
}, body: postAssessmentRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(PATCH_ALLERGY,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchAllergyRequestModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchAllergyRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future patchHistories(
|
|
|
|
|
@ -155,11 +152,11 @@ class SOAPService extends LookupService {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(PATCH_HISTORY,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchHistoriesRequestModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchHistoriesRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future patchChiefComplaint(
|
|
|
|
|
@ -167,11 +164,11 @@ class SOAPService extends LookupService {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(PATCH_CHIEF_COMPLAINT,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchChiefComplaintRequestModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchChiefComplaintRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future patchPhysicalExam(
|
|
|
|
|
@ -179,11 +176,11 @@ class SOAPService extends LookupService {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(PATCH_PHYSICAL_EXAM,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchPhysicalExamRequestModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchPhysicalExamRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future patchProgressNote(
|
|
|
|
|
@ -191,11 +188,11 @@ class SOAPService extends LookupService {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(PATCH_PROGRESS_NOTE,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchProgressNoteRequestModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchProgressNoteRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future patchAssessment(
|
|
|
|
|
@ -203,111 +200,106 @@ class SOAPService extends LookupService {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(PATCH_ASSESSMENT,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchAssessmentRequestModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: patchAssessmentRequestModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post (GET_ALLERGY,
|
|
|
|
|
await baseAppClient.post(GET_ALLERGY,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
patientAllergiesList.clear();
|
|
|
|
|
print("Success");
|
|
|
|
|
patientAllergiesList.clear();
|
|
|
|
|
|
|
|
|
|
response['List_Allergies']['entityList'].forEach((v) {
|
|
|
|
|
patientAllergiesList.add(GetAllergiesResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: generalGetReqForSOAP.toJson());
|
|
|
|
|
response['List_Allergies']['entityList'].forEach((v) {
|
|
|
|
|
patientAllergiesList.add(GetAllergiesResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: generalGetReqForSOAP.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getPatientHistories(
|
|
|
|
|
GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async {
|
|
|
|
|
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel,
|
|
|
|
|
{bool isFirst = false}) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(GET_HISTORY,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
if (isFirst)
|
|
|
|
|
patientHistoryList.clear();
|
|
|
|
|
if (isFirst) patientHistoryList.clear();
|
|
|
|
|
response['List_History']['entityList'].forEach((v) {
|
|
|
|
|
patientHistoryList.add(GetHistoryResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getHistoryReqModel.toJson());
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getHistoryReqModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getPatientChiefComplaint(
|
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post (GET_CHIEF_COMPLAINT,
|
|
|
|
|
await baseAppClient.post(GET_CHIEF_COMPLAINT,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
patientChiefComplaintList.clear();
|
|
|
|
|
response['List_ChiefComplaint']['entityList'].forEach((v) {
|
|
|
|
|
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getChiefComplaintReqModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
patientChiefComplaintList.clear();
|
|
|
|
|
response['List_ChiefComplaint']['entityList'].forEach((v) {
|
|
|
|
|
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getChiefComplaintReqModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getPatientPhysicalExam(
|
|
|
|
|
GetPhysicalExamReqModel getPhysicalExamReqModel) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post (GET_PHYSICAL_EXAM,
|
|
|
|
|
await baseAppClient.post(GET_PHYSICAL_EXAM,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
patientPhysicalExamList.clear();
|
|
|
|
|
response['PhysicalExamList']['entityList'].forEach((v) {
|
|
|
|
|
patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getPhysicalExamReqModel.toJson());
|
|
|
|
|
patientPhysicalExamList.clear();
|
|
|
|
|
response['PhysicalExamList']['entityList'].forEach((v) {
|
|
|
|
|
patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getPhysicalExamReqModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getPatientProgressNote(
|
|
|
|
|
GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post (GET_PROGRESS_NOTE,
|
|
|
|
|
await baseAppClient.post(GET_PROGRESS_NOTE,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
patientProgressNoteList.clear();
|
|
|
|
|
response['ProgressNoteList']['entityList'].forEach((v) {
|
|
|
|
|
patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getGetProgressNoteReqModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
patientProgressNoteList.clear();
|
|
|
|
|
response['ProgressNoteList']['entityList'].forEach((v) {
|
|
|
|
|
patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getGetProgressNoteReqModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getPatientAssessment(
|
|
|
|
|
GetAssessmentReqModel getAssessmentReqModel) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post (GET_ASSESSMENT,
|
|
|
|
|
await baseAppClient.post(GET_ASSESSMENT,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
print("Success");
|
|
|
|
|
patientAssessmentList.clear();
|
|
|
|
|
response['AssessmentList']['entityList'].forEach((v) {
|
|
|
|
|
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getAssessmentReqModel.toJson());
|
|
|
|
|
print("Success");
|
|
|
|
|
patientAssessmentList.clear();
|
|
|
|
|
response['AssessmentList']['entityList'].forEach((v) {
|
|
|
|
|
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: getAssessmentReqModel.toJson());
|
|
|
|
|
}
|
|
|
|
|
}
|