HHC Fixes

merge-update-with-lab-changes
haroon amjad 4 years ago
parent f1129cc14c
commit a9e48e487f

@ -0,0 +1,13 @@
class AppState {
static final AppState _instance = AppState._internal();
AppState._internal();
factory AppState() => _instance;
bool isLogged = false;
set setLogged(v) => isLogged = v;
bool get getIsLogged => isLogged;
}

@ -141,11 +141,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
if (BASE_URL == "https://uat.hmgwebservices.com/") { // if (BASE_URL == "https://uat.hmgwebservices.com/") {
print("URL : $url"); print("URL : $url");
final jsonBody = json.encode(body); final jsonBody = json.encode(body);
print(jsonBody); print(jsonBody);
} // }
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
@ -264,72 +264,65 @@ class BaseAppClient {
if (!isExternal) { if (!isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID') // if (body.containsKey('SetupID')) {
? body['PatientTypeID'] != null // body['SetupID'] = body.containsKey('SetupID')
? body['PatientTypeID'] // ? body['SetupID'] != null
: user['PatientType'] != null // ? body['SetupID']
? user['PatientType'] // : SETUP_ID
: PATIENT_TYPE_ID // : SETUP_ID;
: PATIENT_TYPE_ID; // }
if (user != null) { //
body['TokenID'] = token; // body['VersionID'] = VERSION_ID;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; // body['Channel'] = CHANNEL;
body['PatientOutSA'] = user['OutSA']; // body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['SessionID'] = SESSION_ID; //getSe //
// headers = { // body['IPAdress'] = IP_ADDRESS;
// 'Content-Type': 'application/json', // body['generalid'] = GENERAL_ID;
// 'Accept': 'application/json', // body['PatientOutSA'] = body.containsKey('PatientOutSA')
// 'Authorization': pharmacyToken, // ? body['PatientOutSA'] != null
// 'Mobilenumber': user['MobileNumber'].toString(), // ? body['PatientOutSA']
// 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', // : PATIENT_OUT_SA
// 'Username': user['PatientID'].toString(), // : PATIENT_OUT_SA;
// }; //
} // if (body.containsKey('isDentalAllowedBackend')) {
} // body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
// ? body['isDentalAllowedBackend'] != null
// ? body['isDentalAllowedBackend']
// : IS_DENTAL_ALLOWED_BACKEND
// : IS_DENTAL_ALLOWED_BACKEND;
// }
//
// body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
//
// if (!body.containsKey('IsPublicRequest')) {
// body['PatientType'] = body.containsKey('PatientType')
// ? body['PatientType'] != null
// ? body['PatientType']
// : user['PatientType'] != null
// ? user['PatientType']
// : PATIENT_TYPE
// : PATIENT_TYPE;
//
// body['PatientTypeID'] = body.containsKey('PatientTypeID')
// ? body['PatientTypeID'] != null
// ? body['PatientTypeID']
// : user['PatientType'] != null
// ? user['PatientType']
// : PATIENT_TYPE_ID
// : PATIENT_TYPE_ID;
// if (user != null) {
// body['TokenID'] = token;
// body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
// body['PatientOutSA'] = user['OutSA'];
// body['SessionID'] = SESSION_ID; //getSe
// }
// }
} }
// print("URL : $url"); print("URL : $url");
// print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
// print("Headers : ${json.encode(headers)}"); print("Headers : ${json.encode(headers)}");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);

@ -124,9 +124,9 @@ class HomeHealthCareViewModel extends BaseViewModel {
Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async { Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken().then((value) async { // await _pharmacyModuleService.generatePharmacyToken().then((value) async {
await _customerAddressesService.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); await _customerAddressesService.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
}); // });
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
error = _customerAddressesService.error; error = _customerAddressesService.error;

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -47,6 +48,9 @@ class ProjectViewModel extends BaseViewModel {
List<PrivilegeModel> get privileges => List<PrivilegeModel> get privileges =>
isLoginChild ? privilegeChildUser : privilegeChildUser; isLoginChild ? privilegeChildUser : privilegeChildUser;
List<LaserBodyPart> selectedBodyPartList = [];
int laserSelectionDuration = 0;
StreamSubscription subscription; StreamSubscription subscription;
ProjectViewModel() { ProjectViewModel() {

@ -9,7 +9,6 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -42,6 +41,8 @@ class _LocationPageState extends State<LocationPage> {
double longitude = 0; double longitude = 0;
bool showCurrentLocation = false; bool showCurrentLocation = false;
GoogleMapController mapController;
AppMap appMap; AppMap appMap;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
static CameraPosition _kGooglePlex = CameraPosition( static CameraPosition _kGooglePlex = CameraPosition(
@ -49,7 +50,7 @@ class _LocationPageState extends State<LocationPage> {
zoom: 14.4746, zoom: 14.4746,
); );
LatLng currentPostion; LatLng currentPostion;
Completer<GoogleMapController> mapController = Completer(); // Completer<GoogleMapController> mapController = Completer();
Placemark selectedPlace; Placemark selectedPlace;
@override @override
@ -145,152 +146,156 @@ class _LocationPageState extends State<LocationPage> {
// ], // ],
// ), // ),
// PlacePicker( PlacePicker(
// apiKey: GOOGLE_API_KEY, apiKey: GOOGLE_API_KEY,
// enableMyLocationButton: true, enableMyLocationButton: true,
// automaticallyImplyAppBarLeading: false, automaticallyImplyAppBarLeading: false,
// autocompleteOnTrailingWhitespace: true, autocompleteOnTrailingWhitespace: true,
// selectInitialPosition: true, selectInitialPosition: true,
// autocompleteLanguage: projectViewModel.currentLanguage, autocompleteLanguage: projectViewModel.currentLanguage,
// enableMapTypeButton: true, enableMapTypeButton: true,
// searchForInitialValue: false, searchForInitialValue: false,
// onPlacePicked: (PickResult result) { onMapCreated: (GoogleMapController controller) {
// print(result.adrAddress); mapController = controller;
// }, },
// selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { onPlacePicked: (PickResult result) {
// return isSearchBarFocused print(result.adrAddress);
// ? Container() },
// : FloatingCard( selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
// bottomPosition: 0.0, print("state: $state, isSearchBarFocused: $isSearchBarFocused");
// leftPosition: 0.0, return isSearchBarFocused
// rightPosition: 0.0, ? Container()
// width: 500, : FloatingCard(
// borderRadius: BorderRadius.circular(0.0), bottomPosition: 0.0,
// child: state == SearchingState.Searching leftPosition: 0.0,
// ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer rightPosition: 0.0,
// : DefaultButton(TranslationBase.of(context).addNewAddress, () async { width: 500,
// AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( borderRadius: BorderRadius.circular(0.0),
// customer: Customer(addresses: [ child: state == SearchingState.Searching
// Addresses( ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer
// address1: selectedPlace.formattedAddress, : DefaultButton(TranslationBase.of(context).addNewAddress, () async {
// address2: selectedPlace.formattedAddress, AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
// customerAttributes: "", customer: Customer(addresses: [
// createdOnUtc: "", Addresses(
// id: "0", address1: selectedPlace.formattedAddress,
// faxNumber: "", address2: selectedPlace.formattedAddress,
// phoneNumber: projectViewModel.user.mobileNumber, customerAttributes: "",
// countryId: 69, createdOnUtc: "",
// latLong: "$latitude,$longitude", id: "0",
// email: projectViewModel.user.emailAddress) faxNumber: "",
// // Addresses( phoneNumber: projectViewModel.user.mobileNumber,
// // address1: selectedPlace.formattedAddress, countryId: 69,
// // address2: selectedPlace.formattedAddress, latLong: selectedPlace.geometry.location.lat.toString() + "," + selectedPlace.geometry.location.lng.toString(),
// // customerAttributes: "", email: projectViewModel.user.emailAddress)
// // city: "", // Addresses(
// // createdOnUtc: "", // address1: selectedPlace.formattedAddress,
// // id: "0", // address2: selectedPlace.formattedAddress,
// // latLong: "${selectedPlace.geometry.location}", // customerAttributes: "",
// // email: "") // city: "",
// ]), // createdOnUtc: "",
// ); // id: "0",
// // latLong: "${selectedPlace.geometry.location}",
// selectedPlace.addressComponents.forEach((e) { // email: "")
// if (e.types.contains("country")) { ]),
// addNewAddressRequestModel.customer.addresses[0].country = e.longName; );
// }
// if (e.types.contains("postal_code")) {
// addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
// }
// if (e.types.contains("locality")) {
// addNewAddressRequestModel.customer.addresses[0].city = e.longName;
// }
// });
//
// await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
// if (model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast(model.error);
// } else {
// AppToast.showSuccessToast(message: "Address Added Successfully");
// }
// Navigator.of(context).pop(addNewAddressRequestModel);
// }).insideContainer);
// },
// initialPosition: LatLng(latitude, longitude),
// useCurrentLocation: showCurrentLocation,
// ),
Expanded( selectedPlace.addressComponents.forEach((e) {
child: Stack( if (e.types.contains("country")) {
alignment: Alignment.center, addNewAddressRequestModel.customer.addresses[0].country = e.longName;
children: [ }
if (appMap != null) appMap, if (e.types.contains("postal_code")) {
Container( addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
margin: EdgeInsets.only(bottom: 50.0), }
child: Icon( if (e.types.contains("locality")) {
Icons.place, addNewAddressRequestModel.customer.addresses[0].city = e.longName;
color: CustomColors.accentColor, }
size: 50, });
),
), await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
// FloatingCard( if (model.state == ViewState.ErrorLocal) {
// bottomPosition: 0.0, Utils.showErrorToast(model.error);
// leftPosition: 0.0, } else {
// rightPosition: 0.0, AppToast.showSuccessToast(message: "Address Added Successfully");
// width: 500, }
// borderRadius: BorderRadius.circular(0.0), Navigator.of(context).pop(addNewAddressRequestModel);
// // child: state == SearchingState.Searching }).insideContainer);
// // ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer },
// // : initialPosition: LatLng(latitude, longitude),
// child: DefaultButton(TranslationBase.of(context).addNewAddress, () async { useCurrentLocation: showCurrentLocation,
// AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
// customer: Customer(addresses: [
// // Addresses(
// // address1: selectedPlace.formattedAddress,
// // address2: selectedPlace.formattedAddress,
// // customerAttributes: "",
// // createdOnUtc: "",
// // id: "0",
// // faxNumber: "",
// // phoneNumber: projectViewModel.user.mobileNumber,
// // countryId: 69,
// // latLong: "$latitude,$longitude",
// // email: projectViewModel.user.emailAddress)
//
// // Addresses(
// // address1: selectedPlace.formattedAddress,
// // address2: selectedPlace.formattedAddress,
// // customerAttributes: "",
// // city: "",
// // createdOnUtc: "",
// // id: "0",
// // latLong: "${selectedPlace.geometry.location}",
// // email: "")
// ]),
// );
//
// // selectedPlace.addressComponents.forEach((e) {
// // if (e.types.contains("country")) {
// // addNewAddressRequestModel.customer.addresses[0].country = e.longName;
// // }
// // if (e.types.contains("postal_code")) {
// // addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
// // }
// // if (e.types.contains("locality")) {
// // addNewAddressRequestModel.customer.addresses[0].city = e.longName;
// // }
// // });
//
// await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
// if (model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast(model.error);
// } else {
// AppToast.showSuccessToast(message: "Address Added Successfully");
// }
// Navigator.of(context).pop(addNewAddressRequestModel);
// }).insideContainer),
],
),
), ),
// Expanded(
// child: Stack(
// alignment: Alignment.center,
// children: [
// if (appMap != null) appMap,
// Container(
// margin: EdgeInsets.only(bottom: 50.0),
// child: Icon(
// Icons.place,
// color: CustomColors.accentColor,
// size: 50,
// ),
// ),
// // FloatingCard(
// // bottomPosition: 0.0,
// // leftPosition: 0.0,
// // rightPosition: 0.0,
// // width: 500,
// // borderRadius: BorderRadius.circular(0.0),
// // // child: state == SearchingState.Searching
// // // ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer
// // // :
// // child: DefaultButton(TranslationBase.of(context).addNewAddress, () async {
// // AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
// // customer: Customer(addresses: [
// // // Addresses(
// // // address1: selectedPlace.formattedAddress,
// // // address2: selectedPlace.formattedAddress,
// // // customerAttributes: "",
// // // createdOnUtc: "",
// // // id: "0",
// // // faxNumber: "",
// // // phoneNumber: projectViewModel.user.mobileNumber,
// // // countryId: 69,
// // // latLong: "$latitude,$longitude",
// // // email: projectViewModel.user.emailAddress)
// //
// // // Addresses(
// // // address1: selectedPlace.formattedAddress,
// // // address2: selectedPlace.formattedAddress,
// // // customerAttributes: "",
// // // city: "",
// // // createdOnUtc: "",
// // // id: "0",
// // // latLong: "${selectedPlace.geometry.location}",
// // // email: "")
// // ]),
// // );
// //
// // // selectedPlace.addressComponents.forEach((e) {
// // // if (e.types.contains("country")) {
// // // addNewAddressRequestModel.customer.addresses[0].country = e.longName;
// // // }
// // // if (e.types.contains("postal_code")) {
// // // addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
// // // }
// // // if (e.types.contains("locality")) {
// // // addNewAddressRequestModel.customer.addresses[0].city = e.longName;
// // // }
// // // });
// //
// // await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
// // if (model.state == ViewState.ErrorLocal) {
// // Utils.showErrorToast(model.error);
// // } else {
// // AppToast.showSuccessToast(message: "Address Added Successfully");
// // }
// // Navigator.of(context).pop(addNewAddressRequestModel);
// // }).insideContainer),
// ],
// ),
// ),
), ),
); );
} }

@ -194,7 +194,10 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
longitude: longitude, longitude: longitude,
), ),
), ),
); ).then((value) {
print(value);
widget.model.getCustomerAddresses();
});
}, },
child: Padding( child: Padding(
padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8), padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8),

@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -23,7 +22,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'book_reminder_page.dart'; import 'book_reminder_page.dart';
@ -37,8 +35,9 @@ class BookConfirm extends StatefulWidget {
String appoDateFormatted = ""; String appoDateFormatted = "";
String appoTimeFormatted = ""; String appoTimeFormatted = "";
bool isLiveCareAppointment; bool isLiveCareAppointment;
int initialSlotDuration;
BookConfirm({@required this.doctor, @required this.selectedDate, @required this.isLiveCareAppointment, @required this.selectedTime}); BookConfirm({@required this.doctor, @required this.selectedDate, @required this.isLiveCareAppointment, @required this.selectedTime, @required this.initialSlotDuration});
DoctorsListService service; DoctorsListService service;
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
@ -208,7 +207,7 @@ class _BookConfirmState extends State<BookConfirm> {
if (isLiveCareSchedule != null && isLiveCareSchedule) { if (isLiveCareSchedule != null && isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
} else { } else {
insertAppointment(context, widget.doctor); insertAppointment(context, widget.doctor, widget.initialSlotDuration);
} }
}, },
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)), child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)),
@ -255,7 +254,7 @@ class _BookConfirmState extends State<BookConfirm> {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () async { Future.delayed(new Duration(milliseconds: 1500), () async {
if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) { if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor); insertAppointment(context, widget.doctor, widget.initialSlotDuration);
} else { } else {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
} }
@ -269,13 +268,13 @@ class _BookConfirmState extends State<BookConfirm> {
}); });
} }
insertAppointment(context, DoctorList docObject) { insertAppointment(context, DoctorList docObject, int initialSlotDuration) {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime; final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
projectViewModel.analytics.appointment.book_appointment_click_confirm(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); projectViewModel.analytics.appointment.book_appointment_click_confirm(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, context).then((res) { widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, null, null, null, projectViewModel).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor);
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);

@ -154,7 +154,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
onTap: (index) { onTap: (index) {
setState(() { setState(() {
if (index == 1) { if (index == 1) {
if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.doctor.clinicID == 47 || widget.isLiveCareAppointment) { if (widget.doctor.clinicID == 23 || widget.doctor.clinicID == 47 || widget.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex; _tabController.index = _tabController.previousIndex;
showFooterButton = false; showFooterButton = false;
} else { } else {
@ -529,6 +529,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
isLiveCareAppointment: widget.isLiveCareAppointment, isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate, selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime, selectedTime: DocAvailableAppointments.selectedTime,
initialSlotDuration: DocAvailableAppointments.initialSlotDuration,
), ),
), ),
); );

@ -28,6 +28,7 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedTime; static String selectedTime;
bool isLiveCareAppointment; bool isLiveCareAppointment;
final dynamic doctorSchedule; final dynamic doctorSchedule;
static int initialSlotDuration;
DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment}); DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment});
@ -239,6 +240,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); _eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() { setState(() {
DocAvailableAppointments.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0])); DocAvailableAppointments.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]));
DocAvailableAppointments.selectedAppoDateTime = DateUtil.convertStringToDate(freeSlotsResponse[0]);
selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]), language); selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]), language);
selectedDateJSON = freeSlotsResponse[0]; selectedDateJSON = freeSlotsResponse[0];
}); });
@ -292,9 +294,9 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) { if (res['FreeTimeSlots'].length != 0) {
DocAvailableAppointments.initialSlotDuration = res['InitialSlotDuration'];
DocAvailableAppointments.areAppointmentsAvailable = true; DocAvailableAppointments.areAppointmentsAvailable = true;
freeSlotsResponse = res['FreeTimeSlots']; freeSlotsResponse = res['FreeTimeSlots'];
_getJSONSlots().then((value) { _getJSONSlots().then((value) {
setState(() => { setState(() => {
_events.clear(), _events.clear(),

@ -184,9 +184,11 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).continues, TranslationBase.of(context).continues,
getDuration() != 0 ? () { getDuration() != 0
callDoctorsSearchAPI(); ? () {
} : null, callDoctorsSearchAPI();
}
: null,
color: CustomColors.green, color: CustomColors.green,
disabledColor: CustomColors.grey2, disabledColor: CustomColors.grey2,
), ),
@ -208,6 +210,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List(); List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
projectViewModel.selectedBodyPartList = _selectedBodyPartList;
service.getDoctorsList(253, 0, false, context).then((res) { service.getDoctorsList(253, 0, false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -270,33 +273,14 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
if (_selectedBodyPartList.length > 0) { if (_selectedBodyPartList.length > 0) {
duration = _selectedBodyPartList.fold(0, (previousValue, element) => previousValue + int.parse(element.timeDuration)); duration = _selectedBodyPartList.fold(0, (previousValue, element) => previousValue + int.parse(element.timeDuration));
} }
print("duration:$duration");
if (lowerUpperLegsList.length == 2) { if (lowerUpperLegsList.length == 2) {
duration -= 30; duration -= 30;
} }
print("duration1:$duration");
if (upperLowerArmsList.length == 2) { if (upperLowerArmsList.length == 2) {
duration -= 15; duration -= 15;
} }
print("duration2:$duration");
// for (int i = 0; i < _selectedBodyPartList.length; i++) {
// if (
//
// (lowerUpperLegsList.length == 2 && (_selectedBodyPartList[i].mappingCode == "47" || _selectedBodyPartList[i].mappingCode == "48")) ||
// (upperLowerArmsList.length == 2 && (_selectedBodyPartList[i].mappingCode == "40" || _selectedBodyPartList[i].mappingCode == "41"))
//
//
// ) {
// print("duration:$duration");
//
// duration += 15;
// print("duration1:$duration");
// } else {
// duration += int.parse(_selectedBodyPartList[i].timeDuration);
// }
// }
print(duration);
_duration = duration; _duration = duration;
projectViewModel.laserSelectionDuration = duration;
return duration; return duration;
} }
@ -378,6 +362,9 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
setState(() { setState(() {
if (value) { if (value) {
_selectedBodyPartList.clear(); _selectedBodyPartList.clear();
_selectedBodyPartList.add(fullBody);
} else {
_selectedBodyPartList.clear();
} }
_isFullBody = !_isFullBody; _isFullBody = !_isFullBody;
}); });

@ -435,7 +435,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
service service
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, context, widget.selectedProcedure.procedureID, .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, context, widget.selectedProcedure.procedureID,
widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum) widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

@ -359,7 +359,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
service service
.insertAppointment( .insertAppointment(
docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, context, widget.obGyneProcedureListResponse.procedureId) docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, context, widget.obGyneProcedureListResponse.procedureId)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);

@ -3,10 +3,12 @@ import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart'; import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart';
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/models/apple_pay_request.dart'; import 'package:diplomaticquarterapp/models/apple_pay_request.dart';
@ -28,6 +30,7 @@ class DoctorsListService extends BaseService {
double long; double long;
String deviceToken; String deviceToken;
String tokenID; String tokenID;
List<LaserBodyPart> selectedBodyPartList = [];
Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async { Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
@ -317,8 +320,8 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, BuildContext context, Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, BuildContext context,
[String procedureID, num testTypeEnum, num testProcedureEnum]) async { [String procedureID, num testTypeEnum, num testProcedureEnum, ProjectViewModel projectViewModel]) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -339,13 +342,14 @@ class DoctorsListService extends BaseService {
"ProcedureID": procedureID, "ProcedureID": procedureID,
"TestTypeEnum": testTypeEnum, "TestTypeEnum": testTypeEnum,
"TestProcedureEnum": testProcedureEnum, "TestProcedureEnum": testProcedureEnum,
"InitialSlotDuration": 0, "InitialSlotDuration": initialSlotDuration,
"StrAppointmentDate": selectedDate, "StrAppointmentDate": selectedDate,
"IsVirtual": false, "IsVirtual": false,
"DeviceType": Platform.isIOS ? 'iOS' : 'Android', "DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"BookedBy": 102, "BookedBy": 102,
"VisitType": 1, "VisitType": 1,
"VisitFor": 1, "VisitFor": 1,
"GenderID": authUser.gender,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2, "LanguageID": languageID == 'ar' ? 1 : 2,
@ -360,10 +364,18 @@ class DoctorsListService extends BaseService {
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
if(clinicID == 253) {
List<String> procedureID = projectViewModel.selectedBodyPartList.map((element) => element.id.toString()).toList();
request["GeneralProcedureList"] = procedureID;
request["InitialSlotDuration"] = projectViewModel.laserSelectionDuration;
}
dynamic localRes; dynamic localRes;
await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async { await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);

@ -142,6 +142,7 @@ class PushNotificationHandler {
newMessage(message); newMessage(message);
}); });
else else
// if(message != null)
newMessage(message); newMessage(message);
}); });

@ -32,13 +32,13 @@ class MyInAppBrowser extends InAppBrowser {
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';

Loading…
Cancel
Save