Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into ZohaibKambrani
Conflicts: lib/screens/patients/DischargedPatientPage.dart lib/screens/patients/ReferralDischargedPatientDetails.dart lib/screens/patients/insurance_approvals_details.dart lib/screens/patients/patients_screen.dart lib/screens/patients/profile/note/progress_note_screen.dart lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart lib/screens/prescription/update_prescription_form.dart lib/screens/sick-leave/add-sickleave.dart lib/widgets/patients/PatientCard.dart pubspec.lockipd-changes-for-vida-plus
commit
b3ae86db31
@ -1,4 +1,4 @@
|
|||||||
package com.example.doctor_app_flutter
|
package com.hmg.hmgDr
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@ -1,2 +1,6 @@
|
|||||||
enum FilterType { Clinic, Hospital }
|
enum FilterType { Clinic, Hospital }
|
||||||
|
|
||||||
|
enum OutPatientFilterType { Previous, Today, NextWeek }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,2 @@
|
|||||||
|
enum PatientType { inPatient, OutPatient }
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/config/config.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
|
||||||
|
|
||||||
class PatientMuseService extends BaseService {
|
|
||||||
List<PatientMuseResultsModel> patientMuseResultsModelList = List();
|
|
||||||
|
|
||||||
getECGPatient({int patientType, int patientOutSA,int patientID}) async {
|
|
||||||
Map<String,dynamic> body = Map();
|
|
||||||
body['PatientType'] = patientType==7 ? 1: patientType;
|
|
||||||
body['PatientOutSA'] = patientOutSA;
|
|
||||||
body['PatientID'] = patientID;
|
|
||||||
hasError = false;
|
|
||||||
await baseAppClient.post(
|
|
||||||
GET_ECG,
|
|
||||||
onSuccess: (dynamic response, int statusCode) {
|
|
||||||
patientMuseResultsModelList.clear();
|
|
||||||
response['HIS_GetPatientMuseResultsList'].forEach((v) {
|
|
||||||
patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onFailure: (String error, int statusCode) {
|
|
||||||
hasError = true;
|
|
||||||
super.error = error;
|
|
||||||
},
|
|
||||||
body: body
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import 'package:doctor_app_flutter/config/config.dart';
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
import 'package:doctor_app_flutter/core/model/imei_details.dart';
|
import 'package:doctor_app_flutter/core/model/auth/imei_details.dart';
|
||||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
import 'package:doctor_app_flutter/models/doctor/user_model.dart';
|
import 'package:doctor_app_flutter/models/doctor/user_model.dart';
|
||||||
|
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
|
||||||
|
class PatientMuseService extends BaseService {
|
||||||
|
List<PatientMuseResultsModel> patientMuseResultsModelList = List();
|
||||||
|
|
||||||
|
getECGPatient({int patientType, int patientOutSA, int patientID}) async {
|
||||||
|
Map<String, dynamic> body = Map();
|
||||||
|
body['PatientType'] = patientType == 7 ? 1 : patientType;
|
||||||
|
body['PatientOutSA'] = patientOutSA;
|
||||||
|
body['PatientID'] = patientID;
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(GET_ECG,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
patientMuseResultsModelList.clear();
|
||||||
|
response['HIS_GetPatientMuseResultsList'].forEach((v) {
|
||||||
|
patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,8 @@
|
|||||||
import 'package:doctor_app_flutter/config/config.dart';
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
import 'package:doctor_app_flutter/core/model/ReferralRequest.dart';
|
import 'package:doctor_app_flutter/core/model/referral/ReferralRequest.dart';
|
||||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
|
||||||
class ReferralService extends BaseService {
|
class ReferralService extends BaseService {
|
||||||
|
|
||||||
Future referralPatient(
|
Future referralPatient(
|
||||||
{int admissionNo,
|
{int admissionNo,
|
||||||
String roomID,
|
String roomID,
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
|
||||||
|
class OutPatientService extends BaseService {
|
||||||
|
List<PatiantInformtion> _patientList = [];
|
||||||
|
List<PatiantInformtion> get patientList => _patientList;
|
||||||
|
|
||||||
|
Future getOutPatient(
|
||||||
|
PatientSearchRequestModel patientSearchRequestModel) async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(
|
||||||
|
GET_MY_OUT_PATIENT,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_patientList.clear();
|
||||||
|
response['List_MyOutPatient'].forEach((v) {
|
||||||
|
_patientList.add(PatiantInformtion.fromJson(v));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
body: patientSearchRequestModel.toJson(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getPatientFileInformation(
|
||||||
|
PatientSearchRequestModel patientSearchRequestModel) async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(
|
||||||
|
PRM_SEARCH_PATIENT,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_patientList.clear();
|
||||||
|
response['GetPatientFileInformation_PRMList'].forEach((v) {
|
||||||
|
_patientList.add(PatiantInformtion.fromJson(v));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
body: patientSearchRequestModel.toJson(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
|
||||||
|
class PatientInPatientService extends BaseService {
|
||||||
|
List<PatiantInformtion> inPatientList = List();
|
||||||
|
List<PatiantInformtion> myInPatientList = List();
|
||||||
|
|
||||||
|
Future getInPatientList(
|
||||||
|
PatientSearchRequestModel requestModel, bool isMyInpatient) async {
|
||||||
|
hasError = false;
|
||||||
|
await getDoctorProfile();
|
||||||
|
|
||||||
|
if (isMyInpatient) {
|
||||||
|
requestModel.doctorID = doctorProfile.doctorID;
|
||||||
|
} else {
|
||||||
|
requestModel.doctorID = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
await baseAppClient.post(
|
||||||
|
GET_PATIENT_IN_PATIENT_LIST,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
inPatientList.clear();
|
||||||
|
myInPatientList.clear();
|
||||||
|
|
||||||
|
response['List_MyInPatient'].forEach((v) {
|
||||||
|
PatiantInformtion patient = PatiantInformtion.fromJson(v);
|
||||||
|
inPatientList.add(patient);
|
||||||
|
if(patient.doctorId == doctorProfile.doctorID){
|
||||||
|
myInPatientList.add(patient);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
body: requestModel.toJson(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import 'package:doctor_app_flutter/config/config.dart';
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
import 'package:doctor_app_flutter/core/insurance_approval_request_model.dart';
|
import 'package:doctor_app_flutter/core/insurance_approval_request_model.dart';
|
||||||
import 'package:doctor_app_flutter/core/model/insurance_approval.dart';
|
import 'package:doctor_app_flutter/core/model/insurance/insurance_approval.dart';
|
||||||
import 'package:doctor_app_flutter/core/model/insurance_approval_in_patient_model.dart';
|
import 'package:doctor_app_flutter/core/model/insurance/insurance_approval_in_patient_model.dart';
|
||||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import 'package:doctor_app_flutter/config/config.dart';
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
import 'package:doctor_app_flutter/core/model/medical_file_model.dart';
|
import 'package:doctor_app_flutter/core/model/medical_report/medical_file_model.dart';
|
||||||
import 'package:doctor_app_flutter/core/model/medical_file_request_model.dart';
|
import 'package:doctor_app_flutter/core/model/medical_report/medical_file_request_model.dart';
|
||||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
|
||||||
class MedicalFileService extends BaseService {
|
class MedicalFileService extends BaseService {
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
|
import '../../base/base_service.dart';
|
||||||
|
|
||||||
|
class RadiologyService extends BaseService {
|
||||||
|
List<FinalRadiology> finalRadiologyList = List();
|
||||||
|
String url = '';
|
||||||
|
|
||||||
|
Future getRadImageURL(
|
||||||
|
{int invoiceNo,
|
||||||
|
int lineItem,
|
||||||
|
int projectId,
|
||||||
|
@required PatiantInformtion patient}) async {
|
||||||
|
hasError = false;
|
||||||
|
final Map<String, dynamic> body = new Map<String, dynamic>();
|
||||||
|
body['InvoiceNo'] = invoiceNo;
|
||||||
|
body['LineItemNo'] = lineItem;
|
||||||
|
body['ProjectID'] = projectId;
|
||||||
|
|
||||||
|
await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
url = response['Data'];
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getPatientRadOrders(PatiantInformtion patient,
|
||||||
|
{isInPatient = false}) async {
|
||||||
|
String url = GET_PATIENT_ORDERS;
|
||||||
|
final Map<String, dynamic> body = new Map<String, dynamic>();
|
||||||
|
if (isInPatient) {
|
||||||
|
url = GET_IN_PATIENT_ORDERS;
|
||||||
|
body['ProjectID'] = patient.projectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.postPatient(url, patient: patient,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
finalRadiologyList = [];
|
||||||
|
String label = "ListRAD";
|
||||||
|
if (isInPatient) {
|
||||||
|
label = "List_GetRadOreders";
|
||||||
|
}
|
||||||
|
response[label].forEach((radiology) {
|
||||||
|
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,59 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/config/config.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
|
|
||||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
|
|
||||||
import 'base/base_service.dart';
|
|
||||||
|
|
||||||
class RadiologyService extends BaseService {
|
|
||||||
List<FinalRadiology> finalRadiologyList = List();
|
|
||||||
String url = '';
|
|
||||||
|
|
||||||
Future getRadImageURL({int invoiceNo, int lineItem, int projectId,@required PatiantInformtion patient}) async {
|
|
||||||
hasError = false;
|
|
||||||
final Map<String, dynamic> body = new Map<String, dynamic>();
|
|
||||||
body['InvoiceNo'] = invoiceNo;
|
|
||||||
body['LineItemNo'] = lineItem;
|
|
||||||
body['ProjectID'] = projectId;
|
|
||||||
|
|
||||||
await baseAppClient.postPatient(GET_RAD_IMAGE_URL,
|
|
||||||
patient: patient,
|
|
||||||
onSuccess: (dynamic response, int statusCode) {
|
|
||||||
url = response['Data'];
|
|
||||||
}, onFailure: (String error, int statusCode) {
|
|
||||||
hasError = true;
|
|
||||||
super.error = error;
|
|
||||||
}, body: body);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future getPatientRadOrders(PatiantInformtion patient , {isInPatient = false}) async {
|
|
||||||
String url = GET_PATIENT_ORDERS;
|
|
||||||
final Map<String, dynamic> body = new Map<String, dynamic>();
|
|
||||||
if(isInPatient) {
|
|
||||||
url = GET_IN_PATIENT_ORDERS;
|
|
||||||
body['ProjectID'] = patient.projectId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
hasError = false;
|
|
||||||
await baseAppClient.postPatient(url,
|
|
||||||
patient: patient,
|
|
||||||
onSuccess: (dynamic response, int statusCode) {
|
|
||||||
finalRadiologyList = [];
|
|
||||||
String label = "ListRAD";
|
|
||||||
if(isInPatient) {
|
|
||||||
label ="List_GetRadOreders";
|
|
||||||
}
|
|
||||||
response[label].forEach((radiology) {
|
|
||||||
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
|
|
||||||
});
|
|
||||||
}, onFailure: (String error, int statusCode) {
|
|
||||||
hasError = true;
|
|
||||||
super.error = error;
|
|
||||||
}, body:body);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,5 +1,198 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/patient/patientInPatientService.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
|
||||||
|
import '../../locator.dart';
|
||||||
import 'base_view_model.dart';
|
import 'base_view_model.dart';
|
||||||
|
|
||||||
class PatientSearchViewModel extends BaseViewModel{
|
class PatientSearchViewModel extends BaseViewModel {
|
||||||
|
OutPatientService _outPatientService = locator<OutPatientService>();
|
||||||
|
|
||||||
|
List<PatiantInformtion> get patientList => _outPatientService.patientList;
|
||||||
|
|
||||||
|
List<PatiantInformtion> filterData = [];
|
||||||
|
|
||||||
|
DateTime selectedFromDate;
|
||||||
|
DateTime selectedToDate;
|
||||||
|
|
||||||
|
searchData(String str) {
|
||||||
|
var strExist = str.length > 0 ? true : false;
|
||||||
|
if (strExist) {
|
||||||
|
filterData = [];
|
||||||
|
for (var i = 0; i < _outPatientService.patientList.length; i++) {
|
||||||
|
String firstName =
|
||||||
|
_outPatientService.patientList[i].firstName.toUpperCase();
|
||||||
|
String lastName =
|
||||||
|
_outPatientService.patientList[i].lastName.toUpperCase();
|
||||||
|
String mobile =
|
||||||
|
_outPatientService.patientList[i].mobileNumber.toUpperCase();
|
||||||
|
String patientID =
|
||||||
|
_outPatientService.patientList[i].patientId.toString();
|
||||||
|
|
||||||
|
if (firstName.contains(str.toUpperCase()) ||
|
||||||
|
lastName.contains(str.toUpperCase()) ||
|
||||||
|
mobile.contains(str) ||
|
||||||
|
patientID.contains(str)) {
|
||||||
|
filterData.add(_outPatientService.patientList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
} else {
|
||||||
|
filterData = _outPatientService.patientList;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getOutPatient(PatientSearchRequestModel patientSearchRequestModel,
|
||||||
|
{bool isLocalBusy = false}) async {
|
||||||
|
if (isLocalBusy) {
|
||||||
|
setState(ViewState.BusyLocal);
|
||||||
|
} else {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
}
|
||||||
|
await getDoctorProfile(isGetProfile: true);
|
||||||
|
patientSearchRequestModel.doctorID = doctorProfile.doctorID;
|
||||||
|
await _outPatientService.getOutPatient(patientSearchRequestModel);
|
||||||
|
if (_outPatientService.hasError) {
|
||||||
|
error = _outPatientService.error;
|
||||||
|
if (isLocalBusy) {
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else {
|
||||||
|
setState(ViewState.Error);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
filterData = _outPatientService.patientList;
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel,
|
||||||
|
{bool isLocalBusy = false}) async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _outPatientService
|
||||||
|
.getPatientFileInformation(patientSearchRequestModel);
|
||||||
|
if (_outPatientService.hasError) {
|
||||||
|
error = _outPatientService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else {
|
||||||
|
filterData = _outPatientService.patientList;
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getPatientBasedOnDate(
|
||||||
|
{item,
|
||||||
|
PatientSearchRequestModel patientSearchRequestModel,
|
||||||
|
PatientType selectedPatientType,
|
||||||
|
bool isSearchWithKeyInfo,
|
||||||
|
OutPatientFilterType outPatientFilterType}) async {
|
||||||
|
String dateTo;
|
||||||
|
String dateFrom;
|
||||||
|
if (OutPatientFilterType.Previous == outPatientFilterType) {
|
||||||
|
selectedFromDate = DateTime(
|
||||||
|
DateTime.now().year, DateTime.now().month - 1, DateTime.now().day);
|
||||||
|
selectedToDate = DateTime(
|
||||||
|
DateTime.now().year, DateTime.now().month, DateTime.now().day - 1);
|
||||||
|
dateTo = DateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd');
|
||||||
|
dateFrom = DateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd');
|
||||||
|
} else if (OutPatientFilterType.NextWeek == outPatientFilterType) {
|
||||||
|
dateTo = DateUtils.convertDateToFormat(
|
||||||
|
DateTime(DateTime.now().year, DateTime.now().month,
|
||||||
|
DateTime.now().day + 6),
|
||||||
|
'yyyy-MM-dd');
|
||||||
|
|
||||||
|
dateFrom = DateUtils.convertDateToFormat(
|
||||||
|
DateTime(DateTime.now().year, DateTime.now().month,
|
||||||
|
DateTime.now().day + 1),
|
||||||
|
'yyyy-MM-dd');
|
||||||
|
} else {
|
||||||
|
dateFrom = DateUtils.convertDateToFormat(
|
||||||
|
DateTime(
|
||||||
|
DateTime.now().year, DateTime.now().month, DateTime.now().day),
|
||||||
|
'yyyy-MM-dd');
|
||||||
|
dateTo = DateUtils.convertDateToFormat(
|
||||||
|
DateTime(
|
||||||
|
DateTime.now().year, DateTime.now().month, DateTime.now().day),
|
||||||
|
'yyyy-MM-dd');
|
||||||
|
}
|
||||||
|
PatientSearchRequestModel currentModel = PatientSearchRequestModel();
|
||||||
|
currentModel.patientID = patientSearchRequestModel.patientID;
|
||||||
|
currentModel.firstName = patientSearchRequestModel.firstName;
|
||||||
|
currentModel.lastName = patientSearchRequestModel.lastName;
|
||||||
|
currentModel.middleName = patientSearchRequestModel.middleName;
|
||||||
|
currentModel.doctorID = patientSearchRequestModel.doctorID;
|
||||||
|
currentModel.from = dateFrom;
|
||||||
|
currentModel.to = dateTo;
|
||||||
|
await getOutPatient(currentModel, isLocalBusy: true);
|
||||||
|
filterData = _outPatientService.patientList;
|
||||||
|
}
|
||||||
|
|
||||||
|
PatientInPatientService _inPatientService =
|
||||||
|
locator<PatientInPatientService>();
|
||||||
|
|
||||||
|
List<PatiantInformtion> get inPatientList => _inPatientService.inPatientList;
|
||||||
|
|
||||||
|
List<PatiantInformtion> get myIinPatientList =>
|
||||||
|
_inPatientService.myInPatientList;
|
||||||
|
|
||||||
|
List<PatiantInformtion> filteredInPatientItems = List();
|
||||||
|
|
||||||
|
Future getInPatientList(PatientSearchRequestModel requestModel,
|
||||||
|
{bool isMyInpatient = false}) async {
|
||||||
|
await getDoctorProfile();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
|
||||||
|
if (inPatientList.length == 0)
|
||||||
|
await _inPatientService.getInPatientList(requestModel, false);
|
||||||
|
if (_inPatientService.hasError) {
|
||||||
|
error = _inPatientService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else {
|
||||||
|
// setDefaultInPatientList();
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future setDefaultInPatientList() async {
|
||||||
|
setState(ViewState.BusyLocal);
|
||||||
|
await getDoctorProfile();
|
||||||
|
filteredInPatientItems.clear();
|
||||||
|
if (inPatientList.length > 0) filteredInPatientItems.addAll(inPatientList);
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearPatientList() {
|
||||||
|
_inPatientService.inPatientList = [];
|
||||||
|
_inPatientService.myInPatientList = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
void filterSearchResults(String query) {
|
||||||
|
var strExist = query.length > 0 ? true : false;
|
||||||
|
if (strExist) {
|
||||||
|
filteredInPatientItems = [];
|
||||||
|
for (var i = 0; i < inPatientList.length; i++) {
|
||||||
|
String firstName = inPatientList[i].firstName.toUpperCase();
|
||||||
|
String lastName = inPatientList[i].lastName.toUpperCase();
|
||||||
|
String mobile = inPatientList[i].mobileNumber.toUpperCase();
|
||||||
|
String patientID = inPatientList[i].patientId.toString();
|
||||||
|
|
||||||
|
if (firstName.contains(query.toUpperCase()) ||
|
||||||
|
lastName.contains(query.toUpperCase()) ||
|
||||||
|
mobile.contains(query) ||
|
||||||
|
patientID.contains(query)) {
|
||||||
|
filteredInPatientItems.add(inPatientList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
} else {
|
||||||
|
if (inPatientList.length > 0) filteredInPatientItems.clear();
|
||||||
|
filteredInPatientItems.addAll(inPatientList);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue