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

Reviewed-on: https://34.17.182.140/Haroon6138/HMG_Patient_App_New/pulls/190
calender_pacakge_changes
Haroon6138 2 months ago
commit faf00b88ef

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@ -0,0 +1 @@
{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"72x72","expected-size":"72","filename":"72.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"76x76","expected-size":"152","filename":"152.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"50x50","expected-size":"100","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"76x76","expected-size":"76","filename":"76.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"50x50","expected-size":"50","filename":"50.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"72x72","expected-size":"144","filename":"144.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"40x40","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"83.5x83.5","expected-size":"167","filename":"167.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"20x20","expected-size":"20","filename":"20.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@ -488,7 +488,7 @@
"services2": "الخدمات", "services2": "الخدمات",
"cantSeeProfile": "لرؤية ملفك الطبي، يرجى تسجيل الدخول أو التسجيل الآن", "cantSeeProfile": "لرؤية ملفك الطبي، يرجى تسجيل الدخول أو التسجيل الآن",
"loginRegisterNow": "تسجيل الدخول أو التسجيل الآن", "loginRegisterNow": "تسجيل الدخول أو التسجيل الآن",
"hmgPharmacy": "صيدلية HMG", "hmgPharmacy": "صيدلية مجموعة الحبيب الطبية",
"ecommerceSolution": "حلول التجارة الإلكترونية", "ecommerceSolution": "حلول التجارة الإلكترونية",
"comprehensive": "شامل", "comprehensive": "شامل",
"onlineConsulting": "استشارات عبر الإنترنت", "onlineConsulting": "استشارات عبر الإنترنت",
@ -666,7 +666,7 @@
"findUs": "اعثر علينا", "findUs": "اعثر علينا",
"liveChat": "دردشة مباشرة", "liveChat": "دردشة مباشرة",
"service": "خدمة", "service": "خدمة",
"hmgServiceLabel": "خدمة HMG", "hmgServiceLabel": "خدمة مجموعة الحبيب الطبية",
"healthWeatherIndicators": "مؤشرات الطقس الصحية", "healthWeatherIndicators": "مؤشرات الطقس الصحية",
"healthTipsBasedOnCurrentWeather": "نصائح صحية بناءً على الطقس الحالي", "healthTipsBasedOnCurrentWeather": "نصائح صحية بناءً على الطقس الحالي",
"moreDetails": "المزيد من التفاصيل", "moreDetails": "المزيد من التفاصيل",
@ -717,10 +717,10 @@
"bloodDonationInfo": "من خلال هذه الخدمة، يمكنك تسجيل اسمك كمتبرع بالدم <20><>يث سيتواصل معك بنك الدم في مجموعة الحبيب الطبية في حالة الحاجة إلى فصيلة الدم.", "bloodDonationInfo": "من خلال هذه الخدمة، يمكنك تسجيل اسمك كمتبرع بالدم <20><>يث سيتواصل معك بنك الدم في مجموعة الحبيب الطبية في حالة الحاجة إلى فصيلة الدم.",
"bloodInstruction": "أدخل المعلومات المطلوبة، من أجل التسجيل في خدمة التبرع بالدم", "bloodInstruction": "أدخل المعلومات المطلوبة، من أجل التسجيل في خدمة التبرع بالدم",
"viewTerms": "لعرض الشروط والأحكام", "viewTerms": "لعرض الشروط والأحكام",
"wantConnectHmgNetwork": "عزيزي العميل، لا يوجد وصول إلى الإنترنت، هل ترغب في الاتصال بشبكة HMG لاستخدام تطبيقنا، تأكد من أنك في نطاق شبكة HMG", "wantConnectHmgNetwork": "عزيزي العميل، لا يوجد وصول إلى الإنترنت، هل ترغب في الاتصال بشبكة مجموعة الحبيب الطبية لاستخدام تطبيقنا، تأكد من أنك في نطاق شبكة مجموعة الحبيب الطبية",
"failedToAccessHmgServices": "متصل بشبكة HMG،\n\nلكن فشل في الوصول إلى خدمات HMG", "failedToAccessHmgServices": "متصل بشبكة مجموعة الحبيب الطبية،\n\nلكن فشل في الوصول إلى خدمات مجموعة الحبيب الطبية",
"offerAndPackages": "عروض وباقات", "offerAndPackages": "عروض وباقات",
"offerAndPackagesDetails": "تتيح لك هذه الخدمة عرض جميع عروض HMG:", "offerAndPackagesDetails": "تتيح لك هذه الخدمة عرض جميع عروض مجموعة الحبيب الطبية:",
"invoiceNo": "رقم الفاتورة", "invoiceNo": "رقم الفاتورة",
"invoiceDate": "تاريخ الفاتورة", "invoiceDate": "تاريخ الفاتورة",
"specialResult": "نتيجة خاصة", "specialResult": "نتيجة خاصة",
@ -853,8 +853,8 @@
"onboardingBody1": "ببضع نقرات فقط يمكنك استشارة الطبيب الذي تختاره.", "onboardingBody1": "ببضع نقرات فقط يمكنك استشارة الطبيب الذي تختاره.",
"onboardingHeading2": "الوصول إلى السجل الطبي بين يديك", "onboardingHeading2": "الوصول إلى السجل الطبي بين يديك",
"onboardingBody2": "تتبع تاريخك الطبي بما في ذلك الفحوصات المخبرية، الوصفات الطبية، التأمين، وغيرها.", "onboardingBody2": "تتبع تاريخك الطبي بما في ذلك الفحوصات المخبرية، الوصفات الطبية، التأمين، وغيرها.",
"hmgHospitals": "مستشفيات HMG", "hmgHospitals": "مستشفيات مجموعة الحبيب الطبية",
"hmcMedicalClinic": "مراكز HMC الطبية", "hmcMedicalClinic": "مراكز مجموعة الحبيب الطبية",
"applyFilter": "تطبيق الفلتر", "applyFilter": "تطبيق الفلتر",
"facilityAndLocation": "المرفق والموقع", "facilityAndLocation": "المرفق والموقع",
"regionAndLocation": "المنطقة والمواقع", "regionAndLocation": "المنطقة والمواقع",
@ -1581,5 +1581,6 @@
"reschedulingAppo": "إعادة جدولة الموعد، يرجى الانتظار...", "reschedulingAppo": "إعادة جدولة الموعد، يرجى الانتظار...",
"invalidEligibility": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة.", "invalidEligibility": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة.",
"invalidInsurance": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح.", "invalidInsurance": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح.",
"continueCash": "تواصل نقدا" "continueCash": "تواصل نقدا",
"hmgPolicies": "سياسات مجموعة الحبيب الطبية"
} }

@ -1572,5 +1572,6 @@
"reschedulingAppo": "Rescheduling Appointment, Please wait...", "reschedulingAppo": "Rescheduling Appointment, Please wait...",
"invalidEligibility": "You cannot make online payment because you are not eligible to use the provided service.", "invalidEligibility": "You cannot make online payment because you are not eligible to use the provided service.",
"invalidInsurance": "You cannot make online payment because you do not have a valid insurance.", "invalidInsurance": "You cannot make online payment because you do not have a valid insurance.",
"continueCash": "Continue as cash" "continueCash": "Continue as cash",
"hmgPolicies": "HMG Policies"
} }

@ -194,12 +194,14 @@ class ApiClientImp implements ApiClient {
body['TokenID'] = "@dm!n"; body['TokenID'] = "@dm!n";
} }
// body['TokenID'] = "@dm!n"; body['TokenID'] = "@dm!n";
// body['PatientID'] = 4773715; body['PatientID'] = 4773781;
// body['PatientTypeID'] = 1; // body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0; // body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q"; // body['SessionID'] = "45786230487560q";
//VIP Patient: 1181868
// body['IdentificationNo'] = "2235558844"; // body['IdentificationNo'] = "2235558844";
// body['MobileNo'] = "966533147722"; // body['MobileNo'] = "966533147722";
// body['PatientID'] = 809289; // body['PatientID'] = 809289;

@ -229,7 +229,7 @@ class ApiConsts {
static String getAiOverViewLabOrder = "Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API"; static String getAiOverViewLabOrder = "Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API";
// ************ static values for Api **************** // ************ static values for Api ****************
static final double appVersionID = 19.7; static final double appVersionID = 19.8;
// static final double appVersionID = 50.7; // static final double appVersionID = 50.7;
static final int appChannelId = 3; static final int appChannelId = 3;
static final String appIpAddress = "10.20.10.20"; static final String appIpAddress = "10.20.10.20";
@ -916,6 +916,8 @@ var GET_PRESCRIPTION_INSTRUCTIONS_PDF = 'Services/ChatBot_Service.svc/REST/Chatb
const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard'; const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard';
const SEND_PATIENT_IMMEDIATE_UPDATE_INSURANCE_REQUEST = 'Services/OUTPs.svc/REST/PatientCompanyUpdate';
class ApiKeyConstants { class ApiKeyConstants {
static final String googleMapsApiKey = 'AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng'; static final String googleMapsApiKey = 'AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng';
} }

@ -161,15 +161,17 @@ extension SmoothContainerExtension on ShapeBorder {
smoothness: 1, smoothness: 1,
side: side ?? BorderSide.none, side: side ?? BorderSide.none,
), ),
shadows: hasShadow shadows:
? [ // hasShadow
BoxShadow( // ? [
color: const Color(0xff000000).withOpacity(.05), // BoxShadow(
blurRadius: 32, // color: const Color(0xff000000).withOpacity(.05),
offset: const Offset(0, 0), // blurRadius: 32,
) // offset: const Offset(0, 0),
] // )
: [], // ]
// :
[],
); );
} }
} }

@ -464,7 +464,11 @@ class BookAppointmentsViewModel extends ChangeNotifier {
final result = await bookAppointmentsRepo.getLiveCareScheduleClinics(_appState.getAuthenticatedUser()!.age!, _appState.getAuthenticatedUser()!.gender!); final result = await bookAppointmentsRepo.getLiveCareScheduleClinics(_appState.getAuthenticatedUser()!.age!, _appState.getAuthenticatedUser()!.gender!);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), // (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
isClinicsListLoading = false;
notifyListeners();
},
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});

@ -183,7 +183,7 @@ class EmergencyServicesRepoImp implements EmergencyServicesRepo {
@override @override
Future<Either<Failure, GenericApiModel<List<HospitalsModel>>>> getProjectList() async { Future<Either<Failure, GenericApiModel<List<HospitalsModel>>>> getProjectList() async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {'IsOnlineCheckIn': false, 'IsAdvancePayment': false, 'IsForER': true};
try { try {
GenericApiModel<List<HospitalsModel>>? apiResponse; GenericApiModel<List<HospitalsModel>>? apiResponse;

@ -89,7 +89,7 @@ class ImmediateLiveCareRepoImp implements ImmediateLiveCareRepo {
body: mapDevice, body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) { onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType; failure = failureType;
onError!(error); // onError!(error);
}, },
onSuccess: (response, statusCode, {messageStatus, errorMessage}) { onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try { try {
@ -142,7 +142,7 @@ class ImmediateLiveCareRepoImp implements ImmediateLiveCareRepo {
body: mapDevice, body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) { onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType; failure = failureType;
onError!(error); // onError!(error);
}, },
onSuccess: (response, statusCode, {messageStatus, errorMessage}) { onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try { try {

@ -174,13 +174,21 @@ class ImmediateLiveCareViewModel extends ChangeNotifier {
}, },
onConfirmTap: () async { onConfirmTap: () async {
Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!); Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
Navigator.push( //Call the API to attempt updating patient insurance
GetIt.instance<NavigationService>().navigatorKey.currentContext!, LoaderBottomSheet.showLoader();
CustomPageRoute( myAppointmentsViewModel.sendPatientUpdateRequest(onSuccess: (val) {
page: InsuranceHomePage(), LoaderBottomSheet.hideLoader();
), getLiveCareImmediateAppointmentFees();
); }, onError: (err) {
LoaderBottomSheet.hideLoader();
Navigator.push(
GetIt.instance<NavigationService>().navigatorKey.currentContext!,
CustomPageRoute(
page: InsuranceHomePage(),
),
);
});
}), }),
), callBackFunc: () { ), callBackFunc: () {
// Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!); // Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);

@ -52,7 +52,7 @@ class InsuranceApprovalResponseModel {
String? eApprovalRemarks; String? eApprovalRemarks;
bool? isEmailSentOnDelayApproval; bool? isEmailSentOnDelayApproval;
int? eAuthorizationID; int? eAuthorizationID;
InsuranceApprovalDetails? apporvalDetails; List<InsuranceApprovalDetails>? apporvalDetails = [];
String? approvalStatusDescption; String? approvalStatusDescption;
String? clinicName; String? clinicName;
String? clinicNameN; String? clinicNameN;
@ -217,7 +217,9 @@ class InsuranceApprovalResponseModel {
isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval']; isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval'];
eAuthorizationID = json['EAuthorizationID']; eAuthorizationID = json['EAuthorizationID'];
if (json['ApporvalDetails'] != null && json['ApporvalDetails'].length != 0) { if (json['ApporvalDetails'] != null && json['ApporvalDetails'].length != 0) {
apporvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); json['ApporvalDetails'].forEach((v) {
apporvalDetails!.add(InsuranceApprovalDetails.fromJson(v));
});
} }
approvalStatusDescption = json['ApprovalStatusDescption']; approvalStatusDescption = json['ApprovalStatusDescption'];
clinicName = json['ClinicName']; clinicName = json['ClinicName'];
@ -302,9 +304,9 @@ class InsuranceApprovalResponseModel {
data['EApprovalRemarks'] = this.eApprovalRemarks; data['EApprovalRemarks'] = this.eApprovalRemarks;
data['IsEmailSentOnDelayApproval'] = this.isEmailSentOnDelayApproval; data['IsEmailSentOnDelayApproval'] = this.isEmailSentOnDelayApproval;
data['EAuthorizationID'] = this.eAuthorizationID; data['EAuthorizationID'] = this.eAuthorizationID;
if (this.apporvalDetails != null) { // if (this.apporvalDetails != null) {
data['ApporvalDetails'] = this.apporvalDetails!.toJson; // data['ApporvalDetails'] = this.apporvalDetails!.toJson;
} // }
data['ApprovalStatusDescption'] = this.approvalStatusDescption; data['ApprovalStatusDescption'] = this.approvalStatusDescption;
data['ClinicName'] = this.clinicName; data['ClinicName'] = this.clinicName;
data['ClinicNameN'] = this.clinicNameN; data['ClinicNameN'] = this.clinicNameN;

@ -232,7 +232,7 @@ class LabRepoImp implements LabRepo {
"DoctorID": labOrder.doctorID!, "DoctorID": labOrder.doctorID!,
"OrderNo": labOrder.orderNo!, "OrderNo": labOrder.orderNo!,
"InvoiceType": labOrder.invoiceType!, "InvoiceType": labOrder.invoiceType!,
"SetupID": labOrder.setupID!, "SetupID": labOrder.setupID ?? "",
"IsDownload": true, "IsDownload": true,
'ClinicName': labOrder.clinicDescription, 'ClinicName': labOrder.clinicDescription,
'DateofBirth': Utils.appState.getAuthenticatedUser()!.dateofBirth, 'DateofBirth': Utils.appState.getAuthenticatedUser()!.dateofBirth,

@ -205,14 +205,36 @@ class LabViewModel extends ChangeNotifier {
} }
filterLabReports(String query) { filterLabReports(String query) {
final clinicMap = <String, List<PatientLabOrdersResponseModel>>{};
final hospitalMap = <String, List<PatientLabOrdersResponseModel>>{};
if (query.isEmpty) { if (query.isEmpty) {
filteredLabOrders = List.from(patientLabOrders); // reset // filteredLabOrders = List.from(patientLabOrders); // reset
for (var order in patientLabOrders) {
final clinicKey = (order.clinicDescription ?? 'Unknown').trim();
clinicMap.putIfAbsent(clinicKey, () => []).add(order);
final hospitalKey = (order.projectName ?? order.projectID ?? 'Unknown').toString().trim();
hospitalMap.putIfAbsent(hospitalKey, () => []).add(order);
}
patientLabOrdersByClinic = clinicMap.values.toList();
patientLabOrdersByHospital = hospitalMap.values.toList();
patientLabOrdersViewList = isSortByClinic ? patientLabOrdersByClinic : patientLabOrdersByHospital;
} else { } else {
filteredLabOrders = patientLabOrders.where((order) { filteredLabOrders = patientLabOrders.where((order) {
final descriptions = order.testDetails?.map((d) => d.description?.toLowerCase()).toList() ?? []; final descriptions = order.testDetails?.map((d) => d.description?.toLowerCase()).toList() ?? [];
return descriptions.any((desc) => desc != null && desc.contains(query.toLowerCase())); return descriptions.any((desc) => desc != null && desc.contains(query.toLowerCase()));
}).toList(); }).toList();
patientLabOrders = filteredLabOrders; // patientLabOrders = filteredLabOrders;
for (var order in filteredLabOrders) {
final clinicKey = (order.clinicDescription ?? 'Unknown').trim();
clinicMap.putIfAbsent(clinicKey, () => []).add(order);
final hospitalKey = (order.projectName ?? order.projectID ?? 'Unknown').toString().trim();
hospitalMap.putIfAbsent(hospitalKey, () => []).add(order);
}
patientLabOrdersByClinic = clinicMap.values.toList();
patientLabOrdersByHospital = hospitalMap.values.toList();
patientLabOrdersViewList = isSortByClinic ? patientLabOrdersByClinic : patientLabOrdersByHospital;
} }
notifyListeners(); notifyListeners();
} }

@ -27,6 +27,7 @@ class LabResult {
num? resultTypeID; num? resultTypeID;
String? packageShortDescription; String? packageShortDescription;
int? testId; int? testId;
String? testShortDescription;
LabResult( LabResult(
{this.description, {this.description,
@ -54,6 +55,7 @@ class LabResult {
this.criticalLow, this.criticalLow,
this.referenceLow, this.referenceLow,
this.testId, this.testId,
this.testShortDescription,
}); });
LabResult.fromJson(Map<String, dynamic> json) { LabResult.fromJson(Map<String, dynamic> json) {
@ -85,6 +87,7 @@ class LabResult {
packageShortDescription = json['PackageShortDescription']; packageShortDescription = json['PackageShortDescription'];
resultTypeID = json['ResultTypeID']; resultTypeID = json['ResultTypeID'];
testId = json['TestID']; testId = json['TestID'];
testShortDescription = json['TestShortDescription'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -114,6 +117,7 @@ class LabResult {
data['CriticalLow'] = this.criticalLow; data['CriticalLow'] = this.criticalLow;
data['ReferenceLow'] = this.referenceLow; data['ReferenceLow'] = this.referenceLow;
data['TestID'] = this.testId; data['TestID'] = this.testId;
data['TestShortDescription'] = this.testShortDescription;
return data; return data;
} }

@ -41,7 +41,7 @@ class MedicalFileViewModel extends ChangeNotifier {
List<SickLeaveList> patientSickLeavesViewList = []; List<SickLeaveList> patientSickLeavesViewList = [];
bool isSickLeavesSortByClinic = true; bool isSickLeavesSortByClinic = true;
bool isSickLeavesDataNeedsReloading = true; // bool isSickLeavesDataNeedsReloading = true;
List<GetAllergiesResponseModel> patientAllergiesList = []; List<GetAllergiesResponseModel> patientAllergiesList = [];
@ -164,7 +164,7 @@ class MedicalFileViewModel extends ChangeNotifier {
} }
setIsPatientSickLeaveListLoading(bool val) { setIsPatientSickLeaveListLoading(bool val) {
if (val && isSickLeavesDataNeedsReloading) { // if (val && isSickLeavesDataNeedsReloading) {
patientSickLeaveList.clear(); patientSickLeaveList.clear();
patientSickLeavesByClinic.clear(); patientSickLeavesByClinic.clear();
patientSickLeavesByHospital.clear(); patientSickLeavesByHospital.clear();
@ -172,7 +172,7 @@ class MedicalFileViewModel extends ChangeNotifier {
patientSickLeavePDFBase64 = ""; patientSickLeavePDFBase64 = "";
isSickLeavesSortByClinic = true; isSickLeavesSortByClinic = true;
isPatientSickLeaveListLoading = val; isPatientSickLeaveListLoading = val;
} // }
notifyListeners(); notifyListeners();
} }
@ -268,11 +268,13 @@ class MedicalFileViewModel extends ChangeNotifier {
} }
Future<void> getPatientSickLeaveList({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientSickLeaveList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
if (!isSickLeavesDataNeedsReloading) { // if (!isSickLeavesDataNeedsReloading) {
return; // return;
} // }
patientSickLeaveList.clear(); patientSickLeaveList.clear();
notifyListeners();
final result = await medicalFileRepo.getPatientSickLeavesList(); final result = await medicalFileRepo.getPatientSickLeavesList();
result.fold( result.fold(
@ -314,7 +316,7 @@ class MedicalFileViewModel extends ChangeNotifier {
} }
} }
patientSickLeavesViewList = patientSickLeavesByClinic; patientSickLeavesViewList = patientSickLeavesByClinic;
isSickLeavesDataNeedsReloading = false; // isSickLeavesDataNeedsReloading = false;
notifyListeners(); notifyListeners();
if (onSuccess != null) { if (onSuccess != null) {
@ -353,6 +355,11 @@ class MedicalFileViewModel extends ChangeNotifier {
Future<void> getPatientMedicalReportList({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientMedicalReportList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
patientMedicalReportList.clear(); patientMedicalReportList.clear();
patientMedicalReportRequestedList.clear();
patientMedicalReportReadyList.clear();
patientMedicalReportCancelledList.clear();
notifyListeners();
final result = await medicalFileRepo.getPatientMedicalReportsList(); final result = await medicalFileRepo.getPatientMedicalReportsList();
result.fold( result.fold(

@ -20,7 +20,8 @@ import 'models/req_model/appointment_rate_req_model.dart';
import 'models/resp_models/appointment_details_resp_model.dart'; import 'models/resp_models/appointment_details_resp_model.dart';
abstract class MyAppointmentsRepo { abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments({required bool isActiveAppointment, required bool isArrivedAppointments, bool isForEyeMeasurement = false}); Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments(
{required bool isActiveAppointment, required bool isArrivedAppointments, bool isForEyeMeasurement = false});
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment( Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment(
{required int projectID, required int clinicID, required String appointmentNo, required bool isLiveCareAppointment}); {required int projectID, required int clinicID, required String appointmentNo, required bool isLiveCareAppointment});
@ -67,14 +68,16 @@ abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<AppointmentDetails>>> getAppointmentDetails(int appointmentID, int projectID); Future<Either<Failure, GenericApiModel<AppointmentDetails>>> getAppointmentDetails(int appointmentID, int projectID);
Future<Either<Failure, GenericApiModel<void>>> sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note); Future<Either<Failure, GenericApiModel<void>>> sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note);
Future<Either<Failure, GenericApiModel<void>>> sendDoctorRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName); Future<Either<Failure, GenericApiModel<void>>> sendDoctorRate(
int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName);
Future<Either<Failure, GenericApiModel<List<PatientQueueDetails>>>> getPatientAppointmentQueueDetails({required int appointmentNo, required int patientID}); Future<Either<Failure, GenericApiModel<List<PatientQueueDetails>>>> getPatientAppointmentQueueDetails({required int appointmentNo, required int patientID});
Future<Either<Failure, GenericApiModel<dynamic>>> convertPatientToCash({required int projectID}); Future<Either<Failure, GenericApiModel<dynamic>>> convertPatientToCash({required int projectID});
Future<Either<Failure, GenericApiModel<dynamic>>> sendPatientUpdateRequest();
} }
class MyAppointmentsRepoImp implements MyAppointmentsRepo { class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@ -194,9 +197,7 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
"AppointmentNo": appointmentNo, "AppointmentNo": appointmentNo,
"PaymentMethodName": paymentMethodName, "PaymentMethodName": paymentMethodName,
"PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(), "PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(),
"PaymentDate": payedAmount == 0 ? "" : "/Date(${DateTime "PaymentDate": payedAmount == 0 ? "" : "/Date(${DateTime.now().millisecondsSinceEpoch})/",
.now()
.millisecondsSinceEpoch})/",
"PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference, "PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference,
"ProjectID": projectID, "ProjectID": projectID,
"PatientID": patientID, "PatientID": patientID,
@ -865,10 +866,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
} }
} }
@override @override
Future<Either<Failure, GenericApiModel<void>>> sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { Future<Either<Failure, GenericApiModel<void>>> sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async {
AppointmentRate appointmentRate = AppointmentRate(); AppointmentRate appointmentRate = AppointmentRate();
appointmentRate.rate = rate; appointmentRate.rate = rate;
appointmentRate.appointmentNo = appointmentNo; appointmentRate.appointmentNo = appointmentNo;
@ -879,7 +878,6 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
appointmentRate.createdBy = 2; appointmentRate.createdBy = 2;
appointmentRate.editedBy = 2; appointmentRate.editedBy = 2;
try { try {
GenericApiModel<bool>? apiResponse; GenericApiModel<bool>? apiResponse;
Failure? failure; Failure? failure;
@ -908,7 +906,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
} }
@override @override
Future<Either<Failure, GenericApiModel<void>>> sendDoctorRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName) async { Future<Either<Failure, GenericApiModel<void>>> sendDoctorRate(
int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
@ -991,4 +990,35 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
return Left(UnknownFailure(e.toString())); return Left(UnknownFailure(e.toString()));
} }
} }
}
@override
Future<Either<Failure, GenericApiModel>> sendPatientUpdateRequest() async {
Map<String, dynamic> request = {};
try {
GenericApiModel<bool>? apiResponse;
Failure? failure;
await apiClient.post(SEND_PATIENT_IMMEDIATE_UPDATE_INSURANCE_REQUEST, onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
}, onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = (response['MessageStatus'] == 1);
apiResponse = GenericApiModel<bool>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: list,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
}, body: request);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
}

@ -54,9 +54,6 @@ class MyAppointmentsViewModel extends ChangeNotifier {
List<PatientQueueDetails> patientQueueDetailsList = []; List<PatientQueueDetails> patientQueueDetailsList = [];
late PatientQueueDetails currentPatientQueueDetails; late PatientQueueDetails currentPatientQueueDetails;
List<PatientAppointmentHistoryResponseModel> patientAppointmentsHistoryList = []; List<PatientAppointmentHistoryResponseModel> patientAppointmentsHistoryList = [];
List<PatientAppointmentHistoryResponseModel> filteredAppointmentList = []; List<PatientAppointmentHistoryResponseModel> filteredAppointmentList = [];
@ -344,10 +341,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, bool isLiveCareAppointment, Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, bool isLiveCareAppointment, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
{Function(dynamic)? onSuccess, Function(String)? onError}) async { final result = await myAppointmentsRepo.getPatientShareAppointment(projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo, isLiveCareAppointment: isLiveCareAppointment);
final result = await myAppointmentsRepo.getPatientShareAppointment(
projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo, isLiveCareAppointment: isLiveCareAppointment);
result.fold( result.fold(
(failure) async { (failure) async {
@ -421,13 +416,23 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}, },
onConfirmTap: () async { onConfirmTap: () async {
Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!); Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
Navigator.push( //Call the API to attempt updating patient insurance
GetIt.instance<NavigationService>().navigatorKey.currentContext!, LoaderBottomSheet.showLoader();
CustomPageRoute( sendPatientUpdateRequest(onSuccess: (val) {
page: InsuranceHomePage(), LoaderBottomSheet.hideLoader();
), setIsPatientAppointmentShareLoading(true);
); getPatientShareAppointment(projectID, clinicID, appointmentNo, isLiveCareAppointment);
}, onError: (err) {
LoaderBottomSheet.hideLoader();
Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
Navigator.push(
GetIt.instance<NavigationService>().navigatorKey.currentContext!,
CustomPageRoute(
page: InsuranceHomePage(),
),
);
});
}), }),
), callBackFunc: () { ), callBackFunc: () {
// Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!); // Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
@ -443,6 +448,27 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> sendPatientUpdateRequest({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.sendPatientUpdateRequest();
result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
onError!(failure.message);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> convertPatientToCash({required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> convertPatientToCash({required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.convertPatientToCash(projectID: projectID); final result = await myAppointmentsRepo.convertPatientToCash(projectID: projectID);
@ -465,13 +491,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> addAdvanceNumberRequest( Future<void> addAdvanceNumberRequest(
{required String advanceNumber, {required String advanceNumber, required String paymentReference, required String appointmentNo, Function(dynamic)? onSuccess, Function(String)? onError}) async {
required String paymentReference, final result = await myAppointmentsRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference, appointmentNo: appointmentNo);
required String appointmentNo,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result =
await myAppointmentsRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference, appointmentNo: appointmentNo);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -489,14 +510,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> generateAppointmentQR( Future<void> generateAppointmentQR(
{required int clinicID, {required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp, Function(dynamic)? onSuccess, Function(String)? onError}) async {
required int projectID, final result = await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp);
required String appointmentNo,
required int isFollowUp,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result =
await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -513,14 +528,13 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> cancelAppointment( Future<void> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
{required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel); final result = await myAppointmentsRepo.cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold( result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure), // (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async { (failure) async {
if(onError != null) { if (onError != null) {
onError(failure.message); onError(failure.message);
} }
}, },
@ -538,8 +552,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> confirmAppointment( Future<void> confirmAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
{required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.confirmAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel); final result = await myAppointmentsRepo.confirmAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold( result.fold(
@ -600,8 +613,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
required int checkInType, required int checkInType,
Function(dynamic)? onSuccess, Function(dynamic)? onSuccess,
Function(String)? onError}) async { Function(String)? onError}) async {
final result = await myAppointmentsRepo.sendCheckInNfcRequest( final result = await myAppointmentsRepo.sendCheckInNfcRequest(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel, scannedCode: scannedCode, checkInType: checkInType);
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel, scannedCode: scannedCode, checkInType: checkInType);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -647,12 +659,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> insertLiveCareVIDARequest( Future<void> insertLiveCareVIDARequest(
{required clientRequestID, {required clientRequestID, required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, final result = await myAppointmentsRepo.insertLiveCareVIDARequest(clientRequestID: clientRequestID, patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result = await myAppointmentsRepo.insertLiveCareVIDARequest(
clientRequestID: clientRequestID, patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -928,5 +936,4 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}, },
); );
} }
} }

@ -13,10 +13,10 @@ class GetInvoicesListResponseModel {
String? doctorName; String? doctorName;
String? doctorNameN; String? doctorNameN;
String? clinicName; String? clinicName;
double? decimalDoctorRate; num? decimalDoctorRate;
String? doctorImageURL; String? doctorImageURL;
int? doctorRate; num? doctorRate;
int? patientNumber; num? patientNumber;
String? projectName; String? projectName;
GetInvoicesListResponseModel( GetInvoicesListResponseModel(

@ -67,6 +67,19 @@ class RadiologyViewModel extends ChangeNotifier {
patientRadiologyOrders = apiResponse.data!; patientRadiologyOrders = apiResponse.data!;
filteredRadiologyOrders = List.from(patientRadiologyOrders); filteredRadiologyOrders = List.from(patientRadiologyOrders);
tempRadiologyOrders = [...patientRadiologyOrders]; tempRadiologyOrders = [...patientRadiologyOrders];
final clinicMap = <String, List<PatientRadiologyResponseModel>>{};
final hospitalMap = <String, List<PatientRadiologyResponseModel>>{};
for (var order in patientRadiologyOrders) {
final clinicKey = (order.clinicDescription ?? 'Unknown').trim();
clinicMap.putIfAbsent(clinicKey, () => []).add(order);
final hospitalKey = (order.projectName ?? order.projectID ?? 'Unknown').toString().trim();
hospitalMap.putIfAbsent(hospitalKey, () => []).add(order);
}
patientRadiologyOrdersByClinic = clinicMap.values.toList();
patientRadiologyOrdersByHospital = hospitalMap.values.toList();
patientRadiologyOrdersViewList = isSortByClinic ? patientRadiologyOrdersByClinic : patientRadiologyOrdersByHospital;
isRadiologyOrdersLoading = false; isRadiologyOrdersLoading = false;
filterSuggestions(); filterSuggestions();
notifyListeners(); notifyListeners();
@ -168,9 +181,31 @@ class RadiologyViewModel extends ChangeNotifier {
filterRadiologyReports(String query) { filterRadiologyReports(String query) {
if (query.isEmpty) { if (query.isEmpty) {
patientRadiologyOrders = tempRadiologyOrders; // reset patientRadiologyOrders = tempRadiologyOrders; // reset
final clinicMap = <String, List<PatientRadiologyResponseModel>>{};
final hospitalMap = <String, List<PatientRadiologyResponseModel>>{};
for (var order in patientRadiologyOrders) {
final clinicKey = (order.clinicDescription ?? 'Unknown').trim();
clinicMap.putIfAbsent(clinicKey, () => []).add(order);
final hospitalKey = (order.projectName ?? order.projectID ?? 'Unknown').toString().trim();
hospitalMap.putIfAbsent(hospitalKey, () => []).add(order);
}
patientRadiologyOrdersByClinic = clinicMap.values.toList();
patientRadiologyOrdersByHospital = hospitalMap.values.toList();
patientRadiologyOrdersViewList = isSortByClinic ? patientRadiologyOrdersByClinic : patientRadiologyOrdersByHospital;
} else { } else {
filteredRadiologyOrders = filteredRadiologyOrders.where((desc) => desc.description!.toLowerCase().contains(query.toLowerCase())).toList(); filteredRadiologyOrders = filteredRadiologyOrders.where((desc) => (desc.description ?? "").toLowerCase().contains(query.toLowerCase())).toList();
patientRadiologyOrders = filteredRadiologyOrders;
final clinicMap = <String, List<PatientRadiologyResponseModel>>{};
final hospitalMap = <String, List<PatientRadiologyResponseModel>>{};
for (var order in filteredRadiologyOrders) {
final clinicKey = (order.clinicDescription ?? 'Unknown').trim();
clinicMap.putIfAbsent(clinicKey, () => []).add(order);
final hospitalKey = (order.projectName ?? order.projectID ?? 'Unknown').toString().trim();
hospitalMap.putIfAbsent(hospitalKey, () => []).add(order);
}
patientRadiologyOrdersByClinic = clinicMap.values.toList();
patientRadiologyOrdersByHospital = hospitalMap.values.toList();
patientRadiologyOrdersViewList = isSortByClinic ? patientRadiologyOrdersByClinic : patientRadiologyOrdersByHospital;
} }
notifyListeners(); notifyListeners();
} }

@ -1573,5 +1573,6 @@ abstract class LocaleKeys {
static const invalidEligibility = 'invalidEligibility'; static const invalidEligibility = 'invalidEligibility';
static const invalidInsurance = 'invalidInsurance'; static const invalidInsurance = 'invalidInsurance';
static const continueCash = 'continueCash'; static const continueCash = 'continueCash';
static const hmgPolicies = 'hmgPolicies';
} }

@ -116,7 +116,7 @@ class _SelectImmediateLiveCareClinicPageState extends State<SelectImmediateLiveC
onImmediateLiveCareClinicSelected(GetLiveCareClinicListResponseModel liveCareClinic) { onImmediateLiveCareClinicSelected(GetLiveCareClinicListResponseModel liveCareClinic) {
//TODO: add implementation to show clinic schedule //TODO: add implementation to show clinic schedule
if (liveCareClinic.isOnline == 1) { // if (liveCareClinic.isOnline == 1) {
showCommonBottomSheetWithoutHeight(context, child: SelectLiveCareCallType(immediateLiveCareViewModel: immediateLiveCareViewModel), callBackFunc: () async { showCommonBottomSheetWithoutHeight(context, child: SelectLiveCareCallType(immediateLiveCareViewModel: immediateLiveCareViewModel), callBackFunc: () async {
if (immediateLiveCareViewModel.liveCareSelectedCallType != 0) { if (immediateLiveCareViewModel.liveCareSelectedCallType != 0) {
immediateLiveCareViewModel.setImmediateLiveCareSelectedClinic(liveCareClinic); immediateLiveCareViewModel.setImmediateLiveCareSelectedClinic(liveCareClinic);
@ -130,17 +130,24 @@ class _SelectImmediateLiveCareClinicPageState extends State<SelectImmediateLiveC
); );
}, onError: (err) { }, onError: (err) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}); });
} }
}, title: LocaleKeys.selectLiveCareCallType.tr(), isCloseButtonVisible: true, isFullScreen: false); }, title: LocaleKeys.selectLiveCareCallType.tr(), isCloseButtonVisible: true, isFullScreen: false);
} else { // } else {
showCommonBottomSheetWithoutHeight(context, // showCommonBottomSheetWithoutHeight(context,
child: Utils.getErrorWidget( // child: Utils.getErrorWidget(
loadingText: "The selected clinic is only available between ${liveCareClinic.shiftTimings!.first.startTime} & ${liveCareClinic.shiftTimings!.first.endTime} hours."), // loadingText: "The selected clinic is only available between ${liveCareClinic.shiftTimings!.first.startTime} & ${liveCareClinic.shiftTimings!.first.endTime} hours."),
callBackFunc: () {}, // callBackFunc: () {},
title: "", // title: "",
isCloseButtonVisible: true, // isCloseButtonVisible: true,
isFullScreen: false); // isFullScreen: false);
} // }
} }
} }

@ -144,7 +144,14 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
padding: EdgeInsets.only(top: 24.h), padding: EdgeInsets.only(top: 24.h),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: bookAppointmentsVM.isClinicsListLoading ? 5 : bookAppointmentsVM.liveCareClinicsList.length, itemCount: bookAppointmentsVM.isClinicsListLoading
? 5
: bookAppointmentsVM.liveCareClinicsList.isNotEmpty
? bookAppointmentsVM.liveCareClinicsList.length
: 1,
// bookAppointmentsVM.isClinicsListLoading ? 5 : bookAppointmentsVM.liveCareClinicsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return bookAppointmentsVM.isClinicsListLoading return bookAppointmentsVM.isClinicsListLoading
? ClinicCard( ? ClinicCard(
@ -163,14 +170,16 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
curve: Curves.easeInOut, curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: ClinicCard( child: bookAppointmentsVM.liveCareClinicsList.isNotEmpty
bookAppointmentsVM: bookAppointmentsVM, ? ClinicCard(
liveCareClinicsResponseModel: bookAppointmentsVM.liveCareClinicsList[index], bookAppointmentsVM: bookAppointmentsVM,
clinicsListResponseModel: GetClinicsListResponseModel(), liveCareClinicsResponseModel: bookAppointmentsVM.liveCareClinicsList[index],
isLoading: bookAppointmentsVM.isClinicsListLoading, clinicsListResponseModel: GetClinicsListResponseModel(),
).onPress(() { isLoading: bookAppointmentsVM.isClinicsListLoading,
onLiveCareClinicSelected(bookAppointmentsVM.liveCareClinicsList[index]); ).onPress(() {
}), onLiveCareClinicSelected(bookAppointmentsVM.liveCareClinicsList[index]);
})
: Utils.getNoDataWidget(context),
), ),
), ),
), ),

@ -7,6 +7,7 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/emergency_services/emergency_services_view_model.dart'; import 'package:hmg_patient_app_new/features/emergency_services/emergency_services_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart'; import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
@ -24,11 +25,13 @@ class ErOnlineCheckinHome extends StatelessWidget {
ErOnlineCheckinHome({super.key}); ErOnlineCheckinHome({super.key});
late EmergencyServicesViewModel emergencyServicesViewModel; late EmergencyServicesViewModel emergencyServicesViewModel;
late MyAppointmentsViewModel myAppointmentsViewModel;
bool _supportsNFC = false; bool _supportsNFC = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
emergencyServicesViewModel = Provider.of<EmergencyServicesViewModel>(context, listen: false); emergencyServicesViewModel = Provider.of<EmergencyServicesViewModel>(context, listen: false);
myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false);
FlutterNfcKit.nfcAvailability.then((value) { FlutterNfcKit.nfcAvailability.then((value) {
_supportsNFC = (value == NFCAvailability.available); _supportsNFC = (value == NFCAvailability.available);
}); });
@ -81,6 +84,9 @@ class ErOnlineCheckinHome extends StatelessWidget {
await emergencyServicesViewModel.autoGenerateInvoiceERClinic( await emergencyServicesViewModel.autoGenerateInvoiceERClinic(
projectID: value, projectID: value,
onSuccess: (value) { onSuccess: (value) {
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(context, showCommonBottomSheetWithoutHeight(context,
title: LocaleKeys.onlineCheckIn.tr(), title: LocaleKeys.onlineCheckIn.tr(),

@ -692,6 +692,8 @@ class ServicesPage extends StatelessWidget {
) )
], ],
), ),
SizedBox(height: 24.h),
LocaleKeys.hmgPolicies.tr().toText18(weight: FontWeight.bold),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(
children: [ children: [

@ -1,5 +1,6 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
@ -122,35 +123,69 @@ class InsuranceApprovalDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Approval Details".toText16(isBold: true), "Approval Details".toText16(isBold: true),
SizedBox(height: 16.h), ListView.separated(
Row( padding: EdgeInsets.only(top: 16.h),
mainAxisAlignment: MainAxisAlignment.spaceBetween, shrinkWrap: true,
children: [ physics: NeverScrollableScrollPhysics(),
LocaleKeys.procedureName.tr(context: context).toText14(isBold: true), itemCount: insuranceApprovalResponseModel.apporvalDetails!.length,
Expanded( itemBuilder: (context, index) {
child: (insuranceApprovalResponseModel.apporvalDetails!.procedureName ?? "") return AnimationConfiguration.staggeredList(
.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor, textAlignment: TextAlign.end, maxLine: 2), position: index,
), duration: const Duration(milliseconds: 500),
], child: SlideAnimation(
), verticalOffset: 100.0,
SizedBox(height: 8.h), child: FadeInAnimation(
Row( child: AnimatedContainer(
mainAxisAlignment: MainAxisAlignment.spaceBetween, duration: Duration(milliseconds: 300),
children: [ curve: Curves.easeInOut,
"${LocaleKeys.status.tr(context: context)}: ".toText14(isBold: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
insuranceApprovalResponseModel.apporvalDetails!.status!.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), child: Column(
], crossAxisAlignment: CrossAxisAlignment.start,
), children: [
SizedBox(height: 8.h), Row(
Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ LocaleKeys.procedureName.tr(context: context).toText14(isBold: true),
"${LocaleKeys.usageStatus.tr(context: context)}: ".toText14(isBold: true), Expanded(
(insuranceApprovalResponseModel.apporvalDetails!.isInvoicedDesc ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), child: (insuranceApprovalResponseModel.apporvalDetails![index]!.procedureName ?? "")
], .toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor, textAlignment: TextAlign.end, maxLine: 2),
), ),
], ],
) : SizedBox.shrink(), ),
SizedBox(height: 8.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"${LocaleKeys.status.tr(context: context)}: ".toText14(isBold: true),
insuranceApprovalResponseModel.apporvalDetails![index]!.status!.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
],
),
SizedBox(height: 8.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"${LocaleKeys.usageStatus.tr(context: context)}: ".toText14(isBold: true),
(insuranceApprovalResponseModel.apporvalDetails![index]!.isInvoicedDesc ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
],
),
],
),
),
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => Column(
children: [
SizedBox(height: 16.h),
Divider(height: 1, color: AppColors.greyColor),
SizedBox(height: 16.h),
],
),
),
],
)
: SizedBox.shrink(),
), ),
) )
], ],

File diff suppressed because one or more lines are too long

@ -22,7 +22,7 @@ class LabOrderResultItem extends StatelessWidget {
final bool isExpanded; final bool isExpanded;
final Color iconColor; final Color iconColor;
const LabOrderResultItem({super.key, required this.onTap, this.tests, required this.index, this.isLoading = false, this.isExpanded = false,required this.iconColor, required this.severityText}); const LabOrderResultItem({super.key, required this.onTap, this.tests, required this.index, this.isLoading = false, this.isExpanded = false, required this.iconColor, required this.severityText});
@override @override
build(BuildContext context) { build(BuildContext context) {
@ -42,7 +42,10 @@ class LabOrderResultItem extends StatelessWidget {
padding: EdgeInsets.only(bottom: 8.h), padding: EdgeInsets.only(bottom: 8.h),
child: '${tests!.description}'.toText14(weight: FontWeight.w500), child: '${tests!.description}'.toText14(weight: FontWeight.w500),
), ),
(tests!.packageShortDescription ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight), // (tests!.packageShortDescription ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
((tests!.testShortDescription != null && tests!.testShortDescription!.isNotEmpty) ? tests!.testShortDescription : tests!.packageShortDescription)!
.toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
SizedBox(height: 12.h), SizedBox(height: 12.h),
Directionality( Directionality(
textDirection: ui.TextDirection.ltr, textDirection: ui.TextDirection.ltr,
@ -65,28 +68,30 @@ class LabOrderResultItem extends StatelessWidget {
), ),
), ),
), ),
SizedBox(width: 4.h,), SizedBox(
width: 4.h,
),
Visibility( Visibility(
// visible: tests?.checkIfGraphShouldBeDisplayed() == true, // visible: tests?.checkIfGraphShouldBeDisplayed() == true,
visible: true, visible: true,
child: Expanded( child: Expanded(
flex: 2, flex: 2,
child: Visibility( child: Visibility(
visible: tests?.referanceRange != null, visible: tests?.referanceRange != null,
child: Text( child: Text(
"(${LocaleKeys.referenceRange.tr(context: context)}: ${tests?.referanceRange})", "(${LocaleKeys.referenceRange.tr(context: context)}: ${tests?.referanceRange})",
style: TextStyle( style: TextStyle(
fontSize: 12.f, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: AppColors.greyTextColor, color: AppColors.greyTextColor,
),
// overflow: TextOverflow.ellipsis,
// maxLines: 2,
softWrap: true,
), ),
// overflow: TextOverflow.ellipsis,
// maxLines: 2,
softWrap: true,
), ),
), ),
),
) )
], ],
), ),
@ -102,14 +107,8 @@ class LabOrderResultItem extends StatelessWidget {
spacing: 6.h, spacing: 6.h,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
severityText.tr().toText10( severityText.tr().toText10(weight: FontWeight.w500, color: AppColors.greyTextColor),
weight: FontWeight.w500, Utils.buildSvgWithAssets(icon: AppAssets.lab_result_indicator, width: 21, height: 23, iconColor: iconColor),
color: AppColors.greyTextColor),
Utils.buildSvgWithAssets(
icon: AppAssets.lab_result_indicator,
width: 21,
height: 23,
iconColor: iconColor),
], ],
), ),
), ),
@ -119,7 +118,7 @@ class LabOrderResultItem extends StatelessWidget {
iconSize: 16.h, iconSize: 16.h,
text: LocaleKeys.viewReport.tr(context: context), text: LocaleKeys.viewReport.tr(context: context),
onPressed: () { onPressed: () {
onTap(); onTap();
}, },
backgroundColor: AppColors.secondaryLightRedColor, backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor,

@ -17,6 +17,7 @@ import 'package:hmg_patient_app_new/presentation/medical_report/widgets/patient_
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
@ -251,46 +252,21 @@ class _MedicalReportsPageState extends State<MedicalReportsPage> {
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Row( Wrap(
alignment: WrapAlignment.start,
direction: Axis.horizontal,
spacing: 6.h,
runSpacing: 6.h,
children: [ children: [
CustomButton( AppCustomChipWidget(
text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(report.appointmentDate), false), labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(report.appointmentDate), false),
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 24.h,
), ),
SizedBox(width: 8.h), AppCustomChipWidget(
CustomButton( labelText: medicalFileVM.isMedicalReportsSortByClinic ? report.projectName! : report.clinicDescription!,
text: medicalFileVM.isMedicalReportsSortByClinic ? report.projectName! : report.clinicDescription!,
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 24.h,
),
SizedBox(width: 8.h),
CustomButton(
text: report.statusDesc!,
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 24.h,
), ),
report.statusDesc != null ? AppCustomChipWidget(
labelText: report.statusDesc ?? "test",
) : SizedBox.shrink(),
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),

@ -84,76 +84,77 @@ class PrescriptionItemView extends StatelessWidget {
SizedBox(height: 14.h), SizedBox(height: 14.h),
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
SizedBox(height: 14.h), SizedBox(height: 14.h),
Row( Visibility(
mainAxisSize: MainAxisSize.max, visible: (!isLoading && prescriptionVM.prescriptionDetailsList[index].frequencyNumber != 0),
children: [ child: Row(
Utils.buildSvgWithAssets(icon: AppAssets.prescription_reminder_icon, width: 35.h, height: 35.h).toShimmer2(isShow: isLoading), mainAxisSize: MainAxisSize.max,
SizedBox(width: 8.h), children: [
Column( Utils.buildSvgWithAssets(icon: AppAssets.prescription_reminder_icon, width: 35.h, height: 35.h).toShimmer2(isShow: isLoading),
crossAxisAlignment: CrossAxisAlignment.start, SizedBox(width: 8.h),
children: [ Column(
LocaleKeys.setReminder.tr(context: context).toText13(isBold: true), crossAxisAlignment: CrossAxisAlignment.start,
"Notify me before the consumption time".toText10(color: AppColors.textColorLight), children: [
], LocaleKeys.setReminder.tr(context: context).toText13(isBold: true),
).toShimmer2(isShow: isLoading).expanded, "Notify me before the consumption time".toText10(color: AppColors.textColorLight),
Switch( ],
activeColor: AppColors.successColor, ).toShimmer2(isShow: isLoading).expanded,
activeTrackColor: AppColors.successColor.withValues(alpha: .15), Switch(
value: isLoading ? false : prescriptionVM.prescriptionDetailsList[index].hasReminder!, activeColor: AppColors.successColor,
onChanged: (newValue) async { activeTrackColor: AppColors.successColor.withValues(alpha: .15),
CalenderUtilsNew calender = CalenderUtilsNew.instance; value: isLoading ? false : prescriptionVM.prescriptionDetailsList[index].hasReminder!,
onChanged: (newValue) async {
if (prescriptionVM.prescriptionDetailsList[index].hasReminder ?? false) { CalenderUtilsNew calender = CalenderUtilsNew.instance;
LoaderBottomSheet.showLoader(loadingText: "Removing Reminders");
bool resultValue = await calender.checkAndRemoveMultipleItems(id:prescriptionVM.prescriptionDetailsList[index].itemID.toString());
prescriptionVM.setPrescriptionItemReminder(newValue, prescriptionVM.prescriptionDetailsList[index]); if (prescriptionVM.prescriptionDetailsList[index].hasReminder ?? false) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.showLoader(loadingText: "Removing Reminders");
return; bool resultValue = await calender.checkAndRemoveMultipleItems(id: prescriptionVM.prescriptionDetailsList[index].itemID.toString());
}
DateTime startDate = DateTime.now(); prescriptionVM.setPrescriptionItemReminder(newValue, prescriptionVM.prescriptionDetailsList[index]);
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionVM.prescriptionDetailsList[index].days!.toInt()); LoaderBottomSheet.hideLoader();
BottomSheetUtils().showReminderBottomSheet( return;
context, }
endDate,
"",
prescriptionVM.prescriptionDetailsList[index].itemID.toString(),
"",
"",
title: "${prescriptionVM.prescriptionDetailsList[index].itemDescription} Prescription Reminder",
description:
"${prescriptionVM.prescriptionDetailsList[index].itemDescription} ${prescriptionVM.prescriptionDetailsList[index].frequency} ${prescriptionVM.prescriptionDetailsList[index].route} ",
onSuccess: () {
}, DateTime startDate = DateTime.now();
isMultiAllowed: true, DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionVM.prescriptionDetailsList[index].days!.toInt());
onMultiDateSuccess: (int selectedIndex) async{ BottomSheetUtils().showReminderBottomSheet(
bool isEventAdded = await calender.createMultipleEvents( context,
endDate,
"",
prescriptionVM.prescriptionDetailsList[index].itemID.toString(),
"",
"",
title: "${prescriptionVM.prescriptionDetailsList[index].itemDescription} Prescription Reminder",
description:
"${prescriptionVM.prescriptionDetailsList[index].itemDescription} ${prescriptionVM.prescriptionDetailsList[index].frequency} ${prescriptionVM.prescriptionDetailsList[index].route} ",
onSuccess: () {},
isMultiAllowed: true,
onMultiDateSuccess: (int selectedIndex) async {
bool isEventAdded = await calender.createMultipleEvents(
reminderMinutes: selectedIndex, reminderMinutes: selectedIndex,
frequencyNumber: prescriptionVM.prescriptionDetailsList[index].frequencyNumber?.toInt(), frequencyNumber: prescriptionVM.prescriptionDetailsList[index].frequencyNumber?.toInt(),
days: prescriptionVM.prescriptionDetailsList[index].days!.toInt(), days: prescriptionVM.prescriptionDetailsList[index].days!.toInt(),
orderDate: prescriptionVM.prescriptionDetailsList[index].orderDate!, orderDate: prescriptionVM.prescriptionDetailsList[index].orderDate!,
itemDescriptionN: prescriptionVM.prescriptionDetailsList[index].itemDescription!, itemDescriptionN: prescriptionVM.prescriptionDetailsList[index].itemDescription!,
route: prescriptionVM.prescriptionDetailsList[index].route!, route: prescriptionVM.prescriptionDetailsList[index].route!,
onFailure: (errorMessage)=> prescriptionVM.showError(errorMessage), onFailure: (errorMessage) => prescriptionVM.showError(errorMessage),
prescriptionNumber: prescriptionVM.prescriptionDetailsList[index].itemID.toString(), prescriptionNumber: prescriptionVM.prescriptionDetailsList[index].itemID.toString(),
); );
prescriptionVM.setPrescriptionItemReminder(isEventAdded, prescriptionVM.prescriptionDetailsList[index]); prescriptionVM.setPrescriptionItemReminder(isEventAdded, prescriptionVM.prescriptionDetailsList[index]);
// setCalender(context, // setCalender(context,
// eventId: prescriptionVM.prescriptionDetailsList[index].itemID.toString(), // eventId: prescriptionVM.prescriptionDetailsList[index].itemID.toString(),
// selectedMinutes: selectedIndex, // selectedMinutes: selectedIndex,
// frequencyNumber: prescriptionVM.prescriptionDetailsList[index].frequencyNumber?.toInt(), // frequencyNumber: prescriptionVM.prescriptionDetailsList[index].frequencyNumber?.toInt(),
// days: prescriptionVM.prescriptionDetailsList[index].days!.toInt(), // days: prescriptionVM.prescriptionDetailsList[index].days!.toInt(),
// orderDate: prescriptionVM.prescriptionDetailsList[index].orderDate!, // orderDate: prescriptionVM.prescriptionDetailsList[index].orderDate!,
// itemDescriptionN: prescriptionVM.prescriptionDetailsList[index].itemDescription!, // itemDescriptionN: prescriptionVM.prescriptionDetailsList[index].itemDescription!,
// route: prescriptionVM.prescriptionDetailsList[index].route!); // route: prescriptionVM.prescriptionDetailsList[index].route!);
}, },
); );
}, },
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
], ],
).paddingSymmetrical(16.h, 0.h), ).paddingSymmetrical(16.h, 0.h),
),
SizedBox(height: 14.h), SizedBox(height: 14.h),
// Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
// Row( // Row(

@ -86,19 +86,6 @@ class _RadiologyOrdersPageState extends State<RadiologyOrdersPage> {
child: Consumer<RadiologyViewModel>( child: Consumer<RadiologyViewModel>(
builder: (context, model, child) { builder: (context, model, child) {
// Build grouping lists if we have data and none constructed yet // Build grouping lists if we have data and none constructed yet
if (!model.isRadiologyOrdersLoading && model.patientRadiologyOrders.isNotEmpty && model.patientRadiologyOrdersViewList.isEmpty) {
final clinicMap = <String, List<PatientRadiologyResponseModel>>{};
final hospitalMap = <String, List<PatientRadiologyResponseModel>>{};
for (var order in model.patientRadiologyOrders) {
final clinicKey = (order.clinicDescription ?? 'Unknown').trim();
clinicMap.putIfAbsent(clinicKey, () => []).add(order);
final hospitalKey = (order.projectName ?? order.projectID ?? 'Unknown').toString().trim();
hospitalMap.putIfAbsent(hospitalKey, () => []).add(order);
}
model.patientRadiologyOrdersByClinic = clinicMap.values.toList();
model.patientRadiologyOrdersByHospital = hospitalMap.values.toList();
model.patientRadiologyOrdersViewList = model.isSortByClinic ? model.patientRadiologyOrdersByClinic : model.patientRadiologyOrdersByHospital;
}
return Padding( return Padding(
padding: EdgeInsets.symmetric(horizontal: 24.h), padding: EdgeInsets.symmetric(horizontal: 24.h),
@ -140,13 +127,12 @@ class _RadiologyOrdersPageState extends State<RadiologyOrdersPage> {
), ),
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
selectedFilterText.isNotEmpty selectedFilterText.isNotEmpty
? AppCustomChipWidget( ? AppCustomChipWidget(
padding: EdgeInsets.symmetric(horizontal: 5.h), padding: EdgeInsets.symmetric(horizontal: 5.h),
labelText: selectedFilterText, labelText: selectedFilterText,
deleteIcon: 'assets/images/svg/cross_circle.svg', deleteIcon: AppAssets.close_bottom_sheet_icon,
backgroundColor: AppColors.alertColor, backgroundColor: AppColors.alertColor,
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,
deleteIconColor: AppColors.whiteColor, deleteIconColor: AppColors.whiteColor,

Loading…
Cancel
Save