Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into fix_loader

 Conflicts:
	lib/config/localized_values.dart
	lib/screens/dashboard_screen.dart
	lib/util/translations_delegate_base.dart
merge-requests/259/head
Elham Rababah 5 years ago
commit 4a3175830d

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -590,6 +590,36 @@ const Map<String, Map<String, String>> localizedValues = {
'allergicTO': {'en': "ALLERGIC TO ", 'ar':" حساس من" }, 'allergicTO': {'en': "ALLERGIC TO ", 'ar':" حساس من" },
'normal': {'en': "Normal", 'ar':"عادي" }, 'normal': {'en': "Normal", 'ar':"عادي" },
'abnormal': {'en': "Abnormal", 'ar':" غير عادي" }, 'abnormal': {'en': "Abnormal", 'ar':" غير عادي" },
"systolic-lng": {"en": "Systolic", "ar": "الإنقباض"},
"diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"},
"mass": {"en": "Mass", "ar": "كتلة"},
"temp-c": {"en": "°C", "ar": "°س"},
"bpm": {"en": "bpm", "ar": "نبضة"},
"respiration-signs": {"en": "Respiration", "ar": "تنفس"},
"sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"},
"body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"},
'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'},
'heart': {'en': 'Heart', 'ar': 'قلب'},
'medicalReport': {'en': "medical Report", 'ar': "تقرير طبي"},
'visitDate': {'en': "Visit Date", 'ar': "تاريخ الزيارة"},
'test': {'en': "Procedures/Test", 'ar': "عمليات/تحاليل"},
'regular': {'en': "Regular", 'ar': "اعتيادي"},
'addMoreProcedure': {
'en': "Add More Procedures",
'ar': "اضف المزيد من العمليات"
},
'searchProcedures': {'en': "Search Procedures", 'ar': "البحث في العمليات"},
'selectProcedures': {'en': "Select procedure", 'ar': "اختر العملية"},
'procedureCategorise': {
'en': "Select Procedure Category",
'ar': "اختر صنف العمليات "
},
'addSelectedProcedures': {
'en': "add Selected Procedures",
'ar': "اضافة العمليات المختارة "
},
'updateProcedure': {'en': "Update Procedure", 'ar': "تحديث العملية"},
'orderProcedure': {'en': "order procedure", 'ar': "طلب العمليات"},
'nameOrICD': {'en': "Name or ICD", 'ar':"الاسم او  ICD" }, 'nameOrICD': {'en': "Name or ICD", 'ar':"الاسم او  ICD" },
'dType': {'en': "Type", 'ar':"النوع" }, 'dType': {'en': "Type", 'ar':"النوع" },
'addAssessmentDetails': {'en': "Add Assessment Details", 'ar':"أضف تفاصيل التقييم" }, 'addAssessmentDetails': {'en': "Add Assessment Details", 'ar':"أضف تفاصيل التقييم" },

@ -12,3 +12,4 @@ final LOGGED_IN_USER = 'loggedUser';
final DASHBOARD_DATA = 'dashboard-data'; final DASHBOARD_DATA = 'dashboard-data';
final OTP_TYPE = 'otp-type'; final OTP_TYPE = 'otp-type';
final LAST_LOGIN_USER = 'last-login-user'; final LAST_LOGIN_USER = 'last-login-user';
final PASSWORD = 'password';

@ -4,30 +4,30 @@ class GetIMEIDetailsModel {
int logInTypeID; int logInTypeID;
bool outSA; bool outSA;
String mobile; String mobile;
Null identificationNo; dynamic identificationNo;
int doctorID; int doctorID;
String doctorName; String doctorName;
String doctorNameN; String doctorNameN;
int clinicID; int clinicID;
String clinicDescription; String clinicDescription;
Null clinicDescriptionN; dynamic clinicDescriptionN;
int projectID; int projectID;
String projectName; String projectName;
String genderDescription; String genderDescription;
Null genderDescriptionN; dynamic genderDescriptionN;
String titleDescription; String titleDescription;
Null titleDescriptionN; dynamic titleDescriptionN;
Null zipCode; dynamic zipCode;
String createdOn; String createdOn;
Null createdBy; dynamic createdBy;
String editedOn; String editedOn;
int editedBy; dynamic editedBy;
bool biometricEnabled; bool biometricEnabled;
Null preferredLanguage; dynamic preferredLanguage;
bool isActive; bool isActive;
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
String password;
GetIMEIDetailsModel( GetIMEIDetailsModel(
{this.iD, {this.iD,
this.iMEI, this.iMEI,
@ -56,7 +56,8 @@ class GetIMEIDetailsModel {
this.preferredLanguage, this.preferredLanguage,
this.isActive, this.isActive,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID}); this.vidaRefreshTokenID,
this.password});
GetIMEIDetailsModel.fromJson(Map<String, dynamic> json) { GetIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
iD = json['ID']; iD = json['ID'];
@ -87,6 +88,7 @@ class GetIMEIDetailsModel {
isActive = json['IsActive']; isActive = json['IsActive'];
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
password = json['Password'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -119,6 +121,7 @@ class GetIMEIDetailsModel {
data['IsActive'] = this.isActive; data['IsActive'] = this.isActive;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['Password'] = this.password;
return data; return data;
} }
} }

@ -1,9 +1,9 @@
class InsertIMEIDetailsModel { class InsertIMEIDetailsModel {
String iMEI; String iMEI;
int logInTypeID; int logInTypeID;
Null outSA; dynamic outSA;
Null mobile; String mobile;
Null identificationNo; dynamic identificationNo;
int doctorID; int doctorID;
String doctorName; String doctorName;
String doctorNameN; String doctorNameN;
@ -31,7 +31,7 @@ class InsertIMEIDetailsModel {
int patientOutSA; int patientOutSA;
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
dynamic password;
InsertIMEIDetailsModel( InsertIMEIDetailsModel(
{this.iMEI, {this.iMEI,
this.logInTypeID, this.logInTypeID,
@ -64,13 +64,14 @@ class InsertIMEIDetailsModel {
this.isLoginForDoctorApp, this.isLoginForDoctorApp,
this.patientOutSA, this.patientOutSA,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID}); this.vidaRefreshTokenID,
this.password});
InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) { InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
iMEI = json['IMEI']; iMEI = json['IMEI'];
logInTypeID = json['LogInTypeID']; logInTypeID = json['LogInTypeID'];
outSA = json['OutSA']; outSA = json['OutSA'];
mobile = json['Mobile']; mobile = json['MobileNo'];
identificationNo = json['IdentificationNo']; identificationNo = json['IdentificationNo'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
@ -99,6 +100,7 @@ class InsertIMEIDetailsModel {
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
password = json['Password'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -106,7 +108,7 @@ class InsertIMEIDetailsModel {
data['IMEI'] = this.iMEI; data['IMEI'] = this.iMEI;
data['LogInTypeID'] = this.logInTypeID; data['LogInTypeID'] = this.logInTypeID;
data['OutSA'] = this.outSA; data['OutSA'] = this.outSA;
data['Mobile'] = this.mobile; data['MobileNo'] = this.mobile;
data['IdentificationNo'] = this.identificationNo; data['IdentificationNo'] = this.identificationNo;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
@ -135,6 +137,7 @@ class InsertIMEIDetailsModel {
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['Password'] = this.password;
return data; return data;
} }
} }

@ -3,20 +3,20 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; 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-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/models/patient/vital_sign/vital_sign_res_model.dart';
class VitalSignsService extends BaseService { class VitalSignsService extends BaseService {
List<VitalSignResModel> patientVitalSignList = [];
List<VitalSignResModel> patientVitalSignOrderdSubList = [];
VitalSignData patientVitalSigns; VitalSignData patientVitalSigns;
List<VitalSignHistory> patientVitalSignsHistory = [];
Future getPatientVitalSign(PatiantInformtion patient) async { Future getPatientVitalSign(PatiantInformtion patient) async {
patientVitalSigns = null; patientVitalSigns = null;
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = 2954208; //patient.patientMRN; body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = "2016055308"; //patient.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = 210011002; //patient.episodeNo; body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post( await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA, GET_PATIENT_VITAL_SIGN_DATA,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -35,4 +35,37 @@ class VitalSignsService extends BaseService {
body: body, body: body,
); );
} }
Future getPatientVitalSignsHistory(
PatiantInformtion patient, String fromDate, String toDate) async {
patientVitalSigns = null;
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
body['PatientTypeID'] = 1;
body['PatientType'] = 1;
body['DeviceTypeID'] = 1;
body['isDentalAllowedBackend'] = false;
body['From'] = fromDate;
body['To'] = toDate;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA,
onSuccess: (dynamic response, int statusCode) {
patientVitalSignsHistory.clear();
if (response['VitalSignsHistory'] != null) {
response['VitalSignsHistory'].forEach((v) {
patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v));
});
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error.toString();
},
body: body,
);
}
} }

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
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-data.dart';
class PrescriptionService extends BaseService { class PrescriptionService extends BaseService {
@ -93,9 +94,24 @@ class PrescriptionService extends BaseService {
} }
Future getDrugToDrug( Future getDrugToDrug(
VitalSignData vital, List<GetAllergiesResModel> allergy) async { VitalSignData vital,
List<MasterKeyModel> diagnosis,
List<GetAllergiesResModel> allergy,
PatiantInformtion patient,
List<PrescriptionModel> prescription) async {
Map<String, dynamic> request = {
"Prescription": {
"objPatientInfo": {"Gender": patient.gender, "Age": patient.age},
"objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg},
"objPrescriptionItems": prescription[0].entityList,
"objAllergies": allergy,
"objDiagnosis": diagnosis,
"IsDoctor": "false",
"IsPharmacist": "false"
}
};
hasError = false; hasError = false;
var request = {};
await baseAppClient.post(DRUG_TO_DRUG, await baseAppClient.post(DRUG_TO_DRUG,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
drugToDrug = []; drugToDrug = [];
@ -103,6 +119,6 @@ class PrescriptionService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _drugRequestModel.toJson()); }, body: request);
} }
} }

@ -81,11 +81,15 @@ class AuthViewModel extends BaseViewModel {
Future insertDeviceImei(request) async { Future insertDeviceImei(request) async {
var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); var loggedIn = await sharedPref.getObj(LOGGED_IN_USER);
var user = await sharedPref.getObj(LAST_LOGIN_USER);
if (user != null) {
user = GetIMEIDetailsModel.fromJson(user);
}
request['IMEI'] = DEVICE_TOKEN; request['IMEI'] = DEVICE_TOKEN;
request['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); request['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
request['BioMetricEnabled'] = true; request['BioMetricEnabled'] = true;
request['MobileNo'] = loggedIn['MobileNumber']; request['MobileNo'] =
loggedIn != null ? loggedIn['MobileNumber'] : user.mobile;
InsertIMEIDetailsModel nRequest = InsertIMEIDetailsModel.fromJson(request); InsertIMEIDetailsModel nRequest = InsertIMEIDetailsModel.fromJson(request);
nRequest.genderDescription = request['Gender_Description']; nRequest.genderDescription = request['Gender_Description'];
nRequest.genderDescriptionN = request['Gender_DescriptionN']; nRequest.genderDescriptionN = request['Gender_DescriptionN'];
@ -93,9 +97,14 @@ class AuthViewModel extends BaseViewModel {
nRequest.titleDescription = request['Title_Description']; nRequest.titleDescription = request['Title_Description'];
nRequest.titleDescriptionN = request['Title_DescriptionN']; nRequest.titleDescriptionN = request['Title_DescriptionN'];
nRequest.projectID = await sharedPref.getInt(PROJECT_ID); nRequest.projectID = await sharedPref.getInt(PROJECT_ID);
nRequest.doctorID = loggedIn != null
? loggedIn['List_MemberInformation'][0]['MemberID']
: user.doctorID;
nRequest.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
nRequest.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); nRequest.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
nRequest.vidaRefreshTokenID = nRequest.vidaRefreshTokenID =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
nRequest.password = await sharedPref.getString(PASSWORD);
try { try {
var localRes; var localRes;
await baseAppClient.post(INSERT_DEVICE_IMEI, await baseAppClient.post(INSERT_DEVICE_IMEI,

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; 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-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/models/patient/vital_sign/vital_sign_res_model.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -12,6 +13,15 @@ class VitalSignsViewModel extends BaseViewModel {
VitalSignsService _vitalSignService = locator<VitalSignsService>(); VitalSignsService _vitalSignService = locator<VitalSignsService>();
VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns;
List<VitalSignHistory> get patientVitalSignsHistory => _vitalSignService.patientVitalSignsHistory;
String heightCm = "0";
String weightKg = "0";
String bodyMax = "0";
String temperatureCelcius = "0";
String hartRat = "0";
String respirationBeatPerMinute = "0";
String bloodPressure = "0 / 0";
Future getPatientVitalSign(PatiantInformtion patient) async { Future getPatientVitalSign(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -20,47 +30,51 @@ class VitalSignsViewModel extends BaseViewModel {
error = _vitalSignService.error; error = _vitalSignService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
// if (patientVitalSigns == null) {
// makeVitalSignDemoData();
// }
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
makeVitalSignDemoData(){ Future getPatientVitalSignHistory(PatiantInformtion patient, String from, String to) async {
_vitalSignService.patientVitalSigns = VitalSignData( setState(ViewState.Busy);
appointmentNo: 2016053265, await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
bloodPressureCuffLocation: 0, if (_vitalSignService.hasError) {
bloodPressureCuffSize: 0, error = _vitalSignService.error;
bloodPressureHigher: 38, setState(ViewState.Error);
bloodPressureLower: 32, } else {
bloodPressurePatientPosition: 1, patientVitalSignsHistory.forEach((element) {
bodyMassIndex: 31.11, if (heightCm == "0" || heightCm == null || heightCm == 'null') {
fio2: 0, heightCm = element.heightCm.toString();
headCircumCm: 0, }
heightCm: 150, if (weightKg == "0" || weightKg == null || weightKg == 'null') {
idealBodyWeightLbs: -2, weightKg = element.weightKg.toString();
isPainManagementDone: false, }
isVitalsRequired: true, if (bodyMax == "0" ||
leanBodyWeightLbs: 0, bodyMax == null ||
painCharacter: null, bodyMax == 'null') {
painDuration: null, bodyMax = element.bodyMassIndex.toString();
painFrequency: null, }
painLocation: null, if (temperatureCelcius == "0" ||
painScore: 0, temperatureCelcius == null ||
patientMRN: 3333274, temperatureCelcius == 'null') {
patientType: 1, temperatureCelcius = element.temperatureCelcius.toString();
pulseBeatPerMinute: 0, }
pulseRhythm: 0, if (hartRat == "0" || hartRat == null || hartRat == 'null') {
respirationBeatPerMinute: 0, hartRat = element.pulseBeatPerMinute.toString();
respirationPattern: 0, }
sao2: 0, if (respirationBeatPerMinute == "0" ||
status: 47, respirationBeatPerMinute == null ||
temperatureCelcius: 40, respirationBeatPerMinute == 'null') {
temperatureCelciusMethod: 1, respirationBeatPerMinute =
waistSizeInch: 39, element.respirationBeatPerMinute.toString();
weightKg: 70, }
); if (bloodPressure == "0 / 0" ||
bloodPressure == null ||
bloodPressure == 'null') {
bloodPressure = element.bloodPressure.toString();
}
});
setState(ViewState.Idle);
}
} }
String getBMI(var bodyMassIndex) { String getBMI(var bodyMassIndex) {

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
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-data.dart';
class PrescriptionViewModel extends BaseViewModel { class PrescriptionViewModel extends BaseViewModel {
@ -72,10 +73,15 @@ class PrescriptionViewModel extends BaseViewModel {
} }
Future getDrugToDrug( Future getDrugToDrug(
VitalSignData vital, List<GetAllergiesResModel> allergy) async { VitalSignData vital,
List<MasterKeyModel> listOfDiagnosisType,
List<GetAllergiesResModel> allergy,
PatiantInformtion patient,
List<PrescriptionModel> prescription) async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getDrugToDrug(vital, allergy); await _prescriptionService.getDrugToDrug(
vital, listOfDiagnosisType, allergy, patient, prescription);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error; error = _prescriptionService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -27,11 +27,14 @@ const LOCATIONS = const [
]; ];
enum vitalSignDetails { enum vitalSignDetails {
bodyMeasurements, BodyMeasurements,
temperature, Temperature,
pulse, Pulse,
pespiration, Prescriptions,
bloodPressure, BloodPressure,
oxygenation, Respiration,
painScale heart,
PainScale,
Weight,
Height
} }

@ -11,7 +11,7 @@ class ActivationCodeModel2 {
int isMobileFingerPrint; int isMobileFingerPrint;
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
String iMEI;
ActivationCodeModel2( ActivationCodeModel2(
{this.oTPSendType, {this.oTPSendType,
this.mobileNumber, this.mobileNumber,
@ -24,7 +24,8 @@ class ActivationCodeModel2 {
this.generalid, this.generalid,
this.isMobileFingerPrint, this.isMobileFingerPrint,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID}); this.vidaRefreshTokenID,
this.iMEI});
ActivationCodeModel2.fromJson(Map<String, dynamic> json) { ActivationCodeModel2.fromJson(Map<String, dynamic> json) {
oTPSendType = json['OTP_SendType']; oTPSendType = json['OTP_SendType'];
@ -39,6 +40,7 @@ class ActivationCodeModel2 {
isMobileFingerPrint = json['IsMobileFingerPrint']; isMobileFingerPrint = json['IsMobileFingerPrint'];
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
iMEI = json['IMEI'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -55,6 +57,7 @@ class ActivationCodeModel2 {
data['IsMobileFingerPrint'] = this.isMobileFingerPrint; data['IsMobileFingerPrint'] = this.isMobileFingerPrint;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['IMEI'] = this.iMEI;
return data; return data;
} }
} }

@ -33,36 +33,36 @@ class VitalSignData {
VitalSignData( VitalSignData(
{this.appointmentNo, {this.appointmentNo,
this.bloodPressureCuffLocation, this.bloodPressureCuffLocation,
this.bloodPressureCuffSize, this.bloodPressureCuffSize,
this.bloodPressureHigher, this.bloodPressureHigher,
this.bloodPressureLower, this.bloodPressureLower,
this.bloodPressurePatientPosition, this.bloodPressurePatientPosition,
this.bodyMassIndex, this.bodyMassIndex,
this.fio2, this.fio2,
this.headCircumCm, this.headCircumCm,
this.heightCm, this.heightCm,
this.idealBodyWeightLbs, this.idealBodyWeightLbs,
this.isPainManagementDone, this.isPainManagementDone,
this.isVitalsRequired, this.isVitalsRequired,
this.leanBodyWeightLbs, this.leanBodyWeightLbs,
this.painCharacter, this.painCharacter,
this.painDuration, this.painDuration,
this.painFrequency, this.painFrequency,
this.painLocation, this.painLocation,
this.painScore, this.painScore,
this.patientMRN, this.patientMRN,
this.patientType, this.patientType,
this.pulseBeatPerMinute, this.pulseBeatPerMinute,
this.pulseRhythm, this.pulseRhythm,
this.respirationBeatPerMinute, this.respirationBeatPerMinute,
this.respirationPattern, this.respirationPattern,
this.sao2, this.sao2,
this.status, this.status,
this.temperatureCelcius, this.temperatureCelcius,
this.temperatureCelciusMethod, this.temperatureCelciusMethod,
this.waistSizeInch, this.waistSizeInch,
this.weightKg}); this.weightKg});
VitalSignData.fromJson(Map<String, dynamic> json) { VitalSignData.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo']; appointmentNo = json['appointmentNo'];
@ -133,4 +133,5 @@ class VitalSignData {
data['weightKg'] = this.weightKg; data['weightKg'] = this.weightKg;
return data; return data;
} }
} }

@ -0,0 +1,257 @@
class VitalSignHistory {
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;
VitalSignHistory(
{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});
VitalSignHistory.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 = json['VitalSignDate'];
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;
}
}

@ -85,9 +85,9 @@ const String PATIENT_ORDERS = 'patients/patient_orders';
const String PATIENT_INSURANCE_APPROVALS = const String PATIENT_INSURANCE_APPROVALS =
'patients/patient_insurance_approvals'; 'patients/patient_insurance_approvals';
const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data';
const String CREATE_EPISODE = 'patients/create-episode'; const String CREATE_EPISODE = 'patients/create-episode';
const String UPDATE_EPISODE = 'patients/update-episode'; const String UPDATE_EPISODE = 'patients/update-episode';
const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data';
const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request'; const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request';
const String PATIENT_ADMISSION_REQUEST_2 = 'patients/admission-request-second'; const String PATIENT_ADMISSION_REQUEST_2 = 'patients/admission-request-second';
const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third'; const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third';

@ -70,7 +70,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
var request = await sharedPref.getObj(DOCTOR_PROFILE); var request = await sharedPref.getObj(DOCTOR_PROFILE);
authProvider.insertDeviceImei(request).then((value) { authProvider.insertDeviceImei(request).then((value) {
// print(value['ReturnValue']); // print(value);
changeIsLoading(false); changeIsLoading(false);
}); });
} }
@ -116,7 +116,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
IsLoginForDoctorApp: true, IsLoginForDoctorApp: true,
PatientOutSA: false); PatientOutSA: false);
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getDashboard(), //onModelReady: (model) => model.getDashboard(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,

@ -66,7 +66,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
(BuildContext context, MedicalFileViewModel model, Widget child) => (BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'medical file'.toUpperCase(), appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
body: NetworkBaseView( body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -141,7 +141,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
'Visit Date : ', TranslationBase.of(context).visitDate +
": ",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 &&
@ -174,7 +175,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
'Doctor : '.toUpperCase(), TranslationBase.of(context).doctorName +
": ".toUpperCase(),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 &&
@ -203,7 +205,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
'Clinic : ', TranslationBase.of(context).clinicName +
": ",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 &&
@ -229,7 +232,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
'Episode Number : ', TranslationBase.of(context).episode +
": ",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 &&
@ -277,7 +281,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
Texts( Texts(
'History of present illness' TranslationBase.of(context)
.historyOfPresentIllness
.toUpperCase(), .toUpperCase(),
variant: isHistoryExpand variant: isHistoryExpand
? "bodyText" ? "bodyText"
@ -376,7 +381,10 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Row( Row(
children: [ children: [
Texts('assessment'.toUpperCase(), Texts(
TranslationBase.of(context)
.assessment
.toUpperCase(),
variant: isAssessmentExpand variant: isAssessmentExpand
? "bodyText" ? "bodyText"
: '', : '',
@ -554,7 +562,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
Texts( Texts(
'Test / procedures' TranslationBase.of(context)
.test
.toUpperCase(), .toUpperCase(),
variant: isProcedureExpand variant: isProcedureExpand
? "bodyText" ? "bodyText"
@ -638,18 +647,22 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
Row( Row(
children: [ children: [
AppText( Expanded(
model child: AppText(
.medicalFileList[0] model
.entityList[0] .medicalFileList[
.timelines[ 0]
encounterNumber] .entityList[0]
.timeLineEvents[0] .timelines[
.consulations[0] encounterNumber]
.lstProcedure[index] .timeLineEvents[0]
.procName, .consulations[0]
fontWeight: .lstProcedure[
FontWeight.w700, index]
.procName,
fontWeight:
FontWeight.w700,
),
) )
], ],
), ),
@ -717,7 +730,10 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Row( Row(
children: [ children: [
Texts('physical exam'.toUpperCase(), Texts(
TranslationBase.of(context)
.physicalSystemExamination
.toUpperCase(),
variant: isPhysicalExam variant: isPhysicalExam
? "bodyText" ? "bodyText"
: '', : '',

@ -27,7 +27,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
(BuildContext context, MedicalFileViewModel model, Widget child) => (BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'medical Report'.toUpperCase(), appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
body: NetworkBaseView( body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -93,6 +93,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
if (model.medicalFileList.length != 0) if (model.medicalFileList.length != 0)
ListView.builder( ListView.builder(
//physics: , //physics: ,
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model itemCount: model
@ -108,7 +109,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Row( Row(
children: [ children: [
AppText( AppText(
'Branch : ', TranslationBase.of(context).branch +
": ",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
AppText(model AppText(model
@ -121,13 +123,19 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Row( Row(
children: [ children: [
AppText( AppText(
'Doctor : '.toUpperCase(), TranslationBase.of(context)
.doctorName
.toUpperCase() +
": ",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList[0] model
.timelines[index].doctorName, .medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
@ -136,7 +144,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Row( Row(
children: [ children: [
AppText( AppText(
'Clinic : ', TranslationBase.of(context)
.clinicName +
": ",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
AppText( AppText(

@ -681,7 +681,9 @@ class _PatientsScreenState extends State<PatientsScreen> {
PATIENTS_PROFILE, PATIENTS_PROFILE,
arguments: { arguments: {
"patient": item, "patient": item,
"patientType":patientType "patientType":patientType,
"from" : patient.getFrom,
"to" : patient.getTo,
}); });
}, },
), ),

@ -112,7 +112,7 @@ class MyReferralDetailScreen extends StatelessWidget {
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: model.patientArrivalList[0], patient: model.patientArrivalList[0],
route: PATIENT_VITAL_SIGN, route: VITAL_SIGN_DETAILS /*PATIENT_VITAL_SIGN*/,
nameLine1: TranslationBase.of(context).vital, nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs, nameLine2: TranslationBase.of(context).signs,
icon: 'heartbeat.png'), icon: 'heartbeat.png'),

@ -0,0 +1,217 @@
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class LineChartCurved extends StatelessWidget {
final String title;
final List<TimeSeriesSales2> timeSeries;
final int indexes;
LineChartCurved({this.title, this.timeSeries, this.indexes});
List<int> xAxixs = List();
List<double> yAxixs = List();
@override
Widget build(BuildContext context) {
getXaxix();
getYaxix();
return AspectRatio(
aspectRatio: 1.1,
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18)),
// color: Colors.white,
),
child: Stack(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(
height: 4,
),
Text(
title,
style: TextStyle(
color: Colors.black,
fontSize: 15,
letterSpacing: 2),
textAlign: TextAlign.center,
),
SizedBox(height: 10,),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 18.0, left: 16.0),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
),
),
),
const SizedBox(
height: 10,
),
],
),
],
),
),
);
}
getXaxix() {
for (int index = 0; index < timeSeries.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries.length) {
xAxixs.add(mIndex);
}
}
}
getYaxix() {
int indexess= (timeSeries.length*0.30).toInt();
for (int index = 0; index < timeSeries.length; index++) {
int mIndex = indexess * index;
if (mIndex < timeSeries.length) {
yAxixs.add(timeSeries[mIndex].sales);
}
}
}
LineChartData sampleData1(context) {
return LineChartData(
lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
color: Colors.black,
fontSize: 10,
),
rotateAngle:-65,
//rotateAngle:-65,
margin: 22,
getTitles: (value) {
if (timeSeries.length < 15) {
if (timeSeries.length > value.toInt()) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
} else
return '';
} else {
if (value.toInt() == 0)
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == timeSeries.length - 1)
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
}
}
return '';
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
getTitles: (value) {
// if (timeSeries.length < 10) {
// return '${value.toInt()}';
// } else {
// if (value == getMinY())
// return '${value.toInt()}';
// if (value == getMaxY())
// return '${value.toInt()}';
// if (yAxixs.contains(value)) {
// return '${value.toInt()}';
// }
// return '';
// }
return '${value.toInt()}';
},
margin: 12,
),
),
borderData: FlBorderData(
show: true,
border: const Border(
bottom: BorderSide(
color: Colors.black,
width: 0.5,
),
left: BorderSide(
color: Colors.black,
),
right: BorderSide(
color: Colors.black,
),
top: BorderSide(
color: Colors.transparent,
),
),
),
minX: 0,
maxX: (timeSeries.length - 1).toDouble(),
maxY: getMaxY()+0.3,
minY: getMinY(),
lineBarsData: getData(context),
);
}
double getMaxY() {
double max = 0;
timeSeries.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
return max.roundToDouble() ;
}
double getMinY() {
double min = timeSeries[0].sales;
timeSeries.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
int value = min.toInt();
return value.toDouble();
}
List<LineChartBarData> getData(context) {
List<FlSpot> spots = List();
for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [Theme.of(context).primaryColor],
barWidth: 5,
isStrokeCapRound: true,
dotData: FlDotData(
show: false,
),
belowBarData: BarAreaData(
show: false,
),
);
return [
lineChartBarData1,
];
}
}

@ -0,0 +1,257 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class LineChartCurvedBloodPressure extends StatelessWidget {
final String title;
final List<TimeSeriesSales2> timeSeries1;
final List<TimeSeriesSales2> timeSeries2;
final int indexes;
LineChartCurvedBloodPressure(
{this.title, this.timeSeries1, this.indexes, this.timeSeries2});
List<int> xAxixs = List();
List<double> yAxixs = List();
@override
Widget build(BuildContext context) {
getXaxix();
return AspectRatio(
aspectRatio: 1.1,
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18)),
// color: Colors.white,
),
child: Stack(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(
height: 15,
),
Text(
title,
style: TextStyle(
color: Colors.black, fontSize: 15, letterSpacing: 2),
textAlign: TextAlign.center,
),
SizedBox(
height: 10,
),
Expanded(
child: Padding(
padding:
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
),
),
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Container(
width: 20,
height: 20,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Theme.of(context).primaryColor),
),
SizedBox(width: 5,),
AppText(TranslationBase.of(context).systolicLng)
],
),
SizedBox(width: 15,),
Row(
children: [
Container(
width: 20,
height: 20,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.grey),
),
SizedBox(width: 5,),
AppText(TranslationBase.of(context).diastolicLng)
],
),
],
)
],
),
],
),
),
);
}
getXaxix() {
for (int index = 0; index < timeSeries1.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries1.length) {
xAxixs.add(mIndex);
}
}
}
LineChartData sampleData1(context) {
return LineChartData(
lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
color: Colors.black,
fontSize: 10,
),
rotateAngle: -65,
//rotateAngle:-65,
margin: 22,
getTitles: (value) {
if (timeSeries1.length < 15) {
if (timeSeries1.length > value.toInt()) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
} else
return '';
} else {
if (value.toInt() == 0)
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == timeSeries1.length - 1)
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
}
}
return '';
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
getTitles: (value) {
return '${value.toInt()}';
},
margin: 12,
),
),
borderData: FlBorderData(
show: true,
border: const Border(
bottom: BorderSide(
color: Colors.black,
width: 0.5,
),
left: BorderSide(
color: Colors.black,
),
right: BorderSide(
color: Colors.black,
),
top: BorderSide(
color: Colors.transparent,
),
),
),
minX: 0,
maxX: (timeSeries1.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: getMinY(),
lineBarsData: getData(context),
);
}
double getMaxY() {
double max = 0;
timeSeries1.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
timeSeries2.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
return max.roundToDouble();
}
double getMinY() {
double min = timeSeries1[0].sales;
timeSeries1.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
timeSeries2.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
int value = min.toInt();
return value.toDouble();
}
List<LineChartBarData> getData(context) {
List<FlSpot> spots = List();
for (int index = 0; index < timeSeries1.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
}
List<FlSpot> spots2 = List();
for (int index = 0; index < timeSeries2.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [Theme.of(context).primaryColor],
barWidth: 5,
isStrokeCapRound: true,
dotData: FlDotData(
show: false,
),
belowBarData: BarAreaData(
show: false,
),
);
final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: spots2,
isCurved: true,
colors: [Colors.grey],
barWidth: 5,
isStrokeCapRound: true,
dotData: FlDotData(
show: false,
),
belowBarData: BarAreaData(
show: false,
),
);
return [lineChartBarData1, lineChartBarData2];
}
}

@ -18,6 +18,8 @@ class PatientVitalSignScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String from = routeArgs['from'];
String to = routeArgs['to'];
return BaseView<VitalSignsViewModel>( return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientVitalSign(patient), onModelReady: (model) => model.getPatientVitalSign(patient),
@ -115,7 +117,7 @@ class PatientVitalSignScreen extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( /*Row(
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).waistSize} :", "${TranslationBase.of(context).waistSize} :",
@ -133,7 +135,7 @@ class PatientVitalSignScreen extends StatelessWidget {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
], ],
), ),*/
Row( Row(
children: [ children: [
AppText( AppText(

@ -0,0 +1,148 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_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/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class VitalSignBloodPressureWidget extends StatefulWidget {
final List<VitalSignHistory> vitalList;
final String title1;
final String title2;
final String title3;
final String viewKey1;
final String viewKey2;
VitalSignBloodPressureWidget(
{Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2});
@override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
}
class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(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(projectViewModel),
),
],
),
),
);
}
List<TableRow> fullData(ProjectViewModel projectViewModel) {
List<TableRow> tableRow = [];
tableRow.add(TableRow(children: [
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
),
),
child: Center(
child: AppText(
TranslationBase.of(context).date,
color: Colors.white,
),
),
height: 60,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: AppText(widget.title2, color: Colors.white),
),
height: 60),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
),
),
child: Center(
child: AppText(widget.title3, color: Colors.white),
),
height: 60),
),
]));
widget.vitalList.forEach((vital) {
var data = vital.toJson()[widget.viewKey1];
DateTime elementDate =
DateUtils.getDateTimeFromServerFormat(vital.createdOn);
if (data != 0)
tableRow.add(TableRow(children: [
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
'${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ',
textAlign: TextAlign.center,
),
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
'${vital.toJson()[widget.viewKey1]}',
textAlign: TextAlign.center,
),
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
'${vital.toJson()[widget.viewKey2]}',
textAlign: TextAlign.center,
),
),
),
),
]));
});
return tableRow;
}
}

@ -1,246 +1,197 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../config/shared_pref_kay.dart'; class VitalSignDetailsScreen extends StatelessWidget {
import '../../../../config/size_config.dart';
import '../../../../lookups/patient_lookup.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../models/patient/vital_sign/vital_sign_res_model.dart';
import '../../../../routes.dart';
import '../../../../screens/patients/profile/vital_sign/vital_sign_item.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); int appointmentNo;
int projectID;
bool isNotOneAppointment;
VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true});
class VitalSignDetailsScreen extends StatefulWidget {
// VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key);
@override @override
_VitalSignDetailsScreenState createState() => _VitalSignDetailsScreenState(); Widget build(BuildContext context) {
}
class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
VitalSignResModel vitalSing;
String url = "assets/images/";
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:
*@desc: getVitalSignList Function
*/
getVitalSignList(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String from = routeArgs['from'];
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); String to = routeArgs['to'];
int inOutpatientType = 1; String imageBasePath = 'assets/images/';
if (type == '0') {
inOutpatientType = 2;
}
print(type);
VitalSignReqModel vitalSignReqModel = VitalSignReqModel(
patientID: patient.patientId,
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
inOutpatientType: inOutpatientType,
languageID: 2,
transNo:
patient.admissionNo != null ? int.parse(patient.admissionNo) : 0);
model.getPatientVitalSign(vitalSignReqModel.toJson());
}
final double contWidth = SizeConfig.realScreenWidth * 0.70;
@override return BaseView<VitalSignsViewModel>(
Widget build(BuildContext context) { onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to),
final routeArgs = ModalRoute.of(context).settings.arguments as Map; builder: (_, mode, widget) => AppScaffold(
vitalSing = routeArgs['vitalSing']; isShowAppBar: true,
return BaseView<PatientViewModel>( baseViewModel: mode,
onModelReady: (model) => getVitalSignList(context, model),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).vitalSign, appBarTitle: TranslationBase.of(context).vitalSign,
body: model.patientVitalSignOrderdSubList.length == 0 body: mode.patientVitalSignsHistory.length > 0
? DrAppEmbeddedError( ? Container(
error: 'You don\'t have any vital Sings') child: ListView(
: Container( children: <Widget>[
child: Column( Row(
children: <Widget>[ children: <Widget>[
Row( InkWell(
children: <Widget>[ onTap: () =>isNotOneAppointment? Navigator.push(
InkWell( context,
onTap: () { FadePage(
Navigator.of(context).pushNamed( page: VitalSignItemDetailsScreen(
BODY_MEASUREMENTS, pageKey: vitalSignDetails.Height,
arguments: { pageTitle: TranslationBase.of(context).height,
'title': TranslationBase.of(context) vitalList: mode.patientVitalSignsHistory,
.bodyMeasurements, ),
'key': ),
vitalSignDetails.bodyMeasurements ):null,
}); child: Container(
}, child: VitalSignItem(
child: Container( des: TranslationBase.of(context).height,
child: VitalSignItem( imagePath: "${imageBasePath}vital_height.png",
des: TranslationBase.of(context) lastVal: mode.heightCm,
.bodyMeasurements, unit: TranslationBase.of(context).cm,
url: url + 'heartbeat.png', ),
lastVal: model ),
.patientVitalSignOrderdSubList[0] ),
.heightCm InkWell(
.toString(), onTap: () => isNotOneAppointment ? Navigator.push(
unit: 'Cm', context,
), FadePage(
), page: VitalSignItemDetailsScreen(
), pageKey: vitalSignDetails.Weight,
InkWell( pageTitle: TranslationBase.of(context).weight,
onTap: () { vitalList: mode.patientVitalSignsHistory,
Navigator.of(context).pushNamed( ),
BODY_MEASUREMENTS, ),
arguments: { ):null,
'title': TranslationBase.of(context) child: VitalSignItem(
.temperature, des: TranslationBase.of(context).weight,
'key': vitalSignDetails.temperature, imagePath: "${imageBasePath}vital_weight.png",
}); unit: TranslationBase.of(context).kg,
}, lastVal: mode.weightKg,
child: Container( ),
child: VitalSignItem( ),
des: TranslationBase.of(context) ],
.temperature, ),
url: url + 'heartbeat.png', Row(
lastVal: model children: <Widget>[
.patientVitalSignOrderdSubList[0] InkWell(
.temperatureCelcius onTap: () => isNotOneAppointment ? Navigator.push(
.toString(), context,
unit: 'C', FadePage(
), page: VitalSignItemDetailsScreen(
), pageKey: vitalSignDetails.BodyMeasurements,
), pageTitle: TranslationBase.of(context)
], .bodyMeasurements,
vitalList: mode.patientVitalSignsHistory,
),
),
): null,
child: VitalSignItem(
des: TranslationBase.of(context).body,
imagePath: "${imageBasePath}vital_body_mass.png",
lastVal: mode.bodyMax,
unit: TranslationBase.of(context).mass,
),
),
InkWell(
onTap: () => isNotOneAppointment ? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Temperature,
pageTitle:
TranslationBase.of(context).temperature,
vitalList: mode.patientVitalSignsHistory,
),
),
):null,
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context).temperature,
imagePath: "${imageBasePath}vital_temperature.png",
lastVal: mode.temperatureCelcius,
unit: TranslationBase.of(context).tempC,
), ),
Row( ),
children: <Widget>[ ),
InkWell( ],
onTap: () { ),
Navigator.of(context).pushNamed( Row(
BODY_MEASUREMENTS, children: <Widget>[
arguments: { InkWell(
'title': onTap: () => isNotOneAppointment ? Navigator.push(
TranslationBase.of(context).pulse, context,
'key': vitalSignDetails.pulse FadePage(
}); page: VitalSignItemDetailsScreen(
}, pageKey: vitalSignDetails.heart,
child: VitalSignItem( pageTitle: TranslationBase.of(context).heart,
des: TranslationBase.of(context).pulse, vitalList: mode.patientVitalSignsHistory,
url: url + 'heartbeat.png', ),
lastVal: model
.patientVitalSignOrderdSubList[0]
.pulseBeatPerMinute
.toString(),
unit: 'M',
),
),
InkWell(
onTap: () {
Navigator.of(context).pushNamed(
BODY_MEASUREMENTS,
arguments: {
'title': TranslationBase.of(context)
.respiration,
'key': vitalSignDetails.pespiration
});
},
child: VitalSignItem(
des:
TranslationBase.of(context).respiration,
url: url + 'heartbeat.png',
lastVal: model
.patientVitalSignOrderdSubList[0]
.respirationBeatPerMinute
.toString(),
unit: 'M',
),
),
],
), ),
Row( ):null,
children: <Widget>[ child: VitalSignItem(
InkWell( des: TranslationBase.of(context).heart,
onTap: () { imagePath: "${imageBasePath}vital_heart_rate.png",
Navigator.of(context).pushNamed( lastVal: mode.hartRat,
BODY_MEASUREMENTS, unit: TranslationBase.of(context).bpm,
arguments: { ),
'title': TranslationBase.of(context) ),
.bloodPressure, InkWell(
'key': vitalSignDetails.bloodPressure onTap: () => isNotOneAppointment ? Navigator.push(
}); context,
}, FadePage(
child: VitalSignItem( page: VitalSignItemDetailsScreen(
des: TranslationBase.of(context) pageKey: vitalSignDetails.Respiration,
.bloodPressure, pageTitle:
url: url + 'heartbeat.png', TranslationBase.of(context).respirationRate,
lastVal: model vitalList: mode.patientVitalSignsHistory,
.patientVitalSignOrderdSubList[0] ),
.bloodPressure
.toString(),
unit: '',
),
),
InkWell(
onTap: () {
Navigator.of(context).pushNamed(
BODY_MEASUREMENTS,
arguments: {
'title': TranslationBase.of(context)
.oxygenation,
'key': vitalSignDetails.oxygenation
});
},
child: VitalSignItem(
des:
TranslationBase.of(context).oxygenation,
url: url + 'heartbeat.png',
lastVal: model
.patientVitalSignOrderdSubList[0].fIO2
.toString(),
unit: '',
),
),
],
), ),
Row( ):null,
mainAxisAlignment: MainAxisAlignment.center, child: VitalSignItem(
children: <Widget>[ des: TranslationBase.of(context).respirationRate,
InkWell( imagePath: "${imageBasePath}vital_respiration.png",
onTap: () { lastVal: mode.respirationBeatPerMinute,
Navigator.of(context).pushNamed( unit: TranslationBase.of(context).respirationSigns,
BODY_MEASUREMENTS, ),
arguments: { ),
'title': TranslationBase.of(context) ],
.painScale, ),
'key': vitalSignDetails.painScale Row(
}); mainAxisAlignment: MainAxisAlignment.center,
}, children: <Widget>[
child: VitalSignItem( InkWell(
des: TranslationBase onTap: () => isNotOneAppointment ? Navigator.push(
.of(context) context,
.painScale, FadePage(
url: url + 'heartbeat.png', page: VitalSignItemDetailsScreen(
), pageKey: vitalSignDetails.BloodPressure,
), pageTitle: TranslationBase.of(context).bloodPressure,
], vitalList: mode.patientVitalSignsHistory,
),
), ),
], ):null,
child: VitalSignItem(
des: TranslationBase.of(context).bloodPressure,
imagePath: "${imageBasePath}vital_blood-pressure.png",
lastVal: mode.bloodPressure,
unit: TranslationBase.of(context).sysDias,
),
),
],
),
],
),
)
: Center(
child: AppText('No Data'),
), ),
),),); ),
);
} }
} }

@ -0,0 +1,124 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_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/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class VitalSignDetailsWidget extends StatefulWidget {
final List<VitalSignHistory> 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) {
ProjectViewModel projectViewModel = Provider.of(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(projectViewModel),
),
],
),
),
);
}
List<TableRow> fullData(ProjectViewModel projectViewModel) {
List<TableRow> tableRow = [];
tableRow.add(TableRow(children: [
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
),
),
child: Center(
child: AppText(
TranslationBase.of(context).date,
color: Colors.white,
),
),
height: 60,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
),
),
child: Center(
child: AppText(widget.title2, color: Colors.white),
),
height: 60),
)
]));
widget.vitalList.forEach((vital) {
var data = vital.toJson()[widget.viewKey];
DateTime elementDate =
DateUtils.getDateTimeFromServerFormat(vital.createdOn);
if (data != 0)
tableRow.add(TableRow(children: [
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
'${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ',
textAlign: TextAlign.center,
),
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
'${vital.toJson()[widget.viewKey]}',
textAlign: TextAlign.center,
),
),
),
),
]));
});
return tableRow;
}
}

@ -1,32 +1,23 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../../../config/size_config.dart';
import '../../../../widgets/shared/rounded_container_widget.dart';
/*
*@author: Elham Rababah
*@Date:03/6/2020
*@param:
*@return:
*@desc: VitalSignItem
*/
class VitalSignItem extends StatelessWidget { class VitalSignItem extends StatelessWidget {
const VitalSignItem( const VitalSignItem(
{Key key, {Key key,
@required this.url,
@required this.des, @required this.des,
this.lastVal = 'N/A', this.lastVal = 'N/A',
this.unit = '', this.unit = '',
this.height, this.height,
this.width}) this.width,
@required this.imagePath})
: super(key: key); : super(key: key);
final String url;
final String des; final String des;
final String lastVal; final String lastVal;
final String unit; final String unit;
final String imagePath;
final double height; final double height;
final double width; final double width;
@ -34,52 +25,70 @@ class VitalSignItem extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return RoundedContainer( return RoundedContainer(
margin: 0.025 * SizeConfig.realScreenWidth, margin: 0.025 * SizeConfig.realScreenWidth,
height: 0.14 * SizeConfig.realScreenHeight, height: 0.15 * SizeConfig.realScreenHeight,
width: 0.45 * SizeConfig.realScreenWidth, width: 0.45 * SizeConfig.realScreenWidth,
child: Container( child: Container(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Row( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Container(
flex: 2, height: 0.10 * SizeConfig.realScreenHeight,
child: Text( child: Row(
des,
style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier,
color: HexColor('#B8382C'),
fontWeight: FontWeight.bold),
),
),
Expanded(
flex: 1,
child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Image.asset( flex: 2,
url, child: Align(
height: SizeConfig.heightMultiplier * 7, alignment: Alignment.topLeft,
), child: Padding(
), padding: const EdgeInsets.all(8.0),
Expanded( child: Text(
child: RichText( des,
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
new TextSpan(text: lastVal),
new TextSpan(
text: ' ${unit}',
style: TextStyle( style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier,
color: HexColor('#B8382C'), color: HexColor('#B8382C'),
fontWeight: FontWeight.bold,
), ),
), ),
], ),
), ),
)) ),
Expanded(
flex: 1,
child: Container(
child: Image.asset(
imagePath,
width: 40,
height: 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'),
),
),
]),
),
),
),
),
),
], ],
), ),
), ),

File diff suppressed because one or more lines are too long

@ -1,16 +1,15 @@
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/widgets/patients/vital_sign_details_wideget.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart';
import 'package:doctor_app_flutter/widgets/shared/charts/app_time_series_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/* import 'package:charts_flutter/flutter.dart' as charts;
*@author: Elham Rababah
*@Date:03/6/2020 import 'LineChartCurved.dart';
*@param:
*@return:
*@desc: VitalSingChartAndDetials
*/
class VitalSingChartAndDetials extends StatelessWidget { class VitalSingChartAndDetials extends StatelessWidget {
VitalSingChartAndDetials({ VitalSingChartAndDetials({
Key key, Key key,
@ -21,30 +20,47 @@ class VitalSingChartAndDetials extends StatelessWidget {
@required this.title2, @required this.title2,
}) : super(key: key); }) : super(key: key);
final List<VitalSignResModel> vitalList; final List<VitalSignHistory> vitalList;
final String name; final String name;
final String viewKey; final String viewKey;
final String title1; final String title1;
final String title2; final String title2;
List<TimeSeriesSales2> timeSeriesData = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
generateData();
return Column( return Column(
children: <Widget>[ children: <Widget>[
AppExpandableNotifier( AppExpandableNotifier(
headerWid: AppTimeSeriesChart( // isExpand: true,
headerWid: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,),
bodyWid: VitalSignDetailsWidget(
vitalList: vitalList, vitalList: vitalList,
chartName: name, title1: title1,
title2: title2,
viewKey: viewKey, viewKey: viewKey,
), ),
bodyWid: VitalSignDetailsWidget(
vitalList: vitalList.reversed.toList(),
title1: '${title1}',
title2: '${title2}',
viewKey: '${viewKey}',
),
), ),
], ],
); );
} }
generateData() {
if (vitalList.length > 0) {
vitalList.reversed.toList().forEach(
(element) {
DateTime elementDate = DateUtils.getDateTimeFromServerFormat(element.createdOn);
if( element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0)
timeSeriesData.add(
TimeSeriesSales2(
new DateTime(elementDate.year, elementDate.month, elementDate.day),
element.toJson()[viewKey].toDouble(),
),
);
},
);
}
return timeSeriesData.reversed.toList();
}
} }

@ -0,0 +1,88 @@
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/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart';
import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'LineChartCurved.dart';
import 'LineChartCurvedBloodPressure.dart';
class VitalSingChartBloodPressure extends StatelessWidget {
VitalSingChartBloodPressure({
Key key,
@required this.vitalList,
@required this.name,
@required this.viewKey1,
@required this.viewKey2,
@required this.title1,
@required this.title2,
@required this.title3,
}) : super(key: key);
final List<VitalSignHistory> vitalList;
final String name;
final String viewKey1;
final String viewKey2;
final String title1;
final String title2;
final String title3;
List<TimeSeriesSales2> timeSeriesData1 = [];
List<TimeSeriesSales2> timeSeriesData2 = [];
@override
Widget build(BuildContext context) {
generateData();
return Column(
children: <Widget>[
AppExpandableNotifier(
// isExpand: true,
headerWid: LineChartCurvedBloodPressure(
title: name,
timeSeries1: timeSeriesData1,
timeSeries2: timeSeriesData2,
indexes: timeSeriesData1.length ~/ 5.5,
),
bodyWid: VitalSignBloodPressureWidget(
vitalList: vitalList,
title1: title1,
title2: title2,
title3: title3,
viewKey1: viewKey1,
viewKey2: viewKey2,
),
),
],
);
}
generateData() {
if (vitalList.length > 0) {
vitalList.reversed.toList().forEach(
(element) {
DateTime elementDate =
DateUtils.getDateTimeFromServerFormat(element.createdOn);
if (element.toJson()[viewKey1]?.toInt() != 0)
timeSeriesData1.add(
TimeSeriesSales2(
new DateTime(
elementDate.year, elementDate.month, elementDate.day),
element.toJson()[viewKey1].toDouble(),
),
);
if (element.toJson()[viewKey2]?.toInt() != 0)
timeSeriesData2.add(
TimeSeriesSales2(
new DateTime(
elementDate.year, elementDate.month, elementDate.day),
element.toJson()[viewKey2].toDouble(),
),
);
},
);
}
}
}

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -25,13 +26,13 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
addPrescriptionForm( addPrescriptionForm(context, PrescriptionViewModel model,
context, PrescriptionViewModel model, PatiantInformtion patient) { PatiantInformtion patient, prescription) {
showModalBottomSheet( showModalBottomSheet(
isScrollControlled: true, isScrollControlled: true,
context: context, context: context,
builder: (BuildContext bc) { builder: (BuildContext bc) {
return PrescriptionFormWidget(model, patient); return PrescriptionFormWidget(model, patient, prescription);
}); });
} }
@ -56,8 +57,7 @@ postProcedure(
postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.clinicID = patient.clinicId;
postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.patientMRN = patient.patientMRN;
postProcedureReqModel.vidaAuthTokenID =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY";
sss.add(PrescriptionRequestModel( sss.add(PrescriptionRequestModel(
covered: true, covered: true,
dose: 1, dose: 1,
@ -86,13 +86,15 @@ postProcedure(
class PrescriptionFormWidget extends StatefulWidget { class PrescriptionFormWidget extends StatefulWidget {
final PrescriptionViewModel model; final PrescriptionViewModel model;
PatiantInformtion patient; PatiantInformtion patient;
PrescriptionFormWidget(this.model, this.patient); List<PrescriptionModel> prescriptionList;
PrescriptionFormWidget(this.model, this.patient, this.prescriptionList);
@override @override
_PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState();
} }
class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> { class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
int selectedType;
TextEditingController durationController = TextEditingController(); TextEditingController durationController = TextEditingController();
TextEditingController strengthController = TextEditingController(); TextEditingController strengthController = TextEditingController();
TextEditingController routeController = TextEditingController(); TextEditingController routeController = TextEditingController();
@ -127,6 +129,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
selectedType = 1;
referToList = List(); referToList = List();
strengthList = List(); strengthList = List();
routeList = List(); routeList = List();
@ -252,6 +255,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
referToList.add(urgentOrder); referToList.add(urgentOrder);
} }
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
@ -301,7 +310,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: model.drugsList, list: model.drugsList,
attributeName: 'Description', attributeName: 'GenericName',
attributeValueId: 'ItemId', attributeValueId: 'ItemId',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
@ -344,10 +353,22 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Row( child: Row(
children: [ children: [
AppText('Order Type'), AppText('Order Type'),
Radio(), Radio(
activeColor: Color(0xFFB9382C),
value: 0,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
},
),
Text('Regular'), Text('Regular'),
Radio( Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1, value: 1,
onChanged: (value) {
setSelectedType(value);
},
), ),
Text('Urgent'), Text('Urgent'),
], ],
@ -694,8 +715,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.addMedication, .addMedication,
onPressed: () { onPressed: () {
formKey.currentState.save(); formKey.currentState.save();
// Navigator.pop(context); Navigator.pop(context);
// openDrugToDrug(); openDrugToDrug();
if (strength == null || if (strength == null ||
route == null || route == null ||
frequency == null || frequency == null ||
@ -800,9 +821,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column( child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
DrugToDrug(widget.patient), DrugToDrug(widget.patient, widget.prescriptionList),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).addMedication, title: TranslationBase.of(context).addMedication,
onPressed: () { onPressed: () {

@ -1,5 +1,8 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/prescription_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
@ -16,13 +19,15 @@ import 'package:flutter/material.dart';
class DrugToDrug extends StatefulWidget { class DrugToDrug extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
DrugToDrug(this.patient); final prescription;
DrugToDrug(this.patient, this.prescription);
@override @override
_DrugToDrug createState() => _DrugToDrug(); _DrugToDrug createState() => _DrugToDrug();
} }
class _DrugToDrug extends State<DrugToDrug> { class _DrugToDrug extends State<DrugToDrug> {
int typeID = 1; int typeID = 1;
bool isLoaded = false;
List<Map<dynamic, dynamic>> expandableList = [ List<Map<dynamic, dynamic>> expandableList = [
{'name': 'CRITICAL'}, {'name': 'CRITICAL'},
{'name': 'HIGH'}, {'name': 'HIGH'},
@ -30,54 +35,59 @@ class _DrugToDrug extends State<DrugToDrug> {
{'name': 'LOW'}, {'name': 'LOW'},
{'name': 'INFO'}, {'name': 'INFO'},
]; ];
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: 2954208, //widget.patient.patientMRN,
episodeId: 210011002, //widget.patient.episodeNo,
appointmentNo: 2016055308, //widget.patient.appointmentNo,
doctorID: '',
editedBy: '');
VitalSignsViewModel model = new VitalSignsViewModel();
SOAPViewModel model2 = new SOAPViewModel();
@override @override
void initState() { void initState() {
getTypeID(); getTypeID();
getRequestedData();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( return isLoaded == true
patientMRN: 2954208, //widget.patient.patientMRN, ? BaseView<PrescriptionViewModel>(
episodeId: 210011002, //widget.patient.episodeNo, onModelReady: (model3) => model3.getDrugToDrug(
appointmentNo: 2016055308, //widget.patient.appointmentNo, model.patientVitalSigns,
doctorID: '', model2.listOfDiagnosisType,
editedBy: ''); model2.patientAllergiesList,
widget.patient,
return BaseView<VitalSignsViewModel>( widget.prescription),
onModelReady: (model) => model.getPatientVitalSign(widget.patient), builder: (BuildContext context, PrescriptionViewModel model3,
builder: (BuildContext context, model, Widget child) { Widget child) =>
return BaseView<SOAPViewModel>( NetworkBaseView(
onModelReady: (model2) => baseViewModel: model3,
model2.getPatientAllergy(generalGetReqForSOAP), child: Container(
builder: (BuildContext context, model2, Widget child) { height: SizeConfig.realScreenHeight * .4,
return BaseView<PrescriptionViewModel>( child: new ListView.builder(
onModelReady: (model3) => model3.getDrugToDrug( itemCount: expandableList.length,
model.patientVitalSigns, model2.patientAllergiesList), itemBuilder: (context, i) {
builder: (BuildContext context, return new ExpansionTile(
PrescriptionViewModel model3, Widget child) => title: new Text(
NetworkBaseView( expandableList[i]['name'],
baseViewModel: model3, style: new TextStyle(
child: Container( fontSize: 20.0,
height: SizeConfig.realScreenHeight * .45, fontWeight: FontWeight.bold,
child: new ListView.builder( fontStyle: FontStyle.italic),
itemCount: expandableList.length, ),
itemBuilder: (context, i) { children: <Widget>[Text('Hi')],
return new ExpansionTile( );
title: new Text( }))))
expandableList[i]['name'], : Container(
style: new TextStyle( height: SizeConfig.realScreenHeight * .45,
fontSize: 20.0, child: Center(
fontWeight: FontWeight.bold, child: CircularProgressIndicator(
fontStyle: FontStyle.italic), valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
), )));
children: <Widget>[Text('Hi')],
);
}))));
});
});
} }
getTypeID() async { getTypeID() async {
@ -86,4 +96,15 @@ class _DrugToDrug extends State<DrugToDrug> {
typeID = type; typeID = type;
}); });
} }
getRequestedData() async {
await model.getPatientVitalSign(widget.patient);
await model2.getPatientAllergy(generalGetReqForSOAP);
await model2.getMasterLookup(MasterKeysService.DiagnosisType);
if (model.state == ViewState.Idle && model2.state == ViewState.Idle) {
setState(() {
isLoaded = true;
});
}
}
} }

@ -128,7 +128,10 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
InkWell( InkWell(
onTap: () { onTap: () {
addPrescriptionForm( addPrescriptionForm(
context, model, patient); context,
model,
patient,
model.prescriptionList);
//model.postPrescription(); //model.postPrescription();
}, },
child: CircleAvatar( child: CircleAvatar(
@ -219,7 +222,10 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
onTap: () { onTap: () {
addPrescriptionForm( addPrescriptionForm(
context, model, patient); context,
model,
patient,
model.prescriptionList);
//model.postPrescription(); //model.postPrescription();
}, },
), ),
@ -453,6 +459,26 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.edit), .edit),
onTap: () { onTap: () {
updatePrescriptionForm( updatePrescriptionForm(
startDate:
model.prescriptionList[0].entityList[index].startDate
.toString(),
dose: model
.prescriptionList[
0]
.entityList[
index]
.doseTimingID
.toString(),
frequency:
model.prescriptionList[0].entityList[index].frequencyID
.toString(),
rouat: model
.prescriptionList[
0]
.entityList[
index]
.routeID
.toString(),
patient: patient:
patient, patient,
drugId: model drugId: model
@ -466,17 +492,13 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
0] 0]
.entityList[ .entityList[
index] index]
.medicationName, .doseDetail,
remarks: model remarks: model
.prescriptionList[ .prescriptionList[0]
0] .entityList[index]
.entityList[
index]
.remarks, .remarks,
model: model: model,
model, context: context);
context:
context);
//model.postPrescription(); //model.postPrescription();
}, },
), ),
@ -500,8 +522,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
addPrescriptionForm( addPrescriptionForm(context, model,
context, model, patient); patient, model.prescriptionList);
//model.postPrescription(); //model.postPrescription();
}, },
child: CircleAvatar( child: CircleAvatar(
@ -577,7 +599,11 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
int drugId, int drugId,
String remarks, String remarks,
PrescriptionViewModel model, PrescriptionViewModel model,
PatiantInformtion patient}) { PatiantInformtion patient,
String rouat,
String frequency,
String dose,
String startDate}) {
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
TextEditingController doseController = TextEditingController(); TextEditingController doseController = TextEditingController();
TextEditingController frequencyController = TextEditingController(); TextEditingController frequencyController = TextEditingController();
@ -587,11 +613,11 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
isScrollControlled: true, isScrollControlled: true,
builder: (BuildContext bc) { builder: (BuildContext bc) {
return Container( return Container(
height: 600, height: MediaQuery.of(context).size.height * 0.73,
child: Form( child: Form(
child: Padding( child: Padding(
padding: padding:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -626,7 +652,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields( child: TextFields(
hintText: 'Dose', hintText: 'Dose Time',
controller: doseController, controller: doseController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
), ),
@ -649,7 +675,6 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
AppText('Remarks'),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
@ -667,7 +692,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
height: 12.0, height: 12.0,
), ),
SizedBox( SizedBox(
height: 140.0, height: MediaQuery.of(context).size.height * 0.12,
), ),
Container( Container(
margin: margin:
@ -679,6 +704,10 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
title: 'update prescription'.toUpperCase(), title: 'update prescription'.toUpperCase(),
onPressed: () { onPressed: () {
updatePrescription( updatePrescription(
startDate: startDate,
doseId: dose,
frequencyId: frequency,
routeId: rouat,
patient: patient, patient: patient,
model: model, model: model,
drugId: drugId, drugId: drugId,
@ -704,10 +733,14 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
updatePrescription( updatePrescription(
{PrescriptionViewModel model, {PrescriptionViewModel model,
int drugId, int drugId,
String frequencyId,
String remarks, String remarks,
String dose, String dose,
String doseId,
String frequency, String frequency,
String route, String route,
String routeId,
String startDate,
PatiantInformtion patient}) async { PatiantInformtion patient}) async {
//PrescriptionViewModel model = PrescriptionViewModel(); //PrescriptionViewModel model = PrescriptionViewModel();
PostPrescriptionReqModel updatePrescriptionReqModel = PostPrescriptionReqModel updatePrescriptionReqModel =
@ -718,21 +751,22 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
updatePrescriptionReqModel.clinicID = patient.clinicId; updatePrescriptionReqModel.clinicID = patient.clinicId;
updatePrescriptionReqModel.episodeID = patient.episodeNo; updatePrescriptionReqModel.episodeID = patient.episodeNo;
updatePrescriptionReqModel.patientMRN = patient.patientMRN; updatePrescriptionReqModel.patientMRN = patient.patientMRN;
updatePrescriptionReqModel.vidaAuthTokenID =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY";
sss.add(PrescriptionRequestModel( sss.add(PrescriptionRequestModel(
covered: true, covered: true,
dose: frequency.isNotEmpty ? int.parse(dose) : 1, dose: 9, //frequency.isNotEmpty ? int.parse(dose) : 1,
itemId: drugId, itemId: drugId,
doseUnitId: 1, doseUnitId: 2,
route: frequency.isNotEmpty ? int.parse(route) : 1, route: route.isNotEmpty ? int.parse(route) : int.parse(routeId),
frequency: frequency.isNotEmpty ? int.parse(frequency) : 1, frequency: frequency.isNotEmpty
? int.parse(frequency)
: int.parse(frequencyId),
remarks: remarks.isEmpty ? '' : remarks, remarks: remarks.isEmpty ? '' : remarks,
approvalRequired: true, approvalRequired: true,
icdcode10Id: "test2", icdcode10Id: "test2",
doseTime: 1, doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId),
duration: 2, duration: 2,
doseStartDate: "2020-12-20T13:07:41.769Z")); doseStartDate: startDate));
updatePrescriptionReqModel.prescriptionRequestModel = sss; updatePrescriptionReqModel.prescriptionRequestModel = sss;
//postProcedureReqModel.procedures = controlsProcedure; //postProcedureReqModel.procedures = controlsProcedure;

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
@ -61,7 +62,7 @@ class _EntityListCheckboxSearchWidgetState
child: ListView( child: ListView(
children: [ children: [
TextFields( TextFields(
hintText: 'Search ', hintText: TranslationBase.of(context).searchProcedures,
suffixIcon: EvaIcons.search, suffixIcon: EvaIcons.search,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); filterSearchResults(value);

File diff suppressed because it is too large Load Diff

@ -12,6 +12,12 @@ class DateUtils {
} }
static convertDateFromServerFormat(String str, dateFormat) { static convertDateFromServerFormat(String str, dateFormat) {
var date = getDateTimeFromServerFormat(str);
return DateFormat(dateFormat).format(date);
}
static DateTime getDateTimeFromServerFormat(String str) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
@ -23,7 +29,7 @@ class DateUtils {
var date = new DateTime.fromMillisecondsSinceEpoch( var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex))); int.parse(str.substring(startIndex + start.length, endIndex)));
return DateFormat(dateFormat).format(date); return date;
} }
static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate) { static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate) {
@ -77,5 +83,138 @@ class DateUtils {
int.parse(str.substring(startIndex + start.length, endIndex))); int.parse(str.substring(startIndex + start.length, endIndex)));
return differenceBetweenDateAndCurrent(date); return differenceBetweenDateAndCurrent(date);
} }
/// get month by
/// [weekDay] convert week day in int to week day name
static getWeekDay(int weekDay) {
switch (weekDay) {
case 1:
return "Monday";
case 2:
return "Tuesday";
case 3:
return "Wednesday";
case 4:
return "Thursday";
case 5:
return "Friday";
case 6:
return "Saturday ";
case 7:
return "Sunday";
}
}
/// get month by
/// [weekDay] convert week day in int to week day name arabic
static getWeekDayArabic(int weekDay) {
switch (weekDay) {
case 1:
return "الاثنين";
case 2:
return "الثلاثاء";
case 3:
return "الاربعاء";
case 4:
return "الخميس";
case 5:
return "الجمعه";
case 6:
return "السبت ";
case 7:
return "الاحد";
}
}
/// get month by
/// [month] convert month number in to month name
static getMonth(int month) {
switch (month) {
case 1:
return "January";
case 2:
return "February";
case 3:
return "March";
case 4:
return "April";
case 5:
return "May";
case 6:
return "June";
case 7:
return "July";
case 8:
return "August";
case 9:
return "September";
case 10:
return "October";
case 11:
return "November";
case 12:
return "December";
}
}
/// get month by
/// [month] convert month number in to month name in Arabic
static getMonthArabic(int month) {
switch (month) {
case 1:
return "يناير";
case 2:
return " فبراير";
case 3:
return "مارس";
case 4:
return "أبريل";
case 5:
return "مايو";
case 6:
return "يونيو";
case 7:
return "يوليو";
case 8:
return "أغسطس";
case 9:
return "سبتمبر";
case 10:
return " اكتوبر";
case 11:
return " نوفمبر";
case 12:
return "ديسمبر";
}
}
static getMonthByName(String month) {
switch (month.toLowerCase()) {
case 'january':
return 1;
case 'february':
return 2;
case 'march':
return 3;
case 'april':
return 4;
case 'may':
return 5;
case 'june':
return 6;
case 'july':
return 7;
case 'august':
return 8;
case 'september':
return 9;
case 'october':
return 10;
case 'november':
return 11;
case 'december':
return 12;
}
}
} }

@ -616,6 +616,40 @@ class TranslationBase {
String get patientNoDetailErrMsg => String get patientNoDetailErrMsg =>
localizedValues['patientNoDetailErrMsg'][locale.languageCode]; localizedValues['patientNoDetailErrMsg'][locale.languageCode];
String get systolicLng =>
localizedValues['systolic-lng'][locale.languageCode];
String get diastolicLng =>
localizedValues['diastolic-lng'][locale.languageCode];
String get mass => localizedValues['mass'][locale.languageCode];
String get tempC => localizedValues['temp-c'][locale.languageCode];
String get bpm => localizedValues['bpm'][locale.languageCode];
String get respirationSigns =>
localizedValues['respiration-signs'][locale.languageCode];
String get sysDias => localizedValues['sys-dias'][locale.languageCode];
String get body => localizedValues['body'][locale.languageCode];
String get respirationRate =>
localizedValues['respirationRate'][locale.languageCode];
String get heart => localizedValues['heart'][locale.languageCode];
String get medicalReport =>
localizedValues['medicalReport'][locale.languageCode];
String get visitDate => localizedValues['visitDate'][locale.languageCode];
String get test => localizedValues['test'][locale.languageCode];
String get addMoreProcedure =>
localizedValues['addMoreProcedure'][locale.languageCode];
String get regular => localizedValues['regular'][locale.languageCode];
String get searchProcedures =>
localizedValues['searchProcedures'][locale.languageCode];
String get procedureCategorise =>
localizedValues['procedureCategorise'][locale.languageCode];
String get selectProcedures =>
localizedValues['selectProcedures'][locale.languageCode];
String get addSelectedProcedures =>
localizedValues['addSelectedProcedures'][locale.languageCode];
String get updateProcedure =>
localizedValues['updateProcedure'][locale.languageCode];
String get orderProcedure =>
localizedValues['orderProcedure'][locale.languageCode];
String get nameOrICD => String get nameOrICD =>
localizedValues['nameOrICD'][locale.languageCode]; localizedValues['nameOrICD'][locale.languageCode];

@ -63,6 +63,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
bool authenticated; bool authenticated;
var fingrePrintBefore;
var selectedOption;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -105,7 +109,9 @@ class _VerificationMethodsState extends State<VerificationMethods> {
helpers.showErrorToast('Error: ${snapshot.error}'); helpers.showErrorToast('Error: ${snapshot.error}');
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} else { } else {
return Container( return SingleChildScrollView(
child: Container(
height: SizeConfig.realScreenHeight,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -155,18 +161,17 @@ class _VerificationMethodsState extends State<VerificationMethods> {
TextOverflow.ellipsis, TextOverflow.ellipsis,
), ),
subtitle: Text( subtitle: Text(
// user. != null user.editedOn != null
// ? formatDate(Helpers ? formatDate(Helpers
// .convertStringToDate( .convertStringToDate(
// user user
// .)) .editedOn))
// : user != : user.createdOn !=
// null null
// ? formatDate(Helpers ? formatDate(Helpers
// .convertStringToDate(user .convertStringToDate(user
// .createdOn)) .createdOn))
//: : '--',
'--',
overflow: overflow:
TextOverflow.ellipsis, TextOverflow.ellipsis,
textAlign: textAlign:
@ -263,7 +268,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
3, authProv)), 3, authProv)),
Expanded( Expanded(
child: getButton( child: getButton(
2, authProv)) 4, authProv))
], ],
) )
: SizedBox(), : SizedBox(),
@ -275,7 +280,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
child: child:
getButton(1, authProv)), getButton(1, authProv)),
Expanded( Expanded(
child: getButton(4, authProv)) child: getButton(2, authProv))
], ],
), ),
]), ]),
@ -307,7 +312,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
)) ))
], ],
), ),
); ));
} }
} }
}); });
@ -342,14 +347,13 @@ class _VerificationMethodsState extends State<VerificationMethods> {
authProv authProv
.sendActivationCodeForDoctorApp(activationCodeModel) .sendActivationCodeForDoctorApp(activationCodeModel)
.then((res) { .then((res) {
widget.changeLoadingStata(false);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print("VerificationCode : " + res["VerificationCode"]); print("VerificationCode : " + res["VerificationCode"]);
sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]);
sharedPref.setString( sharedPref.setString(
VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]);
sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]);
sharedPref.setString(PASSWORD, widget.password);
this.startSMSService(oTPSendType, authProv); this.startSMSService(oTPSendType, authProv);
} else { } else {
print(res['ErrorEndUserMessage']); print(res['ErrorEndUserMessage']);
@ -380,55 +384,50 @@ class _VerificationMethodsState extends State<VerificationMethods> {
sendActivationCodeVerificationScreen( sendActivationCodeVerificationScreen(
oTPSendType, AuthViewModel authProv) async { oTPSendType, AuthViewModel authProv) async {
// TODO : build enum for verfication method // TODO : build enum for verfication method
if (oTPSendType == 1 || oTPSendType == 2) { //if (oTPSendType == 1 || oTPSendType == 2) {
widget.changeLoadingStata(true); widget.changeLoadingStata(true);
ActivationCodeModel2 activationCodeModel = ActivationCodeModel2( ActivationCodeModel2 activationCodeModel = ActivationCodeModel2(
facilityId: user.projectID, iMEI: user.iMEI,
memberID: user.doctorID, facilityId: user.projectID,
zipCode: user.outSA == true ? '971' : '966', memberID: user.doctorID,
mobileNumber: user.mobile, zipCode: user.outSA == true ? '971' : '966',
oTPSendType: oTPSendType, mobileNumber: user.mobile,
isMobileFingerPrint: 1, oTPSendType: oTPSendType,
vidaAuthTokenID: user.vidaAuthTokenID, isMobileFingerPrint: 1,
vidaRefreshTokenID: user.vidaRefreshTokenID); vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID);
try { try {
authProv authProv
.sendActivationCodeVerificationScreen(activationCodeModel) .sendActivationCodeVerificationScreen(activationCodeModel)
.then((res) { .then((res) {
widget.changeLoadingStata(false); if (res['MessageStatus'] == 1) {
print("VerificationCode : " + res["VerificationCode"]);
if (res['MessageStatus'] == 1) { sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]);
print("VerificationCode : " + res["VerificationCode"]); sharedPref.setString(
sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]);
sharedPref.setString( sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]);
VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); if (oTPSendType == 1 || oTPSendType == 2) {
sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); widget.changeLoadingStata(false);
this.startSMSService(oTPSendType, authProv); this.startSMSService(oTPSendType, authProv);
} else { } else {
print(res['ErrorEndUserMessage']); checkActivationCode(authProv);
helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { } else {
print('$err'); print(res['ErrorEndUserMessage']);
widget.changeLoadingStata(false); helpers.showErrorToast(res['ErrorEndUserMessage']);
}
helpers.showErrorToast(); }).catchError((err) {
}); print('$err');
} catch (e) {} widget.changeLoadingStata(false);
} else {
// TODO route to this page with parameters to inicate we should present 2 option
if (Platform.isAndroid && oTPSendType == 3) {
helpers.showErrorToast('Your device not support this feature');
} else {
// Navigator.of(context).push(MaterialPageRoute(
// builder: (BuildContext context) =>
// VerificationMethodsScreen(password: widget.password,)));
// Navigator.of(context).pushNamed(VERIFICATION_METHODS, helpers.showErrorToast();
// arguments: {'verificationMethod': oTPSendType}); });
} } catch (e) {}
} // }
// else {
// checkActivationCode(authProv);
// }
} }
Widget getButton(flag, authProv) { Widget getButton(flag, authProv) {
@ -635,10 +634,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
authenticateUser(type, isActive, authProv) { authenticateUser(type, isActive, authProv) {
//GifLoaderDialogUtils.showMyDialog(context); //GifLoaderDialogUtils.showMyDialog(context);
// if (type == 2 || type == 3) { if (type == 3 || type == 4) {
// fingrePrintBefore = type; fingrePrintBefore = type;
// } }
//this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type; this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type;
switch (type) { switch (type) {
case 1: case 1:
@ -657,55 +656,14 @@ class _VerificationMethodsState extends State<VerificationMethods> {
default: default:
break; break;
} }
// sharedPref.setInt(LAST_LOGIN, sharedPref.setInt(OTP_TYPE, selectedOption);
// this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); // sharedPref.setInt(LAST_LOGIN),
} }
loginWithSMS(type, isActive, authProv) { loginWithSMS(type, isActive, authProv) {
this.sendActivationCode(type, authProv); this.sendActivationCode(type, authProv);
// //if (!el.disabled) {
// if (this.user != null) {
// this.checkUserAuthentication(type);
// } else {
// // if (this.loginTokenID != null) {
// this.sendActivationCode(type, authProv);
// // } else {
// //this.checkUserAuthentication(type);
// // }
// }
} }
// checkUserAuthentication(type) {
// // showLoader(true);
// // var req = getCommonRequest(type: type);
// // req.logInTokenID = "";
// // var request = CheckPatientAuthenticationReq.fromJson(req.toJson());
// // sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
// // authService
// // .checkPatientAuthentication(request)
// // .then((value) => {
// // GifLoaderDialogUtils.hideDialog(context),
// // if (value['isSMSSent'])
// // {
// // sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
// // this.loginTokenID = value['LogInTokenID'],
// // sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
// // // Future.delayed(Duration(seconds: 1), () {
// // this.sendActivationCode(type)
// // // })
// // }
// // else
// // {
// // if (value['IsAuthenticated']) {this.checkActivationCode()}
// // }
// // })
// // .catchError((err) {
// // print(err);
// // GifLoaderDialogUtils.hideDialog(context);
// // });
// }
Future<void> _getAvailableBiometrics() async { Future<void> _getAvailableBiometrics() async {
var availableBiometrics; var availableBiometrics;
try { try {
@ -729,11 +687,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} }
startSMSService(type, authProv) { startSMSService(type, authProv) {
sharedPref.setInt(OTP_TYPE, type);
new SMSOTP( new SMSOTP(
context, context,
type, type,
_loggedUser['MobileNumber'], _loggedUser != null ? _loggedUser['MobileNumber'] : user.mobile,
(value) { (value) {
showDialog( showDialog(
context: context, context: context,
@ -746,7 +703,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
this.checkActivationCode(authProv, value: value); this.checkActivationCode(authProv, value: value);
}, },
() => { () => {
Navigator.pop(context), //Navigator.pop(context),
print('Faild..'), print('Faild..'),
}, },
).displayDialog(context); ).displayDialog(context);
@ -759,31 +716,29 @@ class _VerificationMethodsState extends State<VerificationMethods> {
localizedReason: 'Scan your fingerprint to authenticate', localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true, useErrorDialogs: true,
stickyAuth: true); stickyAuth: true);
if (user.logInTypeID == 1 || user.logInTypeID == 2) { if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) {
this.onlySMSBox = true; this.sendActivationCode(type, authProv);
// this.checkActivationCode(authProv);
} else { } else {
this.checkActivationCode(authProv); setState(() {
this.onlySMSBox = true;
});
} }
// if (authenticated == true) {
// if (user != null && (user.logInTypeID == 4 || user.logInTypeID == 3)) {
// //this.checkActivationCode();
// } else {
// // var request = this.getCommonRequest(type: type);
// // this.getMobileInfo(request);
// }
// }
} }
} }
checkActivationCode(AuthViewModel authProv, {value}) async { checkActivationCode(AuthViewModel authProv, {value}) async {
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel( new CheckActivationCodeRequestModel(
zipCode: _loggedUser['ZipCode'], zipCode:
mobileNumber: _loggedUser['MobileNumber'], _loggedUser != null ? _loggedUser['ZipCode'] : user.zipCode,
projectID: await sharedPref.getInt(PROJECT_ID), mobileNumber:
_loggedUser != null ? _loggedUser['MobileNumber'] : user.mobile,
projectID: await sharedPref.getInt(PROJECT_ID) != null
? await sharedPref.getInt(PROJECT_ID)
: user.projectID,
logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID),
activationCode: value, activationCode: value ?? '0000',
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
generalid: "Cs2020@2016\$2958"); generalid: "Cs2020@2016\$2958");

@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class AppBarChart extends StatelessWidget {
const AppBarChart({
Key key,
@required this.seriesList,
}) : super(key: key);
final List<charts.Series> seriesList;
@override
Widget build(BuildContext context) {
return Container(
height: 400,
margin: EdgeInsets.only(top: 60),
child: charts.BarChart(
seriesList,
// animate: animate,
/// Customize the primary measure axis using a small tick renderer.
/// Use String instead of num for ordinal domain axis
/// (typically bar charts).
primaryMeasureAxis: new charts.NumericAxisSpec(
renderSpec: new charts.GridlineRendererSpec(
// Display the measure axis labels below the gridline.
//
// 'Before' & 'after' follow the axis value direction.
// Vertical axes draw 'before' below & 'after' above the tick.
// Horizontal axes draw 'before' left & 'after' right the tick.
labelAnchor: charts.TickLabelAnchor.before,
// Left justify the text in the axis.
//
// Note: outside means that the secondary measure axis would right
// justify.
labelJustification:
charts.TickLabelJustification.outside,
)),
),
);
}
}

@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
/// chart line
/// [seriesList] charts series
/// [chartTitle] the charts title
/// [animate] enable and disable animate on create chart
/// [includeArea] chart include Area
/// [stacked] stacked chart over the design
class AppLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final String chartTitle;
final bool animate;
final bool includeArea;
final bool stacked;
AppLineChart(
{Key key,
@required this.seriesList,
this.chartTitle,
this.animate = true,
this.includeArea = false,
this.stacked = true});
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Text(
chartTitle,
style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
),
Expanded(
child: charts.LineChart(seriesList,
defaultRenderer: charts.LineRendererConfig(
includeArea: false, stacked: true),
animate: animate),
),
],
),
);
}
}

@ -0,0 +1,71 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:charts_flutter/flutter.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/data_display/list/flexible_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
/// App Time Series Chart
/// [seriesList] the series list
/// [chartName] the name of the chart
/// [startDate] the start date
/// [endDate] the end date
class AppTimeSeriesChart extends StatelessWidget {
AppTimeSeriesChart({
Key key,
@required this.seriesList,
this.chartName = '',
this.startDate,
this.endDate,
});
final String chartName;
final List<Series<dynamic, DateTime>> seriesList;
final DateTime startDate;
final DateTime endDate;
@override
Widget build(BuildContext context) {
return FlexibleContainer(
heightFactor: 0.47,
child: Column(
children: <Widget>[
AppText(chartName, fontSize: SizeConfig.textMultiplier * 3),
Container(
height: SizeConfig.realScreenHeight * 0.37,
child: Center(
child: Container(
child: charts.TimeSeriesChart(
seriesList,
animate: true,
behaviors: [
charts.RangeAnnotation(
[
charts.RangeAnnotationSegment(startDate, endDate,
charts.RangeAnnotationAxisType.domain ),
],
),
],
),
),
),
),
],
),
);
}
}
class TimeSeriesSales {
final DateTime time;
final int sales;
TimeSeriesSales(this.time, this.sales);
}
class TimeSeriesSales2 {
final DateTime time;
final double sales;
TimeSeriesSales2(this.time, this.sales);
}

@ -0,0 +1,93 @@
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
/// Custom Item widget
/// [startIcon] icon at the start of the widget
/// [startIconSize] icon size of start icon
/// [startIconColor] icon color of start icon
/// [endIcon] icon at the end of the widget
/// [endIconSize] icon size of end icon
/// [endIconColor] icon color of end icon
/// [disabled] disabled on tap function
/// [onTap] opTap function
/// [padding] padding of the widget
/// [child] child of the widget
/// [decoration] decoration of the widget
class CustomItem extends StatelessWidget {
final IconData startIcon;
final double startIconSize;
final Color startIconColor;
final IconData endIcon;
final double endIconSize;
final Color endIconColor;
final bool disabled;
final Function onTap;
final EdgeInsets padding;
final Widget child;
final BoxDecoration decoration;
CustomItem(
{Key key,
this.startIcon,
this.disabled: false,
this.onTap,
this.startIconColor,
this.endIcon = EvaIcons.chevronRight,
this.padding,
this.child,
this.endIconColor,
this.endIconSize = 20,
this.decoration,
this.startIconSize = 19})
: super(key: key);
@override
Widget build(BuildContext context) {
return IgnorePointer(
ignoring: disabled,
child: Container(
decoration: decoration != null ? decoration : BoxDecoration(),
child: InkWell(
onTap: () {
if (onTap != null) onTap();
},
child: Padding(
padding: padding != null
? padding
: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
child: Row(
children: <Widget>[
if (startIcon != null)
Expanded(
flex: 1,
child: Icon(
startIcon,
color: startIconColor ?? Theme.of(context).primaryColor,
size: startIconSize,
),
),
if (startIcon != null) SizedBox(width: 18.0),
Expanded(
child: child,
flex: 10,
),
endIcon == null
? Expanded(child: Container())
: Expanded(
flex: 1,
child: Icon(
endIcon,
color: endIconColor != null
? endIconColor
: Colors.grey[500],
size: endIconSize,
),
)
],
),
),
),
),
);
}
}

@ -0,0 +1,50 @@
import 'package:flutter/material.dart';
/// Flexible container widget
/// [widthFactor] If non-null, the fraction of the incoming width given to the child.
/// If non-null, the child is given a tight width constraint that is the max
/// incoming width constraint multiplied by this factor.
/// If null, the incoming width constraints are passed to the child
/// [heightFactor]If non-null, the fraction of the incoming height given to the child.
/// If non-null, the child is given a tight height constraint that is the max
/// incoming height constraint multiplied by this factor.
/// If null, the incoming height constraints are passed to the child
/// [padding] add padding to the container
/// [child] child widget inside the container
class FlexibleContainer extends StatelessWidget {
final double widthFactor;
final double heightFactor;
final EdgeInsets padding;
final Widget child;
FlexibleContainer({
Key key,
this.widthFactor = 0.9,
this.heightFactor = 1,
this.padding,
this.child,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
// widthFactor: widthFactor,
// heightFactor: heightFactor,
child: ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: Material(
color: Theme.of(context).backgroundColor,
child: Container(
padding: padding,
width: double.infinity,
decoration: BoxDecoration(
border: Border.all(
color: Theme.of(context).dividerColor, width: 2.0),
borderRadius: BorderRadius.circular(8.0)),
child: child,
),
),
),
);
}
}

@ -23,6 +23,8 @@ class PatientProfileWidget extends StatelessWidget {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String from = routeArgs['from'];
String to = routeArgs['to'];
return Container( return Container(
color: Color(0XFFF2F2F2), color: Color(0XFFF2F2F2),
@ -442,7 +444,7 @@ class PatientProfileWidget extends StatelessWidget {
SliverPadding( SliverPadding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
sliver: ProfileMedicalInfoWidget( sliver: ProfileMedicalInfoWidget(
patient: patient, patientType:patientType patient: patient, patientType:patientType, from: from, to: to,
)) ))
]), ]),
); );

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
@ -23,9 +24,14 @@ import '../../shared/app_texts_widget.dart';
*@desc: Profile Medical Info Widget *@desc: Profile Medical Info Widget
*/ */
class ProfileMedicalInfoWidget extends StatelessWidget { class ProfileMedicalInfoWidget extends StatelessWidget {
ProfileMedicalInfoWidget({Key key, this.patient, this.patientType}); ProfileMedicalInfoWidget(
{Key key, this.patient, this.patientType, this.from, this.to});
String from;
String to;
PatiantInformtion patient; PatiantInformtion patient;
String patientType; String patientType;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
@ -50,42 +56,41 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patientMRN: patient.patientMRN); patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel); await model.postEpisode(postEpisodeReqModel);
patient.episodeNo = model.episodeID; patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); Navigator.of(context).pushNamed(CREATE_EPISODE,
arguments: {'patient': patient});
}, },
isLoading: model.state == ViewState.BusyLocal, isLoading: model.state == ViewState.BusyLocal,
icon: 'create-episod.png' icon: 'create-episod.png'),
), if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
if(int.parse(patientType) ==7 || int.parse(patientType) == 6) PatientProfileButton(
PatientProfileButton( key: key,
key: key, patient: patient,
patient: patient, isDisable: patient.episodeNo == 0 ? true : false,
isDisable: patient.episodeNo == 0 ? true : false, nameLine1: TranslationBase.of(context).update,
nameLine1: TranslationBase nameLine2: TranslationBase.of(context).episode,
.of(context) route: UPDATE_EPISODE,
.update, icon: 'modilfy-episode.png'),
nameLine2: TranslationBase if (int.parse(patientType) == 7)
.of(context) PatientProfileButton(
.episode, key: key,
route: UPDATE_EPISODE, patient: patient,
icon: 'modilfy-episode.png'), from: from,
PatientProfileButton( to: to,
key: key, nameLine1: TranslationBase.of(context).vital,
patient: patient, nameLine2: TranslationBase.of(context).signs,
nameLine1: TranslationBase.of(context).vital, route:
nameLine2: TranslationBase.of(context).signs, VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN
route: (selectedPatientType == 6 || selectedPatientType == 7) ? PATIENT_VITAL_SIGN : VITAL_SIGN_DETAILS, */
icon: 'heartbeat.png'), ,
if(selectedPatientType != 7) icon: 'heartbeat.png'),
PatientProfileButton( if (selectedPatientType != 7)
key: key, PatientProfileButton(
patient: patient, key: key,
route: LAB_ORDERS, patient: patient,
nameLine1: TranslationBase.of(context).lab, route: LAB_ORDERS,
nameLine2: TranslationBase.of(context).result, nameLine1: TranslationBase.of(context).lab,
icon: 'lab.png'), nameLine2: TranslationBase.of(context).result,
icon: 'lab.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -113,65 +118,51 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
key: key, key: key,
patient: patient, patient: patient,
route: ORDER_PRESCRIPTION, route: ORDER_PRESCRIPTION,
nameLine1: 'Order', nameLine1: TranslationBase.of(context).orders,
nameLine2: 'Prescription', nameLine2: TranslationBase.of(context).prescription,
icon: 'lab.png'), icon: 'lab.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
route: ORDER_PROCEDURE, route: ORDER_PROCEDURE,
nameLine1: 'Order Test', nameLine1: TranslationBase.of(context).orders,
nameLine2: 'Or Procedures', nameLine2: TranslationBase.of(context).procedures,
icon: 'lab.png'), icon: 'lab.png'),
if(selectedPatientType == 7|| int.parse(patientType) == 6) if (selectedPatientType == 7|| int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
route: REFER_PATIENT_TO_DOCTOR, route: REFER_PATIENT_TO_DOCTOR,
nameLine1: TranslationBase nameLine1: TranslationBase.of(context).myReferral,
.of(context) nameLine2: TranslationBase.of(context).patient,
.myReferral,
nameLine2: TranslationBase
.of(context)
.patient,
icon: 'note.png'), icon: 'note.png'),
if(selectedPatientType != 0 && selectedPatientType != 5) if (selectedPatientType != 0 && selectedPatientType != 5)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
route: PATIENT_ORDERS, route: PATIENT_ORDERS,
nameLine1: TranslationBase nameLine1: TranslationBase.of(context).orders,
.of(context) nameLine2: TranslationBase.of(context).list,
.orders,
nameLine2: TranslationBase
.of(context)
.list,
icon: 'radiology-1.png'), icon: 'radiology-1.png'),
if(selectedPatientType != 0 && selectedPatientType != 5) if (selectedPatientType != 0 && selectedPatientType != 5)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
route: ADD_SICKLEAVE, route: ADD_SICKLEAVE,
nameLine1: TranslationBase nameLine1: TranslationBase.of(context).patientSick,
.of(context) nameLine2: TranslationBase.of(context).leave,
.patientSick,
nameLine2: TranslationBase
.of(context)
.leave,
icon: 'sick_leaves_icons.png'), icon: 'sick_leaves_icons.png'),
if( selectedPatientType == 7|| int.parse(patientType) == 6) if (selectedPatientType == 7|| int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
route: PATIENT_UCAF_REQUEST, route: PATIENT_UCAF_REQUEST,
nameLine1: TranslationBase nameLine1: TranslationBase.of(context).patient,
.of(context) nameLine2: TranslationBase.of(context).ucaf,
.patient,
nameLine2: TranslationBase
.of(context)
.ucaf,
icon: 'lab.png'), icon: 'lab.png'),
],),); ],
),
);
} }
} }
@ -230,18 +221,25 @@ class PatientProfileButton extends StatelessWidget {
final String icon; final String icon;
final dynamic route; final dynamic route;
final PatiantInformtion patient; final PatiantInformtion patient;
String from;
String to;
final String url = "assets/images/"; final String url = "assets/images/";
final bool isDisable; final bool isDisable;
final bool isLoading; final bool isLoading;
final Function onTap; final Function onTap;
PatientProfileButton(
PatientProfileButton({Key key, {Key key,
this.patient, this.patient,
this.nameLine1, this.nameLine1,
this.nameLine2, this.nameLine2,
this.icon, this.icon,
this.route, this.isDisable = false, this.onTap, this.isLoading = false}) this.route,
this.isDisable = false,
this.onTap,
this.isLoading = false,
this.from,
this.to})
: super(key: key); : super(key: key);
@override @override
@ -249,9 +247,13 @@ class PatientProfileButton extends StatelessWidget {
return new Container( return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0), margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell( child: InkWell(
onTap: isDisable?null:onTap != null ? onTap : () { onTap: isDisable
navigator(context, this.route); ? null
}, : onTap != null
? onTap
: () {
navigator(context, this.route);
},
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
@ -273,8 +275,7 @@ class PatientProfileButton extends StatelessWidget {
textAlign: TextAlign.left, textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
), ),
if(isLoading) if (isLoading) DrAppCircularProgressIndeicator()
DrAppCircularProgressIndeicator()
], ],
), ),
), ),
@ -313,6 +314,13 @@ class PatientProfileButton extends StatelessWidget {
} }
void navigator(BuildContext context, route) { void navigator(BuildContext context, route) {
Navigator.of(context).pushNamed(route, arguments: {'patient': patient}); if (from == null) {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null) {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
Navigator.of(context).pushNamed(route,
arguments: {'patient': patient, 'from': from, 'to': to});
} }
} }

@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
/// FadePage animation
/// [page]
class FadePage extends PageRouteBuilder {
final Widget page;
FadePage({this.page})
: super(
opaque: false,
fullscreenDialog: true,
barrierDismissible: true,
barrierColor: Colors.black.withOpacity(0.8),
pageBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
) =>
page,
transitionDuration: Duration(milliseconds: 300),
transitionsBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child,
) {
return FadeTransition(
opacity: animation,
child: child
);
}
);
}

@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
///Slide Up Page Route
/// [widget] widget we need to slide up
/// [fullscreenDialog] show the widget as full screen dialog
/// [opaque] When an opaque route's entrance transition is complete, the routes behind the opaque route will not be built to save resources.
class SlideUpPageRoute extends PageRouteBuilder {
final Widget widget;
final bool fullscreenDialog;
final bool opaque;
SlideUpPageRoute(
{this.widget, this.fullscreenDialog = false, this.opaque = true})
: super(
pageBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
) {
return widget;
},
fullscreenDialog: fullscreenDialog,
opaque: opaque,
barrierColor: Color.fromRGBO(0, 0, 0, 0.5),
barrierDismissible: true,
transitionDuration: Duration(milliseconds: 800),
transitionsBuilder: ((BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child) {
var begin = Offset(0.0, 1.0);
var end = Offset.zero;
var curve = Curves.easeInOutQuint;
var tween =
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
return SlideTransition(
position: animation.drive(tween), child: child);
}),
);
}

@ -70,7 +70,7 @@ packages:
name: build name: build
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.6.0" version: "1.6.1"
build_config: build_config:
dependency: transitive dependency: transitive
description: description:
@ -84,35 +84,35 @@ packages:
name: build_daemon name: build_daemon
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.1.6"
build_modules: build_modules:
dependency: transitive dependency: transitive
description: description:
name: build_modules name: build_modules
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.2" version: "3.0.3"
build_resolvers: build_resolvers:
dependency: transitive dependency: transitive
description: description:
name: build_resolvers name: build_resolvers
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.1" version: "1.5.2"
build_runner: build_runner:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: build_runner name: build_runner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.11" version: "1.10.13"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
name: build_runner_core name: build_runner_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.5" version: "6.1.6"
build_web_compilers: build_web_compilers:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -189,7 +189,7 @@ packages:
name: code_builder name: code_builder
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.5.0" version: "3.6.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
@ -281,6 +281,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
equatable:
dependency: transitive
description:
name: equatable
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.5"
eva_icons_flutter: eva_icons_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
@ -351,6 +358,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.10.11" version: "0.10.11"
fl_chart:
dependency: "direct main"
description:
name: fl_chart
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.2"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -581,6 +595,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0-nullsafety.1"
path_drawing:
dependency: transitive
description:
name: path_drawing
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.1+1"
path_parsing:
dependency: transitive
description:
name: path_parsing
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
@ -678,7 +706,7 @@ packages:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.3.2+3" version: "4.3.2+4"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -706,7 +734,7 @@ packages:
name: scratch_space name: scratch_space
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.4+2" version: "0.0.4+3"
shared_preferences: shared_preferences:
dependency: "direct main" dependency: "direct main"
description: description:

@ -59,6 +59,9 @@ dependencies:
#Dependency Injection #Dependency Injection
get_it: ^4.0.2 get_it: ^4.0.2
#chart
fl_chart: ^0.12.1
#firebase #firebase
firebase_messaging: ^7.0.0 firebase_messaging: ^7.0.0
#GIF image #GIF image

Loading…
Cancel
Save