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.
103 lines
3.7 KiB
Dart
103 lines
3.7 KiB
Dart
import 'package:doctor_app_flutter/config/config.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 'base/lookup-service.dart';
|
|
|
|
class SOAPService extends LookupService {
|
|
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
|
|
await baseAppClient.post(
|
|
GET_ALLERGIES,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
listOfAllergies.clear();
|
|
response['List_Allergies']['entityList'].forEach((v) {
|
|
listOfAllergies.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());
|
|
}
|
|
}
|