diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index a8c2950a..74ab7c32 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -101,6 +101,15 @@ class LabsViewModel extends BaseViewModel { getPatientLabResult({required PatientLabOrders patientLabOrder, required bool isVidaPlus, bool isTablet = false}) async { setState(ViewState.Busy); await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder, isVidaPlus: isVidaPlus); + await _labsService.getLaboratoryResult( + invoiceNo: patientLabOrder.invoiceNo, + invoiceType: patientLabOrder.invoiceType, + orderNo: patientLabOrder.orderNo, + projectID: patientLabOrder.projectID, + clinicID: patientLabOrder.clinicID, + setupID: patientLabOrder.setupID, + isVidaPlus: isVidaPlus); + if (_labsService.hasError) { error = _labsService.error!; setState(ViewState.Error); diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 665e8020..d41f62bb 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -24,15 +24,16 @@ class _LaboratoryResultPageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getLaboratoryResult( - invoiceNo: widget.patientLabOrders!.invoiceNo, - invoiceType: widget.patientLabOrders!.invoiceType, - clinicID: widget.patientLabOrders!.clinicID, - projectID: widget.patientLabOrders!.projectID, - orderNo: widget.patientLabOrders!.orderNo, - setupID: widget.patientLabOrders!.setupID, - isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)), - ), + onModelReady: (model) {}, + // onModelReady: (model) => model.getLaboratoryResult( + // invoiceNo: widget.patientLabOrders!.invoiceNo, + // invoiceType: widget.patientLabOrders!.invoiceType, + // clinicID: widget.patientLabOrders!.clinicID, + // projectID: widget.patientLabOrders!.projectID, + // orderNo: widget.patientLabOrders!.orderNo, + // setupID: widget.patientLabOrders!.setupID, + // isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)), + // ), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: widget.patientLabOrders!.doctorName!, diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index fae3c671..89b0b7b5 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -40,7 +40,7 @@ class _LaboratoryResultWidgetState extends State { super.initState(); this.model = widget.labmodel; - labSpecialResult = widget.details; + labSpecialResult = widget.details ?? "No Data Available"; } @@ -73,7 +73,7 @@ class _LaboratoryResultWidgetState extends State { WidgetsBinding.instance.addPostFrameCallback((_) { model?.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID!)), patientLabOrder: widget.patientLabOrder!, isTablet: isTabletScreen); }); - + labSpecialResult = widget.details ?? "No Data Available"; }, builder: (_, __, w) => NetworkBaseView( baseViewModel: widget.labmodel,