You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
391 lines
16 KiB
Dart
391 lines
16 KiB
Dart
|
6 years ago
|
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/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/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/patients/profile/patient-page-header-widget.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:flutter/material.dart';
|
||
|
|
|
||
|
|
class PatientVitalSignScreen extends StatelessWidget {
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||
|
|
PatiantInformtion patient = routeArgs['patient'];
|
||
|
|
|
||
|
|
return BaseView<VitalSignsViewModel>(
|
||
|
|
onModelReady: (model) => model.getPatientArrivalList(
|
||
|
|
DateUtils.convertDateToFormat(DateTime.now(), "yyyy-MM-dd"), patient,
|
||
|
|
fromDate: DateUtils.convertDateToFormat(
|
||
|
|
DateTime.now().subtract(Duration(days: 500)), "yyyy-MM-dd")),
|
||
|
|
builder: (_, model, w) => AppScaffold(
|
||
|
|
baseViewModel: model,
|
||
|
|
appBarTitle: TranslationBase.of(context).vitalSign,
|
||
|
|
body: SingleChildScrollView(
|
||
|
|
child: Container(
|
||
|
|
child: Column(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
||
|
|
children: [
|
||
|
|
PatientPageHeaderWidget(patient),
|
||
|
|
SizedBox(
|
||
|
|
height: 16,
|
||
|
|
),
|
||
|
|
Container(
|
||
|
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
||
|
|
child: Column(
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).weight} :",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${model.patientVitalSigns.weightKg} ${TranslationBase.of(context).kg}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).idealBodyWeight} :",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${model.patientVitalSigns.idealBodyWeightLbs} ${TranslationBase.of(context).kg}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 4,
|
||
|
|
),
|
||
|
|
Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).height} :",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${model.patientVitalSigns.heightCm} ${TranslationBase.of(context).cm}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 4,
|
||
|
|
),
|
||
|
|
Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).waistSize} :",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${model.patientVitalSigns.waistSizeInch} ${TranslationBase.of(context).inch}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).headCircum} :",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${model.patientVitalSigns.headCircumCm} ${TranslationBase.of(context).cm}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 16,
|
||
|
|
),
|
||
|
|
Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).leanBodyWeight} :",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${model.patientVitalSigns.leanBodyWeightLbs} ${TranslationBase.of(context).kg}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 4,
|
||
|
|
),
|
||
|
|
Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).bodyMassIndex} :",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${model.patientVitalSigns.bodyMassIndex}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 4,
|
||
|
|
),
|
||
|
|
Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"G.C.S :",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"N/A",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 16,
|
||
|
|
),
|
||
|
|
const Divider(
|
||
|
|
color: Color(0xffCCCCCC),
|
||
|
|
height: 1,
|
||
|
|
thickness: 2,
|
||
|
|
indent: 0,
|
||
|
|
endIndent: 0,
|
||
|
|
),
|
||
|
|
TemperatureWidget(model.patientVitalSigns),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
)
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
class TemperatureWidget extends StatefulWidget {
|
||
|
|
final VitalSignData vitalSign;
|
||
|
|
|
||
|
|
TemperatureWidget(this.vitalSign);
|
||
|
|
|
||
|
|
@override
|
||
|
|
_TemperatureWidgetState createState() => _TemperatureWidgetState();
|
||
|
|
}
|
||
|
|
|
||
|
|
class _TemperatureWidgetState extends State<TemperatureWidget> {
|
||
|
|
bool isExpand = false;
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Container(
|
||
|
|
child: HeaderBodyExpandableNotifier(
|
||
|
|
headerWidget: Container(
|
||
|
|
margin: EdgeInsets.symmetric(vertical: 16.0),
|
||
|
|
child: Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).temperature}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: isExpand ? FontWeight.bold : FontWeight.normal,
|
||
|
|
),
|
||
|
|
InkWell(
|
||
|
|
onTap: () {
|
||
|
|
setState(() {
|
||
|
|
isExpand = !isExpand;
|
||
|
|
});
|
||
|
|
},
|
||
|
|
child: Icon(isExpand ? Icons.remove : Icons.add),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
bodyWidget: Container(
|
||
|
|
child: Column(
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).temperature} (C):",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${widget.vitalSign.temperatureCelcius}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).temperature} (F):",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${widget.vitalSign.temperatureCelcius * (9/5) + 32}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 4,
|
||
|
|
),
|
||
|
|
Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
AppText(
|
||
|
|
"${TranslationBase.of(context).method} :",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.black,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
width: 8,
|
||
|
|
),
|
||
|
|
AppText(
|
||
|
|
"${widget.vitalSign.temperatureCelciusMethod}",
|
||
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
||
|
|
color: Colors.grey.shade800,
|
||
|
|
fontWeight: FontWeight.normal,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 32,
|
||
|
|
),
|
||
|
|
const Divider(
|
||
|
|
color: Color(0xffCCCCCC),
|
||
|
|
height: 1,
|
||
|
|
thickness: 2,
|
||
|
|
indent: 0,
|
||
|
|
endIndent: 0,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
isExpand: isExpand,
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|