|
|
|
@ -1,11 +1,9 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.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/core/model/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.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/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';
|
|
|
|
@ -31,22 +29,13 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
|
|
|
|
|
final String viewKey1;
|
|
|
|
|
final String viewKey2;
|
|
|
|
|
|
|
|
|
|
VitalSignItemDetailsScreen(
|
|
|
|
|
{this.vitalList,
|
|
|
|
|
this.pageKey,
|
|
|
|
|
@required this.viewKey1,
|
|
|
|
|
@required this.viewKey2,
|
|
|
|
|
this.pageTitle,
|
|
|
|
|
this.patient,
|
|
|
|
|
this.patientType,
|
|
|
|
|
this.arrivalType});
|
|
|
|
|
VitalSignItemDetailsScreen({this.vitalList, this.pageKey, @required this.viewKey1, @required this.viewKey2, this.pageTitle, this.patient, this.patientType, this.arrivalType});
|
|
|
|
|
|
|
|
|
|
final List<VitalSignHistory> vitalList;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
generateData();
|
|
|
|
|
switch (pageKey) {
|
|
|
|
|
case vitalSignDetails.BodyMeasurements:
|
|
|
|
|
VSchart = [
|
|
|
|
@ -243,50 +232,24 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
|
|
|
|
|
return VitalSignDetailPainScale(vitalList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (vitalListTemp.length != 0 &&
|
|
|
|
|
chartInfo['viewKey'] == 'BloodPressure' ||
|
|
|
|
|
chartInfo['viewKey'] == 'O2') {
|
|
|
|
|
// return LineChartCurvedBloodPressureNew(
|
|
|
|
|
// title: projectViewModel.isArabic
|
|
|
|
|
// ? chartInfo['nameAr']
|
|
|
|
|
// : chartInfo['name'],
|
|
|
|
|
// timeSeries1: timeSeriesData1,
|
|
|
|
|
// timeSeries2: timeSeriesData2,
|
|
|
|
|
// indexes: timeSeriesData1.length ~/ 5.5,
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
if (vitalListTemp.length != 0 && chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') {
|
|
|
|
|
return VitalSingChartBloodPressure(
|
|
|
|
|
vitalList: vitalList,
|
|
|
|
|
name: projectViewModel.isArabic
|
|
|
|
|
? chartInfo['nameAr']
|
|
|
|
|
: chartInfo['name'],
|
|
|
|
|
name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'],
|
|
|
|
|
title1: chartInfo['title1'],
|
|
|
|
|
title2: projectViewModel.isArabic
|
|
|
|
|
? chartInfo['title2Ar']
|
|
|
|
|
: chartInfo['title2'],
|
|
|
|
|
title3: projectViewModel.isArabic
|
|
|
|
|
? chartInfo['title3Ar']
|
|
|
|
|
: chartInfo['title3'],
|
|
|
|
|
viewKey1: chartInfo['viewKey'] == 'BloodPressure'
|
|
|
|
|
? 'BloodPressureHigher'
|
|
|
|
|
: 'SAO2',
|
|
|
|
|
viewKey2: chartInfo['viewKey'] == 'BloodPressure'
|
|
|
|
|
? 'BloodPressureLower'
|
|
|
|
|
: 'FIO2',
|
|
|
|
|
title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'],
|
|
|
|
|
title3: projectViewModel.isArabic ? chartInfo['title3Ar'] : chartInfo['title3'],
|
|
|
|
|
viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2',
|
|
|
|
|
viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return vitalListTemp.length != 0
|
|
|
|
|
? VitalSingChartAndDetials(
|
|
|
|
|
vitalList: vitalList,
|
|
|
|
|
name: projectViewModel.isArabic
|
|
|
|
|
? chartInfo['nameAr']
|
|
|
|
|
: chartInfo['name'],
|
|
|
|
|
name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'],
|
|
|
|
|
title1: chartInfo['title1'],
|
|
|
|
|
title2: projectViewModel.isArabic
|
|
|
|
|
? chartInfo['title2Ar']
|
|
|
|
|
: chartInfo['title2'],
|
|
|
|
|
title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'],
|
|
|
|
|
viewKey: chartInfo['viewKey'])
|
|
|
|
|
: Container();
|
|
|
|
|
}).toList(),
|
|
|
|
@ -297,30 +260,4 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
generateData() {
|
|
|
|
|
if (vitalList.length > 0) {
|
|
|
|
|
vitalList.reversed.toList().forEach(
|
|
|
|
|
(element) {
|
|
|
|
|
if (element.toJson()[viewKey1]?.toInt() != 0)
|
|
|
|
|
timeSeriesData1.add(
|
|
|
|
|
TimeSeriesSales2(
|
|
|
|
|
AppDateUtils.convertStringToDate(element.createdOn),
|
|
|
|
|
// new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day),
|
|
|
|
|
element.toJson()[viewKey1].toDouble(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (element.toJson()[viewKey2]?.toInt() != 0)
|
|
|
|
|
timeSeriesData2.add(
|
|
|
|
|
TimeSeriesSales2(
|
|
|
|
|
AppDateUtils.convertStringToDate(element.createdOn),
|
|
|
|
|
// new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day),
|
|
|
|
|
element.toJson()[viewKey2].toDouble(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|