|
|
|
@ -1,6 +1,7 @@
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
|
|
|
@ -14,8 +15,7 @@ import '../../locator.dart';
|
|
|
|
class LiveCarePatientViewModel extends BaseViewModel {
|
|
|
|
class LiveCarePatientViewModel extends BaseViewModel {
|
|
|
|
List<PatiantInformtion> filterData = [];
|
|
|
|
List<PatiantInformtion> filterData = [];
|
|
|
|
|
|
|
|
|
|
|
|
LiveCarePatientServices _liveCarePatientServices =
|
|
|
|
LiveCarePatientServices _liveCarePatientServices = locator<LiveCarePatientServices>();
|
|
|
|
locator<LiveCarePatientServices>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StartCallRes get startCallRes => _liveCarePatientServices.startCallRes;
|
|
|
|
StartCallRes get startCallRes => _liveCarePatientServices.startCallRes;
|
|
|
|
|
|
|
|
|
|
|
|
@ -28,12 +28,9 @@ class LiveCarePatientViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PendingPatientERForDoctorAppRequestModel
|
|
|
|
PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel =
|
|
|
|
pendingPatientERForDoctorAppRequestModel =
|
|
|
|
PendingPatientERForDoctorAppRequestModel(sErServiceID: _dashboardService.sServiceID, outSA: false);
|
|
|
|
PendingPatientERForDoctorAppRequestModel(
|
|
|
|
await _liveCarePatientServices.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel);
|
|
|
|
sErServiceID: _dashboardService.sServiceID, outSA: false);
|
|
|
|
|
|
|
|
await _liveCarePatientServices.getPendingPatientERForDoctorApp(
|
|
|
|
|
|
|
|
pendingPatientERForDoctorAppRequestModel);
|
|
|
|
|
|
|
|
if (_liveCarePatientServices.hasError) {
|
|
|
|
if (_liveCarePatientServices.hasError) {
|
|
|
|
error = _liveCarePatientServices.error;
|
|
|
|
error = _liveCarePatientServices.error;
|
|
|
|
|
|
|
|
|
|
|
|
@ -120,16 +117,11 @@ class LiveCarePatientViewModel extends BaseViewModel {
|
|
|
|
if (strExist) {
|
|
|
|
if (strExist) {
|
|
|
|
filterData = [];
|
|
|
|
filterData = [];
|
|
|
|
for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) {
|
|
|
|
for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) {
|
|
|
|
String fullName =
|
|
|
|
String fullName = _liveCarePatientServices.patientList[i].fullName.toUpperCase();
|
|
|
|
_liveCarePatientServices.patientList[i].fullName.toUpperCase();
|
|
|
|
String patientID = _liveCarePatientServices.patientList[i].patientId.toString();
|
|
|
|
String patientID =
|
|
|
|
String mobile = _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase();
|
|
|
|
_liveCarePatientServices.patientList[i].patientId.toString();
|
|
|
|
|
|
|
|
String mobile =
|
|
|
|
if (fullName.contains(str.toUpperCase()) || patientID.contains(str) || mobile.contains(str)) {
|
|
|
|
_liveCarePatientServices.patientList[i].mobileNumber.toUpperCase();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fullName.contains(str.toUpperCase()) ||
|
|
|
|
|
|
|
|
patientID.contains(str) ||
|
|
|
|
|
|
|
|
mobile.contains(str)) {
|
|
|
|
|
|
|
|
filterData.add(_liveCarePatientServices.patientList[i]);
|
|
|
|
filterData.add(_liveCarePatientServices.patientList[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -139,4 +131,22 @@ class LiveCarePatientViewModel extends BaseViewModel {
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future isLogin(int loginStatus) async {
|
|
|
|
|
|
|
|
await getDoctorProfile(isGetProfile: true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel();
|
|
|
|
|
|
|
|
userLoginRequestModel.isOutKsa = (doctorProfile.projectID == 2 || doctorProfile.projectID == 3) ? 1 : 0;
|
|
|
|
|
|
|
|
userLoginRequestModel.isLogin = loginStatus;
|
|
|
|
|
|
|
|
userLoginRequestModel.generalid = "Cs2020@2016\$2958";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
|
|
|
await _liveCarePatientServices.isLogin(loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel);
|
|
|
|
|
|
|
|
if (_liveCarePatientServices.hasError) {
|
|
|
|
|
|
|
|
error = _liveCarePatientServices.error;
|
|
|
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|