Project selection added in Laser & advance payment

Dev_3.3_MedicalReportCR
haroon amjad 1 year ago
parent e64a91855f
commit 75685b1f61

@ -51,12 +51,13 @@ class HospitalService extends BaseService {
}
}
Future getHospitals({bool isResBasedOnLoc = true}) async {
Future getHospitals({bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async {
if (isResBasedOnLoc) await _getCurrentLocation();
Map<String, dynamic> body = Map();
body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['IsAdvancePayment'] = isAdvancePayment;
await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) {
_hospitals.clear();

@ -70,9 +70,9 @@ class MyBalanceViewModel extends BaseViewModel {
}
}
Future getHospitals() async {
Future getHospitals({bool isAdvancePayment = false}) async {
setState(ViewState.Busy);
await _hospitalService.getHospitals();
await _hospitalService.getHospitals(isAdvancePayment: isAdvancePayment);
if (_hospitalService.hasError) {
error = _hospitalService.error;
setState(ViewState.Error);

@ -57,6 +57,16 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
super.dispose();
}
void getAncillaryOrderDetails(AnciallryOrdersViewModel model) {
GifLoaderDialogUtils.showMyDialog(context);
model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) {
addToSelectedProcedures(model);
GifLoaderDialogUtils.hideDialog(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
});
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
@ -64,6 +74,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
AppGlobal.context = context;
return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) {
// getAncillaryOrderDetails(model);
model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) {
addToSelectedProcedures(model);
});

@ -240,11 +240,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
dropdownValue =
clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString();
if (dropdownValue == "253-false-0-0") {
Navigator.push(context, FadePage(page: LaserClinic()));
// Navigator.push(context, FadePage(page: LaserClinic()));
} else if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
if(!nearestAppo)
getDoctorsList(context);
if (!nearestAppo) getDoctorsList(context);
} else {}
});
projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription);
@ -333,7 +332,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
setState(() {
selectedHospital = newValue;
projectDropdownValue = newValue.mainProjectID.toString();
getDoctorsList(context);
if (dropdownValue.split("-")[0] == "253") {
Navigator.push(context, FadePage(page: LaserClinic()));
} else {
getDoctorsList(context);
}
});
},
),
@ -458,7 +461,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
bool isDentalSelectedAndSupported() {
if (dropdownValue != null)
return dropdownValue != "" && (dropdownValue.split("-")[0] == "17") && isMobileAppDentalAllow;
return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" || dropdownValue.split("-")[0] == "253") && isMobileAppDentalAllow;
else
return false;
}
@ -531,8 +534,8 @@ class _SearchByClinicState extends State<SearchByClinic> {
searchInfo.clinic = selectedClinic;
searchInfo.date = DateTime.now();
if(projectViewModel.isLogin) {
if(projectViewModel.user.age > 12) {
if (projectViewModel.isLogin) {
if (projectViewModel.user.age > 12) {
navigateToDentalComplaints(context, searchInfo);
} else {
callDoctorsSearchAPI(17);

@ -67,7 +67,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
projectViewModel = Provider.of(context);
return BaseView<MyBalanceViewModel>(
onModelReady: (model) {
model.getHospitals();
model.getHospitals(isAdvancePayment: true);
model.getFamilyFiles();
},
builder: (_, model, w) => AppScaffold(
@ -315,7 +315,6 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
advanceModel.patientName = patientName;
GifLoaderDialogUtils.showMyDialog(context);
model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) {
@ -327,7 +326,8 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
isShowInstallments: false, isFromAdvancePayment: true),
isShowInstallments: false,
isFromAdvancePayment: true),
),
).then(
(value) {

@ -131,11 +131,16 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
GifLoaderDialogUtils.showMyDialog(context);
service.getSickLeaveStatusByAdmissionNo(model.sickLeaveList[index].projectID, model.sickLeaveList[index].admissionNo).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
if (res["List_GetSickLeaveStatusByAdmissionNo"].length != 0) {
admissionStatusForSickLeave = AdmissionStatusForSickLeave.fromJson(res["List_GetSickLeaveStatusByAdmissionNo"][0]);
if (admissionStatusForSickLeave.status != 6) {
AppToast.showErrorToast(message: TranslationBase.of(context).sickLeaveAdmittedPatient);
if (res != null && res["List_GetSickLeaveStatusByAdmissionNo"] != null) {
if (res["List_GetSickLeaveStatusByAdmissionNo"].length != 0) {
admissionStatusForSickLeave = AdmissionStatusForSickLeave.fromJson(res["List_GetSickLeaveStatusByAdmissionNo"][0]);
if (admissionStatusForSickLeave.status != 6) {
AppToast.showErrorToast(message: TranslationBase.of(context).sickLeaveAdmittedPatient);
} else {
openWorkPlaceUpdatePageFunc(requestNumber, setupID, model, index, projectID);
}
} else {
openWorkPlaceUpdatePageFunc(requestNumber, setupID, model, index, projectID);
}

Loading…
Cancel
Save