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 {
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);

@ -24,15 +24,16 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>(
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!,

@ -40,7 +40,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
super.initState();
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((_) {
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,

Loading…
Cancel
Save