lab result fixes

master
Haroon Amjad 2 months ago
parent 034ab30229
commit bc71be6753

@ -101,6 +101,15 @@ class LabsViewModel extends BaseViewModel {
getPatientLabResult({required PatientLabOrders patientLabOrder, required bool isVidaPlus, bool isTablet = false}) async { getPatientLabResult({required PatientLabOrders patientLabOrder, required bool isVidaPlus, bool isTablet = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder, isVidaPlus: isVidaPlus); 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) { if (_labsService.hasError) {
error = _labsService.error!; error = _labsService.error!;
setState(ViewState.Error); setState(ViewState.Error);

@ -24,15 +24,16 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLaboratoryResult( onModelReady: (model) {},
invoiceNo: widget.patientLabOrders!.invoiceNo, // onModelReady: (model) => model.getLaboratoryResult(
invoiceType: widget.patientLabOrders!.invoiceType, // invoiceNo: widget.patientLabOrders!.invoiceNo,
clinicID: widget.patientLabOrders!.clinicID, // invoiceType: widget.patientLabOrders!.invoiceType,
projectID: widget.patientLabOrders!.projectID, // clinicID: widget.patientLabOrders!.clinicID,
orderNo: widget.patientLabOrders!.orderNo, // projectID: widget.patientLabOrders!.projectID,
setupID: widget.patientLabOrders!.setupID, // orderNo: widget.patientLabOrders!.orderNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)), // setupID: widget.patientLabOrders!.setupID,
), // isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)),
// ),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.patientLabOrders!.doctorName!, appBarTitle: widget.patientLabOrders!.doctorName!,

@ -40,7 +40,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
super.initState(); super.initState();
this.model = widget.labmodel; this.model = widget.labmodel;
labSpecialResult = widget.details; labSpecialResult = widget.details ?? "No Data Available";
} }
@ -73,7 +73,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
model?.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID!)), patientLabOrder: widget.patientLabOrder!, isTablet: isTabletScreen); 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( builder: (_, __, w) => NetworkBaseView(
baseViewModel: widget.labmodel, baseViewModel: widget.labmodel,

Loading…
Cancel
Save