You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
260 lines
9.3 KiB
Dart
260 lines
9.3 KiB
Dart
import 'package:doctor_app_flutter/config/config.dart';
|
|
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
|
|
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
|
|
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
|
|
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
|
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
|
|
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
|
|
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
|
|
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 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart';
|
|
|
|
import 'base/lookup-service.dart';
|
|
|
|
class SOAPService extends LookupService {
|
|
List<GetChiefComplaintResModel> chiefComplaintList = [];
|
|
|
|
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
|
|
await baseAppClient.post(
|
|
GET_ALLERGIES,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
allergiesList.clear();
|
|
response['List_Allergies']['entityList'].forEach((v) {
|
|
allergiesList.add(MasterKeyModel.fromJson(v));
|
|
});
|
|
},
|
|
onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
},
|
|
body: getAllergiesRequestModel.toJson(),
|
|
);
|
|
}
|
|
|
|
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
|
|
hasError = false;
|
|
|
|
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());
|
|
}
|
|
|
|
Future postHistories(
|
|
PostHistoriesRequestModel postHistoriesRequestModel) async {
|
|
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());
|
|
}
|
|
|
|
Future postChiefComplaint(
|
|
PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post(POST_CHIEF_COMPLAINT,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: postChiefComplaintRequestModel.toJson());
|
|
}
|
|
|
|
Future postPhysicalExam(
|
|
PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post(POST_PHYSICAL_EXAM,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: postPhysicalExamRequestModel.toJson());
|
|
}
|
|
|
|
Future postProgressNote(
|
|
PostProgressNoteRequestModel postProgressNoteRequestModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post(POST_PROGRESS_NOTE,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: postProgressNoteRequestModel.toJson());
|
|
}
|
|
|
|
Future postAssessment(
|
|
PostAssessmentRequestModel postAssessmentRequestModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post(POST_ASSESSMENT,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, 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());
|
|
}
|
|
|
|
Future patchHistories(
|
|
PostHistoriesRequestModel patchHistoriesRequestModel) async {
|
|
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());
|
|
}
|
|
|
|
Future patchChiefComplaint(
|
|
PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async {
|
|
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());
|
|
}
|
|
|
|
Future patchPhysicalExam(
|
|
PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
|
|
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());
|
|
}
|
|
|
|
Future patchProgressNote(
|
|
PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
|
|
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());
|
|
}
|
|
|
|
Future patchAssessment(
|
|
PatchAssessmentReqModel patchAssessmentRequestModel) async {
|
|
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());
|
|
}
|
|
|
|
|
|
|
|
Future getPatientAllergy(PostAllergyRequestModel getPatientAllergyRequestModel) async {
|
|
hasError = false;
|
|
|
|
await baseAppClient.post (GET_ALLERGY,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: getPatientAllergyRequestModel.toJson());
|
|
}
|
|
|
|
Future getPatientHistories(
|
|
PostHistoriesRequestModel getPatientHistoriesRequestModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post (GET_HISTORY,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: getPatientHistoriesRequestModel.toJson());
|
|
}
|
|
|
|
Future getPatientChiefComplaint(
|
|
GeneralGetReqForSOAP getPatientChiefComplaintRequestModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post (GET_CHIEF_COMPLAINT,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
chiefComplaintList.clear();
|
|
response['List_ChiefComplaint']['entityList'].forEach((v) {
|
|
chiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
|
|
});
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: getPatientChiefComplaintRequestModel.toJson());
|
|
}
|
|
|
|
Future getPatientPhysicalExam(
|
|
PostPhysicalExamRequestModel getPatientPhysicalExamRequestModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post (GET_PHYSICAL_EXAM,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: getPatientPhysicalExamRequestModel.toJson());
|
|
}
|
|
|
|
Future getPatientProgressNote(
|
|
PostProgressNoteRequestModel getPatientProgressNoteRequestModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post (GET_PROGRESS_NOTE,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: getPatientProgressNoteRequestModel.toJson());
|
|
}
|
|
|
|
Future getPatientAssessment(
|
|
PostAssessmentRequestModel getPatientAssessmentRequestModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post (GET_ASSESSMENT,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
print("Success");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: getPatientAssessmentRequestModel.toJson());
|
|
}
|
|
}
|