Merge branch 'vital_sign' into 'master'
Vital sign See merge request Cloud_Solution/diplomatic-quarter!22merge-requests/34/merge
commit
915de5a871
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,39 @@
|
||||
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,
|
||||
Respiration,
|
||||
heart,
|
||||
PainScale,
|
||||
Weight,
|
||||
Height
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,9 +1,23 @@
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
|
||||
import 'client/base_app_client.dart';
|
||||
|
||||
class BaseService{
|
||||
class BaseService {
|
||||
String error;
|
||||
bool hasError = false;
|
||||
BaseAppClient baseAppClient = BaseAppClient();
|
||||
AuthenticatedUser user;
|
||||
|
||||
}
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
|
||||
BaseService() {
|
||||
getUser();
|
||||
}
|
||||
|
||||
getUser() async {
|
||||
user = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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,276 @@
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
|
||||
class AppointmentHistory {
|
||||
String setupID;
|
||||
int projectID;
|
||||
int appointmentNo;
|
||||
DateTime appointmentDate;
|
||||
Null appointmentDateN;
|
||||
int appointmentType;
|
||||
String bookDate;
|
||||
int patientType;
|
||||
int patientID;
|
||||
int clinicID;
|
||||
int doctorID;
|
||||
String endDate;
|
||||
String startTime;
|
||||
String endTime;
|
||||
int status;
|
||||
int visitType;
|
||||
int visitFor;
|
||||
int patientStatusType;
|
||||
int companyID;
|
||||
int bookedBy;
|
||||
String bookedOn;
|
||||
int confirmedBy;
|
||||
String confirmedOn;
|
||||
int arrivalChangedBy;
|
||||
String arrivedOn;
|
||||
Null editedBy;
|
||||
Null editedOn;
|
||||
Null doctorName;
|
||||
Null doctorNameN;
|
||||
String statusDesc;
|
||||
Null statusDescN;
|
||||
bool vitalStatus;
|
||||
Null vitalSignAppointmentNo;
|
||||
int episodeID;
|
||||
int actualDoctorRate;
|
||||
String clinicName;
|
||||
bool complainExists;
|
||||
String doctorImageURL;
|
||||
String doctorNameObj;
|
||||
int doctorRate;
|
||||
List<String> doctorSpeciality;
|
||||
String doctorTitle;
|
||||
int gender;
|
||||
String genderDescription;
|
||||
bool iSAllowOnlineCheckedIN;
|
||||
bool isActiveDoctor;
|
||||
bool isActiveDoctorProfile;
|
||||
bool isDoctorAllowVedioCall;
|
||||
bool isExecludeDoctor;
|
||||
int isFollowup;
|
||||
bool isLiveCareAppointment;
|
||||
bool isMedicalReportRequested;
|
||||
bool isOnlineCheckedIN;
|
||||
String latitude;
|
||||
Null listHISGetContactLensPerscription;
|
||||
Null listHISGetGlassPerscription;
|
||||
String longitude;
|
||||
int nextAction;
|
||||
int noOfPatientsRate;
|
||||
int originalClinicID;
|
||||
int originalProjectID;
|
||||
String projectName;
|
||||
String qR;
|
||||
int remaniningHoursTocanPay;
|
||||
bool sMSButtonVisable;
|
||||
|
||||
AppointmentHistory(
|
||||
{this.setupID,
|
||||
this.projectID,
|
||||
this.appointmentNo,
|
||||
this.appointmentDate,
|
||||
this.appointmentDateN,
|
||||
this.appointmentType,
|
||||
this.bookDate,
|
||||
this.patientType,
|
||||
this.patientID,
|
||||
this.clinicID,
|
||||
this.doctorID,
|
||||
this.endDate,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.status,
|
||||
this.visitType,
|
||||
this.visitFor,
|
||||
this.patientStatusType,
|
||||
this.companyID,
|
||||
this.bookedBy,
|
||||
this.bookedOn,
|
||||
this.confirmedBy,
|
||||
this.confirmedOn,
|
||||
this.arrivalChangedBy,
|
||||
this.arrivedOn,
|
||||
this.editedBy,
|
||||
this.editedOn,
|
||||
this.doctorName,
|
||||
this.doctorNameN,
|
||||
this.statusDesc,
|
||||
this.statusDescN,
|
||||
this.vitalStatus,
|
||||
this.vitalSignAppointmentNo,
|
||||
this.episodeID,
|
||||
this.actualDoctorRate,
|
||||
this.clinicName,
|
||||
this.complainExists,
|
||||
this.doctorImageURL,
|
||||
this.doctorNameObj,
|
||||
this.doctorRate,
|
||||
this.doctorSpeciality,
|
||||
this.doctorTitle,
|
||||
this.gender,
|
||||
this.genderDescription,
|
||||
this.iSAllowOnlineCheckedIN,
|
||||
this.isActiveDoctor,
|
||||
this.isActiveDoctorProfile,
|
||||
this.isDoctorAllowVedioCall,
|
||||
this.isExecludeDoctor,
|
||||
this.isFollowup,
|
||||
this.isLiveCareAppointment,
|
||||
this.isMedicalReportRequested,
|
||||
this.isOnlineCheckedIN,
|
||||
this.latitude,
|
||||
this.listHISGetContactLensPerscription,
|
||||
this.listHISGetGlassPerscription,
|
||||
this.longitude,
|
||||
this.nextAction,
|
||||
this.noOfPatientsRate,
|
||||
this.originalClinicID,
|
||||
this.originalProjectID,
|
||||
this.projectName,
|
||||
this.qR,
|
||||
this.remaniningHoursTocanPay,
|
||||
this.sMSButtonVisable});
|
||||
|
||||
AppointmentHistory.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
projectID = json['ProjectID'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
appointmentDate = DateUtil.convertStringToDate(json['AppointmentDate']);
|
||||
appointmentDateN = json['AppointmentDateN'];
|
||||
appointmentType = json['AppointmentType'];
|
||||
bookDate = json['BookDate'];
|
||||
patientType = json['PatientType'];
|
||||
patientID = json['PatientID'];
|
||||
clinicID = json['ClinicID'];
|
||||
doctorID = json['DoctorID'];
|
||||
endDate = json['EndDate'];
|
||||
startTime = json['StartTime'];
|
||||
endTime = json['EndTime'];
|
||||
status = json['Status'];
|
||||
visitType = json['VisitType'];
|
||||
visitFor = json['VisitFor'];
|
||||
patientStatusType = json['PatientStatusType'];
|
||||
companyID = json['CompanyID'];
|
||||
bookedBy = json['BookedBy'];
|
||||
bookedOn = json['BookedOn'];
|
||||
confirmedBy = json['ConfirmedBy'];
|
||||
confirmedOn = json['ConfirmedOn'];
|
||||
arrivalChangedBy = json['ArrivalChangedBy'];
|
||||
arrivedOn = json['ArrivedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
editedOn = json['EditedOn'];
|
||||
doctorName = json['DoctorName'];
|
||||
doctorNameN = json['DoctorNameN'];
|
||||
statusDesc = json['StatusDesc'];
|
||||
statusDescN = json['StatusDescN'];
|
||||
vitalStatus = json['VitalStatus'];
|
||||
vitalSignAppointmentNo = json['VitalSignAppointmentNo'];
|
||||
episodeID = json['EpisodeID'];
|
||||
actualDoctorRate = json['ActualDoctorRate'];
|
||||
clinicName = json['ClinicName'];
|
||||
complainExists = json['ComplainExists'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorNameObj = json['DoctorNameObj'];
|
||||
doctorRate = json['DoctorRate'];
|
||||
// doctorSpeciality = json['DoctorSpeciality'].cast<String>();
|
||||
doctorTitle = json['DoctorTitle'];
|
||||
gender = json['Gender'];
|
||||
genderDescription = json['GenderDescription'];
|
||||
iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN'];
|
||||
isActiveDoctor = json['IsActiveDoctor'];
|
||||
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
|
||||
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
|
||||
isExecludeDoctor = json['IsExecludeDoctor'];
|
||||
isFollowup = json['IsFollowup'];
|
||||
isLiveCareAppointment = json['IsLiveCareAppointment'];
|
||||
isMedicalReportRequested = json['IsMedicalReportRequested'];
|
||||
isOnlineCheckedIN = json['IsOnlineCheckedIN'];
|
||||
latitude = json['Latitude'];
|
||||
listHISGetContactLensPerscription =
|
||||
json['List_HIS_GetContactLensPerscription'];
|
||||
listHISGetGlassPerscription = json['List_HIS_GetGlassPerscription'];
|
||||
longitude = json['Longitude'];
|
||||
nextAction = json['NextAction'];
|
||||
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||
originalClinicID = json['OriginalClinicID'];
|
||||
originalProjectID = json['OriginalProjectID'];
|
||||
projectName = json['ProjectName'];
|
||||
qR = json['QR'];
|
||||
remaniningHoursTocanPay = json['RemaniningHoursTocanPay'];
|
||||
sMSButtonVisable = json['SMSButtonVisable'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['AppointmentDate'] = this.appointmentDate;
|
||||
data['AppointmentDateN'] = this.appointmentDateN;
|
||||
data['AppointmentType'] = this.appointmentType;
|
||||
data['BookDate'] = this.bookDate;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['EndDate'] = this.endDate;
|
||||
data['StartTime'] = this.startTime;
|
||||
data['EndTime'] = this.endTime;
|
||||
data['Status'] = this.status;
|
||||
data['VisitType'] = this.visitType;
|
||||
data['VisitFor'] = this.visitFor;
|
||||
data['PatientStatusType'] = this.patientStatusType;
|
||||
data['CompanyID'] = this.companyID;
|
||||
data['BookedBy'] = this.bookedBy;
|
||||
data['BookedOn'] = this.bookedOn;
|
||||
data['ConfirmedBy'] = this.confirmedBy;
|
||||
data['ConfirmedOn'] = this.confirmedOn;
|
||||
data['ArrivalChangedBy'] = this.arrivalChangedBy;
|
||||
data['ArrivedOn'] = this.arrivedOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['DoctorNameN'] = this.doctorNameN;
|
||||
data['StatusDesc'] = this.statusDesc;
|
||||
data['StatusDescN'] = this.statusDescN;
|
||||
data['VitalStatus'] = this.vitalStatus;
|
||||
data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo;
|
||||
data['EpisodeID'] = this.episodeID;
|
||||
data['ActualDoctorRate'] = this.actualDoctorRate;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['ComplainExists'] = this.complainExists;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorNameObj'] = this.doctorNameObj;
|
||||
data['DoctorRate'] = this.doctorRate;
|
||||
data['DoctorSpeciality'] = this.doctorSpeciality;
|
||||
data['DoctorTitle'] = this.doctorTitle;
|
||||
data['Gender'] = this.gender;
|
||||
data['GenderDescription'] = this.genderDescription;
|
||||
data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN;
|
||||
data['IsActiveDoctor'] = this.isActiveDoctor;
|
||||
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
|
||||
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
|
||||
data['IsExecludeDoctor'] = this.isExecludeDoctor;
|
||||
data['IsFollowup'] = this.isFollowup;
|
||||
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
|
||||
data['IsMedicalReportRequested'] = this.isMedicalReportRequested;
|
||||
data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['List_HIS_GetContactLensPerscription'] =
|
||||
this.listHISGetContactLensPerscription;
|
||||
data['List_HIS_GetGlassPerscription'] = this.listHISGetGlassPerscription;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['NextAction'] = this.nextAction;
|
||||
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||
data['OriginalClinicID'] = this.originalClinicID;
|
||||
data['OriginalProjectID'] = this.originalProjectID;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['QR'] = this.qR;
|
||||
data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay;
|
||||
data['SMSButtonVisable'] = this.sMSButtonVisable;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,188 @@
|
||||
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';
|
||||
|
||||
import '../../../d_q_icons_icons.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: ListView(
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.Height,
|
||||
pageTitle: 'Height',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).height,
|
||||
icon: DQIcons.height,
|
||||
lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length-1].heightCm.toString(),
|
||||
unit: ' Cm',
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.Weight,
|
||||
pageTitle: 'Weight',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).weight,
|
||||
icon: DQIcons.weight_scale,
|
||||
unit: ' Kg',
|
||||
lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length-1].weightKg.toString(),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.BodyMeasurements,
|
||||
pageTitle: 'BMI',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).bodyMeasurements,
|
||||
icon: DQIcons.bmi,
|
||||
lastVal: mode.vitalSignResModelList[1].pulseBeatPerMinute
|
||||
.toString(),
|
||||
unit: 'BMI',
|
||||
),
|
||||
),
|
||||
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,
|
||||
icon: DQIcons.thermometer,
|
||||
lastVal: mode
|
||||
.vitalSignResModelList[1].temperatureCelcius
|
||||
.toString(),
|
||||
unit: 'C',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.heart,
|
||||
pageTitle: 'Hart ',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).heart,
|
||||
icon: DQIcons.heart,
|
||||
lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length-1].pulseBeatPerMinute
|
||||
.toString(),
|
||||
unit: ' bpm',
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.Respiration,
|
||||
pageTitle: 'Respiration Rate',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).respirationRate,
|
||||
icon: DQIcons.outline,
|
||||
lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length-1].respirationBeatPerMinute.toString(),
|
||||
unit: ' bmp',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VitalSignItemDetailsScreen(
|
||||
pageKey: VitalSignDetails.BloodPressure,
|
||||
pageTitle: 'BloodPressure',
|
||||
vitalList: mode.vitalSignResModelList,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: VitalSignItem(
|
||||
des: TranslationBase.of(context).pulse,
|
||||
icon: DQIcons.blood_pressure,
|
||||
lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length -1].bloodPressure
|
||||
.toString(),
|
||||
unit: ' SBP/DBP',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
) : 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,91 @@
|
||||
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.des,
|
||||
this.lastVal = 'N/A',
|
||||
this.unit = '',
|
||||
this.height,
|
||||
this.width,
|
||||
@required this.icon})
|
||||
: super(key: key);
|
||||
|
||||
final String des;
|
||||
final String lastVal;
|
||||
final String unit;
|
||||
final IconData icon;
|
||||
final double height;
|
||||
final double width;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RoundedContainer(
|
||||
margin: 0.025 * SizeConfig.realScreenWidth,
|
||||
height: 0.15 * SizeConfig.realScreenHeight,
|
||||
width: 0.45 * SizeConfig.realScreenWidth,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 0.10 * SizeConfig.realScreenHeight,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
des,
|
||||
style: TextStyle(
|
||||
fontSize: 1.7 * SizeConfig.textMultiplier,
|
||||
color: Hexcolor('#B8382C'),
|
||||
fontWeight: FontWeight.bold,),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(child: Icon(icon,size: 40,),),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
child: Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 5,right: 5),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: Colors.black),
|
||||
children: [
|
||||
TextSpan(text: lastVal),
|
||||
TextSpan(
|
||||
text: unit,
|
||||
style: TextStyle(
|
||||
color: Hexcolor('#B8382C'),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,189 @@
|
||||
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.Respiration:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'Respiration Rate',
|
||||
'title1': 'Date',
|
||||
'title2': 'bpm',
|
||||
'viewKey': 'RespirationBeatPerMinute',
|
||||
},
|
||||
];
|
||||
|
||||
break;
|
||||
case VitalSignDetails.heart:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'FIO2',
|
||||
'title1': 'Date',
|
||||
'title2': 'bpm',
|
||||
'viewKey': 'PulseBeatPerMinute',
|
||||
},
|
||||
];
|
||||
|
||||
break;
|
||||
case VitalSignDetails.PainScale:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'PainScore',
|
||||
'title1': 'Date',
|
||||
'title2': 'Cm',
|
||||
'viewKey': 'PainScore',
|
||||
},
|
||||
];
|
||||
|
||||
break;
|
||||
case VitalSignDetails.Weight:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'Weight Kg',
|
||||
'title1': 'Date',
|
||||
'title2': 'Kg',
|
||||
'viewKey': 'WeightKg',
|
||||
},
|
||||
];
|
||||
|
||||
break;
|
||||
|
||||
case VitalSignDetails.Height:
|
||||
VSchart = [
|
||||
{
|
||||
'name': 'Height Cm',
|
||||
'title1': 'Date',
|
||||
'title2': 'Cm',
|
||||
'viewKey': 'HeightCm',
|
||||
},
|
||||
];
|
||||
|
||||
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