lab results updates & fixes

merge-update-with-lab-changes
haroon amjad 3 months ago
parent 981089632f
commit 34d298a81a

@ -1,4 +1,5 @@
import 'package:hmg_patient_app/widgets/data_display/medical/LabResult/newUI/labWidgets.dart';
class LabResultList {
String? filterName = "";
String? description = "";
@ -26,8 +27,8 @@ enum ResultFlag {
static ResultFlag? fromJson(String key, num? resultValueFlag) {
///these lines are added cause the result flag is coupled with two values
///if resultvalueflag is empty or line carriage then it has to be interpretive
if(resultValueFlag == null) return ResultFlag.IRR;
if(resultValueFlag == 5) return ResultFlag.IRR;
// if (resultValueFlag == null) return ResultFlag.IRR;
// if(resultValueFlag == 5) return ResultFlag.IRR;
switch (key) {
case 'N':
return ResultFlag.N;
@ -125,7 +126,6 @@ class LabResult {
num? width;
num? resultTypeID;
LabResult(
{this.description,
this.femaleInterpretativeData,
@ -180,8 +180,7 @@ class LabResult {
packageShortDescription = json['PackageShortDescription'];
testShortDescription = json['TestShortDescription'];
resultTypeID = json['ResultTypeID'];
calculatedResultFlag =
ResultFlag.fromJson(flag ?? json['CalculatedResultFlag'],resultTypeID);
calculatedResultFlag = ResultFlag.fromJson(flag ?? json['CalculatedResultFlag'], resultTypeID);
}
Map<String, dynamic> toJson() {
@ -216,4 +215,11 @@ class LabResult {
return data;
}
bool shouldShowResultBarAndGraph() {
if (resultTypeID == null) return false;
if (resultTypeID == 6) return false;
return true;
}
}

@ -187,7 +187,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 2266239; //4609100
// body['PatientID'] = 53320; //4609100
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574
@ -304,10 +304,10 @@ class BaseAppClient {
print(e);
print(e);
if(e.toString().contains("ClientException")) {
if (e.toString().contains("ClientException")) {
onFailure('Something went wrong, plase try again', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}else{
} else {
onFailure(e.toString(), -1);
}
_analytics.errorTracking.log(endPoint, error: "api exception: $e - API Path: $url");

@ -205,6 +205,7 @@ class LabsService extends BaseService {
response['ListPLR'].forEach((lab) {
labOrdersResultsList.add(LabOrderResult.fromJson(lab));
});
labOrdersResultsList = labOrdersResultsList.reversed.toList();
}, onFailure: (String error, int statusCode) {
labOrdersResultsList.clear();
hasError = true;

@ -192,7 +192,8 @@ class LabsViewModel extends BaseViewModel {
recentThree.reversed.forEach((element) {
try {
var dateTime = DateUtil.convertStringToDate(element.verifiedOnDateTime!);
threePointGraphValue.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime));
// threePointGraphValue.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime));
threePointGraphValue.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), actualValue: element.resultValue!,label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime));
counter++;
} catch (e) {}
});
@ -215,7 +216,8 @@ class LabsViewModel extends BaseViewModel {
try {
print("the mapping is being done");
var dateTime = DateUtil.convertStringToDate(element.verifiedOnDateTime!);
completeeGraphValues.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime));
// completeeGraphValues.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime));
completeeGraphValues.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime,actualValue: element.resultValue!));
} catch (e) {
print("the mapping is having exception $e");

@ -83,6 +83,7 @@ class _ExceptionBottomSheetState extends State<ExceptionBottomSheet> {
borderColor: CustomColors.bgRedLightColor,
textColor: CustomColors.bgRedColor,
icon: "assets/images/svg/cancel.svg",
iconColor: CustomColors.bgRedColor,
),
),
SizedBox(width: MediaQuery.of(context).size.width * 0.05),

@ -23,8 +23,7 @@ import 'package:hmg_patient_app/pages/login/welcome.dart';
import 'package:hmg_patient_app/pages/medical/medical_profile_page_new.dart';
import 'package:hmg_patient_app/services/authentication/auth_provider.dart';
import 'package:hmg_patient_app/services/clinic_services/get_clinic_service.dart';
import 'package:hmg_patient_app/services/family_files/family_files_provider.dart'
as family;
import 'package:hmg_patient_app/services/family_files/family_files_provider.dart' as family;
import 'package:hmg_patient_app/services/livecare_services/livecare_provider.dart';
import 'package:hmg_patient_app/services/payfort_services/payfort_view_model.dart';
import 'package:hmg_patient_app/services/robo_search/event_provider.dart';
@ -762,7 +761,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
),
),
).then((value) {
sharedPref.setBool(HAS_ENABLED_QUICK_LOGIN, value);
sharedPref.setBool(HAS_ENABLED_QUICK_LOGIN, value ?? true);
});
}

@ -328,7 +328,7 @@ class _RegisterNew extends State<RegisterNew> {
(!Utils.validateUaeNationalId(nationalIDorFile.text) && selectedCountry.countryCode == '971')) {
context.showBottomSheet(
child: ExceptionBottomSheet(
message: "Please enter correct national id",
message: TranslationBase.of(context).incorrectNationalId,
showCancel: false,
onOkPressed: () {
Navigator.of(context).pop();
@ -657,6 +657,7 @@ class _RegisterNew extends State<RegisterNew> {
setState(() {
isSkipRegistration = true;
});
Navigator.of(context).pop();
sendActivationCode(type, "", null, isSkipRegistration);
},
),
@ -768,7 +769,7 @@ class _RegisterNew extends State<RegisterNew> {
var req = getCommonRequest(type: type);
req.logInTokenID = "";
var request = CheckPatientAuthenticationReq.fromJson(req.toJson());
GifLoaderDialogUtils.showMyDialog(context);
authService.checkPatientAuthentication(request).then((value) async {
if (value['isSMSSent']) {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']);

@ -190,7 +190,6 @@ class _WelcomeLogin extends State<WelcomeLogin> {
text: TranslationBase.of(context).login,
icon: "assets/images/svg/login1.svg",
onPressed: () {
if (nationIdController.text.isNotEmpty) {
showModalBottomSheet(
context: context,
@ -201,7 +200,6 @@ class _WelcomeLogin extends State<WelcomeLogin> {
enableDrag: false,
// Prevent dragging to avoid focus conflicts
builder: (bottomSheetContext) => StatefulBuilder(builder: (BuildContext context, StateSetter setModalState) {
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom),
child: SingleChildScrollView(
@ -261,7 +259,8 @@ class _WelcomeLogin extends State<WelcomeLogin> {
icon: "assets/images/svg/whatsapp.svg",
),
),
], myFocusNode: myFocusNode,
],
myFocusNode: myFocusNode,
),
),
);
@ -273,7 +272,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
} else {
context.showBottomSheet(
child: ExceptionBottomSheet(
message: TranslationBase.of(context).pleaseEnterNationalIdOrFileNo,
message: TranslationBase.of(context).pleaseEnterNationalIdOrFileNo,
showCancel: false,
onOkPressed: () {
Navigator.of(context).pop();
@ -326,7 +325,8 @@ class _WelcomeLogin extends State<WelcomeLogin> {
}
checkUserAuthentication(type) {
showLoader(true);
// showLoader(true);
GifLoaderDialogUtils.showMyDialog(context);
var req = getCommonRequest(type: type);
req.logInTokenID = "";
@ -562,8 +562,11 @@ class _WelcomeLogin extends State<WelcomeLogin> {
healthId = nhic['HealthId'];
}
showLoader(false);
//this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN);
deviceToken = await sharedPref.getString(PUSH_TOKEN);
final lastLoginPref = await sharedPref.getInt(LAST_LOGIN);
lastLogin = lastLoginPref ?? user?.logInType;
GifLoaderDialogUtils.hideDialog(context);
}
getCommonRequest({type}) {
@ -745,9 +748,4 @@ class _WelcomeLogin extends State<WelcomeLogin> {
}
});
}
showLoader(bool isTrue) {
setState(() {
isLoading = isTrue;
});
}
}

@ -136,7 +136,8 @@ class FlowChartPage extends StatelessWidget {
),
LabResultChartAndDetails(
name: filterName!,
labResult: model.labOrdersResultsList,
// labResult: model.labOrdersResultsList,
labResult: model.labOrdersResultsList.reversed.toList(),
),
],
)

@ -13,19 +13,19 @@ class DynamicResultChart extends StatelessWidget {
final bool isFullScreenGraph;
const DynamicResultChart(
{super.key, required this.dataPoints, required this.thresholds,required this.width,required this.scrollDirection, required this.height, this.maxX, this.isFullScreenGraph = false});
{super.key, required this.dataPoints, required this.thresholds, required this.width, required this.scrollDirection, required this.height, this.maxX, this.isFullScreenGraph = false});
@override
Widget build(BuildContext context) {
var minY = 0.0;
var maxY = 0.0;
if(thresholds.isNotEmpty) {
print("the thresholds are $thresholds");
var minY = 0.0;
var maxY = 0.0;
if (thresholds.isNotEmpty) {
print("the thresholds are $thresholds");
minY = thresholds.first.value;
maxY = thresholds.last.value + 1;
}else{
return SizedBox.shrink();
}
} else {
return SizedBox.shrink();
}
final spots = dataPoints.asMap().entries.map((entry) {
return FlSpot(entry.key.toDouble(), entry.value.value);
@ -44,123 +44,118 @@ class DynamicResultChart extends StatelessWidget {
LineChartData(
minY: minY,
maxY: maxY,
minX: dataPoints.first.labelValue-1,
minX: dataPoints.first.labelValue - 1,
maxX: maxX,
lineTouchData:
LineTouchData(touchTooltipData: LineTouchTooltipData(
getTooltipItems: (touchedSpots) {
if (touchedSpots.isEmpty) return [];
lineTouchData: LineTouchData(touchTooltipData: LineTouchTooltipData(getTooltipItems: (touchedSpots) {
if (touchedSpots.isEmpty) return [];
// Only show tooltip for the first touched spot, hide others
return touchedSpots.map((spot) {
if (spot == touchedSpots.first) {
final dataPoint = dataPoints[spot.x.toInt()];
return LineTooltipItem(
'${dataPoint.label} ${spot.y.toStringAsFixed(2)}',
const TextStyle(color: Colors.white),
);
}
return null; // hides the rest
}).toList();
}
)),
titlesData: FlTitlesData(
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
reservedSize: 77,
interval: .1, // Let fl_chart handle it
getTitlesWidget: (value, _) {
// print("the value is ======== ${value}");
// Only show tooltip for the first touched spot, hide others
return touchedSpots.map((spot) {
if (spot == touchedSpots.first) {
final dataPoint = dataPoints[spot.x.toInt()];
// Compare with 2-decimal precision to avoid close duplicates
final matchingThreshold = thresholds.firstWhere(
(t) =>
t.value.toStringAsFixed(1) ==
value.toStringAsFixed(1),
orElse: () => ThresholdRange(
label: '',
value: 0,
color: Colors.transparent,
lineColor: Colors.transparent),
);
if (dataPoint.isStringResource) {
return LineTooltipItem(
'${double.parse(dataPoint.actualValue).toStringAsFixed(2)}',
const TextStyle(color: Colors.white),
);
}
var actualValue = (matchingThreshold.actualValue !=
null)
? "${TranslationBase.of(context).getTranslation(matchingThreshold.label)} (${matchingThreshold.actualValue})"
: '${TranslationBase.of(context).getTranslation(matchingThreshold.label)}';
if (matchingThreshold.label.isNotEmpty) {
return Text(
actualValue,
style: const TextStyle(fontSize: 10),
return LineTooltipItem(
// '${dataPoint.label} ${spot.y.toStringAsFixed(2)}',
'${dataPoint.label} ${double.parse(dataPoint.actualValue).toStringAsFixed(2)}',
const TextStyle(color: Colors.white),
);
}
return const SizedBox.shrink();
},
),
),
bottomTitles: AxisTitles(
axisNameSize: 60,
sideTitles: SideTitles(
showTitles: !isFullScreenGraph,
reservedSize: 50,
getTitlesWidget: (value, _) {
if (value.toInt() >= 0 &&
value.toInt() < dataPoints.length) {
var label = dataPoints[value.toInt()].label;
if (dataPoints[value.toInt()].isStringResource) {
label = TranslationBase.of(context)
.getTranslation(
dataPoints[value.toInt()].label);
}
return null; // hides the rest
}).toList();
})),
titlesData: FlTitlesData(
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
reservedSize: 77,
interval: .1, // Let fl_chart handle it
getTitlesWidget: (value, _) {
// print("the value is ======== ${value}");
// Compare with 2-decimal precision to avoid close duplicates
final matchingThreshold = thresholds.firstWhere(
(t) => t.value.toStringAsFixed(1) == value.toStringAsFixed(1),
orElse: () => ThresholdRange(label: '', value: 0, color: Colors.transparent, lineColor: Colors.transparent),
);
return Padding(
padding: EdgeInsetsDirectional.only(top: 8.0,),
child: Text(
label,
style: const TextStyle(fontSize: 12),
),
);
}
return const SizedBox.shrink();
},
interval: 1, // ensures 1:1 mapping with spots
var actualValue = (matchingThreshold.actualValue != null)
? "${TranslationBase.of(context).getTranslation(matchingThreshold.label)} (${matchingThreshold.actualValue})"
: '${TranslationBase.of(context).getTranslation(matchingThreshold.label)}';
if (matchingThreshold.label.isNotEmpty) {
return Text(
actualValue,
style: const TextStyle(fontSize: 10),
);
}
return const SizedBox.shrink();
},
),
),
bottomTitles: AxisTitles(
axisNameSize: 60,
sideTitles: SideTitles(
showTitles: !isFullScreenGraph,
reservedSize: 50,
getTitlesWidget: (value, _) {
if (value.toInt() >= 0 && value.toInt() < dataPoints.length) {
var label = dataPoints[value.toInt()].label;
if (dataPoints[value.toInt()].isStringResource) {
label = TranslationBase.of(context).getTranslation(dataPoints[value.toInt()].label);
}
return Padding(
padding: EdgeInsetsDirectional.only(
top: 8.0,
),
child: Text(
label,
style: const TextStyle(fontSize: 12),
),
);
}
return const SizedBox.shrink();
},
interval: 1, // ensures 1:1 mapping with spots
),
),
topTitles: AxisTitles(),
rightTitles: AxisTitles(),
),
borderData: FlBorderData(show: false),
lineBarsData: _buildColoredLineSegments(dataPoints, thresholds),
gridData: FlGridData(show: false),
extraLinesData: ExtraLinesData(
horizontalLines: thresholds.map((t) {
return HorizontalLine(
y: t.value,
color: t.lineColor,
strokeWidth: 2,
// label: HorizontalLineLabel(
// show: true,
// alignment: Alignment.centerLeft,
// style: const TextStyle(fontSize: 10),
// labelResolver: (_) => '${t.label} (${t.value.toStringAsFixed(2)})',
// ),
);
}).toList(),
),
rangeAnnotations: RangeAnnotations(
horizontalRangeAnnotations: _buildRangeShades(thresholds),
),
),
topTitles: AxisTitles(),
rightTitles: AxisTitles(),
),
borderData: FlBorderData(show: false),
lineBarsData:
_buildColoredLineSegments(dataPoints, thresholds),
gridData: FlGridData(show: false),
extraLinesData: ExtraLinesData(
horizontalLines: thresholds.map((t) {
return HorizontalLine(
y: t.value,
color: t.lineColor,
strokeWidth: 2,
// label: HorizontalLineLabel(
// show: true,
// alignment: Alignment.centerLeft,
// style: const TextStyle(fontSize: 10),
// labelResolver: (_) => '${t.label} (${t.value.toStringAsFixed(2)})',
// ),
);
}).toList(),
),
rangeAnnotations: RangeAnnotations(
horizontalRangeAnnotations: _buildRangeShades(thresholds),
),
),
),
),
));
));
}
List<LineChartBarData> _buildColoredLineSegments(
List<DataPoint> dataPoints, List<ThresholdRange> thresholds) {
List<LineChartBarData> _buildColoredLineSegments(List<DataPoint> dataPoints, List<ThresholdRange> thresholds) {
List<LineChartBarData> segments = [];
Color getColor(double value) {
for (int i = thresholds.length - 1; i >= 0; i--) {
@ -225,11 +220,10 @@ class DynamicResultChart extends StatelessWidget {
// var max = LineChartHelper.calculateMaxAxisValues(data).maxX;
// print("the maxX is the -------> $max");
return data;
return data;
}
List<HorizontalRangeAnnotation> _buildRangeShades(
List<ThresholdRange> thresholds) {
List<HorizontalRangeAnnotation> _buildRangeShades(List<ThresholdRange> thresholds) {
List<HorizontalRangeAnnotation> ranges = [];
for (int i = 0; i < thresholds.length - 1; i++) {
ranges.add(HorizontalRangeAnnotation(
@ -240,8 +234,6 @@ class DynamicResultChart extends StatelessWidget {
}
return ranges;
}
}
final List<DataPoint> sampleData = [
@ -250,46 +242,22 @@ final List<DataPoint> sampleData = [
DataPoint(value: 1.96, label: 'This result', date: DateTime(2024, 3, 1)),
];
final List<ThresholdRange> thresholdLevels = [
ThresholdRange(
label: 'Critical Low',
value: 1.4,
color: Color(0xfff6e9e9),
lineColor: Color(0xFFe9a2a4)),
ThresholdRange(
label: 'Low',
value: 3.6,
color: Color(0xFFf2fbf5),
lineColor: Color(0xFFeecd94)),
ThresholdRange(
label: 'Normal',
value: 5.96,
color: Color(0xFFf2fbf5),
lineColor: Color(0xFF5dc36b)),
ThresholdRange(
label: 'High',
value: 7.15,
color: Color(0xfff6e9e9),
lineColor: Color(0xFFeecd94)),
ThresholdRange(
label: 'Critical High',
value: 10.15,
color: Color(0xfff6e9e9),
lineColor: Color(0xFFe9a2a4)),
ThresholdRange(label: 'Critical Low', value: 1.4, color: Color(0xfff6e9e9), lineColor: Color(0xFFe9a2a4)),
ThresholdRange(label: 'Low', value: 3.6, color: Color(0xFFf2fbf5), lineColor: Color(0xFFeecd94)),
ThresholdRange(label: 'Normal', value: 5.96, color: Color(0xFFf2fbf5), lineColor: Color(0xFF5dc36b)),
ThresholdRange(label: 'High', value: 7.15, color: Color(0xfff6e9e9), lineColor: Color(0xFFeecd94)),
ThresholdRange(label: 'Critical High', value: 10.15, color: Color(0xfff6e9e9), lineColor: Color(0xFFe9a2a4)),
];
class DataPoint {
final double value;
double labelValue;
String label; // e.g., "This Result"
String label;
String actualValue;
final DateTime date;
bool isStringResource;
DataPoint(
{required this.value,
required this.label,
required this.date,
this.isStringResource = false,
this.labelValue = 0.0});
DataPoint({required this.value, required this.label, required this.date, this.isStringResource = false, this.labelValue = 0.0, this.actualValue = ""});
}
class ThresholdRange {
@ -299,12 +267,7 @@ class ThresholdRange {
final Color lineColor;
final String? actualValue;
ThresholdRange(
{required this.label,
required this.value,
required this.color,
required this.lineColor,
this.actualValue});
ThresholdRange({required this.label, required this.value, required this.color, required this.lineColor, this.actualValue});
@override
String toString() {

@ -1,4 +1,3 @@
import 'package:hmg_patient_app/core/model/labs/patient_lab_orders.dart';
import 'package:hmg_patient_app/core/viewModels/medical/labs_view_model.dart';
import 'package:hmg_patient_app/core/viewModels/project_view_model.dart';
@ -13,7 +12,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart';
class LaboratoryResultWidget extends StatefulWidget {
final GestureTapCallback? onTap;
final String? billNo;
@ -23,16 +21,7 @@ class LaboratoryResultWidget extends StatefulWidget {
final PatientLabOrders? patientLabOrder;
final bool showConfirmMessageDialog;
const LaboratoryResultWidget(
{Key? key,
this.onTap,
this.billNo,
this.details,
this.orderNo,
this.projectName,
this.patientLabOrder,
this.showConfirmMessageDialog = true})
: super(key: key);
const LaboratoryResultWidget({Key? key, this.onTap, this.billNo, this.details, this.orderNo, this.projectName, this.patientLabOrder, this.showConfirmMessageDialog = true}) : super(key: key);
@override
_LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState();
@ -46,7 +35,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
@override
void initState() {
super.initState();
labSpecialResult = widget.details!;
labSpecialResult = widget.details ?? TranslationBase.of(context).noDataAvailable;
}
@override
@ -115,10 +104,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
),
itemBuilder: (context, index) {
var data = model.labResultLists[index];
return LabItem(
key: ValueKey(data.filterName),
item: data,
patientLabOrders: widget.patientLabOrder);
return LabItem(key: ValueKey(data.filterName), item: data, patientLabOrders: widget.patientLabOrder);
},
);
}
@ -165,9 +151,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
),
),
Icon(
_isShowMore
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
_isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
color: Color(0xff575757),
size: 22,
),
@ -177,8 +161,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Container(
width: double.infinity,
child: Html(
data: labSpecialResult ??
TranslationBase.of(context).noDataAvailable,
data: labSpecialResult ?? TranslationBase.of(context).noDataAvailable,
),
),
],

@ -50,18 +50,11 @@ class _LabItemState extends State<LabItem> {
Expanded(
child: Text(
widget.item.filterName ?? '',
style: TextStyle(
fontSize: 21,
fontWeight: FontWeight.bold,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 25 / 16),
style: TextStyle(fontSize: 21, fontWeight: FontWeight.bold, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
),
),
Icon(
_isShowMoreGeneral
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
_isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
color: Color(0xff2B353E),
size: 26,
)
@ -84,8 +77,7 @@ class _LabItemState extends State<LabItem> {
height: 8,
),
if (_isShowMoreGeneral)
...List.generate(widget.item.patientLabResultList?.length ?? 0,
(index) {
...List.generate(widget.item.patientLabResultList?.length ?? 0, (index) {
var data = widget.item.patientLabResultList?[index];
return Column(
children: [
@ -97,8 +89,8 @@ class _LabItemState extends State<LabItem> {
note: data?.testShortDescription ?? '',
source: "",
buttonText: "",
type: data?.calculatedResultFlag?.getType() ??
ResultTypes.unknown,
type: data?.calculatedResultFlag?.getType() ?? ResultTypes.unknown,
shouldShowResultBarAndGraph: data?.shouldShowResultBarAndGraph() ?? true,
onButtonPressed: () {
openFlowChart(context, data?.description ?? '');
},
@ -147,9 +139,7 @@ class _LabItemState extends State<LabItem> {
isScrollControlled: true,
context: context,
scrollControlDisabledMaxHeightRatio: .75,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20), topRight: Radius.circular(20))),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
builder: (context) {
print('builder: the bottom sheet is showing');

@ -6,17 +6,7 @@ import 'package:flutter/material.dart';
///@author
///
enum ResultTypes {
lowCriticalLow,
criticalLow,
low,
normal,
high,
criticalHigh,
highCriticalHigh,
IRR,
unknown
}
enum ResultTypes { lowCriticalLow, criticalLow, low, normal, high, criticalHigh, highCriticalHigh, IRR, unknown }
class ItemResultCardWidget extends StatelessWidget {
final Widget child;
@ -46,12 +36,7 @@ class CustomResultProgressBar extends StatelessWidget {
final String value;
final ResultTypes type;
CustomResultProgressBar(
{Key? key,
required this.percentage,
required this.value,
required this.type})
: super(key: key);
CustomResultProgressBar({Key? key, required this.percentage, required this.value, required this.type}) : super(key: key);
final GlobalKey lcl = GlobalKey();
@ -127,19 +112,19 @@ class CustomResultProgressBar extends StatelessWidget {
Positioned(
left: tooltipPosition,
top: 33,
child: Column(
children: [
TextCloud(
text: "${value}",
child: Column(
children: [
TextCloud(
text: "${value}",
color: getColorForResultType(type),
width: 100,
height: 20,
padding: EdgeInsets.zero,
axisDirection: AxisDirection.up,
),
],
axisDirection: AxisDirection.up,
),
],
),
),
),
],
);
});
@ -162,11 +147,7 @@ class CustomResultProgressBar extends StatelessWidget {
}
}
Widget _buildResultBar({
required int flex,
required Color color,
required String title,
Key? key}) {
Widget _buildResultBar({required int flex, required Color color, required String title, Key? key}) {
return Expanded(
key: key,
flex: flex,
@ -320,6 +301,7 @@ class ItemResultCardWidgetWithParams extends StatelessWidget {
final ResultTypes type;
final bool isArabic;
final Function()? onButtonPressed;
final bool shouldShowResultBarAndGraph;
const ItemResultCardWidgetWithParams({
Key? key,
@ -333,6 +315,7 @@ class ItemResultCardWidgetWithParams extends StatelessWidget {
required this.type,
this.onButtonPressed,
this.isArabic = false,
this.shouldShowResultBarAndGraph = true,
}) : super(key: key);
@override
@ -372,17 +355,19 @@ class ItemResultCardWidgetWithParams extends StatelessWidget {
Expanded(
child: Text(
title,
style: TextStyle(
fontSize: 16,
fontFamily: fontFamily,
fontWeight: FontWeight.w600,
color: const Color(0xff2E303A),
letterSpacing: -.64),
style: TextStyle(fontSize: 16, fontFamily: fontFamily, fontWeight: FontWeight.w600, color: const Color(0xff2E303A), letterSpacing: -.64),
),
),
GestureDetector(
onTap: onButtonPressed,
child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),
// GestureDetector(
// onTap: onButtonPressed,
// child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),
// ),
Visibility(
visible: shouldShowResultBarAndGraph,
child: GestureDetector(
onTap: onButtonPressed,
child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),
),
),
],
),
@ -416,7 +401,7 @@ class ItemResultCardWidgetWithParams extends StatelessWidget {
const SizedBox(height: 10),
// Progress Bar
Visibility(
visible: type != ResultTypes.IRR,
visible: shouldShowResultBarAndGraph,
child: Column(
children: [
SizedBox(

@ -38,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser {
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS
@ -290,7 +290,8 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1");
Platform.isIOS
? form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getStringWithDefaultValue(PUSH_TOKEN, "") + "," + await AppSharedPreferences().getStringWithDefaultValue(ONESIGNAL_APNS_TOKEN, ""))
? form = form.replaceFirst(
'DEVICE_TOKEN', await AppSharedPreferences().getStringWithDefaultValue(PUSH_TOKEN, "") + "," + await AppSharedPreferences().getStringWithDefaultValue(ONESIGNAL_APNS_TOKEN, ""))
: form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getStringWithDefaultValue(PUSH_TOKEN, "") ?? "");
// form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN));

Loading…
Cancel
Save