WD: display values are changed.

dev_v3.13.6_CS_V2
taha.alam 1 year ago
parent 840d7801f1
commit df65ae339c

@ -74,12 +74,20 @@ class VitalSignWidget extends StatelessWidget {
SizedBox( SizedBox(
width: 8, width: 8,
), ),
if(lookupValues!= null) if (condition is RangeConditionWithTitle)
Status( Status(
status: status:
"${TranslationBase.of(context).getValue(condition.current?.quantitativeInterpretation ?? '')}", "${TranslationBase.of(context).getValue(condition.current?.quantitativeInterpretation ?? '')}",
originalData: condition.current?.quantitativeInterpretation??'', originalData: condition.current?.quantitativeInterpretation??'',
) )
else if (condition is RangeConditionForBloodPressure)
Status(
status:
"${TranslationBase.of(context).getValue(condition.systolic?.systolic.quantitativeInterpretation ?? '')}",
originalData: condition
.systolic?.systolic.quantitativeInterpretation ??
'',
)
// Text( // Text(
// "${TranslationBase.of(context).getValue(condition.current?.quantitativeInterpretation ?? '')}", // "${TranslationBase.of(context).getValue(condition.current?.quantitativeInterpretation ?? '')}",
// style: TextStyle( // style: TextStyle(
@ -96,87 +104,169 @@ class VitalSignWidget extends StatelessWidget {
// SizedBox( // SizedBox(
// height: 30, // height: 30,
// child: Row(mainAxisSize: MainAxisSize.max, children: [ // child: Row(mainAxisSize: MainAxisSize.max, children: [
if (lookupValues != null) if (condition is RangeConditionWithTitle)
Flexible( SizedBox(
flex: 1, height: 30,
child: ListView.separated( child: Row(mainAxisSize: MainAxisSize.max, children: [
physics: NeverScrollableScrollPhysics(), Expanded(
separatorBuilder: (_, __) => SizedBox( flex: 1,
width: 8, child: ListView.separated(
), separatorBuilder: (_, __) => SizedBox(
shrinkWrap: true, width: 8,
itemCount: lookupValues?.length ?? 0, ),
itemBuilder: (_, index) { scrollDirection: Axis.horizontal,
var key = lookupValues?.keys.elementAt(index); shrinkWrap: true,
return RangeWidget( itemCount: condition.condition?.length ?? 0,
title: key ?? '', itemBuilder: (_, index) => RangeWidget(
values: lookupValues?[key] ?? [], title: condition.condition?[index].title ?? 'test',
isSelected: false, isSelected: condition.condition?[index]
); .isInRange(vitalSignValue) ==
}), true,
),
),
),
]),
), ),
// Flexible(
// flex: 1,
// child: ListView.separated(
// physics: NeverScrollableScrollPhysics(),
// separatorBuilder: (_, __) => SizedBox(
// width: 8,
// ),
// shrinkWrap: true,
// itemCount: lookupValues?.length ?? 0,
// itemBuilder: (_, index) {
// var key = lookupValues?.keys.elementAt(index);
// return RangeWidget(
// title: key ?? '',
// values: lookupValues?[key] ?? [],
// isSelected: false,
// );
// }),
// ),
if (bloodPressureValues != null) if (condition is RangeConditionForBloodPressure)
Flexible( SizedBox(
flex: 1, height: 30,
child: ListView.separated( child: Row(mainAxisSize: MainAxisSize.max, children: [
separatorBuilder: (_, __) => SizedBox( Expanded(
width: 8, flex: 1,
), child: ListView.separated(
physics: NeverScrollableScrollPhysics(), separatorBuilder: (_, __) => SizedBox(
shrinkWrap: true, width: 8,
itemCount: bloodPressureValues?.length ?? 0, ),
itemBuilder: (_, index) { scrollDirection: Axis.horizontal,
shrinkWrap: true,
var key = bloodPressureValues?.keys.elementAt(index); itemCount: condition.condition?.length ?? 0,
print('the ssize is ${ (bloodPressureValues?[key]?.length??1)*40} '); itemBuilder: (_, currentIndex) {
// return RangeWidget( var title =
// title: key??'', condition.condition?[currentIndex].quotient ??
// values: lookupValues?[key]??[],isSelected: false, '';
// ); return RangeWidget(
return Column( title: title,
children: [ isSelected: condition.condition?[currentIndex]
Row( ?.getValue("systolic-lng")
mainAxisAlignment: MainAxisAlignment.spaceBetween, ?.isSelected ==
children: [ true,
Text( );
TranslationBase.of(context).getValue(key ?? ''), }),
textAlign: TextAlign.center, ),
style: ]),
TextStyle(color: Colors.black, fontSize: 16),
),
Status(
status:
"${TranslationBase.of(context).getValue(condition.getValue(key)?.quantitativeInterpretation ?? '')}",
originalData:condition.getValue(key)?.quantitativeInterpretation ?? '' ,
)
],
),
SizedBox(height: 8),
SizedBox(
height:220,
child: ListView.separated(
separatorBuilder: (_, __) => SizedBox(
width: 8,
),
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: bloodPressureValues?[key]?.length ?? 0,
itemBuilder: (_, index) {
var title = bloodPressureValues?[key]?.keys.elementAt(index);
return RangeWidget(
title: title ?? '',
values: bloodPressureValues?[key]?[title] ?? [],
isSelected: false,
);
}))
],
);
}),
), ),
// ]), // Flexible(
// flex: 1,
// child: ListView.separated(
// separatorBuilder: (_, __) => SizedBox(
// width: 8,
// ),
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemCount: bloodPressure.length ?? 0,
// itemBuilder: (_, index) {
// // return RangeWidget(
// // title: key??'',
// // values: lookupValues?[key]??[],isSelected: false,
// // );
// return Column(
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text(
// TranslationBase.of(context)
// .getValue(bloodPressure[index] ?? ''),
// textAlign: TextAlign.center,
// style:
// TextStyle(color: Colors.black, fontSize: 16),
// ),
//
// Status(
// status:
// "${TranslationBase.of(context).getValue(condition.getValue(bloodPressure[index])?.quantitativeInterpretation ?? '')}",
// originalData:condition.getValue(bloodPressure[index])?.quantitativeInterpretation ?? '' ,
// )
// ],
// ),
// SizedBox(height: 16),
// SizedBox(
// height: 30,
// child: Row(
// mainAxisSize: MainAxisSize.max,
// children: [
// Expanded(
// flex: 1,
// child: ListView.separated(
// separatorBuilder: (_, __) => SizedBox(
// width: 8,
// ),
// scrollDirection: Axis.horizontal,
// shrinkWrap: true,
// itemCount:
// condition.condition?.length ?? 0,
// itemBuilder: (_, currentIndex) {
// var title = condition
// .condition?[currentIndex]
// .getValue(
// bloodPressure[index]).title ??
// '';
// return RangeWidget(
// title: title,
// isSelected: condition
// .condition?[currentIndex]
// ?.getValue(
// bloodPressure[index])
// ?.isSelected ==
// true,
// );
// }),
// ),
// ]),
// ),
// SizedBox(height: 16),
// // SizedBox(
// // height:220,
// // child: ListView.separated(
// // separatorBuilder: (_, __) => SizedBox(
// // width: 8,
// // ),
// // physics: NeverScrollableScrollPhysics(),
// // shrinkWrap: true,
// // itemCount: bloodPressureValues?[key]?.length ?? 0,
// // itemBuilder: (_, index) {
// // var title = bloodPressureValues?[key]?.keys.elementAt(index);
// //
// // return RangeWidget(
// // title: title ?? '',
// // values: bloodPressureValues?[key]?[title] ?? [],
// // isSelected: false,
// // );
// // }))
// ],
// );
// }),
// ),
// ]),
// ), // ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -215,78 +305,34 @@ class VitalSignWidget extends StatelessWidget {
class RangeWidget extends StatelessWidget { class RangeWidget extends StatelessWidget {
final String title; final String title;
final List<String> values;
final bool isSelected; final bool isSelected;
const RangeWidget( const RangeWidget({super.key, required this.title, required this.isSelected});
{super.key,
required this.title,
required this.isSelected,
required this.values});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox(
return Padding( height: 30,
padding: const EdgeInsets.all(8.0), child: Material(
child: Row( shape: RoundedRectangleBorder(
children: [ borderRadius: BorderRadius.circular(3),
SizedBox( ),
height: 30, // color: Color(0xFF359846),
child: Material( color: (isSelected)
shape: RoundedRectangleBorder( ? CustomColors.accentColor
borderRadius: BorderRadiusDirectional.only( : CustomColors.lightGreyColor,
topStart: Radius.circular(8), child: Padding(
bottomStart: Radius.circular(8), padding: const EdgeInsets.all(8.0),
), child: Center(
), child: Text(
// color: Color(0xFF359846), title,
color: CustomColors.lightGreyColor, textAlign: TextAlign.center,
child: Padding( style: TextStyle(
padding: const EdgeInsets.only(top:4.0, bottom :4, right: 8, left: 8), color: (isSelected) ? Colors.white : Colors.black,
child: Text( fontSize: 12),
TranslationBase.of(context).getValue(title),
textAlign: TextAlign.center,
style: TextStyle(color: Colors.black, fontSize: 12),
),
),
), ),
), ),
Expanded( ),
child: Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadiusDirectional.only(
topEnd: Radius.circular(8),
bottomEnd: Radius.circular(8),
),
),
// color: Color(0xFF359846),
color: getColor(title),
child: SizedBox(
height: 30,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: List.generate(
values.length,
(index) => Row(
children: [
Text(
values[index],
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, fontSize: 12),
),
SizedBox(
width: 8,
)
],
),
),
),
),
)),
)
],
), ),
); );
} }

@ -103,6 +103,7 @@ var vital = {
"unit": "mmHg", "unit": "mmHg",
"values": [ "values": [
{ {
"quotient": "(0-90) / (0-60)",
"systolic-lng": { "systolic-lng": {
"min": 0, "min": 0,
"max": 90, "max": 90,
@ -121,6 +122,7 @@ var vital = {
} }
}, },
{ {
"quotient": "(90-120) / (60-70)",
"systolic-lng": { "systolic-lng": {
"min": 90, "min": 90,
"max": 120, "max": 120,
@ -139,6 +141,7 @@ var vital = {
} }
}, },
{ {
"quotient": "(120-130) / (70-80)",
"systolic-lng": { "systolic-lng": {
"min": 120, "min": 120,
"max": 130, "max": 130,
@ -157,6 +160,7 @@ var vital = {
} }
}, },
{ {
"quotient": "(130-140) / (80-90)",
"systolic-lng": { "systolic-lng": {
"min": 130, "min": 130,
"max": 140, "max": 140,
@ -175,6 +179,7 @@ var vital = {
} }
}, },
{ {
"quotient": "≥ 140 /90",
"systolic-lng": { "systolic-lng": {
"min": 140, "min": 140,
"max": 0, "max": 0,
@ -444,6 +449,7 @@ var vitalValues = {
} }
}; };
var bloodPressure = ["systolic-lng", "diastolic-lng"];
class RangeConditionWithTitle { class RangeConditionWithTitle {
String? unit; String? unit;
@ -506,9 +512,22 @@ class BloodPressure {
RangeCondition? systolic; RangeCondition? systolic;
RangeCondition? diastolic; RangeCondition? diastolic;
String? quotient;
BloodPressure.fromJson(Map<String, dynamic> json, String selectedValue) { BloodPressure.fromJson(Map<String, dynamic> json, String selectedValue) {
systolic = RangeCondition.fromJson(json['systolic-lng'], selectedValue.split("/")[0]); systolic = RangeCondition.fromJson(json['systolic-lng'], selectedValue.split("/")[0]);
diastolic = RangeCondition.fromJson(json['diastolic-lng'], selectedValue.split("/")[1]); diastolic = RangeCondition.fromJson(json['diastolic-lng'], selectedValue.split("/")[1]);
quotient = json['quotient'] ?? '';
}
RangeCondition? getValue(String key) {
switch (key) {
case 'systolic-lng':
return this.systolic;
case 'diastolic-lng':
return this.diastolic;
}
} }
} }
@ -537,14 +556,7 @@ class RangeCondition {
} }
bool isInRange(String data) { bool isInRange(String data) {
num value = num.parse(data);
double value = 0.0;
if(data.contains('/')){
value = double.parse(data.split("/")[0])/double.parse(data.split("/")[1]);
print("the blood pressure is ${value}");
}else{
value = double.parse(data);
}
if (max == 0 && min != 0) return value >= min!; if (max == 0 && min != 0) return value >= min!;
if (min == 0 && max != 0) return value < max!; if (min == 0 && max != 0) return value < max!;
if (isMaxIncluded == true) return value >= min! && value <= max!; if (isMaxIncluded == true) return value >= min! && value <= max!;

Loading…
Cancel
Save