diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 6d798d88..7babc8ba 100755 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -136,7 +136,7 @@ class BaseAppClient { // body['ProjectID'] = 12; // body['DoctorID'] = 1002; //3844083 - // body['TokenID'] = "@dm!n"; + // body?['TokenID'] = "@dm!n"; // print("ProjectID :"); // print(body['ProjectID']); diff --git a/lib/config/config.dart b/lib/config/config.dart index 5aca2da2..2621fbc6 100755 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -16,9 +16,9 @@ const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'http://10.20.200.111:1010/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://webservices.hmg.com/'; // diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 4416921b..6a129780 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -11,6 +11,8 @@ import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_r import 'package:doctor_app_flutter/core/model/labs/request_send_lab_report_email.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import '../../base/base_service.dart'; @@ -84,7 +86,7 @@ class LabsService extends BaseService { }, body: body); } - Future getPatientLabResult({required PatientLabOrders patientLabOrder, required PatiantInformtion patient, bool isInpatient = false}) async { + Future getPatientLabResult({required PatientLabOrders patientLabOrder, required ProjectViewModel projectViewModel, required PatiantInformtion patient, bool isInpatient = false}) async { hasError = false; String url = ""; @@ -95,15 +97,16 @@ class LabsService extends BaseService { } Map body = Map(); - if(ProjectViewModel.getVidaPlusStatus()){ + if (Utils.isVidaPlusProject(projectViewModel, int.parse(patientLabOrder.projectID ?? "0"))) { + // if(ProjectViewModel.getVidaPlusStatus()){ body['InvoiceNo_VP'] = patientLabOrder.InvoiceNo_VP; - }else { + } else { body['InvoiceNo'] = patientLabOrder.invoiceNo; } body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; - body['ProjectID'] = patientLabOrder.projectID; + body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID ?? 0; body['InvoiceType'] = patientLabOrder.invoiceType ?? ""; await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { @@ -223,12 +226,12 @@ class LabsService extends BaseService { Map body = Map(); body['FileHash'] = [FileHash??FileName??""]; - if(ProjectViewModel.getVidaPlusStatus()){ + // if(ProjectViewModel.getVidaPlusStatus()){ body['Lang'] = "en"??""; body['Internationalization'] = false; - }else { + // } else { body['LabAccessionNumber'] = labAccessNumber??""; - } + // } await baseAppClient.postPatient(GET_ATTACHMENT, patient: patient, onSuccess: (dynamic response, int statusCode) { labAttachment.clear(); response['GetVidaLabAttachment']['data'].forEach((lab) { diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 3a776368..136d71a5 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:open_filex/open_filex.dart'; @@ -89,9 +90,9 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabResult({PatientLabOrders? patientLabOrder, PatiantInformtion? patient, bool? isInpatient}) async { + getPatientLabResult(ProjectViewModel? projectViewModel, {PatientLabOrders? patientLabOrder, PatiantInformtion? patient, bool? isInpatient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder!, patient: patient!, isInpatient: isInpatient!); + await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder!, projectViewModel: projectViewModel!, patient: patient!, isInpatient: isInpatient!); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/locator.dart b/lib/locator.dart index 1be76422..c12efda5 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_service.dart'; @@ -157,4 +158,5 @@ void setupLocator() { locator.registerFactory(() => ERSignInViewModel()); locator.registerFactory(() => PharmacyInterventionViewModel()); locator.registerFactory(() => SecurityServiceImpl()); + locator.registerFactory(() => ProjectViewModel()); } diff --git a/lib/main.dart b/lib/main.dart index dd83125d..ab1c9b6a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -33,21 +33,21 @@ void main() async { tz.initializeTimeZones(); if (kReleaseMode) { - await service.initialize(); - - // Set up critical threat callback to navigate to unsafe device page - service.setOnCriticalThreatCallback(() { - final navigationService = locator.get(); - final context = navigationService.navigatorKey.currentContext; - if (context != null) { - // Clear entire navigation stack and show unsafe device page - Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute(builder: (_) => const UnsafeDevice()), - (route) => false, // Remove all previous routes - ); - debugPrint('🚨 Navigated to UnsafeDevice page - Critical threat detected'); - } - }); + // await service.initialize(); + // + // // Set up critical threat callback to navigate to unsafe device page + // service.setOnCriticalThreatCallback(() { + // final navigationService = locator.get(); + // final context = navigationService.navigatorKey.currentContext; + // if (context != null) { + // // Clear entire navigation stack and show unsafe device page + // Navigator.of(context).pushAndRemoveUntil( + // MaterialPageRoute(builder: (_) => const UnsafeDevice()), + // (route) => false, // Remove all previous routes + // ); + // debugPrint('🚨 Navigated to UnsafeDevice page - Critical threat detected'); + // } + // }); } runApp(MyApp()); } diff --git a/lib/screens/patients/profile/lab_result/laboratory_result/lab_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result/lab_result_widget.dart index 1f794daa..188e3f2f 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result/lab_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result/lab_result_widget.dart @@ -189,13 +189,13 @@ class LabResultWidget extends StatelessWidget { child: InkWell( onTap: () async { var labAccessNumber = patientLabResultList[index].LabAccessionNo; - if (patientLabResultList[index].FileNameWithExtensionList?.isEmpty == true || patientLabResultList[index].FileNameWithExtensionList?.length == 1) { + if (patientLabResultList[index].FileNameWithExtensionList?.isNotEmpty == true || patientLabResultList[index].FileNameWithExtensionList?.length == 1) { await model.getLabAttachments(patient, labAccessNumber: labAccessNumber, FileName: patientLabResultList[index].FileNameWithExtensionList?.first); model.openPDF(); return; } - if (patientLabResultList[index].UploadedDocuments?.isEmpty == true || patientLabResultList[index].UploadedDocuments?.length == 1) { + if (patientLabResultList[index].UploadedDocuments?.isNotEmpty == true || patientLabResultList[index].UploadedDocuments?.length == 1) { await model.getLabAttachments(patient, labAccessNumber: labAccessNumber, uploadedDocument: patientLabResultList[index].UploadedDocuments?.first); model.openPDF(); return; diff --git a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart index f91d3d6c..03ca0b6f 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart @@ -1,11 +1,14 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'laboratory_result_widget.dart'; @@ -26,7 +29,8 @@ class _LaboratoryResultPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: !widget.patientLabOrders.isInOutPatient!), + onModelReady: (model) => + model.getPatientLabResult(Provider.of(context), patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: !widget.patientLabOrders.isInOutPatient!), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBar: PatientProfileAppBar( diff --git a/lib/screens/splash/splash_screen.dart b/lib/screens/splash/splash_screen.dart index 3fb746e2..31cf8f90 100644 --- a/lib/screens/splash/splash_screen.dart +++ b/lib/screens/splash/splash_screen.dart @@ -31,9 +31,9 @@ class _SplashScreenState extends State { void initState() { super.initState(); AppGlobal.CONTEX = context; - if (kReleaseMode) { - checkDeviceSafety(); - } + // if (kReleaseMode) { + // checkDeviceSafety(); + // } Timer(Duration(seconds: 2, milliseconds: 500), () async { if (isJailBroken || !isRealDevice || !isSafeDevice) { // Critical threat detected - navigate to unsafe device page