|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/add_patient_to_doctor_list_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
|
|
|
|
@ -35,14 +35,12 @@ class LiveCarePatientServices extends BaseService {
|
|
|
|
|
StartCallRes get startCallRes => _startCallRes;
|
|
|
|
|
|
|
|
|
|
Future getPendingPatientERForDoctorApp(
|
|
|
|
|
PendingPatientERForDoctorAppRequestModel
|
|
|
|
|
pendingPatientERForDoctorAppRequestModel) async {
|
|
|
|
|
PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(
|
|
|
|
|
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
|
|
|
|
|
List<PatiantInformtion> localPatientList= [];
|
|
|
|
|
List<PatiantInformtion> localPatientList = [];
|
|
|
|
|
|
|
|
|
|
response['List_PendingPatientList'].forEach((v) {
|
|
|
|
|
localPatientList.add(PatiantInformtion.fromJson(v));
|
|
|
|
@ -50,22 +48,19 @@ class LiveCarePatientServices extends BaseService {
|
|
|
|
|
|
|
|
|
|
/// add new items.
|
|
|
|
|
localPatientList.forEach((element) {
|
|
|
|
|
if ((_patientList.singleWhere((it) => it.patientId == element.patientId,
|
|
|
|
|
orElse: () => null)) == null) {
|
|
|
|
|
if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) {
|
|
|
|
|
_patientList.add(element);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/// remove items.
|
|
|
|
|
List<PatiantInformtion> removedPatientList= [];
|
|
|
|
|
List<PatiantInformtion> removedPatientList = [];
|
|
|
|
|
_patientList.forEach((element) {
|
|
|
|
|
if ((localPatientList.singleWhere((it) => it.patientId == element.patientId,
|
|
|
|
|
orElse: () => null)) == null) {
|
|
|
|
|
if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) {
|
|
|
|
|
removedPatientList.add(element);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
removedPatientList.forEach((element) {
|
|
|
|
|
_patientList.remove(element);
|
|
|
|
|
});
|
|
|
|
@ -105,11 +100,7 @@ class LiveCarePatientServices extends BaseService {
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: {
|
|
|
|
|
"VC_ID": vcID,
|
|
|
|
|
"AltServiceList": altServiceList,
|
|
|
|
|
"generalid":GENERAL_ID
|
|
|
|
|
}, isLiveCare: _isLive);
|
|
|
|
|
}, body: {"VC_ID": vcID, "AltServiceList": altServiceList, "generalid": GENERAL_ID}, isLiveCare: _isLive);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future transferToAdmin(int vcID, String notes) async {
|
|
|
|
@ -128,20 +119,17 @@ class LiveCarePatientServices extends BaseService {
|
|
|
|
|
|
|
|
|
|
Future sendSMSInstruction(int vcID) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(SEND_SMS_INSTRUCTIONS,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
await baseAppClient.post(SEND_SMS_INSTRUCTIONS, onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
transferToAdminResponse = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: {
|
|
|
|
|
"VC_ID": vcID, "generalid": GENERAL_ID
|
|
|
|
|
}, isLiveCare: _isLive);
|
|
|
|
|
}, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await getDoctorProfile( );
|
|
|
|
|
await getDoctorProfile();
|
|
|
|
|
isLoginRequestModel.doctorId = super.doctorProfile.doctorID;
|
|
|
|
|
await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async {
|
|
|
|
|
isLoginResponse = response;
|
|
|
|
@ -155,17 +143,48 @@ class LiveCarePatientServices extends BaseService {
|
|
|
|
|
hasError = false;
|
|
|
|
|
alternativeServicesList.clear();
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_ALTERNATIVE_SERVICE,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
await baseAppClient.post(GET_ALTERNATIVE_SERVICE, onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
response['AlternativeServicesList'].forEach((v) {
|
|
|
|
|
alternativeServicesList.add(AlternativeService.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: {
|
|
|
|
|
"VC_ID": vcID,
|
|
|
|
|
"generalid": GENERAL_ID
|
|
|
|
|
}, isLiveCare: _isLive);
|
|
|
|
|
}, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future addPatientToDoctorList({int vcID}) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await getDoctorProfile();
|
|
|
|
|
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
|
|
|
|
|
|
|
|
|
|
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
|
|
|
|
|
addPatientToDoctorListRequestModel.vCID = vcID;
|
|
|
|
|
addPatientToDoctorListRequestModel.isOutKsa = false;
|
|
|
|
|
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(ADD_PATIENT_TO_DOCTOR, onSuccess: (response, statusCode) async {
|
|
|
|
|
isLoginResponse = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future removePatientFromDoctorList({int vcID}) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
|
|
|
|
|
await getDoctorProfile();
|
|
|
|
|
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
|
|
|
|
|
addPatientToDoctorListRequestModel.vCID = vcID;
|
|
|
|
|
addPatientToDoctorListRequestModel.isOutKsa = false;
|
|
|
|
|
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(REMOVE_PATIENT_FROM_DOCTOR, onSuccess: (response, statusCode) async {
|
|
|
|
|
isLoginResponse = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|