vital sign add oxygenation

merge-requests/579/head
mosazaid 5 years ago
parent ae4e03317b
commit 3335147313

@ -25,6 +25,7 @@ class VitalSignsViewModel extends BaseViewModel {
String hartRat = "0"; String hartRat = "0";
String respirationBeatPerMinute = "0"; String respirationBeatPerMinute = "0";
String bloodPressure = "0 / 0"; String bloodPressure = "0 / 0";
String oxygenation = "0 - 0";
Future getPatientVitalSign(PatiantInformtion patient) async { Future getPatientVitalSign(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -86,6 +87,11 @@ class VitalSignsViewModel extends BaseViewModel {
bloodPressure == 'null') { bloodPressure == 'null') {
bloodPressure = element.bloodPressure.toString(); bloodPressure = element.bloodPressure.toString();
} }
if (oxygenation == "0 - 0" ||
oxygenation == null ||
oxygenation == 'null') {
oxygenation = "${element.sAO2.toString()} - ${element.fIO2.toString()}";
}
}); });
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -36,5 +36,6 @@ enum vitalSignDetails {
heart, heart,
PainScale, PainScale,
Weight, Weight,
Height Height,
Oxygenation,
} }

@ -259,6 +259,14 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
), ),
); );
return [lineChartBarData1, lineChartBarData2]; List<LineChartBarData> lineChartData = List();
if(spots.isNotEmpty){
lineChartData.add(lineChartBarData1);
}
if(spots2.isNotEmpty){
lineChartData.add(lineChartBarData2);
}
return lineChartData;
// return [lineChartBarData1, lineChartBarData2];
} }
} }

@ -278,172 +278,198 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
), ),
Expanded( Expanded(
child: Container( child: SingleChildScrollView(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 4), child: Container(
child: GridView.count( margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16),
shrinkWrap: true, child: GridView.count(
physics: NeverScrollableScrollPhysics(), shrinkWrap: true,
crossAxisSpacing: 6, physics: NeverScrollableScrollPhysics(),
mainAxisSpacing: 6, crossAxisSpacing: 6,
childAspectRatio: 1.0 / 1.0, mainAxisSpacing: 6,
crossAxisCount: 3, crossAxisCount: 3,
children: [ children: [
InkWell( InkWell(
onTap: () => isNotOneAppointment onTap: () => isNotOneAppointment
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Height, pageKey: vitalSignDetails.Height,
pageTitle: pageTitle:
TranslationBase.of(context).height, TranslationBase.of(context).height,
vitalList: vitalList:
mode.patientVitalSignsHistory, mode.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, 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, InkWell(
child: Container( 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( child: VitalSignItem(
des: TranslationBase.of(context).height, des: TranslationBase.of(context).weight,
imagePath: "${assetBasePath}height.png", imagePath: "${assetBasePath}weight.png",
lastVal: mode.heightCm, unit: TranslationBase.of(context).kg,
unit: TranslationBase.of(context).cm, lastVal: mode.weightKg,
), ),
), ),
), InkWell(
InkWell( onTap: () => isNotOneAppointment
onTap: () => isNotOneAppointment ? Navigator.push(
? Navigator.push( context,
context, FadePage(
FadePage( page: VitalSignItemDetailsScreen(
page: VitalSignItemDetailsScreen( pageKey: vitalSignDetails.Temperature,
pageKey: vitalSignDetails.Weight, pageTitle: TranslationBase.of(context)
pageTitle: .temperature,
TranslationBase.of(context).weight, vitalList:
vitalList: mode.patientVitalSignsHistory,
mode.patientVitalSignsHistory, patient: patient,
patient: patient, patientType: patientType,
patientType: patientType, arrivalType: arrivalType,
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: VitalSignItem(
des: TranslationBase.of(context).weight,
imagePath: "${assetBasePath}weight.png",
unit: TranslationBase.of(context).kg,
lastVal: mode.weightKg,
), ),
), InkWell(
InkWell( onTap: () => isNotOneAppointment
onTap: () => isNotOneAppointment ? Navigator.push(
? Navigator.push( context,
context, FadePage(
FadePage( page: VitalSignItemDetailsScreen(
page: VitalSignItemDetailsScreen( pageKey: vitalSignDetails.heart,
pageKey: vitalSignDetails.Temperature, pageTitle:
pageTitle: TranslationBase.of(context) TranslationBase.of(context).heart,
.temperature, vitalList:
vitalList: mode.patientVitalSignsHistory,
mode.patientVitalSignsHistory, patient: patient,
patient: patient, patientType: patientType,
patientType: patientType, arrivalType: arrivalType,
arrivalType: arrivalType, ),
), ),
), )
) : null,
: null,
child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).temperature, des: TranslationBase.of(context).heart,
imagePath: "${assetBasePath}temperature.png", imagePath: "${assetBasePath}heart_rate.png",
lastVal: mode.temperatureCelcius, lastVal: mode.hartRat,
unit: TranslationBase.of(context).tempC, unit: TranslationBase.of(context).bpm,
), ),
), ),
), InkWell(
InkWell( onTap: () => isNotOneAppointment
onTap: () => isNotOneAppointment ? Navigator.push(
? Navigator.push( context,
context, FadePage(
FadePage( page: VitalSignItemDetailsScreen(
page: VitalSignItemDetailsScreen( pageKey: vitalSignDetails.Respiration,
pageKey: vitalSignDetails.heart, pageTitle: TranslationBase.of(context)
pageTitle: .respirationRate,
TranslationBase.of(context).heart, vitalList:
vitalList: mode.patientVitalSignsHistory,
mode.patientVitalSignsHistory, patient: patient,
patient: patient, patientType: patientType,
patientType: patientType, arrivalType: arrivalType,
arrivalType: arrivalType, ),
), ),
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).respirationRate,
imagePath: "${assetBasePath}respiration_rate.png",
lastVal: mode.respirationBeatPerMinute,
unit:
TranslationBase.of(context).respirationSigns,
), ),
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).heart,
imagePath: "${assetBasePath}heart_rate.png",
lastVal: mode.hartRat,
unit: TranslationBase.of(context).bpm,
), ),
), InkWell(
InkWell( onTap: () => isNotOneAppointment
onTap: () => isNotOneAppointment ? Navigator.push(
? Navigator.push( context,
context, FadePage(
FadePage( page: VitalSignItemDetailsScreen(
page: VitalSignItemDetailsScreen( pageKey: vitalSignDetails.BloodPressure,
pageKey: vitalSignDetails.Respiration, pageTitle: TranslationBase.of(context)
pageTitle: TranslationBase.of(context) .bloodPressure,
.respirationRate, vitalList:
vitalList: mode.patientVitalSignsHistory,
mode.patientVitalSignsHistory, patient: patient,
patient: patient, patientType: patientType,
patientType: patientType, arrivalType: arrivalType,
arrivalType: arrivalType, ),
), ),
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).bloodPressure,
imagePath: "${assetBasePath}blood_pressure.png",
lastVal: mode.bloodPressure,
unit: TranslationBase.of(context).sysDias,
), ),
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).respirationRate,
imagePath: "${assetBasePath}respiration_rate.png",
lastVal: mode.respirationBeatPerMinute,
unit:
TranslationBase.of(context).respirationSigns,
), ),
), InkWell(
InkWell( onTap: () => isNotOneAppointment
onTap: () => isNotOneAppointment ? Navigator.push(
? Navigator.push( context,
context, FadePage(
FadePage( page: VitalSignItemDetailsScreen(
page: VitalSignItemDetailsScreen( pageKey: vitalSignDetails.Oxygenation,
pageKey: vitalSignDetails.BloodPressure, pageTitle: TranslationBase.of(context)
pageTitle: TranslationBase.of(context) .oxygenation,
.bloodPressure, vitalList:
vitalList: mode.patientVitalSignsHistory,
mode.patientVitalSignsHistory, patient: patient,
patient: patient, patientType: patientType,
patientType: patientType, arrivalType: arrivalType,
arrivalType: arrivalType, ),
), ),
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).oxygenation,
imagePath: "${assetBasePath}blood_pressure.png",
lastVal: mode.oxygenation,
unit: "%",
), ),
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context).bloodPressure,
imagePath: "${assetBasePath}blood_pressure.png",
lastVal: mode.bloodPressure,
unit: TranslationBase.of(context).sysDias,
), ),
), ],
], ),
), ),
), ),
), ),

@ -141,6 +141,21 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
}, },
]; ];
break;
case vitalSignDetails.Oxygenation:
VSchart = [
{
'name': 'Oxygenation',
'nameAr': 'الأوكسجين',
'title1': 'Date',
'title2': 'SAO2',
'title3': 'FIO2',
'title2Ar': 'SAO2',
'title3Ar': 'FIO2',
'viewKey': 'O2',
},
];
break; break;
case vitalSignDetails.Weight: case vitalSignDetails.Weight:
VSchart = [ VSchart = [
@ -211,7 +226,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
); );
if (vitalListTemp.length != 0 && if (vitalListTemp.length != 0 &&
chartInfo['viewKey'] == 'BloodPressure') { chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') {
return VitalSingChartBloodPressure( return VitalSingChartBloodPressure(
vitalList: vitalList, vitalList: vitalList,
name: projectViewModel.isArabic name: projectViewModel.isArabic
@ -224,8 +239,8 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
title3: projectViewModel.isArabic title3: projectViewModel.isArabic
? chartInfo['title3Ar'] ? chartInfo['title3Ar']
: chartInfo['title3'], : chartInfo['title3'],
viewKey1: 'BloodPressureHigher', viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2',
viewKey2: 'BloodPressureLower', viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2',
); );
} }

Loading…
Cancel
Save