|
|
|
|
@ -6,6 +6,7 @@ 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/models/patient/vital_sign/vital_sign_res_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
|
|
|
|
|
import '../../locator.dart';
|
|
|
|
|
|
|
|
|
|
@ -13,7 +14,9 @@ class VitalSignsViewModel extends BaseViewModel {
|
|
|
|
|
VitalSignsService _vitalSignService = locator<VitalSignsService>();
|
|
|
|
|
|
|
|
|
|
VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns;
|
|
|
|
|
List<VitalSignHistory> get patientVitalSignsHistory => _vitalSignService.patientVitalSignsHistory;
|
|
|
|
|
|
|
|
|
|
List<VitalSignHistory> get patientVitalSignsHistory =>
|
|
|
|
|
_vitalSignService.patientVitalSignsHistory;
|
|
|
|
|
|
|
|
|
|
String heightCm = "0";
|
|
|
|
|
String weightKg = "0";
|
|
|
|
|
@ -34,8 +37,16 @@ class VitalSignsViewModel extends BaseViewModel {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getPatientVitalSignHistory(PatiantInformtion patient, String from, String to) async {
|
|
|
|
|
Future getPatientVitalSignHistory(
|
|
|
|
|
PatiantInformtion patient, String from, String to) async {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
if (from == null || from == "0") {
|
|
|
|
|
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
|
|
|
|
|
}
|
|
|
|
|
if (to == null || to == "0") {
|
|
|
|
|
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
|
|
|
|
|
if (_vitalSignService.hasError) {
|
|
|
|
|
error = _vitalSignService.error;
|
|
|
|
|
@ -48,9 +59,7 @@ class VitalSignsViewModel extends BaseViewModel {
|
|
|
|
|
if (weightKg == "0" || weightKg == null || weightKg == 'null') {
|
|
|
|
|
weightKg = element.weightKg.toString();
|
|
|
|
|
}
|
|
|
|
|
if (bodyMax == "0" ||
|
|
|
|
|
bodyMax == null ||
|
|
|
|
|
bodyMax == 'null') {
|
|
|
|
|
if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') {
|
|
|
|
|
bodyMax = element.bodyMassIndex.toString();
|
|
|
|
|
}
|
|
|
|
|
if (temperatureCelcius == "0" ||
|
|
|
|
|
@ -84,24 +93,24 @@ class VitalSignsViewModel extends BaseViewModel {
|
|
|
|
|
return "Normal";
|
|
|
|
|
} else if (bodyMassIndex <= 30) {
|
|
|
|
|
return "Overweight";
|
|
|
|
|
} else { // > 30.0
|
|
|
|
|
} else {
|
|
|
|
|
// > 30.0
|
|
|
|
|
return "Obese";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getTempratureMethod(int temperatureCelciusMethod){
|
|
|
|
|
// temperatureCelciusMethod ( vital sign response field )- master 2005
|
|
|
|
|
if(temperatureCelciusMethod == 1){
|
|
|
|
|
String getTempratureMethod(int temperatureCelciusMethod) {
|
|
|
|
|
// temperatureCelciusMethod ( vital sign response field )- master 2005
|
|
|
|
|
if (temperatureCelciusMethod == 1) {
|
|
|
|
|
return "Oral";
|
|
|
|
|
} else if(temperatureCelciusMethod == 2){
|
|
|
|
|
} else if (temperatureCelciusMethod == 2) {
|
|
|
|
|
return "Axilla";
|
|
|
|
|
} else if(temperatureCelciusMethod == 3){
|
|
|
|
|
} else if (temperatureCelciusMethod == 3) {
|
|
|
|
|
return "Rectal";
|
|
|
|
|
} else if(temperatureCelciusMethod == 4){
|
|
|
|
|
} else if (temperatureCelciusMethod == 4) {
|
|
|
|
|
return "Tympanic";
|
|
|
|
|
} else if(temperatureCelciusMethod == 5){
|
|
|
|
|
} else if (temperatureCelciusMethod == 5) {
|
|
|
|
|
return "Temporal";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|