done vital sign
parent
5cee1cef4e
commit
a1fa2c0727
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,36 @@
|
||||
const PATIENT_TYPE = const [
|
||||
{"text": "outPatiant", "text_ar": "المريض الخارجي", "val": "0"},
|
||||
{"text": "InPatiant", "text_ar": "المريض المنوم", "val": "1"},
|
||||
{"text": "Discharge", "text_ar": "المريض المعافى", "val": "2"},
|
||||
{"text": "Referrd", "text_ar": "المريض المحول الي", "val": "3"},
|
||||
{
|
||||
"text": "Referral Discharge",
|
||||
"text_ar": "المريض المحال المعافى",
|
||||
"val": "4"
|
||||
},
|
||||
{"text": "Tomorrow Patient", "text_ar": "مريض الغد", "val": "5"},
|
||||
{"text": "Referral", "text_ar": "المريض المحول مني", "val": "6"},
|
||||
];
|
||||
|
||||
const LOCATIONS = const [
|
||||
{
|
||||
"text": "In Saudi Arabia",
|
||||
"text-ar": "داخل المملكة العربية السعودية",
|
||||
"val": "1"
|
||||
},
|
||||
{
|
||||
"text": "Out Saudi Arabia",
|
||||
"text-ar": "خارج المملكة العربية السعودية",
|
||||
"val": "2"
|
||||
},
|
||||
];
|
||||
|
||||
enum VitalSignDetails {
|
||||
BodyMeasurements,
|
||||
Temperature,
|
||||
Pulse,
|
||||
Prescriptions,
|
||||
BloodPressure,
|
||||
Oxygenation,
|
||||
PainScale
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
class VitalSignReqModel {
|
||||
int patientID;
|
||||
int projectID;
|
||||
int patientTypeID;
|
||||
int inOutpatientType;
|
||||
int transNo;
|
||||
int languageID;
|
||||
String stamp ;
|
||||
String iPAdress;
|
||||
double versionID;
|
||||
int channel;
|
||||
String tokenID;
|
||||
String sessionID;
|
||||
bool isLoginForDoctorApp;
|
||||
bool patientOutSA;
|
||||
|
||||
VitalSignReqModel(
|
||||
{this.patientID,
|
||||
this.projectID,
|
||||
this.inOutpatientType,
|
||||
this.transNo,
|
||||
this.languageID,
|
||||
this.tokenID,
|
||||
this.stamp = '2020-04-26T09:32:18.317Z',
|
||||
this.iPAdress='11.11.11.11',
|
||||
this.versionID=1.2,
|
||||
this.channel=9,
|
||||
this.sessionID='E2bsEeYEJo',
|
||||
this.isLoginForDoctorApp=true,
|
||||
this.patientTypeID,
|
||||
this.patientOutSA=false});
|
||||
|
||||
VitalSignReqModel.fromJson(Map<String, dynamic> json) {
|
||||
projectID = json['ProjectID'];
|
||||
patientID = json['PatientID'];
|
||||
languageID = json['LanguageID'];
|
||||
inOutpatientType = json['InOutpatientType'];
|
||||
transNo = json['TransNo'];
|
||||
stamp = json['stamp'];
|
||||
iPAdress = json['IPAdress'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
tokenID = json['TokenID'];
|
||||
sessionID = json['SessionID'];
|
||||
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['InOutPatientType'] = this.inOutpatientType;
|
||||
data['TransNo'] = this.transNo;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['stamp'] = this.stamp;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,259 @@
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
|
||||
class VitalSignResModel {
|
||||
var transNo;
|
||||
var projectID;
|
||||
var weightKg;
|
||||
var heightCm;
|
||||
var temperatureCelcius;
|
||||
var pulseBeatPerMinute;
|
||||
var respirationBeatPerMinute;
|
||||
var bloodPressureLower;
|
||||
var bloodPressureHigher;
|
||||
var sAO2;
|
||||
var fIO2;
|
||||
var painScore;
|
||||
var bodyMassIndex;
|
||||
var headCircumCm;
|
||||
var leanBodyWeightLbs;
|
||||
var idealBodyWeightLbs;
|
||||
var temperatureCelciusMethod;
|
||||
var pulseRhythm;
|
||||
var respirationPattern;
|
||||
var bloodPressureCuffLocation;
|
||||
var bloodPressureCuffSize;
|
||||
var bloodPressurePatientPosition;
|
||||
var painLocation;
|
||||
var painDuration;
|
||||
var painCharacter;
|
||||
var painFrequency;
|
||||
bool isPainManagementDone;
|
||||
var status;
|
||||
bool isVitalsRequired;
|
||||
var patientID;
|
||||
var createdOn;
|
||||
var doctorID;
|
||||
var clinicID;
|
||||
var triageCategory;
|
||||
var gCScore;
|
||||
var lineItemNo;
|
||||
DateTime vitalSignDate;
|
||||
var actualTimeTaken;
|
||||
var sugarLevel;
|
||||
var fBS;
|
||||
var rBS;
|
||||
var observationType;
|
||||
var heartRate;
|
||||
var muscleTone;
|
||||
var reflexIrritability;
|
||||
var bodyColor;
|
||||
var isFirstAssessment;
|
||||
var dateofBirth;
|
||||
var timeOfBirth;
|
||||
var bloodPressure;
|
||||
var bloodPressureCuffLocationDesc;
|
||||
var bloodPressureCuffSizeDesc;
|
||||
var bloodPressurePatientPositionDesc;
|
||||
var clinicName;
|
||||
var doctorImageURL;
|
||||
var doctorName;
|
||||
var painScoreDesc;
|
||||
var pulseRhythmDesc;
|
||||
var respirationPatternDesc;
|
||||
var temperatureCelciusMethodDesc;
|
||||
var time;
|
||||
|
||||
VitalSignResModel(
|
||||
{this.transNo,
|
||||
this.projectID,
|
||||
this.weightKg,
|
||||
this.heightCm,
|
||||
this.temperatureCelcius,
|
||||
this.pulseBeatPerMinute,
|
||||
this.respirationBeatPerMinute,
|
||||
this.bloodPressureLower,
|
||||
this.bloodPressureHigher,
|
||||
this.sAO2,
|
||||
this.fIO2,
|
||||
this.painScore,
|
||||
this.bodyMassIndex,
|
||||
this.headCircumCm,
|
||||
this.leanBodyWeightLbs,
|
||||
this.idealBodyWeightLbs,
|
||||
this.temperatureCelciusMethod,
|
||||
this.pulseRhythm,
|
||||
this.respirationPattern,
|
||||
this.bloodPressureCuffLocation,
|
||||
this.bloodPressureCuffSize,
|
||||
this.bloodPressurePatientPosition,
|
||||
this.painLocation,
|
||||
this.painDuration,
|
||||
this.painCharacter,
|
||||
this.painFrequency,
|
||||
this.isPainManagementDone,
|
||||
this.status,
|
||||
this.isVitalsRequired,
|
||||
this.patientID,
|
||||
this.createdOn,
|
||||
this.doctorID,
|
||||
this.clinicID,
|
||||
this.triageCategory,
|
||||
this.gCScore,
|
||||
this.lineItemNo,
|
||||
this.vitalSignDate,
|
||||
this.actualTimeTaken,
|
||||
this.sugarLevel,
|
||||
this.fBS,
|
||||
this.rBS,
|
||||
this.observationType,
|
||||
this.heartRate,
|
||||
this.muscleTone,
|
||||
this.reflexIrritability,
|
||||
this.bodyColor,
|
||||
this.isFirstAssessment,
|
||||
this.dateofBirth,
|
||||
this.timeOfBirth,
|
||||
this.bloodPressure,
|
||||
this.bloodPressureCuffLocationDesc,
|
||||
this.bloodPressureCuffSizeDesc,
|
||||
this.bloodPressurePatientPositionDesc,
|
||||
this.clinicName,
|
||||
this.doctorImageURL,
|
||||
this.doctorName,
|
||||
this.painScoreDesc,
|
||||
this.pulseRhythmDesc,
|
||||
this.respirationPatternDesc,
|
||||
this.temperatureCelciusMethodDesc,
|
||||
this.time});
|
||||
|
||||
VitalSignResModel.fromJson(Map<String, dynamic> json) {
|
||||
transNo = json['TransNo'];
|
||||
projectID = json['ProjectID'];
|
||||
weightKg = json['WeightKg'];
|
||||
heightCm = json['HeightCm'];
|
||||
temperatureCelcius = json['TemperatureCelcius'];
|
||||
pulseBeatPerMinute = json['PulseBeatPerMinute'];
|
||||
respirationBeatPerMinute = json['RespirationBeatPerMinute'];
|
||||
bloodPressureLower = json['BloodPressureLower'];
|
||||
bloodPressureHigher = json['BloodPressureHigher'];
|
||||
sAO2 = json['SAO2'];
|
||||
fIO2 = json['FIO2'];
|
||||
painScore = json['PainScore'];
|
||||
bodyMassIndex = json['BodyMassIndex'];
|
||||
headCircumCm = json['HeadCircumCm'];
|
||||
leanBodyWeightLbs = json['LeanBodyWeightLbs'];
|
||||
idealBodyWeightLbs = json['IdealBodyWeightLbs'];
|
||||
temperatureCelciusMethod = json['TemperatureCelciusMethod'];
|
||||
pulseRhythm = json['PulseRhythm'];
|
||||
respirationPattern = json['RespirationPattern'];
|
||||
bloodPressureCuffLocation = json['BloodPressureCuffLocation'];
|
||||
bloodPressureCuffSize = json['BloodPressureCuffSize'];
|
||||
bloodPressurePatientPosition = json['BloodPressurePatientPosition'];
|
||||
painLocation = json['PainLocation'];
|
||||
painDuration = json['PainDuration'];
|
||||
painCharacter = json['PainCharacter'];
|
||||
painFrequency = json['PainFrequency'];
|
||||
isPainManagementDone = json['IsPainManagementDone'];
|
||||
status = json['Status'];
|
||||
isVitalsRequired = json['IsVitalsRequired'];
|
||||
patientID = json['PatientID'];
|
||||
createdOn = json['CreatedOn'];
|
||||
doctorID = json['DoctorID'];
|
||||
clinicID = json['ClinicID'];
|
||||
triageCategory = json['TriageCategory'];
|
||||
gCScore = json['GCScore'];
|
||||
lineItemNo = json['LineItemNo'];
|
||||
vitalSignDate = DateUtil.convertStringToDate(json['CreatedOn']);
|
||||
actualTimeTaken = json['ActualTimeTaken'];
|
||||
sugarLevel = json['SugarLevel'];
|
||||
fBS = json['FBS'];
|
||||
rBS = json['RBS'];
|
||||
observationType = json['ObservationType'];
|
||||
heartRate = json['HeartRate'];
|
||||
muscleTone = json['MuscleTone'];
|
||||
reflexIrritability = json['ReflexIrritability'];
|
||||
bodyColor = json['BodyColor'];
|
||||
isFirstAssessment = json['IsFirstAssessment'];
|
||||
dateofBirth = json['DateofBirth'];
|
||||
timeOfBirth = json['TimeOfBirth'];
|
||||
bloodPressure = json['BloodPressure'];
|
||||
bloodPressureCuffLocationDesc = json['BloodPressureCuffLocationDesc'];
|
||||
bloodPressureCuffSizeDesc = json['BloodPressureCuffSizeDesc'];
|
||||
bloodPressurePatientPositionDesc = json['BloodPressurePatientPositionDesc'];
|
||||
clinicName = json['ClinicName'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorName = json['DoctorName'];
|
||||
painScoreDesc = json['PainScoreDesc'];
|
||||
pulseRhythmDesc = json['PulseRhythmDesc'];
|
||||
respirationPatternDesc = json['RespirationPatternDesc'];
|
||||
temperatureCelciusMethodDesc = json['TemperatureCelciusMethodDesc'];
|
||||
time = json['Time'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['TransNo'] = this.transNo;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['WeightKg'] = this.weightKg;
|
||||
data['HeightCm'] = this.heightCm;
|
||||
data['TemperatureCelcius'] = this.temperatureCelcius;
|
||||
data['PulseBeatPerMinute'] = this.pulseBeatPerMinute;
|
||||
data['RespirationBeatPerMinute'] = this.respirationBeatPerMinute;
|
||||
data['BloodPressureLower'] = this.bloodPressureLower;
|
||||
data['BloodPressureHigher'] = this.bloodPressureHigher;
|
||||
data['SAO2'] = this.sAO2;
|
||||
data['FIO2'] = this.fIO2;
|
||||
data['PainScore'] = this.painScore;
|
||||
data['BodyMassIndex'] = this.bodyMassIndex;
|
||||
data['HeadCircumCm'] = this.headCircumCm;
|
||||
data['LeanBodyWeightLbs'] = this.leanBodyWeightLbs;
|
||||
data['IdealBodyWeightLbs'] = this.idealBodyWeightLbs;
|
||||
data['TemperatureCelciusMethod'] = this.temperatureCelciusMethod;
|
||||
data['PulseRhythm'] = this.pulseRhythm;
|
||||
data['RespirationPattern'] = this.respirationPattern;
|
||||
data['BloodPressureCuffLocation'] = this.bloodPressureCuffLocation;
|
||||
data['BloodPressureCuffSize'] = this.bloodPressureCuffSize;
|
||||
data['BloodPressurePatientPosition'] = this.bloodPressurePatientPosition;
|
||||
data['PainLocation'] = this.painLocation;
|
||||
data['PainDuration'] = this.painDuration;
|
||||
data['PainCharacter'] = this.painCharacter;
|
||||
data['PainFrequency'] = this.painFrequency;
|
||||
data['IsPainManagementDone'] = this.isPainManagementDone;
|
||||
data['Status'] = this.status;
|
||||
data['IsVitalsRequired'] = this.isVitalsRequired;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['TriageCategory'] = this.triageCategory;
|
||||
data['GCScore'] = this.gCScore;
|
||||
data['LineItemNo'] = this.lineItemNo;
|
||||
data['VitalSignDate'] = this.vitalSignDate;
|
||||
data['ActualTimeTaken'] = this.actualTimeTaken;
|
||||
data['SugarLevel'] = this.sugarLevel;
|
||||
data['FBS'] = this.fBS;
|
||||
data['RBS'] = this.rBS;
|
||||
data['ObservationType'] = this.observationType;
|
||||
data['HeartRate'] = this.heartRate;
|
||||
data['MuscleTone'] = this.muscleTone;
|
||||
data['ReflexIrritability'] = this.reflexIrritability;
|
||||
data['BodyColor'] = this.bodyColor;
|
||||
data['IsFirstAssessment'] = this.isFirstAssessment;
|
||||
data['DateofBirth'] = this.dateofBirth;
|
||||
data['TimeOfBirth'] = this.timeOfBirth;
|
||||
data['BloodPressure'] = this.bloodPressure;
|
||||
data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc;
|
||||
data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc;
|
||||
data['BloodPressurePatientPositionDesc'] =
|
||||
this.bloodPressurePatientPositionDesc;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['PainScoreDesc'] = this.painScoreDesc;
|
||||
data['PulseRhythmDesc'] = this.pulseRhythmDesc;
|
||||
data['RespirationPatternDesc'] = this.respirationPatternDesc;
|
||||
data['TemperatureCelciusMethodDesc'] = this.temperatureCelciusMethodDesc;
|
||||
data['Time'] = this.time;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
|
||||
|
||||
import '../base_service.dart';
|
||||
|
||||
class VitalSignService extends BaseService {
|
||||
|
||||
List<VitalSignResModel> vitalSignResModelList = List();
|
||||
|
||||
Future getPatientRadOrders () async {
|
||||
hasError = false;
|
||||
await baseAppClient.post(GET_PATIENT_VITAL_SIGN,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
vitalSignResModelList.clear();
|
||||
response['List_DoctorPatientVitalSign'].forEach((vital) {
|
||||
vitalSignResModelList.add(VitalSignResModel.fromJson(vital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: Map());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
|
||||
class VitalSignViewModel extends BaseViewModel {
|
||||
VitalSignService _vitalSignService = locator<VitalSignService>();
|
||||
|
||||
List<VitalSignResModel> get vitalSignResModelList => _vitalSignService.vitalSignResModelList;
|
||||
|
||||
|
||||
getPatientRadOrders() async {
|
||||
setState(ViewState.Busy);
|
||||
await _vitalSignService.getPatientRadOrders();
|
||||
if (_vitalSignService.hasError) {
|
||||
error = _vitalSignService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,184 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/medical/vital_sign_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item_details_screen.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VitalSignDetailsScreen extends StatelessWidget {
|
||||
static const String url = "assets/images/";
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<VitalSignViewModel>(
|
||||
onModelReady: (model) => model.getPatientRadOrders(),
|
||||
builder: (_, mode, widget) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: 'Vital Sign',
|
||||
baseViewModel: mode,
|
||||
body: mode.vitalSignResModelList.length> 0? Container(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.BloodPressure,
|
||||
pageTitle: 'bodyMeasurements',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).bodyMeasurements,
|
||||
url: url + 'heartbeat.png',
|
||||
lastVal:
|
||||
mode.vitalSignResModelList[1].heightCm.toString(),
|
||||
unit: ' Cm',
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.Temperature,
|
||||
pageTitle: 'Temperature',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).temperature,
|
||||
url: url + 'heartbeat.png',
|
||||
lastVal: mode
|
||||
.vitalSignResModelList[1].temperatureCelcius
|
||||
.toString(),
|
||||
unit: 'C',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.Pulse,
|
||||
pageTitle: 'Pulse',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).pulse,
|
||||
url: url + 'heartbeat.png',
|
||||
lastVal: mode.vitalSignResModelList[1].pulseBeatPerMinute
|
||||
.toString(),
|
||||
unit: 'M',
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.Prescriptions,
|
||||
pageTitle: 'Prescriptions',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).respiration,
|
||||
url: url + 'heartbeat.png',
|
||||
lastVal: mode
|
||||
.vitalSignResModelList[1].respirationBeatPerMinute
|
||||
.toString(),
|
||||
unit: 'M',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.BloodPressure,
|
||||
pageTitle: 'BloodPressure',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).bloodPressure,
|
||||
url: url + 'heartbeat.png',
|
||||
lastVal: mode.vitalSignResModelList[1].bloodPressure
|
||||
.toString(),
|
||||
unit: '',
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.Oxygenation,
|
||||
pageTitle: 'Oxygenation',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).oxygenation,
|
||||
url: url + 'heartbeat.png',
|
||||
lastVal: mode.vitalSignResModelList[1].fIO2.toString(),
|
||||
unit: '',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.PainScale,
|
||||
pageTitle: 'PainScale',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).painScale,
|
||||
url: url + 'heartbeat.png',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
) : Center(child: Texts('No Data'),),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
class VitalSignDetailsWidget extends StatefulWidget {
|
||||
final List<VitalSignResModel> vitalList;
|
||||
final String title1;
|
||||
final String title2;
|
||||
final String viewKey;
|
||||
|
||||
VitalSignDetailsWidget(
|
||||
{Key key, this.vitalList, this.title1, this.title2, this.viewKey});
|
||||
|
||||
@override
|
||||
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
|
||||
}
|
||||
|
||||
class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)),
|
||||
border: Border.all(color: Colors.grey, width: 1),
|
||||
),
|
||||
margin: EdgeInsets.all(20),
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Table(
|
||||
border: TableBorder.symmetric(
|
||||
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
|
||||
),
|
||||
children: fullData(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<TableRow> fullData() {
|
||||
List<TableRow> tableRow = [];
|
||||
tableRow.add(TableRow(children: [
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Hexcolor('#515B5D'),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
widget.title1,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
height: 60,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Hexcolor('#515B5D'),
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(widget.title2, color: Colors.white),
|
||||
),
|
||||
height: 60),
|
||||
)
|
||||
]));
|
||||
widget.vitalList.forEach((vital) {
|
||||
tableRow.add(TableRow(children: [
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'${DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'${vital.toJson()[widget.viewKey]}',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]));
|
||||
});
|
||||
return tableRow;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
|
||||
class VitalSignItem extends StatelessWidget {
|
||||
const VitalSignItem(
|
||||
{Key key,
|
||||
@required this.url,
|
||||
@required this.des,
|
||||
this.lastVal = 'N/A',
|
||||
this.unit = '',
|
||||
this.height,
|
||||
this.width})
|
||||
: super(key: key);
|
||||
|
||||
final String url;
|
||||
final String des;
|
||||
final String lastVal;
|
||||
final String unit;
|
||||
|
||||
final double height;
|
||||
final double width;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RoundedContainer(
|
||||
margin: 0.025 * SizeConfig.realScreenWidth,
|
||||
height: 0.14 * SizeConfig.realScreenHeight,
|
||||
width: 0.45 * SizeConfig.realScreenWidth,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
des,
|
||||
style: TextStyle(
|
||||
fontSize: 1.7 * SizeConfig.textMultiplier,
|
||||
color: Hexcolor('#B8382C'),
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Image.asset(
|
||||
url,
|
||||
height: SizeConfig.heightMultiplier * 7,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: Colors.black),
|
||||
children: [
|
||||
new TextSpan(text: lastVal),
|
||||
new TextSpan(
|
||||
text: unit,
|
||||
style: TextStyle(
|
||||
color: Hexcolor('#B8382C'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,162 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_and_detials.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VitalSignItemDetailsScreen extends StatelessWidget {
|
||||
final VitalSignDetails pageKey;
|
||||
final String pageTitle;
|
||||
List<Map> VSchart;
|
||||
|
||||
VitalSignItemDetailsScreen({this.vitalList, this.pageKey, this.pageTitle});
|
||||
|
||||
final List<VitalSignResModel> vitalList;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
switch (pageKey) {
|
||||
case VitalSignDetails.BodyMeasurements:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'Height',
|
||||
'title1': 'Date',
|
||||
'title2': 'Cm',
|
||||
'viewKey': 'HeightCm',
|
||||
},
|
||||
{
|
||||
'name': 'Weight Kg',
|
||||
'title1': 'Date',
|
||||
'title2': 'Kg',
|
||||
'viewKey': 'WeightKg',
|
||||
},
|
||||
{
|
||||
'name': 'BodyMassIndex',
|
||||
'title1': 'Date',
|
||||
'title2': 'BodyMass',
|
||||
'viewKey': 'BodyMassIndex',
|
||||
},
|
||||
{
|
||||
'name': 'HeadCircumCm',
|
||||
'title1': 'Date',
|
||||
'title2': 'Cm',
|
||||
'viewKey': 'HeadCircumCm',
|
||||
},
|
||||
{
|
||||
'name': 'Ideal Body Weight (Lbs)',
|
||||
'title1': 'Date',
|
||||
'title2': 'Ideal Weight',
|
||||
'viewKey': 'IdealBodyWeightLbs',
|
||||
},
|
||||
{
|
||||
'name': 'LeanBodyWeightLbs (Lbs)',
|
||||
'title1': 'Date',
|
||||
'title2': 'Lean Weight',
|
||||
'viewKey': 'LeanBodyWeightLbs',
|
||||
}
|
||||
];
|
||||
|
||||
break;
|
||||
|
||||
case VitalSignDetails.Temperature:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'Temperature In Celcius',
|
||||
'title1': 'Date',
|
||||
'title2': 'C',
|
||||
'viewKey': 'TemperatureCelcius',
|
||||
},
|
||||
];
|
||||
|
||||
break;
|
||||
case VitalSignDetails.Pulse:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'Pulse Beat Per Minute',
|
||||
'title1': 'Date',
|
||||
'title2': 'Minute',
|
||||
'viewKey': 'PulseBeatPerMinute',
|
||||
},
|
||||
];
|
||||
|
||||
break;
|
||||
case VitalSignDetails.Prescriptions:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'Respiration Beat Per Minute',
|
||||
'title1': 'Date',
|
||||
'title2': 'Beat Per Minute',
|
||||
'viewKey': 'RespirationBeatPerMinute',
|
||||
},
|
||||
];
|
||||
|
||||
break;
|
||||
case VitalSignDetails.BloodPressure:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'Blood Pressure Higher',
|
||||
'title1': 'Date',
|
||||
'title2': 'Minute',
|
||||
'viewKey': 'BloodPressureHigher',
|
||||
},
|
||||
{
|
||||
'name': 'Blood Pressure Lower',
|
||||
'title1': 'Date',
|
||||
'title2': 'Minute',
|
||||
'viewKey': 'BloodPressureLower',
|
||||
}
|
||||
];
|
||||
|
||||
break;
|
||||
case VitalSignDetails.Oxygenation:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'FIO2',
|
||||
'title1': 'Date',
|
||||
'title2': 'Cm',
|
||||
'viewKey': 'FIO2',
|
||||
},
|
||||
{
|
||||
'name': 'SAO2',
|
||||
'title1': 'Date',
|
||||
'title2': 'Cm',
|
||||
'viewKey': 'SAO2',
|
||||
},
|
||||
];
|
||||
|
||||
break;
|
||||
case VitalSignDetails.PainScale:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'PainScore',
|
||||
'title1': 'Date',
|
||||
'title2': 'Cm',
|
||||
'viewKey': 'PainScore',
|
||||
},
|
||||
];
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
return AppScaffold(
|
||||
appBarTitle: pageTitle,
|
||||
isShowAppBar: true,
|
||||
body: ListView(
|
||||
children: VSchart.map((chartInfo) {
|
||||
var vitalListTemp = vitalList.where(
|
||||
(element) => element.toJson()[chartInfo['viewKey']] != null,
|
||||
);
|
||||
return vitalListTemp.length != 0
|
||||
? VitalSingChartAndDetials(
|
||||
vitalList: vitalList,
|
||||
name: chartInfo['name'],
|
||||
title1: chartInfo['title1'],
|
||||
title2: chartInfo['title2'],
|
||||
viewKey: chartInfo['viewKey'])
|
||||
: Container();
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
|
||||
class VitalSingChartAndDetials extends StatelessWidget {
|
||||
VitalSingChartAndDetials({
|
||||
Key key,
|
||||
@required this.vitalList,
|
||||
@required this.name,
|
||||
@required this.viewKey,
|
||||
@required this.title1,
|
||||
@required this.title2,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<VitalSignResModel> vitalList;
|
||||
final String name;
|
||||
final String viewKey;
|
||||
final String title1;
|
||||
final String title2;
|
||||
List<TimeSeriesSales> timeSeriesData = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
AppExpandableNotifier(
|
||||
headerWidget: AppTimeSeriesChart(
|
||||
seriesList: generateData(),
|
||||
chartName: name,
|
||||
startDate: DateTime(
|
||||
vitalList[vitalList.length - 1]
|
||||
.vitalSignDate
|
||||
.year,
|
||||
vitalList[vitalList.length - 1]
|
||||
.vitalSignDate
|
||||
.month +
|
||||
3,
|
||||
vitalList[vitalList.length - 1]
|
||||
.vitalSignDate
|
||||
.day),
|
||||
endDate: vitalList[0].vitalSignDate,
|
||||
),
|
||||
bodyWidget: VitalSignDetailsWidget(
|
||||
vitalList: vitalList.reversed.toList(),
|
||||
title1: title1,
|
||||
title2: title2,
|
||||
viewKey: viewKey,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
generateData() {
|
||||
if (vitalList.length > 0) {
|
||||
vitalList.forEach(
|
||||
(element) {
|
||||
timeSeriesData.add(
|
||||
TimeSeriesSales(
|
||||
new DateTime(element.vitalSignDate.year,
|
||||
element.vitalSignDate.month, element.vitalSignDate.day),
|
||||
element.toJson()[viewKey].toInt(),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
return [
|
||||
new charts.Series<TimeSeriesSales, DateTime>(
|
||||
id: 'Sales',
|
||||
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
|
||||
domainFn: (TimeSeriesSales sales, _) => sales.time,
|
||||
measureFn: (TimeSeriesSales sales, _) => sales.sales,
|
||||
data: timeSeriesData,
|
||||
)
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue