Project selection added in Laser & advance payment

merge-update-with-lab-changes
haroon amjad 3 years 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(); if (isResBasedOnLoc) await _getCurrentLocation();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['Latitude'] = await this.sharedPref.getDouble(USER_LAT); body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = await this.sharedPref.getDouble(USER_LONG); body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
body['IsOnlineCheckIn'] = isResBasedOnLoc; body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['IsAdvancePayment'] = isAdvancePayment;
await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) {
_hospitals.clear(); _hospitals.clear();

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

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

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

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

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

Loading…
Cancel
Save