From e54ff2ed5a06d036320b1eb05cc455f0b52dca51 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 4 Sep 2025 11:24:14 +0300 Subject: [PATCH] Lab result fixes & app update to stores VersionID 19.0 --- lib/config/config.dart | 2 +- lib/core/service/client/base_app_client.dart | 2 +- .../medical/LabResult/newUI/LabItem.dart | 2 + .../medical/LabResult/newUI/labWidgets.dart | 61 +++++++++++++------ 4 files changed, 45 insertions(+), 22 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 000f5b31..618733d0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -354,7 +354,7 @@ var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWal var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 18.8; +var VERSION_ID = 19.0; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index ed3c2f36..54da449d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -187,7 +187,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 53320; //4609100 + // body['PatientID'] = 2007395; //4609100 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/widgets/data_display/medical/LabResult/newUI/LabItem.dart b/lib/widgets/data_display/medical/LabResult/newUI/LabItem.dart index 6d8f0d5c..040bbb05 100644 --- a/lib/widgets/data_display/medical/LabResult/newUI/LabItem.dart +++ b/lib/widgets/data_display/medical/LabResult/newUI/LabItem.dart @@ -1,8 +1,10 @@ import 'package:hmg_patient_app/core/model/labs/lab_result.dart'; import 'package:hmg_patient_app/core/model/labs/patient_lab_orders.dart'; +import 'package:hmg_patient_app/core/viewModels/project_view_model.dart'; import 'package:hmg_patient_app/theme/colors.dart'; import 'package:hmg_patient_app/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:readmore/readmore.dart'; import '../FlowChartPage.dart'; diff --git a/lib/widgets/data_display/medical/LabResult/newUI/labWidgets.dart b/lib/widgets/data_display/medical/LabResult/newUI/labWidgets.dart index 36cd12ea..987f1ce7 100644 --- a/lib/widgets/data_display/medical/LabResult/newUI/labWidgets.dart +++ b/lib/widgets/data_display/medical/LabResult/newUI/labWidgets.dart @@ -1,8 +1,11 @@ import 'dart:math'; +import 'package:hmg_patient_app/app_state/app_state.dart'; +import 'package:hmg_patient_app/core/viewModels/project_view_model.dart'; import 'package:hmg_patient_app/uitl/translations_delegate_base.dart'; import 'package:hmg_patient_app/uitl/utils.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; ///@author /// @@ -11,7 +14,7 @@ enum ResultTypes { lowCriticalLow, criticalLow, low, normal, high, criticalHigh, class ItemResultCardWidget extends StatelessWidget { final Widget child; - const ItemResultCardWidget({ + ItemResultCardWidget({ Key? key, required this.child, }) : super(key: key); @@ -54,17 +57,18 @@ class CustomResultProgressBar extends StatelessWidget { OverlayEntry? overlayEntry; + late ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return LayoutBuilder(builder: (context, constraints) { final double totalWidth = constraints.maxWidth; final double spacing = 2; final int spacingCount = 4; // between 5 bars final double flexWidth = totalWidth - 50; - - final double tooltipPosition = - (flexWidth * (percentage / 100)).clamp(0, flexWidth); + final double tooltipPosition = (flexWidth * (percentage / 100)).clamp(0, flexWidth); return Stack( children: [ @@ -115,22 +119,39 @@ class CustomResultProgressBar extends StatelessWidget { ], ), if (!percentage.isNegative) - Positioned( - left: tooltipPosition, - top: 33, - child: Column( - children: [ - TextCloud( - text: "${value}", - color: getColorForResultType(type), - width: 75, - height: 20, - padding: EdgeInsets.zero, - axisDirection: AxisDirection.up, + projectViewModel.isArabic + ? Positioned( + right: tooltipPosition, + top: 33, + child: Column( + children: [ + TextCloud( + text: "${value}", + color: getColorForResultType(type), + width: 75, + height: 20, + padding: EdgeInsets.zero, + axisDirection: AxisDirection.up, + ), + ], + ), + ) + : Positioned( + left: tooltipPosition, + top: 33, + child: Column( + children: [ + TextCloud( + text: "${value}", + color: getColorForResultType(type), + width: 75, + height: 20, + padding: EdgeInsets.zero, + axisDirection: AxisDirection.up, + ), + ], + ), ), - ], - ), - ), ], ); }); @@ -369,7 +390,7 @@ class ItemResultCardWidgetWithParams extends StatelessWidget { // child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false), // ), Visibility( - visible: shouldShowResultBarAndGraph, + visible: true, child: GestureDetector( onTap: onButtonPressed, child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),