Merge pull request 'haroon_dev' (#180) from haroon_dev into master

Reviewed-on: https://34.17.182.140/Haroon6138/HMG_Patient_App_New/pulls/180
pull/185/head
Haroon6138 2 months ago
commit a6344d6a81

@ -618,7 +618,7 @@
"general": "General", "general": "General",
"profile": "ملفي", "profile": "ملفي",
"notifications": "إشعارات", "notifications": "إشعارات",
"notificationDetails": "تفاصيل الاشعار", "notificationDetails": "Notification Details",
"notificationDetailsa": "تفاصيل الاشعار", "notificationDetailsa": "تفاصيل الاشعار",
"infoMyDoctorPoints": "", "infoMyDoctorPoints": "",
"infoMyDoctor": "This service allows you to see all the doctors you have visited in Al Habib Medical Group, and through this service:", "infoMyDoctor": "This service allows you to see all the doctors you have visited in Al Habib Medical Group, and through this service:",

@ -83,6 +83,7 @@ var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
var GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; var GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
var GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; var GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
var SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; var SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
var SEND_PRESCRIPTION_EMAIL_NEW = 'Services/Notifications.svc/REST/SendPrescriptionEmail_New';
var GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; var GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order ///Lab Order

@ -7,7 +7,7 @@ class PenguinMethodChannel {
return await rootBundle.load("assets/images/progress-loading-red-crop-1.gif").then((data) => data.buffer.asUint8List()); return await rootBundle.load("assets/images/progress-loading-red-crop-1.gif").then((data) => data.buffer.asUint8List());
} }
Future<void> launch(String storyboardName, String languageCode, String username, {NavigationClinicDetails? details}) async { Future<void> launch(String storyboardName, String languageCode, String username, bool isClinicNavigation, {NavigationClinicDetails? details}) async {
// Uint8List image = await loadGif(); // Uint8List image = await loadGif();
try { try {
await _channel.invokeMethod('launchPenguin', { await _channel.invokeMethod('launchPenguin', {
@ -31,7 +31,7 @@ class PenguinMethodChannel {
"isEnableReportIssue": true, "isEnableReportIssue": true,
"languageCode": languageCode, "languageCode": languageCode,
"mapBoxKey": "pk.eyJ1IjoicndhaWQiLCJhIjoiY2x5cGo4aHNjMGNsbTJyc2djempobGQxaSJ9.RCaC6WrUt4A4YnZNfxnONQ", "mapBoxKey": "pk.eyJ1IjoicndhaWQiLCJhIjoiY2x5cGo4aHNjMGNsbTJyc2djempobGQxaSJ9.RCaC6WrUt4A4YnZNfxnONQ",
"clinicID": details?.clinicId ?? "", "clinicID": isClinicNavigation ? "${details?.projectId}-${details?.clinicId}" : details?.clinicId ?? "",
// "clinicID": "108", // 46 ,49, 133 // "clinicID": "108", // 46 ,49, 133
"patientID": details?.patientId ?? "", "patientID": details?.patientId ?? "",
"projectID": int.parse(details?.projectId ?? "-1"), "projectID": int.parse(details?.projectId ?? "-1"),

@ -978,4 +978,13 @@ class Utils {
return checkDate == today; return checkDate == today;
} }
static bool isClinicAllowedForRebook(int clinicID) {
bool isAllowed = true;
if (clinicID == 23 || clinicID == 47 || clinicID == 265 || clinicID == 253 || clinicID == 134) {
isAllowed = false;
}
return isAllowed;
}
} }

@ -581,7 +581,8 @@ class AuthenticationViewModel extends ChangeNotifier {
if (!_appState.getIsChildLoggedIn) { if (!_appState.getIsChildLoggedIn) {
await medicalVm.getFamilyFiles(status: 0); await medicalVm.getFamilyFiles(status: 0);
// await medicalVm.getAllPendingRecordsByResponseId(); // await medicalVm.getAllPendingRecordsByResponseId();
_navigationService.replaceAllRoutesAndNavigateToLanding(); // _navigationService.replaceAllRoutesAndNavigateToLanding();
_navigationService.popUntilNamed(AppRoutes.landingScreen);
} }
} else { } else {
if (activation.list != null && activation.list!.isNotEmpty) { if (activation.list != null && activation.list!.isNotEmpty) {

@ -97,10 +97,11 @@ class HospitalSelectionBottomSheetViewModel extends ChangeNotifier {
initPenguinSDK(hospital.iD, clinicID: clinicID); initPenguinSDK(hospital.iD, clinicID: clinicID);
} }
initPenguinSDK(int projectID, {String clinicID = ""}) async { initPenguinSDK(int projectID, {String clinicID = "1"}) async {
NavigationClinicDetails data = NavigationClinicDetails(); NavigationClinicDetails data = NavigationClinicDetails();
data.projectId = projectID.toString(); data.projectId = projectID.toString();
data.clinicId = clinicID; data.clinicId = clinicID;
// data.clinicId = "1";
final bool permited = await AppPermission.askPenguinPermissions(); final bool permited = await AppPermission.askPenguinPermissions();
if (!permited) { if (!permited) {
Map<Permission, PermissionStatus> statuses = await [ Map<Permission, PermissionStatus> statuses = await [
@ -110,7 +111,7 @@ class HospitalSelectionBottomSheetViewModel extends ChangeNotifier {
Permission.bluetoothScan, Permission.bluetoothScan,
Permission.activityRecognition, Permission.activityRecognition,
].request().whenComplete(() { ].request().whenComplete(() {
PenguinMethodChannel().launch("penguin", appState.isArabic() ? "ar" : "en", appState.getAuthenticatedUser()?.patientId?.toString()??"", details: data); PenguinMethodChannel().launch("penguin", appState.isArabic() ? "ar" : "en", appState.getAuthenticatedUser()?.patientId?.toString() ?? "", false, details: data);
}); });
} }
} }

@ -5,14 +5,14 @@ class PatientAppointmentShareResponseModel {
int? appointmentNo; int? appointmentNo;
dynamic cardNumber; dynamic cardNumber;
dynamic cardType; dynamic cardType;
int? cashPrice; num? cashPrice;
int? cashPriceTax; num? cashPriceTax;
int? cashPriceWithTax; num? cashPriceWithTax;
int? clinicID; int? clinicID;
String? clinicName; String? clinicName;
int? companyId; int? companyId;
String? companyName; String? companyName;
int? companyShareWithTax; num? companyShareWithTax;
int? doctorID; int? doctorID;
String? doctorImageURL; String? doctorImageURL;
String? doctorNameObj; String? doctorNameObj;
@ -39,7 +39,7 @@ class PatientAppointmentShareResponseModel {
int? patientStatusType; int? patientStatusType;
num? patientTaxAmount; num? patientTaxAmount;
String? patientType; String? patientType;
int? paymentAmount; num? paymentAmount;
String? paymentDate; String? paymentDate;
dynamic paymentMethodName; dynamic paymentMethodName;
dynamic paymentReferenceNumber; dynamic paymentReferenceNumber;
@ -57,7 +57,7 @@ class PatientAppointmentShareResponseModel {
int? statusCode; int? statusCode;
dynamic statusDesc; dynamic statusDesc;
String? subPolicyNo; String? subPolicyNo;
int? tax; num? tax;
int? userID; int? userID;
PatientAppointmentShareResponseModel({ PatientAppointmentShareResponseModel({

@ -220,9 +220,23 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
isPatientHasQueueAppointment = false; if (patientArrivedAppointmentsHistoryList.isNotEmpty) {
isPatientHasQueueAppointment = false;
notifyListeners();
if (Utils.isDateToday(DateUtil.convertStringToDate(patientArrivedAppointmentsHistoryList.first.appointmentDate))) {
// getPatientAppointmentQueueDetails(appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
getPatientAppointmentQueueDetails();
}
}
if (!isAppointmentDataToBeLoaded) return; if (!isAppointmentDataToBeLoaded) return;
debugPrint('getPatientAppointments CALLED!!!');
patientAppointmentsByClinic.clear();
patientAppointmentsByHospital.clear();
patientAppointmentsViewList.clear();
patientTimelineAppointmentsList.clear();
filteredAppointmentList.clear(); filteredAppointmentList.clear();
patientAppointmentsHistoryList.clear(); patientAppointmentsHistoryList.clear();
patientUpcomingAppointmentsHistoryList.clear(); patientUpcomingAppointmentsHistoryList.clear();
@ -276,6 +290,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
_groupAppointmentsByClinicAndHospital(); _groupAppointmentsByClinicAndHospital();
if (patientArrivedAppointmentsHistoryList.isNotEmpty) { if (patientArrivedAppointmentsHistoryList.isNotEmpty) {
isPatientHasQueueAppointment = false;
notifyListeners();
if (Utils.isDateToday(DateUtil.convertStringToDate(patientArrivedAppointmentsHistoryList.first.appointmentDate))) { if (Utils.isDateToday(DateUtil.convertStringToDate(patientArrivedAppointmentsHistoryList.first.appointmentDate))) {
// getPatientAppointmentQueueDetails(appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID); // getPatientAppointmentQueueDetails(appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
getPatientAppointmentQueueDetails(); getPatientAppointmentQueueDetails();

@ -167,29 +167,44 @@ class PrescriptionsRepoImp implements PrescriptionsRepo {
@override @override
Future<Either<Failure, GenericApiModel>> getPrescriptionPDF( Future<Either<Failure, GenericApiModel>> getPrescriptionPDF(
{required PatientPrescriptionsResponseModel prescriptionsResponseModel, required List<PrescriptionDetailResponseModel> prescriptionDetailsList}) async { {required PatientPrescriptionsResponseModel prescriptionsResponseModel, required List<PrescriptionDetailResponseModel> prescriptionDetailsList}) async {
// Map<String, dynamic> mapDevice = {
// "AppointmentDate": prescriptionsResponseModel.appointmentDate,
// "ClinicName": prescriptionsResponseModel.clinicDescription,
// "DoctorName": prescriptionsResponseModel.doctorName,
// "ProjectID": prescriptionsResponseModel.projectID,
// "DoctorID": prescriptionsResponseModel.doctorID,
// "ClinicID": prescriptionsResponseModel.clinicID,
// "DateofBirth": Utils.appState.getAuthenticatedUser()!.dateofBirth,
// "ListPrescriptions": prescriptionDetailsList,
// "PatientIditificationNum": Utils.appState.getAuthenticatedUser()!.patientIdentificationNo,
// "PatientMobileNumber": Utils.appState.getAuthenticatedUser()!.mobileNumber,
// "PatientName": "${Utils.appState.getAuthenticatedUser()!.firstName!} ${Utils.appState.getAuthenticatedUser()!.lastName!}",
// "To": Utils.appState.getAuthenticatedUser()!.emailAddress,
// "SetupID": prescriptionsResponseModel.setupID,
// "IsDownload": true,
// "isDentalAllowedBackend": false,
// };
Map<String, dynamic> mapDevice = { Map<String, dynamic> mapDevice = {
"AppointmentDate": prescriptionsResponseModel.appointmentDate, "AppointmentNo": prescriptionsResponseModel.appointmentNo,
"ClinicName": prescriptionsResponseModel.clinicDescription,
"DoctorName": prescriptionsResponseModel.doctorName,
"ProjectID": prescriptionsResponseModel.projectID,
"DoctorID": prescriptionsResponseModel.doctorID,
"ClinicID": prescriptionsResponseModel.clinicID,
"DateofBirth": Utils.appState.getAuthenticatedUser()!.dateofBirth,
"ListPrescriptions": prescriptionDetailsList,
"PatientIditificationNum": Utils.appState.getAuthenticatedUser()!.patientIdentificationNo,
"PatientMobileNumber": Utils.appState.getAuthenticatedUser()!.mobileNumber,
"PatientName": "${Utils.appState.getAuthenticatedUser()!.firstName!} ${Utils.appState.getAuthenticatedUser()!.lastName!}",
"To": Utils.appState.getAuthenticatedUser()!.emailAddress,
"SetupID": prescriptionsResponseModel.setupID, "SetupID": prescriptionsResponseModel.setupID,
"EpisodeID": prescriptionsResponseModel.episodeID,
"ClinicID": prescriptionsResponseModel.clinicID,
"ProjectID": prescriptionsResponseModel.projectID,
"DischargeNo": prescriptionsResponseModel.dischargeNo,
"IsDownload": true, "IsDownload": true,
"isDentalAllowedBackend": false, // "To": Utils.appState.getAuthenticatedUser()!.emailAddress,
"To": "amjad.haroon@cloudsolutions.com.sa",
"ClinicName": prescriptionsResponseModel.clinicDescription,
"DoctorName": prescriptionsResponseModel.doctorName,
}; };
try { try {
GenericApiModel<dynamic>? apiResponse; GenericApiModel<dynamic>? apiResponse;
Failure? failure; Failure? failure;
await apiClient.post( await apiClient.post(
SEND_PRESCRIPTION_EMAIL, // SEND_PRESCRIPTION_EMAIL,
SEND_PRESCRIPTION_EMAIL_NEW,
body: mapDevice, body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) { onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType; failure = failureType;

@ -107,6 +107,9 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppointmentDoctorCard( AppointmentDoctorCard(
renderWidgetForERDisplay: ((widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false) ||
(widget.patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) ||
!Utils.isClinicAllowedForRebook(widget.patientAppointmentHistoryResponseModel.clinicID)),
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onAskDoctorTap: () async { onAskDoctorTap: () async {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingDoctorAvailability.tr(context: context)); LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingDoctorAvailability.tr(context: context));
@ -755,12 +758,15 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
], ],
).paddingOnly(left: 16.h, top: 24.h, right: 16.h, bottom: 0.h), ).paddingOnly(left: 16.h, top: 24.h, right: 16.h, bottom: 0.h),
AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel) AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)
? !widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment! ?
(widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment! ||
widget.patientAppointmentHistoryResponseModel.isExecludeDoctor! ||
Utils.isClinicAllowedForRebook(widget.patientAppointmentHistoryResponseModel.clinicID))
? CustomButton( ? CustomButton(
text: LocaleKeys.rebookAppointment.tr(context: context), text: LocaleKeys.rebookAppointment.tr(context: context),
onPressed: () { onPressed: () {
openDoctorScheduleCalendar(); openDoctorScheduleCalendar();
}, },
backgroundColor: AppColors.successColor, backgroundColor: AppColors.successColor,
borderColor: AppColors.successColor, borderColor: AppColors.successColor,
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,
@ -777,7 +783,6 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
: CustomButton( : CustomButton(
text: AppointmentType.getNextActionText(widget.patientAppointmentHistoryResponseModel.nextAction), text: AppointmentType.getNextActionText(widget.patientAppointmentHistoryResponseModel.nextAction),
onPressed: () { onPressed: () {
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
handleAppointmentNextAction(widget.patientAppointmentHistoryResponseModel.nextAction); handleAppointmentNextAction(widget.patientAppointmentHistoryResponseModel.nextAction);
}, },
backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction), backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction),
@ -855,6 +860,9 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.getPatientAppointments(true, false); myAppointmentsViewModel.getPatientAppointments(true, false);
showCommonBottomSheet(context, child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentConfirmedSuccessfully.tr(context: context)), callBackFunc: (str) { showCommonBottomSheet(context, child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentConfirmedSuccessfully.tr(context: context)), callBackFunc: (str) {
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
title: "", title: "",

@ -403,6 +403,9 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onSuccess: (apiResponse) { onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () { Future.delayed(Duration(milliseconds: 500), () {
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
@ -421,6 +424,9 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!, isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
onSuccess: (apiResponse) { onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () { Future.delayed(Duration(milliseconds: 500), () {
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
@ -485,6 +491,8 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onSuccess: (apiResponse) { onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () { Future.delayed(Duration(milliseconds: 500), () {
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
@ -503,6 +511,8 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!, isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
onSuccess: (apiResponse) { onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () { Future.delayed(Duration(milliseconds: 500), () {
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,

@ -184,9 +184,9 @@ class AppointmentCard extends StatelessWidget {
AppCustomChipWidget( AppCustomChipWidget(
labelText: isLoading labelText: isLoading
? 'Olaya' ? 'Olaya'
: patientAppointmentHistoryResponseModel.projectName!.length > 15 : (patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital").length > 15
? '${patientAppointmentHistoryResponseModel.projectName!.substring(0, 15)}...' ? '${(patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital").substring(0, 15)}...'
: patientAppointmentHistoryResponseModel.projectName!) : patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital")
.toShimmer2(isShow: isLoading), .toShimmer2(isShow: isLoading),
AppCustomChipWidget( AppCustomChipWidget(
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
@ -226,7 +226,10 @@ class AppointmentCard extends StatelessWidget {
} }
Widget _buildActionArea(BuildContext context, AppState appState) { Widget _buildActionArea(BuildContext context, AppState appState) {
if ((patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false) && AppointmentType.isArrived(patientAppointmentHistoryResponseModel)) { if ((((patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false) ||
(patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) ||
!Utils.isClinicAllowedForRebook(patientAppointmentHistoryResponseModel.clinicID ?? 0))) &&
AppointmentType.isArrived(patientAppointmentHistoryResponseModel)) {
return CustomButton( return CustomButton(
text: isFromMedicalReport ? LocaleKeys.selectAppointment.tr(context: context) : LocaleKeys.viewDetails.tr(context: context), text: isFromMedicalReport ? LocaleKeys.selectAppointment.tr(context: context) : LocaleKeys.viewDetails.tr(context: context),
onPressed: () { onPressed: () {
@ -425,8 +428,8 @@ class AppointmentCard extends StatelessWidget {
), ),
) )
.then((_) { .then((_) {
myAppointmentsViewModel.initAppointmentsViewModel(); // myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false); // myAppointmentsViewModel.getPatientAppointments(true, false);
}); });
} }
} }

@ -58,17 +58,17 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
projectDetailListModel = Utils.getProjectDetailObj(appState, patientAppointmentHistoryResponseModel.projectID); projectDetailListModel = Utils.getProjectDetailObj(appState, patientAppointmentHistoryResponseModel.projectID);
double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000; double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000;
print(dist); print(dist);
if (dist <= projectDetailListModel.geofenceRadius!) { // if (dist <= projectDetailListModel.geofenceRadius!) {
sendCheckInRequest(projectDetailListModel.checkInQrCode!, 3, context); sendCheckInRequest(projectDetailListModel.checkInQrCode!, 3, context);
} else { // } else {
showCommonBottomSheetWithoutHeight(context, // showCommonBottomSheetWithoutHeight(context,
title: LocaleKeys.error.tr(context: context), // title: LocaleKeys.error.tr(context: context),
child: Utils.getErrorWidget( // child: Utils.getErrorWidget(
loadingText: LocaleKeys.ensureWithinHospitalLocation.tr(context: context), // loadingText: LocaleKeys.ensureWithinHospitalLocation.tr(context: context),
), callBackFunc: () { // ), callBackFunc: () {
Navigator.of(context).pop(); // Navigator.of(context).pop();
}, isFullScreen: false); // }, isFullScreen: false);
} // }
}); });
}), }),
SizedBox(height: 16.h), SizedBox(height: 16.h),
@ -150,6 +150,9 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
scannedCode: scannedCode, scannedCode: scannedCode,
checkInType: checkInType, checkInType: checkInType,
onSuccess: (apiResponse) { onSuccess: (apiResponse) {
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(context, title: LocaleKeys.success.tr(context: context), child: Utils.getSuccessWidget(loadingText: LocaleKeys.success.tr()), callBackFunc: () async { showCommonBottomSheetWithoutHeight(context, title: LocaleKeys.success.tr(context: context), child: Utils.getSuccessWidget(loadingText: LocaleKeys.success.tr()), callBackFunc: () async {
await myAppointmentsViewModel.getPatientAppointmentQueueDetails(); await myAppointmentsViewModel.getPatientAppointmentQueueDetails();

@ -95,11 +95,11 @@ class AppointmentDoctorCard extends StatelessWidget {
labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 4.w), labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 4.w),
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: patientAppointmentHistoryResponseModel.projectName!, labelText: patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital",
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w),
icon: AppAssets.doctor_calendar_icon, icon: AppAssets.doctor_calendar_icon,
labelText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang( labelText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(
DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate),
@ -107,7 +107,7 @@ class AppointmentDoctorCard extends StatelessWidget {
)}", )}",
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w),
icon: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! icon: !patientAppointmentHistoryResponseModel.isLiveCareAppointment!
? AppAssets.walkin_appointment_icon ? AppAssets.walkin_appointment_icon
: AppAssets.small_livecare_icon, : AppAssets.small_livecare_icon,

@ -178,7 +178,7 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
bookAppointmentsViewModel.selectedDoctor.projectName!.toText16(isBold: true), (bookAppointmentsViewModel.selectedDoctor.projectName ?? "Habib Hospital").toText16(isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
bookAppointmentsViewModel.appointmentNearestGateResponseModel != null bookAppointmentsViewModel.appointmentNearestGateResponseModel != null
? Wrap( ? Wrap(

@ -20,26 +20,18 @@ class NotificationDetailsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// Debug logging
print('=== Notification Details ===');
print('Message: ${notification.message}');
print('MessageType: ${notification.messageType}');
print('MessageTypeData: ${notification.messageTypeData}');
print('VideoURL: ${notification.videoURL}');
print('========================');
return CollapsingListView( return CollapsingListView(
title: LocaleKeys.notificationDetails.tr(), title: LocaleKeys.notificationDetails.tr(),
trailing: IconButton( // trailing: IconButton(
icon: Icon( // icon: Icon(
Icons.share_outlined, // Icons.share_outlined,
size: 24.h, // size: 24.h,
color: AppColors.textColor, // color: AppColors.textColor,
), // ),
onPressed: () { // onPressed: () {
_shareNotification(); // _shareNotification();
}, // },
), // ),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -230,21 +222,21 @@ class NotificationDetailsPage extends StatelessWidget {
), ),
// Additional notification info // Additional notification info
if (notification.notificationType != null && notification.notificationType!.isNotEmpty) // if (notification.notificationType != null && notification.notificationType!.isNotEmpty)
Column( // Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
LocaleKeys.typeNotification.tr().toText14( // LocaleKeys.typeNotification.tr().toText14(
weight: FontWeight.w600, // weight: FontWeight.w600,
color: AppColors.greyTextColor, // color: AppColors.greyTextColor,
), // ),
SizedBox(height: 8.h), // SizedBox(height: 8.h),
notification.notificationType!.toText16( // notification.notificationType!.toText16(
weight: FontWeight.w400, // weight: FontWeight.w400,
color: AppColors.textColor, // color: AppColors.textColor,
), // ),
], // ],
), // ),
], ],
), ),
); );

@ -23,7 +23,7 @@ class NotificationsListPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CollapsingListView( return CollapsingListView(
title: LocaleKeys.notifications.tr(context: context), title: LocaleKeys.notification.tr(context: context),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Consumer<NotificationsViewModel>(builder: (context, notificationsVM, child) { child: Consumer<NotificationsViewModel>(builder: (context, notificationsVM, child) {
return Container( return Container(

@ -139,7 +139,7 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
labelText: LocaleKeys.ratingValue.tr(namedArgs: {'rating': widget.prescriptionsResponseModel.decimalDoctorRate.toString()}, context: context), labelText: LocaleKeys.ratingValue.tr(namedArgs: {'rating': widget.prescriptionsResponseModel.decimalDoctorRate.toString()}, context: context),
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: widget.prescriptionsResponseModel.name!, labelText: widget.prescriptionsResponseModel.name ?? "",
), ),
], ],
), ),

@ -165,7 +165,7 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
model.patientPrescriptionOrdersViewList[index].filterName!.toText16(isBold: true) (model.patientPrescriptionOrdersViewList[index].filterName ?? "").toText16(isBold: true)
], ],
), ),
), ),
@ -217,7 +217,7 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(prescription.appointmentDate), false), labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(prescription.appointmentDate), false),
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: model.isSortByClinic ? prescription.name! : prescription.clinicDescription!, labelText: model.isSortByClinic ? prescription.name ?? "" : prescription.clinicDescription!,
), ),
], ],
), ),

Loading…
Cancel
Save