diff --git a/assets/images/patient/vital_signs/oxg.png b/assets/images/patient/vital_signs/oxg.png new file mode 100644 index 00000000..344344e5 Binary files /dev/null and b/assets/images/patient/vital_signs/oxg.png differ diff --git a/assets/images/patient/vital_signs/painScale.png b/assets/images/patient/vital_signs/painScale.png new file mode 100644 index 00000000..36b6b9f0 Binary files /dev/null and b/assets/images/patient/vital_signs/painScale.png differ diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 7bcca11c..90878ea4 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -26,6 +26,12 @@ class VitalSignsViewModel extends BaseViewModel { String respirationBeatPerMinute = "0"; String bloodPressure = "0 / 0"; String oxygenation = "0 - 0"; + String painScore = "-"; + String painLocation = "-"; + String painCharacter = "-"; + String painDuration = "-"; + String isPainDone = "-"; + String painFrequency = "-"; Future getPatientVitalSign(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -90,7 +96,28 @@ class VitalSignsViewModel extends BaseViewModel { if (oxygenation == "0 - 0" || oxygenation == null || oxygenation == 'null') { - oxygenation = "${element.sAO2.toString()} - ${element.fIO2.toString()}"; + oxygenation = + "${element.sAO2.toString()} - ${element.fIO2.toString()}"; + } + if (painScore == null || painScore == "-") { + painScore = element.painScore.toString() != 'null' + ? element.painScore.toString() + : "-"; + painLocation = element.painLocation.toString() != 'null' + ? element.painLocation.toString() + : "-"; + painCharacter = element.painCharacter.toString() != 'null' + ? element.painCharacter.toString() + : "-"; + painDuration = element.painDuration.toString() != 'null' + ? element.painDuration.toString() + : "-"; + isPainDone = element.isPainManagementDone.toString() != 'null' + ? element.isPainManagementDone.toString() + : "-"; + painFrequency = element.painFrequency.toString() != 'null' + ? element.painFrequency.toString() + : "-"; } }); setState(ViewState.Idle); diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart new file mode 100644 index 00000000..72557c74 --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart @@ -0,0 +1,276 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; + +class VitalSignDetailPainScale extends StatelessWidget { + final List vitalList; + + VitalSignDetailPainScale(this.vitalList); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Column( + children: [ + ...List.generate( + vitalList.length, + (index) => Container( + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + child: Center( + child: AppText( + TranslationBase.of(context).description, + color: Colors.black, + bold: true, + ), + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + TranslationBase.of(context).value, + color: Colors.black, + bold: true, + ), + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + TranslationBase.of(context).date, + color: Colors.black, + bold: true, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 7, + ), + Divider( + color: Colors.black, + thickness: 1, + ), + SizedBox( + height: 12, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16), + padding: EdgeInsets.only(left: 8), + child: Row( + children: [ + Expanded( + flex: 2, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Container( + child: AppText( + TranslationBase.of(context).painScale, + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painScore ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Container( + child: AppText( + "Location", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painLocation ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: Container( + child: AppText( + "Character", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painCharacter ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: Container( + child: AppText( + "Duration", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painDuration ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: Container( + child: AppText( + TranslationBase.of(context).painManagement, + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].isPainManagementDone ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: Container( + child: AppText( + "Frequency", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painFrequency ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + ], + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Center( + child: AppText( + "${DateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ), + ), + ) + ], + ), + ), + SizedBox( + height: 8, + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 88085c7e..76684959 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -10,7 +10,10 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -45,10 +48,10 @@ class VitalSignDetailsScreen extends StatelessWidget { appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 ? Column( - children: [ - Expanded( - child: Container( - child: Column( + children: [ + Expanded( + child: Container( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( @@ -75,7 +78,8 @@ class VitalSignDetailsScreen extends StatelessWidget { height: MediaQuery.of(context).size.height * 0.23, width: double.infinity, padding: EdgeInsets.all(12.0), - margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + margin: EdgeInsets.symmetric( + horizontal: 16.0, vertical: 8.0), decoration: BoxDecoration( shape: BoxShape.rectangle, color: Colors.white, @@ -99,14 +103,17 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 1 ? '${assetBasePath}underweight_BMI.png' : '${assetBasePath}underweight_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -114,7 +121,8 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiUnderWeight}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, @@ -123,7 +131,8 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "(<18.5)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, @@ -133,14 +142,17 @@ class VitalSignDetailsScreen extends StatelessWidget { )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 2 ? '${assetBasePath}health_BMI.png' : '${assetBasePath}health_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -149,7 +161,9 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).normal}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * + 1.15, fontWeight: FontWeight.w700, color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) @@ -159,7 +173,8 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "(18.5-24.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) @@ -169,14 +184,17 @@ class VitalSignDetailsScreen extends StatelessWidget { )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 3 ? '${assetBasePath}ovrweight_BMI.png' : '${assetBasePath}ovrweight_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -184,7 +202,8 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiOverWeight}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, + fontSize: + SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) @@ -193,7 +212,8 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "(25-29.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, + fontSize: + SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) @@ -203,14 +223,17 @@ class VitalSignDetailsScreen extends StatelessWidget { )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 4 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -218,7 +241,8 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiObese}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) @@ -227,7 +251,8 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "(30-34.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) @@ -237,14 +262,17 @@ class VitalSignDetailsScreen extends StatelessWidget { )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 5 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -254,7 +282,9 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).bmiObeseExtreme}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * + 1.15, fontWeight: FontWeight.w700, color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) @@ -264,7 +294,8 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "(35<)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) @@ -280,194 +311,467 @@ class VitalSignDetailsScreen extends StatelessWidget { Expanded( child: SingleChildScrollView( child: Container( - margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 6, - mainAxisSpacing: 6, - crossAxisCount: 3, + margin: EdgeInsets.symmetric( + horizontal: 16.0, vertical: 16), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: - TranslationBase.of(context).height, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 6, + mainAxisSpacing: 6, + crossAxisCount: 3, + children: [ + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Height, + pageTitle: + TranslationBase.of( + context) + .height, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context) + .height, + imagePath: + "${assetBasePath}height.png", + lastVal: mode.heightCm, + unit: TranslationBase.of(context) + .cm, + ), ), ), - ) - : null, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context).height, - imagePath: "${assetBasePath}height.png", - lastVal: mode.heightCm, - unit: TranslationBase.of(context).cm, - ), - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: - TranslationBase.of(context).weight, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Weight, + pageTitle: + TranslationBase.of( + context) + .weight, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .weight, + imagePath: + "${assetBasePath}weight.png", + unit: + TranslationBase.of(context).kg, + lastVal: mode.weightKg, ), ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).weight, - imagePath: "${assetBasePath}weight.png", - unit: TranslationBase.of(context).kg, - lastVal: mode.weightKg, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Temperature, - pageTitle: TranslationBase.of(context) - .temperature, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Temperature, + pageTitle: + TranslationBase.of( + context) + .temperature, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context) + .temperature, + imagePath: + "${assetBasePath}temperature.png", + lastVal: mode.temperatureCelcius, + unit: TranslationBase.of(context) + .tempC, + ), ), ), - ) - : null, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context).temperature, - imagePath: "${assetBasePath}temperature.png", - lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context).tempC, - ), - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: - TranslationBase.of(context).heart, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .heart, + pageTitle: + TranslationBase.of( + context) + .heart, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .heart, + imagePath: + "${assetBasePath}heart_rate.png", + lastVal: mode.hartRat, + unit: + TranslationBase.of(context).bpm, ), ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).heart, - imagePath: "${assetBasePath}heart_rate.png", - lastVal: mode.hartRat, - unit: TranslationBase.of(context).bpm, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Respiration, - pageTitle: TranslationBase.of(context) + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Respiration, + pageTitle: + TranslationBase.of( + context) + .respirationRate, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) .respirationRate, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + imagePath: + "${assetBasePath}respiration_rate.png", + lastVal: + mode.respirationBeatPerMinute, + unit: TranslationBase.of(context) + .respirationSigns, ), ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).respirationRate, - imagePath: "${assetBasePath}respiration_rate.png", - lastVal: mode.respirationBeatPerMinute, - unit: - TranslationBase.of(context).respirationSigns, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context) + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .BloodPressure, + pageTitle: + TranslationBase.of( + context) + .bloodPressure, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) .bloodPressure, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + imagePath: + "${assetBasePath}blood_pressure.png", + lastVal: mode.bloodPressure, + unit: TranslationBase.of(context) + .sysDias, ), ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).bloodPressure, - imagePath: "${assetBasePath}blood_pressure.png", - lastVal: mode.bloodPressure, - unit: TranslationBase.of(context).sysDias, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Oxygenation, - pageTitle: TranslationBase.of(context) + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Oxygenation, + pageTitle: + TranslationBase.of( + context) + .oxygenation, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) .oxygenation, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + imagePath: + "${assetBasePath}oxg.png", + lastVal: mode.oxygenation, + unit: "%", ), ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).oxygenation, - imagePath: "${assetBasePath}blood_pressure.png", - lastVal: mode.oxygenation, - unit: "%", - ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .PainScale, + pageTitle: + TranslationBase.of( + context) + .painScale, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .painScale, + imagePath: + "${assetBasePath}painScale.png", + lastVal: mode.painScore, + unit: "", + ), + ), + ], ), + /*RoundedContainer( + width: MediaQuery.of(context).size.width / 2, + margin: EdgeInsets.symmetric( + horizontal: 0.0, vertical: 16), + child: Container( + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(top: 8), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Expanded( + child: Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).painScale}", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painScore}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + "Location", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painLocation}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + "Character", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painCharacter}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + "Duration", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painDuration}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).painManagement, + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.isPainDone}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).frequency, + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painFrequency}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + ], + ), + ), + ), + Container( + child: Image.asset( + "${assetBasePath}painScale.png", + width: 40, + height: 40, + )) + ], + ), + ), + Container( + child: Column( + children: [ + Align( + alignment: + Alignment.topRight, + child: Icon( + EvaIcons.eye, + ), + ), + Align( + alignment: + Alignment.topLeft, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: AppText( + "${TranslationBase.of(context).painScale}", + fontFamily: 'Poppins', + fontSize: SizeConfig + .textMultiplier * + 1.3, + fontWeight: + FontWeight.bold, + ), + ), + ), + ], + ), + ), + ], + ), + ), + ),*/ ], ), ), @@ -475,10 +779,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ], ), + ), ), - ), - ], - ) + ], + ) : Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -502,4 +806,4 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ); } -} +} \ No newline at end of file diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 57fdca16..343d0590 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -2,8 +2,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -225,6 +225,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { (element) => element.toJson()[chartInfo['viewKey']] != null, ); + if (chartInfo['viewKey'] == 'PainScore') { + return VitalSignDetailPainScale(vitalList); + } + if (vitalListTemp.length != 0 && chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { return VitalSingChartBloodPressure(