Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into tasks-translation

 Conflicts:
	lib/config/localized_values.dart
	lib/util/translations_delegate_base.dart
	lib/widgets/patients/profile/profile_medical_info_widget.dart
merge-requests/256/head
hussam al-habibeh 5 years ago
commit 015c3b53c8

@ -44,6 +44,7 @@ android {
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
} }
buildTypes { buildTypes {
@ -72,9 +73,10 @@ dependencies {
implementation 'com.opentok.android:opentok-android-sdk:2.16.5' implementation 'com.opentok.android:opentok-android-sdk:2.16.5'
//permissions //permissions
implementation 'pub.devrel:easypermissions:0.4.0' implementation 'pub.devrel:easypermissions:0.4.0'
implementation 'com.google.firebase:firebase-core:9.6.1'
//retrofit //retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.2' implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2' implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1' implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1'
apply plugin: 'com.google.gms.google-services'
} }

@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "1008895414777",
"project_id": "doctorapp-9f172",
"storage_bucket": "doctorapp-9f172.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28",
"android_client_info": {
"package_name": "com.example.doctor_app_flutter"
}
},
"oauth_client": [
{
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

@ -8,6 +8,7 @@ buildscript {
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.0' classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2'
} }
} }

@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "1008895414777",
"project_id": "doctorapp-9f172",
"storage_bucket": "doctorapp-9f172.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28",
"android_client_info": {
"package_name": "com.example.doctor_app_flutter"
}
},
"oauth_client": [
{
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

@ -1,4 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true android.enableR8=true
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
org.gradle.jvmargs=-Xmx4608m

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

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

@ -71,9 +71,14 @@ class BaseAppClient {
body['SessionID'] = SESSION_ID; body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = 0; // PATIENT_OUT_SA; body['PatientOutSA'] = 0; // PATIENT_OUT_SA;
body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); if (body['VidaAuthTokenID'] == null) {
body['VidaAuthTokenID'] =
await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
}
if (body['VidaRefreshTokenID'] == null) {
body['VidaRefreshTokenID'] = body['VidaRefreshTokenID'] =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
}
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");

@ -71,6 +71,10 @@ const CREATE_REFERRAL_PATIENT =
const RESPONSE_PENDING_REFERRAL_PATIENT = const RESPONSE_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral'; 'Services/DoctorApplication.svc/REST/CreateReferral';
const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal';
const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF';
const GET_DOCTOR_WORKING_HOURS_TABLE = const GET_DOCTOR_WORKING_HOURS_TABLE =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
@ -78,9 +82,13 @@ const GET_PATIENT_LAB_RESULTS =
'Services/DoctorApplication.svc/REST/GetPatientLabResults'; 'Services/DoctorApplication.svc/REST/GetPatientLabResults';
const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New';
const INSERT_DEVICE_IMEI = const INSERT_DEVICE_IMEI =
'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails';
// 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI';
// const SELECT_DEVICE_IMEI =
// 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI';
const SELECT_DEVICE_IMEI = const SELECT_DEVICE_IMEI =
'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
@ -88,6 +96,8 @@ const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN =
'Services/DoctorApplication.svc/REST/SendVerificationCode';
const MEMBER_CHECK_ACTIVATION_CODE_NEW = const MEMBER_CHECK_ACTIVATION_CODE_NEW =
'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; 'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
@ -133,6 +143,9 @@ const GET_PATIENT_ARRIVAL_LIST =
const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies';
const GET_MASTER_LOOKUP_LIST = const GET_MASTER_LOOKUP_LIST =
'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode';
const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies';
const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory';
const POST_CHIEF_COMPLAINT = const POST_CHIEF_COMPLAINT =
@ -173,7 +186,8 @@ const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure';
const UPDATE_PRESCRIPTION = const UPDATE_PRESCRIPTION =
'Services/DoctorApplication.svc/REST/PatchPrescription'; 'Services/DoctorApplication.svc/REST/PatchPrescription';
const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList';
const DRUG_TO_DRUG =
'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
var selectedPatientType = 1; var selectedPatientType = 1;
@ -222,6 +236,8 @@ var SERVICES_PATIANT_HEADER_AR = [
//****************** //******************
// Colors ////// by : ibrahim // Colors ////// by : ibrahim
var DEVICE_TOKEN = "";
const PRIMARY_COLOR = 0xff515B5D; const PRIMARY_COLOR = 0xff515B5D;
const TRANSACTION_NO = 0; const TRANSACTION_NO = 0;

@ -295,7 +295,10 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'},
'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'},
"empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, "empty-message": {
"en": "Please enter this field",
"ar": "يرجى ادخال هذا الحقل"
},
'no-sickleve-applied': { 'no-sickleve-applied': {
'en': "No sick leave applied", 'en': "No sick leave applied",
'ar': 'لم تطبق إجازة مرضية' 'ar': 'لم تطبق إجازة مرضية'
@ -536,6 +539,70 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "There is no Chief Complaint", 'en': "There is no Chief Complaint",
'ar': "ليس هناك شكوى رئيس" 'ar': "ليس هناك شكوى رئيس"
}, },
"more-verify": {
"en": "More Verification Options",
"ar": "المزيد من خيارات التحقق"
},
"welcome-back": {"en": "Welcome back!", "ar": "مرحبا بعودتك!"},
"account-info": {
"en": "Would you like to login with current username?",
"ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟"
},
"another-acc": {"en": "Use Another Account", "ar": "استخدم حسابا آخر"},
"verify-login-with": {
"en": "Please choose one of the following options to verify",
"ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات"
},
"register-user": {"en": "Register", "ar": "تسجيل"},
"verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة"},
"verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"},
"verify-with-sms": {"en": "SMS", "ar": "الرسائل القصيرة"},
"verify-with-whatsapp": {"en": "Whatsapp", "ar": " الواتس اب"},
"last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"},
"last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"},
"verify-fingerprint": {
"en":
"To activate the fingerprint login service, please verify data by using one of the following options.",
"ar":
"لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات"
},
"verification_message": {
"en": "Please enter the Verification Code sent to",
"ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى"
},
"validation_message": {
"en": "The verification code expires in",
"ar": "تنتهي صلاحية رمز التحقق خلال"
},
'addAssessment': {'en': "Add ASSESSMENT", 'ar': "أضف التقييم"},
'assessment': {'en': "ASSESSMENT", 'ar': " التقييم"},
'physicalSystemExamination': {
'en': "Physical/System Examination",
'ar': " الفحص البدني / النظام"
},
'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"},
'addExamination': {'en': "Add Examination", 'ar': "اضافه"},
'doc': {'en': "Doc :", 'ar': " د: "},
'patientNoDetailErrMsg': {
'en': "There is no detail for this patient",
'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': 'قلب'},
'addAssessment': {'en': "Add ASSESSMENT", 'ar': "أضف التقييم"}, 'addAssessment': {'en': "Add ASSESSMENT", 'ar': "أضف التقييم"},
'assessment': {'en': "ASSESSMENT", 'ar': " التقييم"}, 'assessment': {'en': "ASSESSMENT", 'ar': " التقييم"},
'physicalSystemExamination': { 'physicalSystemExamination': {

@ -10,3 +10,5 @@ final DOCTOR_PROFILE = 'doctorProfile';
final LIVE_CARE_PATIENT = 'livecare-patient-profile'; final LIVE_CARE_PATIENT = 'livecare-patient-profile';
final LOGGED_IN_USER = 'loggedUser'; final LOGGED_IN_USER = 'loggedUser';
final DASHBOARD_DATA = 'dashboard-data'; final DASHBOARD_DATA = 'dashboard-data';
final OTP_TYPE = 'otp-type';
final LAST_LOGIN_USER = 'last-login-user';

@ -0,0 +1,124 @@
class GetIMEIDetailsModel {
int iD;
String iMEI;
int logInTypeID;
bool outSA;
String mobile;
Null identificationNo;
int doctorID;
String doctorName;
String doctorNameN;
int clinicID;
String clinicDescription;
Null clinicDescriptionN;
int projectID;
String projectName;
String genderDescription;
Null genderDescriptionN;
String titleDescription;
Null titleDescriptionN;
Null zipCode;
String createdOn;
Null createdBy;
String editedOn;
int editedBy;
bool biometricEnabled;
Null preferredLanguage;
bool isActive;
String vidaAuthTokenID;
String vidaRefreshTokenID;
GetIMEIDetailsModel(
{this.iD,
this.iMEI,
this.logInTypeID,
this.outSA,
this.mobile,
this.identificationNo,
this.doctorID,
this.doctorName,
this.doctorNameN,
this.clinicID,
this.clinicDescription,
this.clinicDescriptionN,
this.projectID,
this.projectName,
this.genderDescription,
this.genderDescriptionN,
this.titleDescription,
this.titleDescriptionN,
this.zipCode,
this.createdOn,
this.createdBy,
this.editedOn,
this.editedBy,
this.biometricEnabled,
this.preferredLanguage,
this.isActive,
this.vidaAuthTokenID,
this.vidaRefreshTokenID});
GetIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
iMEI = json['IMEI'];
logInTypeID = json['LogInTypeID'];
outSA = json['OutSA'];
mobile = json['Mobile'];
identificationNo = json['IdentificationNo'];
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
clinicID = json['ClinicID'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
genderDescription = json['Gender_Description'];
genderDescriptionN = json['Gender_DescriptionN'];
titleDescription = json['Title_Description'];
titleDescriptionN = json['Title_DescriptionN'];
zipCode = json['ZipCode'];
createdOn = json['CreatedOn'];
createdBy = json['CreatedBy'];
editedOn = json['EditedOn'];
editedBy = json['EditedBy'];
biometricEnabled = json['BiometricEnabled'];
preferredLanguage = json['PreferredLanguage'];
isActive = json['IsActive'];
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ID'] = this.iD;
data['IMEI'] = this.iMEI;
data['LogInTypeID'] = this.logInTypeID;
data['OutSA'] = this.outSA;
data['Mobile'] = this.mobile;
data['IdentificationNo'] = this.identificationNo;
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['ClinicID'] = this.clinicID;
data['ClinicDescription'] = this.clinicDescription;
data['ClinicDescriptionN'] = this.clinicDescriptionN;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['Gender_Description'] = this.genderDescription;
data['Gender_DescriptionN'] = this.genderDescriptionN;
data['Title_Description'] = this.titleDescription;
data['Title_DescriptionN'] = this.titleDescriptionN;
data['ZipCode'] = this.zipCode;
data['CreatedOn'] = this.createdOn;
data['CreatedBy'] = this.createdBy;
data['EditedOn'] = this.editedOn;
data['EditedBy'] = this.editedBy;
data['BiometricEnabled'] = this.biometricEnabled;
data['PreferredLanguage'] = this.preferredLanguage;
data['IsActive'] = this.isActive;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
return data;
}
}

@ -0,0 +1,140 @@
class InsertIMEIDetailsModel {
String iMEI;
int logInTypeID;
Null outSA;
Null mobile;
Null identificationNo;
int doctorID;
String doctorName;
String doctorNameN;
int clinicID;
String clinicDescription;
Null clinicDescriptionN;
String projectName;
String genderDescription;
Null genderDescriptionN;
String titleDescription;
Null titleDescriptionN;
bool bioMetricEnabled;
Null preferredLanguage;
bool isActive;
int editedBy;
int projectID;
String tokenID;
int languageID;
String stamp;
String iPAdress;
double versionID;
int channel;
String sessionID;
bool isLoginForDoctorApp;
int patientOutSA;
String vidaAuthTokenID;
String vidaRefreshTokenID;
InsertIMEIDetailsModel(
{this.iMEI,
this.logInTypeID,
this.outSA,
this.mobile,
this.identificationNo,
this.doctorID,
this.doctorName,
this.doctorNameN,
this.clinicID,
this.clinicDescription,
this.clinicDescriptionN,
this.projectName,
this.genderDescription,
this.genderDescriptionN,
this.titleDescription,
this.titleDescriptionN,
this.bioMetricEnabled,
this.preferredLanguage,
this.isActive,
this.editedBy,
this.projectID,
this.tokenID,
this.languageID,
this.stamp,
this.iPAdress,
this.versionID,
this.channel,
this.sessionID,
this.isLoginForDoctorApp,
this.patientOutSA,
this.vidaAuthTokenID,
this.vidaRefreshTokenID});
InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
iMEI = json['IMEI'];
logInTypeID = json['LogInTypeID'];
outSA = json['OutSA'];
mobile = json['Mobile'];
identificationNo = json['IdentificationNo'];
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
clinicID = json['ClinicID'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
projectName = json['ProjectName'];
genderDescription = json['GenderDescription'];
genderDescriptionN = json['GenderDescriptionN'];
titleDescription = json['TitleDescription'];
titleDescriptionN = json['Title_DescriptionN'];
bioMetricEnabled = json['BioMetricEnabled'];
preferredLanguage = json['PreferredLanguage'];
isActive = json['IsActive'];
editedBy = json['EditedBy'];
projectID = json['ProjectID'];
tokenID = json['TokenID'];
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['IMEI'] = this.iMEI;
data['LogInTypeID'] = this.logInTypeID;
data['OutSA'] = this.outSA;
data['Mobile'] = this.mobile;
data['IdentificationNo'] = this.identificationNo;
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['ClinicID'] = this.clinicID;
data['ClinicDescription'] = this.clinicDescription;
data['ClinicDescriptionN'] = this.clinicDescriptionN;
data['ProjectName'] = this.projectName;
data['GenderDescription'] = this.genderDescription;
data['GenderDescriptionN'] = this.genderDescriptionN;
data['TitleDescription'] = this.titleDescription;
data['Title_DescriptionN'] = this.titleDescriptionN;
data['BioMetricEnabled'] = this.bioMetricEnabled;
data['PreferredLanguage'] = this.preferredLanguage;
data['IsActive'] = this.isActive;
data['EditedBy'] = this.editedBy;
data['ProjectID'] = this.projectID;
data['TokenID'] = this.tokenID;
data['LanguageID'] = this.languageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
return data;
}
}

@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.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/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
@ -31,6 +32,7 @@ class SOAPService extends LookupService {
List<GetGetProgressNoteResModel> patientProgressNoteList = []; List<GetGetProgressNoteResModel> patientProgressNoteList = [];
List<GetAssessmentResModel> patientAssessmentList = []; List<GetAssessmentResModel> patientAssessmentList = [];
int episodeID;
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
await baseAppClient.post( await baseAppClient.post(
GET_ALLERGIES, GET_ALLERGIES,
@ -48,6 +50,20 @@ class SOAPService extends LookupService {
); );
} }
Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async {
hasError = false;
await baseAppClient.post(POST_EPISODE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
episodeID = response['EpisodeID'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postEpisodeReqModel.toJson());
}
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
hasError = false; hasError = false;

@ -0,0 +1,29 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/imei_details.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
class AuthService extends BaseService {
List<GetIMEIDetailsModel> _imeiDetails = [];
List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails;
Future selectDeviceImei(imei) async {
try {
// dynamic localRes;
await baseAppClient.post(SELECT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) {
_imeiDetails = [];
response['List_DoctorDeviceDetails'].forEach((v) {
_imeiDetails.add(GetIMEIDetailsModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {"IMEI": imei, "TokenID": "@dm!n"});
//return Future.value(localRes);
} catch (error) {
hasError = true;
super.error = error;
}
}
}

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
@ -12,7 +13,7 @@ class BaseService {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
DoctorProfileModel doctorProfile; DoctorProfileModel doctorProfile;
List<PatientArrivalEntity> patientArrivalList = []; List<PatiantInformtion> patientArrivalList = [];
//TODO add the user login model when we need it //TODO add the user login model when we need it
Future<DoctorProfileModel> getDoctorProfile() async { Future<DoctorProfileModel> getDoctorProfile() async {
@ -50,7 +51,7 @@ class BaseService {
patientArrivalList.clear(); patientArrivalList.clear();
response['patientArrivalList']['entityList'].forEach((v) { response['patientArrivalList']['entityList'].forEach((v) {
PatientArrivalEntity item = PatientArrivalEntity.fromJson(v); PatiantInformtion item = PatiantInformtion.fromJson(v);
patientArrivalList.add(item); patientArrivalList.add(item);
}); });
}, },

@ -14,7 +14,6 @@ class MedicineService extends BaseService {
PharmaciesItemsRequestModel(); PharmaciesItemsRequestModel();
PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel(); PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel();
Future getMedicineItem(String itemName) async { Future getMedicineItem(String itemName) async {
_itemsRequestModel.pHRItemName = itemName; _itemsRequestModel.pHRItemName = itemName;
await baseAppClient.post( await baseAppClient.post(

@ -18,6 +18,7 @@ class PatientReferralService extends LookupService {
List<dynamic> doctorsList = []; List<dynamic> doctorsList = [];
List<MyReferredPatientModel> listMyReferredPatientModel = []; List<MyReferredPatientModel> listMyReferredPatientModel = [];
List<PendingReferral> pendingReferralList = []; List<PendingReferral> pendingReferralList = [];
List<PendingReferral> patientReferralList = [];
String setupID = "0"; String setupID = "0";
Future getProjectsList() async { Future getProjectsList() async {
@ -163,6 +164,33 @@ class PatientReferralService extends LookupService {
); );
} }
Future getPatientReferral(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
await baseAppClient.post(
GET_PATIENT_REFERRAL,
onSuccess: (dynamic response, int statusCode) {
patientReferralList.clear();
response['ReferralList']['entityList'].forEach((v) {
PendingReferral item = PendingReferral.fromJson(v);
item.isReferralDoctorSameBranch =
item.targetProjectId == item.sourceProjectId;
patientReferralList.add(item);
});
},
onFailure: (String error, int statusCode) {
patientReferralList.clear();
hasError = true;
super.error = error;
},
body: body,
);
}
Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async {
hasError = false; hasError = false;
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel doctorProfile = await getDoctorProfile();
@ -221,6 +249,7 @@ class PatientReferralService extends LookupService {
CREATE_REFERRAL_PATIENT, CREATE_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print(response.toString()); print(response.toString());
print("create referral status code = ${statusCode}");
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -3,13 +3,12 @@ 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;
@ -18,14 +17,48 @@ class VitalSignsService extends BaseService{
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = 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) {
if(response['VitalSignsList'] != null){ if (response['VitalSignsList'] != null) {
if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){ if (response['VitalSignsList']['entityList'] != null &&
patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]); (response['VitalSignsList']['entityList'] as List).length > 0) {
patientVitalSigns = VitalSignData.fromJson(
response['VitalSignsList']['entityList'][0]);
}
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error.toString();
},
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) { onFailure: (String error, int statusCode) {

@ -5,6 +5,9 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; 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/master_key_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
class PrescriptionService extends BaseService { class PrescriptionService extends BaseService {
List<PrescriptionModel> _prescriptionList = List(); List<PrescriptionModel> _prescriptionList = List();
@ -13,12 +16,16 @@ class PrescriptionService extends BaseService {
List<SearchDrugModel> get drugsList => _drugsList; List<SearchDrugModel> get drugsList => _drugsList;
List<dynamic> doctorsList = []; List<dynamic> doctorsList = [];
List<dynamic> specialityList = []; List<dynamic> specialityList = [];
List<dynamic> drugToDrug = [];
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel();
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
//search: ["Acetaminophen"],
// vidaAuthTokenID:
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
search: ["Amoxicillin"], search: ["Amoxicillin"],
vidaAuthTokenID: //vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio", // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
); );
PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel _postPrescriptionReqModel =
@ -84,4 +91,18 @@ class PrescriptionService extends BaseService {
body: updatePrescriptionReqModel.toJson(), body: updatePrescriptionReqModel.toJson(),
); );
} }
Future getDrugToDrug(
VitalSignData vital, List<GetAllergiesResModel> allergy) async {
hasError = false;
var request = {};
await baseAppClient.post(DRUG_TO_DRUG,
onSuccess: (dynamic response, int statusCode) {
drugToDrug = [];
//drugToDrug = //response['MedicationList']['entityList'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _drugRequestModel.toJson());
}
} }

@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.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/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
@ -78,6 +79,8 @@ class SOAPViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList => List<GetAssessmentResModel> get patientAssessmentList =>
_SOAPService.patientAssessmentList; _SOAPService.patientAssessmentList;
int get episodeID =>
_SOAPService.episodeID;
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -99,6 +102,17 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postEpisode(postEpisodeReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.postAllergy(postAllergyRequestModel); await _SOAPService.postAllergy(postAllergyRequestModel);
@ -222,6 +236,7 @@ class SOAPViewModel extends BaseViewModel {
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientAllergy(generalGetReqForSOAP); await _SOAPService.getPatientAllergy(generalGetReqForSOAP);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -231,6 +246,14 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
String getAllergicNames(){
String allergiesString='';
patientAllergiesList.forEach((element) {
allergiesString += element.allergyDiseaseName+' , ';
});
return allergiesString;
}
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst); await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst);

@ -1,6 +1,13 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/imei_details.dart';
import 'package:doctor_app_flutter/core/model/insert_imei_model.dart';
import 'package:doctor_app_flutter/core/service/auth_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart';
import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart';
import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
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/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
@ -12,8 +19,9 @@ import '../../models/doctor/user_model.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
class AuthViewModel with ChangeNotifier { class AuthViewModel extends BaseViewModel {
List<ClinicModel> doctorsClinicList = []; List<ClinicModel> doctorsClinicList = [];
String selectedClinicName; String selectedClinicName;
bool isLogin = false; bool isLogin = false;
bool isLoading = true; bool isLoading = true;
@ -71,35 +79,31 @@ class AuthViewModel with ChangeNotifier {
} }
} }
Future<dynamic> insertDeviceImei(imei) async { Future insertDeviceImei(request) async {
try { var loggedIn = await sharedPref.getObj(LOGGED_IN_USER);
dynamic localRes;
await baseAppClient.post(INSERT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: imei);
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> selectDeviceImei(imei) async { request['IMEI'] = DEVICE_TOKEN;
request['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
request['BioMetricEnabled'] = true;
request['MobileNo'] = loggedIn['MobileNumber'];
InsertIMEIDetailsModel nRequest = InsertIMEIDetailsModel.fromJson(request);
nRequest.genderDescription = request['Gender_Description'];
nRequest.genderDescriptionN = request['Gender_DescriptionN'];
nRequest.genderDescriptionN = request['Gender_DescriptionN'];
nRequest.titleDescription = request['Title_Description'];
nRequest.titleDescriptionN = request['Title_DescriptionN'];
nRequest.projectID = await sharedPref.getInt(PROJECT_ID);
nRequest.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
nRequest.vidaRefreshTokenID =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
try { try {
dynamic localRes; var localRes;
await baseAppClient.post(SELECT_DEVICE_IMEI, await baseAppClient.post(INSERT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {}, body: nRequest.toJson());
throw error;
}, body: imei);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
print(error);
throw error; throw error;
} }
} }
@ -120,7 +124,8 @@ class AuthViewModel with ChangeNotifier {
} }
} }
Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async { Future sendActivationCodeForDoctorApp(
ActivationCodeModel activationCodeModel) async {
try { try {
var localRes; var localRes;
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP,
@ -158,8 +163,8 @@ class AuthViewModel with ChangeNotifier {
} }
} }
Future<dynamic> checkActivationCodeForDoctorApp(
Future<dynamic> checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { CheckActivationCodeRequestModel checkActivationCodeRequestModel) async {
try { try {
dynamic localRes; dynamic localRes;
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP,
@ -208,4 +213,21 @@ class AuthViewModel with ChangeNotifier {
throw error; throw error;
} }
} }
Future sendActivationCodeVerificationScreen(
ActivationCodeModel2 activationCodeModel) async {
try {
var localRes;
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: activationCodeModel.toJson());
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
} }

@ -0,0 +1,21 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/imei_details.dart';
import 'package:doctor_app_flutter/core/service/auth_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
class IMEIViewModel extends BaseViewModel {
AuthService _authService = locator<AuthService>();
List<GetIMEIDetailsModel> get imeiDetails => _authService.dashboardItemsList;
Future selectDeviceImei(imei) async {
setState(ViewState.Busy);
await _authService.selectDeviceImei(imei);
if (_authService.hasError) {
error = _authService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -27,9 +27,27 @@ class PatientReferralViewModel extends BaseViewModel {
List<PendingReferral> get pendingReferral => List<PendingReferral> get pendingReferral =>
_referralPatientService.pendingReferralList; _referralPatientService.pendingReferralList;
List<PatientArrivalEntity> get patientArrivalList => List<PendingReferral> get patientReferral =>
_referralPatientService.patientReferralList;
List<PatiantInformtion> get patientArrivalList =>
_referralPatientService.patientArrivalList; _referralPatientService.patientArrivalList;
Future getPatientReferral(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _referralPatientService.getPatientReferral(patient);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else {
if(patientReferral.length == 0){
await getMasterLookup(MasterKeysService.physiotherapyGoals);
} else {
setState(ViewState.Idle);
}
}
}
Future getMasterLookup(MasterKeysService masterKeys) async { Future getMasterLookup(MasterKeysService masterKeys) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.getMasterLookup(masterKeys); await _referralPatientService.getMasterLookup(masterKeys);

@ -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';
@ -11,10 +12,16 @@ import '../../locator.dart';
class VitalSignsViewModel extends BaseViewModel { class VitalSignsViewModel extends BaseViewModel {
VitalSignsService _vitalSignService = locator<VitalSignsService>(); VitalSignsService _vitalSignService = locator<VitalSignsService>();
List<PatientArrivalEntity> get patientArrivalList =>
_vitalSignService.patientArrivalList;
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);
@ -23,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) {

@ -5,6 +5,9 @@ import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; 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/master_key_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
class PrescriptionViewModel extends BaseViewModel { class PrescriptionViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
@ -67,4 +70,16 @@ class PrescriptionViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getDrugToDrug(
VitalSignData vital, List<GetAllergiesResModel> allergy) async {
hasError = false;
setState(ViewState.Busy);
await _prescriptionService.getDrugToDrug(vital, allergy);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
} }

@ -24,6 +24,7 @@ class ProjectViewModel with ChangeNotifier {
List<ClinicModel> doctorClinicsList = []; List<ClinicModel> doctorClinicsList = [];
bool isLoading = false; bool isLoading = false;
bool isError = false; bool isError = false;
bool isLogin = false;
String error = ''; String error = '';
BaseAppClient baseAppClient = BaseAppClient(); BaseAppClient baseAppClient = BaseAppClient();
@ -56,7 +57,9 @@ class ProjectViewModel with ChangeNotifier {
currentLanguage = await sharedPref.getString(APP_Language); currentLanguage = await sharedPref.getString(APP_Language);
_appLocale = Locale(currentLanguage ?? 'en'); _appLocale = Locale(currentLanguage ?? 'en');
_isArabic = currentLanguage != null _isArabic = currentLanguage != null
? currentLanguage == 'ar' ? true : false ? currentLanguage == 'ar'
? true
: false
: false; : false;
notifyListeners(); notifyListeners();
} }

@ -64,10 +64,9 @@ class _LandingPageState extends State<LandingPage> {
ShowCaseWidget( ShowCaseWidget(
builder: Builder(builder: (context) => DashboardScreen()), builder: Builder(builder: (context) => DashboardScreen()),
), ),
MessagesScreen(), // MessagesScreen(),
MyScheduleScreen(), MyScheduleScreen(),
//NewPrescriptionScreen(), // ServicesScreen()
ServicesScreen()
], ],
), ),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),

@ -1,10 +1,13 @@
import 'package:doctor_app_flutter/core/service/auth_service.dart';
import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/medical_file_service.dart'; import 'package:doctor_app_flutter/core/service/medical_file_service.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart';
import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; import 'package:doctor_app_flutter/core/service/sickleave_service.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
@ -54,9 +57,11 @@ void setupLocator() {
locator.registerLazySingleton(() => MedicalFileService()); locator.registerLazySingleton(() => MedicalFileService());
locator.registerLazySingleton(() => AdmissionRequestService()); locator.registerLazySingleton(() => AdmissionRequestService());
locator.registerLazySingleton(() => UcafService()); locator.registerLazySingleton(() => UcafService());
locator.registerLazySingleton(() => AuthService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
locator.registerFactory(() => IMEIViewModel());
locator.registerFactory(() => ScheduleViewModel()); locator.registerFactory(() => ScheduleViewModel());
locator.registerFactory(() => ReferralPatientViewModel()); locator.registerFactory(() => ReferralPatientViewModel());
locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => ReferredPatientViewModel());

@ -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
} }

@ -41,7 +41,7 @@ class MyApp extends StatelessWidget {
), ),
], ],
child: Consumer<ProjectViewModel>( child: Consumer<ProjectViewModel>(
builder: (context,projectProvider,child) => MaterialApp( builder: (context, projectProvider, child) => MaterialApp(
showSemanticsDebugger: false, showSemanticsDebugger: false,
title: 'Flutter Demo', title: 'Flutter Demo',
locale: projectProvider.appLocal, locale: projectProvider.appLocal,
@ -60,13 +60,12 @@ class MyApp extends StatelessWidget {
buttonColor: HexColor('#B8382C'), buttonColor: HexColor('#B8382C'),
fontFamily: 'WorkSans', fontFamily: 'WorkSans',
dividerColor: Colors.grey[350], dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255,255,255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
), ),
initialRoute: INIT_ROUTE, initialRoute: INIT_ROUTE,
routes: routes, routes: routes,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
) )),
),
); );
}); });
}, },

@ -0,0 +1,28 @@
class PostEpisodeReqModel {
int appointmentNo;
int patientMRN;
int doctorID;
String vidaAuthTokenID;
PostEpisodeReqModel(
{this.appointmentNo,
this.patientMRN,
this.doctorID,
this.vidaAuthTokenID});
PostEpisodeReqModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
patientMRN = json['PatientMRN'];
doctorID = json['DoctorID'];
vidaAuthTokenID = json['VidaAuthTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo;
data['PatientMRN'] = this.patientMRN;
data['DoctorID'] = this.doctorID;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}

@ -8,7 +8,7 @@ class ActivationCodeModel {
String password; String password;
int facilityId; int facilityId;
String generalid; String generalid;
String otpSendType;
ActivationCodeModel( ActivationCodeModel(
{this.mobileNumber, {this.mobileNumber,
this.zipCode, this.zipCode,
@ -18,6 +18,7 @@ class ActivationCodeModel {
this.memberID, this.memberID,
this.password, this.password,
this.facilityId, this.facilityId,
this.otpSendType,
this.generalid}); this.generalid});
ActivationCodeModel.fromJson(Map<String, dynamic> json) { ActivationCodeModel.fromJson(Map<String, dynamic> json) {
@ -29,6 +30,7 @@ class ActivationCodeModel {
memberID = json['MemberID']; memberID = json['MemberID'];
password = json['Password']; password = json['Password'];
facilityId = json['facilityId']; facilityId = json['facilityId'];
otpSendType = json['OTP_SendType'];
generalid = json['generalid']; generalid = json['generalid'];
} }
@ -42,6 +44,7 @@ class ActivationCodeModel {
data['MemberID'] = this.memberID; data['MemberID'] = this.memberID;
data['Password'] = this.password; data['Password'] = this.password;
data['facilityId'] = this.facilityId; data['facilityId'] = this.facilityId;
data['OTP_SendType'] = otpSendType;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
return data; return data;
} }

@ -12,7 +12,7 @@ class CheckActivationCodeRequestModel {
String activationCode; String activationCode;
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
int oTPSendType;
CheckActivationCodeRequestModel( CheckActivationCodeRequestModel(
{this.mobileNumber, {this.mobileNumber,
this.zipCode, this.zipCode,
@ -26,7 +26,8 @@ class CheckActivationCodeRequestModel {
this.logInTokenID, this.logInTokenID,
this.activationCode, this.activationCode,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID}); this.vidaRefreshTokenID,
this.oTPSendType});
CheckActivationCodeRequestModel.fromJson(Map<String, dynamic> json) { CheckActivationCodeRequestModel.fromJson(Map<String, dynamic> json) {
mobileNumber = json['MobileNumber']; mobileNumber = json['MobileNumber'];
@ -42,6 +43,7 @@ class CheckActivationCodeRequestModel {
activationCode = json['activationCode']; activationCode = json['activationCode'];
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
oTPSendType = json['OTP_SendType'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -59,6 +61,7 @@ class CheckActivationCodeRequestModel {
data['activationCode'] = this.activationCode; data['activationCode'] = this.activationCode;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['OTP_SendType'] = this.oTPSendType;
return data; return data;
} }
} }

@ -0,0 +1,60 @@
class ActivationCodeModel2 {
int oTPSendType;
String mobileNumber;
String zipCode;
int channel;
int languageID;
double versionID;
int memberID;
int facilityId;
String generalid;
int isMobileFingerPrint;
String vidaAuthTokenID;
String vidaRefreshTokenID;
ActivationCodeModel2(
{this.oTPSendType,
this.mobileNumber,
this.zipCode,
this.channel,
this.languageID,
this.versionID,
this.memberID,
this.facilityId,
this.generalid,
this.isMobileFingerPrint,
this.vidaAuthTokenID,
this.vidaRefreshTokenID});
ActivationCodeModel2.fromJson(Map<String, dynamic> json) {
oTPSendType = json['OTP_SendType'];
mobileNumber = json['MobileNumber'];
zipCode = json['ZipCode'];
channel = json['Channel'];
languageID = json['LanguageID'];
versionID = json['VersionID'];
memberID = json['MemberID'];
facilityId = json['facilityId'];
generalid = json['generalid'];
isMobileFingerPrint = json['IsMobileFingerPrint'];
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['OTP_SendType'] = this.oTPSendType;
data['MobileNumber'] = this.mobileNumber;
data['ZipCode'] = this.zipCode;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['VersionID'] = this.versionID;
data['MemberID'] = this.memberID;
data['facilityId'] = this.facilityId;
data['generalid'] = this.generalid;
data['IsMobileFingerPrint'] = this.isMobileFingerPrint;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
return data;
}
}

@ -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';

@ -1,7 +1,17 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/service/auth_service.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../../lookups/auth_lookup.dart'; import '../../lookups/auth_lookup.dart';
@ -23,21 +33,48 @@ class _LoginsreenState extends State<Loginsreen> {
Future<SharedPreferences> _prefs = SharedPreferences.getInstance(); Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
String platformImei; String platformImei;
Future<String> platformImeiFuture; // Future<String> platformImeiFuture;
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
bool _isLoading = true;
ProjectViewModel projectViewModel;
AuthService authService = AuthService();
@override
void initState() {
super.initState();
bool _isLoading = false; _firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions();
}
_firebaseMessaging.getToken().then((String token) async {
if (DEVICE_TOKEN == "" && projectViewModel.isLogin == false) {
DEVICE_TOKEN = token;
changeLoadingStata(true);
authService.selectDeviceImei(DEVICE_TOKEN).then((value) {
print(authService.dashboardItemsList);
Future<void> getSharedPref() async { if (authService.dashboardItemsList.length > 0) {
sharedPref.getString('platformImei').then((imei) { sharedPref.setObj(
platformImei = imei; LAST_LOGIN_USER, authService.dashboardItemsList[0]);
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (BuildContext context) => VerificationMethodsScreen(
password: null,
)));
} else {
changeLoadingStata(false);
}
//changeLoadingStata(false);
}); });
} else {
changeLoadingStata(false);
} }
@override // else if (projectViewModel.isLogin) {
void initState() { // getNotificationCount(token);
super.initState(); // }
platformImeiFuture = _prefs.then((SharedPreferences prefs) { }).catchError((err) {
return (prefs.getString('platformImei')); print(err);
}); });
} }
@ -56,54 +93,46 @@ class _LoginsreenState extends State<Loginsreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
getSharedPref(); projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold(
isLoading: _isLoading, return BaseView<IMEIViewModel>(
onModelReady: (model) => {},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: SafeArea( body: SafeArea(
child: ListView(children: <Widget>[ child: (_isLoading == false)
FutureBuilder( ? ListView(children: <Widget>[
future: platformImeiFuture, Container(
builder: (BuildContext context, AsyncSnapshot<String> snapshot) { margin:
switch (snapshot.connectionState) { EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30),
case ConnectionState.waiting:
return DrAppCircularProgressIndeicator();
default:
if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
} else {
return Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
(platformImei == null) Column(
? Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AuthHeader(loginType.knownUser), AuthHeader(loginType.knownUser),
LoginForm( LoginForm(
changeLoadingStata: changeLoadingStata: changeLoadingStata,
changeLoadingStata,
), ),
], ],
) )
: Column(
crossAxisAlignment: // : Column(
CrossAxisAlignment.start, // crossAxisAlignment:
children: <Widget>[ // CrossAxisAlignment.start,
AuthHeader(loginType.unknownUser), // children: <Widget>[
KnownUserLogin(), // AuthHeader(loginType.unknownUser),
], // KnownUserLogin(),
), // ],
])); // ),
} ]))
} ])
}), : Center(child: CircularProgressIndicator()),
]),
), ),
); ));
} }
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
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/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
@ -9,14 +10,17 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_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/referral/my-referral-patient-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.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/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -45,6 +49,7 @@ class DashboardScreen extends StatefulWidget {
} }
class _DashboardScreenState extends State<DashboardScreen> { class _DashboardScreenState extends State<DashboardScreen> {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
HospitalViewModel hospitalProvider; HospitalViewModel hospitalProvider;
AuthViewModel authProvider; AuthViewModel authProvider;
bool isLoading = false; bool isLoading = false;
@ -58,6 +63,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
if (_isInit) { if (_isInit) {
projectsProvider = Provider.of<ProjectViewModel>(context); projectsProvider = Provider.of<ProjectViewModel>(context);
projectsProvider.getDoctorClinicsList(); projectsProvider.getDoctorClinicsList();
_firebaseMessaging.setAutoInitEnabled(true);
_firebaseMessaging.getToken().then((String token) async {
if (token != '') {
DEVICE_TOKEN = token;
var request = await sharedPref.getObj(DOCTOR_PROFILE);
authProvider.insertDeviceImei(request).then((value) {
print(value['ReturnValue']);
changeIsLoading(false);
});
}
});
} }
_isInit = false; _isInit = false;
} }
@ -77,6 +94,27 @@ class _DashboardScreenState extends State<DashboardScreen> {
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus(); currentFocus.unfocus();
} }
var _patientSearchFormValues = PatientModel(
FirstName: "0",
MiddleName: "0",
LastName: "0",
PatientMobileNumber: "0",
PatientIdentificationID: "0",
PatientID: 0,
From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(),
To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(),
LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z",
IPAdress: "11.11.11.11",
VersionID: 1.2,
Channel: 9,
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
SessionID: "5G0yXn0Jnq",
IsLoginForDoctorApp: true,
PatientOutSA: false);
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
//onModelReady: (model) => model.getDashboard(), //onModelReady: (model) => model.getDashboard(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -649,7 +687,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
AppText( AppText(
model.dashboardItemsList.length > 0 model.dashboardItemsList.length > 0
? getPatientCount( ? getPatientCount(
model.dashboardItemsList[7]) model.dashboardItemsList[5])
: "", : "",
fontSize: SizeConfig.textMultiplier * 6, fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white, color: Colors.white,
@ -693,7 +731,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white, color: Colors.white,
), ),
AppText( AppText(
TranslationBase.of(context).radiology, TranslationBase.of(context).clinic,
color: Colors.white, color: Colors.white,
) )
], ],
@ -957,6 +995,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
height: 20, height: 20,
), ),
Row( Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
DashboardItem( DashboardItem(
child: Column( child: Column(
@ -984,6 +1024,33 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
); );
}, },
),
SizedBox(
width: 8,
),
DashboardItem(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
DoctorApp.patient,
size: 50,
),
AppText(
TranslationBase.of(context).arrived,
color: Colors.black,
textAlign: TextAlign.center,
)
],
),
hasBorder: true,
onTap: () {
Navigator.of(context)
.pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues,
"selectedType": "7"
});
},
) )
], ],
), ),

@ -68,21 +68,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
try { try {
/* Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile)*/;
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
_formKey.currentState.save(); _formKey.currentState.save();
/* sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType);
String token = await sharedPref.getString(TOKEN);
_patientSearchFormValues.TokenID = token;
_patientSearchFormValues.ProjectID = doctorProfile.projectID; //15
_patientSearchFormValues.DoctorID = doctorProfile.doctorID;
_patientSearchFormValues.ClinicID = doctorProfile.clinicID;*/
if ((_patientSearchFormValues.From == "0" || if ((_patientSearchFormValues.From == "0" ||
_patientSearchFormValues.To == "0") && _patientSearchFormValues.To == "0") &&
_selectedType == "7") { _selectedType == "7") {

@ -274,7 +274,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
.then((res) { .then((res) {
setState(() { setState(() {
_isLoading = false; _isLoading = false;
if (res['MessageStatus'] == 1) {
if (res != null && res['MessageStatus'] == 1) {
if (val2 == 7) { if (val2 == 7) {
if (res[SERVICES_PATIANT2[val2]] == null) { if (res[SERVICES_PATIANT2[val2]] == null) {
_isError = true; _isError = true;
@ -282,6 +283,9 @@ class _PatientsScreenState extends State<PatientsScreen> {
this.error = error.toString(); this.error = error.toString();
} else { } else {
var localList = []; var localList = [];
if(res["patientArrivalList"]["entityList"] == null){
res["patientArrivalList"]["entityList"] = [];
}
res["patientArrivalList"]["entityList"].forEach((v) { res["patientArrivalList"]["entityList"].forEach((v) {
Map<String, dynamic> mergedPatient = { Map<String, dynamic> mergedPatient = {
...v, ...v,
@ -289,7 +293,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
}; };
localList.add(mergedPatient); localList.add(mergedPatient);
}); });
print(localList.toString());
lItems = localList; lItems = localList;
} }
} else { } else {
@ -301,7 +304,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
_isError = false; _isError = false;
} else { } else {
_isError = true; _isError = true;
error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; error = model.error; //res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
} }
}); });
}).catchError((error) { }).catchError((error) {
@ -673,7 +676,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,
}); });
}, },
), ),

@ -72,11 +72,11 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
), ),
Container( Container(
margin: margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16), EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).save, TranslationBase.of(context).save,
hasBorder: true, hasBorder: true,
vPadding: 16, vPadding: 8,
hPadding: 8, hPadding: 8,
borderColor: HexColor("#B8382B"), borderColor: HexColor("#B8382B"),
backgroundColor: HexColor("#B8382B"), backgroundColor: HexColor("#B8382B"),
@ -87,11 +87,11 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
), ),
Container( Container(
margin: margin:
EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 16), EdgeInsets.only(left: 16, right: 16, top: 0.0, bottom: 8),
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancel,
hasBorder: true, hasBorder: true,
vPadding: 16, vPadding: 8,
hPadding: 8, hPadding: 8,
borderColor: Colors.white, borderColor: Colors.white,
backgroundColor: Colors.white, backgroundColor: Colors.white,

@ -12,6 +12,7 @@ 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/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -39,7 +40,7 @@ class MyReferralDetailScreen extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
body: Column( body: model.patientArrivalList != null ? Column(
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -110,8 +111,8 @@ class MyReferralDetailScreen extends StatelessWidget {
icon: 'lab.png'), icon: 'lab.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
// patient: patient, 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'),
@ -160,6 +161,15 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
], ],
) : Container(
child: Center(
child: AppText(
TranslationBase.of(context).patientNoDetailErrMsg,
color: HexColor("#B8382B"),
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
), ),
), ),
); );

@ -8,6 +8,7 @@ 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/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
@ -40,11 +41,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
referToList = List();
dynamic sameBranch = {"id": 1, "name": "Same Branch"};
dynamic otherBranch = {"id": 2, "name": "Other Branch"};
referToList.add(sameBranch);
referToList.add(otherBranch);
appointmentDate = DateTime.now(); appointmentDate = DateTime.now();
} }
@ -53,11 +50,22 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
referToList = List();
dynamic sameBranch = {
"id": 1,
"name": TranslationBase.of(context).sameBranch
};
dynamic otherBranch = {
"id": 2,
"name": TranslationBase.of(context).otherBranch
};
referToList.add(sameBranch);
referToList.add(otherBranch);
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<PatientReferralViewModel>( return BaseView<PatientReferralViewModel>(
onModelReady: (model) => onModelReady: (model) => model.getPatientReferral(patient),
model.getMasterLookup(MasterKeysService.physiotherapyGoals),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
@ -84,9 +92,61 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
model.patientReferral.length == 0
? ReferralForm(model, screenSize)
: PatientReferralItemWidget(
patientName: model.patientReferral[0].patientName,
referralStatus: "${model.patientReferral[0].referralStatus}",
isReferredTo: true,
isSameBranch: model.patientReferral[0]
.isReferralDoctorSameBranch,
referralDoctorName:
model.patientReferral[0].referredByDoctorInfo,
clinicDescription: null,
remark:
model.patientReferral[0].remarksFromSource
),
],
),
if (model.patientReferral.length == 0)
Container( Container(
margin: margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: AppButton(
title: TranslationBase.of(context).refer,
color: HexColor("#B8382B"),
onPressed: () {
if (appointmentDate == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null) return;
model
.makeReferral(
patient,
appointmentDate.toIso8601String(),
_selectedBranch['ID'],
_selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'],
_remarksController.text)
.then((_) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context);
});
},
),
)
],
),
),
),
),
);
}
Widget ReferralForm(PatientReferralViewModel model, Size screenSize) {
return Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -106,8 +166,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
child: InkWell( child: InkWell(
onTap: referToList != null onTap: referToList != null
? () { ? () {
ListSelectDialog dialog = ListSelectDialog dialog = ListSelectDialog(
ListSelectDialog(
list: referToList, list: referToList,
attributeName: 'name', attributeName: 'name',
attributeValueId: 'id', attributeValueId: 'id',
@ -118,13 +177,10 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedBranch = null; _selectedBranch = null;
_selectedClinic = null; _selectedClinic = null;
_selectedDoctor = null; _selectedDoctor = null;
model model.getDoctorBranch().then((value) {
.getDoctorBranch()
.then((value) {
_selectedBranch = value; _selectedBranch = value;
if (_referTo['id'] == 1) { if (_referTo['id'] == 1) {
model.getClinics( model.getClinics(_selectedBranch['ID']);
_selectedBranch['ID']);
} }
}); });
}); });
@ -159,8 +215,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_referTo != null && _referTo != null &&
_referTo['id'] == 2 _referTo['id'] == 2
? () { ? () {
ListSelectDialog dialog = ListSelectDialog dialog = ListSelectDialog(
ListSelectDialog(
list: model.branchesList, list: model.branchesList,
attributeName: 'Desciption', attributeName: 'Desciption',
attributeValueId: 'ID', attributeValueId: 'ID',
@ -170,8 +225,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedBranch = selectedValue; _selectedBranch = selectedValue;
_selectedClinic = null; _selectedClinic = null;
_selectedDoctor = null; _selectedDoctor = null;
model.getClinics( model.getClinics(_selectedBranch['ID']);
_selectedBranch['ID']);
}); });
}, },
); );
@ -205,8 +259,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.clinicsList != null && model.clinicsList != null &&
model.clinicsList.length > 0 model.clinicsList.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog dialog = ListSelectDialog(
ListSelectDialog(
list: model.clinicsList, list: model.clinicsList,
attributeName: 'ClinicDescription', attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID', attributeValueId: 'ClinicID',
@ -216,8 +269,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedDoctor = null; _selectedDoctor = null;
_selectedClinic = selectedValue; _selectedClinic = selectedValue;
model.getClinicDoctors( model.getClinicDoctors(
_selectedClinic['ClinicID'] _selectedClinic['ClinicID'].toString());
.toString());
}); });
}, },
); );
@ -251,8 +303,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.doctorsList != null && model.doctorsList != null &&
model.doctorsList.length > 0 model.doctorsList.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog dialog = ListSelectDialog(
ListSelectDialog(
list: model.doctorsList, list: model.doctorsList,
attributeName: 'DoctorName', attributeName: 'DoctorName',
attributeValueId: 'DoctorID', attributeValueId: 'DoctorID',
@ -292,8 +343,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
onTap: () => _selectDate(context, model), onTap: () => _selectDate(context, model),
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context).chooseAppointment,
.chooseAppointment,
appointmentDate != null appointmentDate != null
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
: null, : null,
@ -312,14 +362,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
Container( Container(
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).remarks, TranslationBase.of(context).remarks, null, false),
null,
false),
enabled: true, enabled: true,
controller: _remarksController, controller: _remarksController,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))
RegExp(ONLY_LETTERS))
], ],
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
minLines: 4, minLines: 4,
@ -327,41 +374,6 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
)), )),
], ],
), ),
),
],
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).refer,
color: HexColor("#B8382B"),
onPressed: () {
if (appointmentDate == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null) return;
model
.makeReferral(
patient,
appointmentDate.toIso8601String(),
_selectedBranch['ID'],
_selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'],
_remarksController.text)
.then((_) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context);
});
},
),
)
],
),
),
),
),
); );
} }

@ -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,146 @@
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];
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(vital.vitalSignDate.weekday) : DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(vital.vitalSignDate.month) : DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.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,128 +1,78 @@
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; return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to),
@override builder: (_, mode, widget) => AppScaffold(
Widget build(BuildContext context) { isShowAppBar: true,
final routeArgs = ModalRoute.of(context).settings.arguments as Map; baseViewModel: mode,
vitalSing = routeArgs['vitalSing'];
return BaseView<PatientViewModel>(
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(
child: Column(
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () { onTap: () =>isNotOneAppointment? Navigator.push(
Navigator.of(context).pushNamed( context,
BODY_MEASUREMENTS, FadePage(
arguments: { page: VitalSignItemDetailsScreen(
'title': TranslationBase.of(context) pageKey: vitalSignDetails.Height,
.bodyMeasurements, pageTitle: TranslationBase.of(context).height,
'key': vitalList: mode.patientVitalSignsHistory,
vitalSignDetails.bodyMeasurements ),
}); ),
}, ):null,
child: Container( child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context) des: TranslationBase.of(context).height,
.bodyMeasurements, imagePath: "${imageBasePath}vital_height.png",
url: url + 'heartbeat.png', lastVal: mode.heightCm,
lastVal: model unit: TranslationBase.of(context).cm,
.patientVitalSignOrderdSubList[0]
.heightCm
.toString(),
unit: 'Cm',
), ),
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () => isNotOneAppointment ? Navigator.push(
Navigator.of(context).pushNamed( context,
BODY_MEASUREMENTS, FadePage(
arguments: { page: VitalSignItemDetailsScreen(
'title': TranslationBase.of(context) pageKey: vitalSignDetails.Weight,
.temperature, pageTitle: TranslationBase.of(context).weight,
'key': vitalSignDetails.temperature, vitalList: mode.patientVitalSignsHistory,
}); ),
},
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context)
.temperature,
url: url + 'heartbeat.png',
lastVal: model
.patientVitalSignOrderdSubList[0]
.temperatureCelcius
.toString(),
unit: 'C',
), ),
):null,
child: VitalSignItem(
des: TranslationBase.of(context).weight,
imagePath: "${imageBasePath}vital_weight.png",
unit: TranslationBase.of(context).kg,
lastVal: mode.weightKg,
), ),
), ),
], ],
@ -130,44 +80,43 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
Row( Row(
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () { onTap: () => isNotOneAppointment ? Navigator.push(
Navigator.of(context).pushNamed( context,
BODY_MEASUREMENTS, FadePage(
arguments: { page: VitalSignItemDetailsScreen(
'title': pageKey: vitalSignDetails.BodyMeasurements,
TranslationBase.of(context).pulse, pageTitle: TranslationBase.of(context)
'key': vitalSignDetails.pulse .bodyMeasurements,
}); vitalList: mode.patientVitalSignsHistory,
}, ),
),
): null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).pulse, des: TranslationBase.of(context).body,
url: url + 'heartbeat.png', imagePath: "${imageBasePath}vital_body_mass.png",
lastVal: model lastVal: mode.bodyMax,
.patientVitalSignOrderdSubList[0] unit: TranslationBase.of(context).mass,
.pulseBeatPerMinute
.toString(),
unit: 'M',
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () => isNotOneAppointment ? Navigator.push(
Navigator.of(context).pushNamed( context,
BODY_MEASUREMENTS, FadePage(
arguments: { page: VitalSignItemDetailsScreen(
'title': TranslationBase.of(context) pageKey: vitalSignDetails.Temperature,
.respiration, pageTitle:
'key': vitalSignDetails.pespiration TranslationBase.of(context).temperature,
}); vitalList: mode.patientVitalSignsHistory,
}, ),
),
):null,
child: Container(
child: VitalSignItem( child: VitalSignItem(
des: des: TranslationBase.of(context).temperature,
TranslationBase.of(context).respiration, imagePath: "${imageBasePath}vital_temperature.png",
url: url + 'heartbeat.png', lastVal: mode.temperatureCelcius,
lastVal: model unit: TranslationBase.of(context).tempC,
.patientVitalSignOrderdSubList[0] ),
.respirationBeatPerMinute
.toString(),
unit: 'M',
), ),
), ),
], ],
@ -175,44 +124,40 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
Row( Row(
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () { onTap: () => isNotOneAppointment ? Navigator.push(
Navigator.of(context).pushNamed( context,
BODY_MEASUREMENTS, FadePage(
arguments: { page: VitalSignItemDetailsScreen(
'title': TranslationBase.of(context) pageKey: vitalSignDetails.heart,
.bloodPressure, pageTitle: TranslationBase.of(context).heart,
'key': vitalSignDetails.bloodPressure vitalList: mode.patientVitalSignsHistory,
}); ),
}, ),
):null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context) des: TranslationBase.of(context).heart,
.bloodPressure, imagePath: "${imageBasePath}vital_heart_rate.png",
url: url + 'heartbeat.png', lastVal: mode.hartRat,
lastVal: model unit: TranslationBase.of(context).bpm,
.patientVitalSignOrderdSubList[0]
.bloodPressure
.toString(),
unit: '',
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () => isNotOneAppointment ? Navigator.push(
Navigator.of(context).pushNamed( context,
BODY_MEASUREMENTS, FadePage(
arguments: { page: VitalSignItemDetailsScreen(
'title': TranslationBase.of(context) pageKey: vitalSignDetails.Respiration,
.oxygenation, pageTitle:
'key': vitalSignDetails.oxygenation TranslationBase.of(context).respirationRate,
}); vitalList: mode.patientVitalSignsHistory,
}, ),
),
):null,
child: VitalSignItem( child: VitalSignItem(
des: des: TranslationBase.of(context).respirationRate,
TranslationBase.of(context).oxygenation, imagePath: "${imageBasePath}vital_respiration.png",
url: url + 'heartbeat.png', lastVal: mode.respirationBeatPerMinute,
lastVal: model unit: TranslationBase.of(context).respirationSigns,
.patientVitalSignOrderdSubList[0].fIO2
.toString(),
unit: '',
), ),
), ),
], ],
@ -221,26 +166,32 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () { onTap: () => isNotOneAppointment ? Navigator.push(
Navigator.of(context).pushNamed( context,
BODY_MEASUREMENTS, FadePage(
arguments: { page: VitalSignItemDetailsScreen(
'title': TranslationBase.of(context) pageKey: vitalSignDetails.BloodPressure,
.painScale, pageTitle: TranslationBase.of(context).bloodPressure,
'key': vitalSignDetails.painScale vitalList: mode.patientVitalSignsHistory,
}); ),
}, ),
):null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase des: TranslationBase.of(context).bloodPressure,
.of(context) imagePath: "${imageBasePath}vital_blood-pressure.png",
.painScale, lastVal: mode.bloodPressure,
url: url + 'heartbeat.png', unit: TranslationBase.of(context).sysDias,
), ),
), ),
], ],
), ),
], ],
), ),
),),); )
: Center(
child: AppText('No Data'),
),
),
);
} }
} }

@ -0,0 +1,122 @@
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];
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(vital.vitalSignDate.weekday) : DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(vital.vitalSignDate.month) : DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.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>[
Container(
height: 0.10 * SizeConfig.realScreenHeight,
child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 2, flex: 2,
child: Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
des, des,
style: TextStyle( style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
color: HexColor('#B8382C'), color: HexColor('#B8382C'),
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold,
),
),
),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: Column( child: Container(
children: <Widget>[
Expanded(
child: Image.asset( child: Image.asset(
url, imagePath,
height: SizeConfig.heightMultiplier * 7, width: 40,
height: 40,
)),
)
],
), ),
), ),
Expanded( Expanded(
child: Container(
width: double.infinity,
child: Align(
alignment: Alignment.topRight,
child: Container(
margin: EdgeInsets.only(left: 5, right: 5),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
style: TextStyle(color: Colors.black), style: TextStyle(color: Colors.black),
children: [ children: [
new TextSpan(text: lastVal), TextSpan(text: "$lastVal "),
new TextSpan( TextSpan(
text: ' ${unit}', text: unit,
style: TextStyle( style: TextStyle(
color: HexColor('#B8382C'), color: HexColor('#B8382C'),
), ),
), ),
], ]),
),
),
),
), ),
))
],
), ),
)
], ],
), ),
), ),

File diff suppressed because one or more lines are too long

@ -1,16 +1,14 @@
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/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 +19,46 @@ 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) {
if( element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0)
timeSeriesData.add(
TimeSeriesSales2(
new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day),
element.toJson()[viewKey].toDouble(),
),
);
},
);
}
return timeSeriesData.reversed.toList();
}
} }

@ -0,0 +1,85 @@
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/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) {
if (element.toJson()[viewKey1]?.toInt() != 0)
timeSeriesData1.add(
TimeSeriesSales2(
new DateTime(element.vitalSignDate.year,
element.vitalSignDate.month, element.vitalSignDate.day),
element.toJson()[viewKey1].toDouble(),
),
);
if (element.toJson()[viewKey2]?.toInt() != 0)
timeSeriesData2.add(
TimeSeriesSales2(
new DateTime(element.vitalSignDate.year,
element.vitalSignDate.month, element.vitalSignDate.day),
element.toJson()[viewKey2].toDouble(),
),
);
},
);
}
}
}

@ -7,6 +7,7 @@ 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';
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/prescription/drugtodrug.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
@ -713,7 +714,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.addMedication, .addMedication,
onPressed: () { onPressed: () {
formKey.currentState.save(); formKey.currentState.save();
// Navigator.pop(context);
// openDrugToDrug();
if (strength == null || if (strength == null ||
route == null || route == null ||
frequency == null || frequency == null ||
@ -728,26 +730,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
} }
if (formKey.currentState.validate()) { if (formKey.currentState.validate()) {
postProcedure(
patient: widget.patient,
doseTimeIn:
doseTime['id'].toString(),
model: widget.model,
duration:
duration['id'].toString(),
frequency:
frequency['id'].toString(),
route: route['id'].toString(),
drugId: selectedDrug['ItemId']
.toString(),
strength:
strength['id'].toString(),
indication:
indicationController.text,
instruction:
instructionController.text,
doseTime: selectedDate);
Navigator.pop(context); Navigator.pop(context);
openDrugToDrug();
} }
{ {
// Navigator.push( // Navigator.push(
@ -824,4 +808,44 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
); );
} }
openDrugToDrug() {
showModalBottomSheet(
context: context,
builder: (context) {
return Container(
height: SizeConfig.realScreenHeight * .5,
width: SizeConfig.realScreenWidth,
child: SingleChildScrollView(
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
DrugToDrug(widget.patient),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: AppButton(
title: TranslationBase.of(context).addMedication,
onPressed: () {
postProcedure(
patient: widget.patient,
doseTimeIn: doseTime['id'].toString(),
model: widget.model,
duration: duration['id'].toString(),
frequency: frequency['id'].toString(),
route: route['id'].toString(),
drugId: selectedDrug['ItemId'].toString(),
strength: strength['id'].toString(),
indication: indicationController.text,
instruction: instructionController.text,
doseTime: selectedDate);
},
))
],
)),
//],
//)
);
});
}
} }

@ -0,0 +1,89 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.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_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
class DrugToDrug extends StatefulWidget {
final PatiantInformtion patient;
DrugToDrug(this.patient);
@override
_DrugToDrug createState() => _DrugToDrug();
}
class _DrugToDrug extends State<DrugToDrug> {
int typeID = 1;
List<Map<dynamic, dynamic>> expandableList = [
{'name': 'CRITICAL'},
{'name': 'HIGH'},
{'name': 'MODERATE'},
{'name': 'LOW'},
{'name': 'INFO'},
];
@override
void initState() {
getTypeID();
super.initState();
}
@override
Widget build(BuildContext context) {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: 2954208, //widget.patient.patientMRN,
episodeId: 210011002, //widget.patient.episodeNo,
appointmentNo: 2016055308, //widget.patient.appointmentNo,
doctorID: '',
editedBy: '');
return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientVitalSign(widget.patient),
builder: (BuildContext context, model, Widget child) {
return BaseView<SOAPViewModel>(
onModelReady: (model2) =>
model2.getPatientAllergy(generalGetReqForSOAP),
builder: (BuildContext context, model2, Widget child) {
return BaseView<PrescriptionViewModel>(
onModelReady: (model3) => model3.getDrugToDrug(
model.patientVitalSigns, model2.patientAllergiesList),
builder: (BuildContext context,
PrescriptionViewModel model3, Widget child) =>
NetworkBaseView(
baseViewModel: model3,
child: Container(
height: SizeConfig.realScreenHeight * .45,
child: new ListView.builder(
itemCount: expandableList.length,
itemBuilder: (context, i) {
return new ExpansionTile(
title: new Text(
expandableList[i]['name'],
style: new TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic),
),
children: <Widget>[Text('Hi')],
);
}))));
});
});
}
getTypeID() async {
var type = await sharedPref.getString(SLECTED_PATIENT_TYPE) == '0' ? 2 : 1;
setState(() {
typeID = type;
});
}
}

@ -792,7 +792,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"doctorId": this.profile['DoctorID'], "doctorId": this.profile['DoctorID'],
"dateTimeFrom": fromDate, "dateTimeFrom": fromDate,
"dateTimeTo": toDate, "dateTimeTo": toDate,
"date": df.format(DateTime.now()), "date": offTime == '1' ? fromDate : df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": "coveringDoctorId":
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
@ -846,7 +846,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"doctorId": this.profile['DoctorID'], "doctorId": this.profile['DoctorID'],
"dateTimeFrom": fromDate, "dateTimeFrom": fromDate,
"dateTimeTo": toDate, "dateTimeTo": toDate,
"date": df.format(DateTime.now()), "date": offTime == '1' ? fromDate : df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": "coveringDoctorId":
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,

@ -77,5 +77,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;
}
}
} }

@ -346,10 +346,12 @@ class Helpers {
} }
logout() async { logout() async {
DEVICE_TOKEN = "";
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
await clearSharedPref(); await clearSharedPref();
sharedPref.setString(APP_Language, lang); sharedPref.setString(APP_Language, lang);
Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN);
// TODO Fix it // TODO Fix it
// Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); // Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN)));
} }
@ -394,7 +396,8 @@ class Helpers {
} }
static BoxDecoration containerBorderDecoration( static BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor, {double borderWidth = -1}) { Color containerColor, Color borderColor,
{double borderWidth = -1}) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,

@ -555,9 +555,75 @@ class TranslationBase {
localizedValues['approvalRequired'][locale.languageCode]; localizedValues['approvalRequired'][locale.languageCode];
String get uncoveredByDoctor => String get uncoveredByDoctor =>
localizedValues['uncoveredByDoctor'][locale.languageCode]; localizedValues['uncoveredByDoctor'][locale.languageCode];
String get chiefComplaintEmptyMsg =>
localizedValues['chiefComplaintEmptyMsg'][locale.languageCode];
String get moreVerification =>
localizedValues['more-verify'][locale.languageCode];
String get welcomeBack =>
localizedValues['welcome-back'][locale.languageCode];
String get accountInfo =>
localizedValues['account-info'][locale.languageCode];
String get useAnotherAccount =>
localizedValues['another-acc'][locale.languageCode];
String get verifyLoginWith =>
localizedValues['verify-login-with'][locale.languageCode];
String get register => localizedValues['register-user'][locale.languageCode];
String get verifyFingerprint =>
localizedValues['verify-with-fingerprint'][locale.languageCode];
String get verifyFaceID =>
localizedValues['verify-with-faceid'][locale.languageCode];
String get verifySMS =>
localizedValues['verify-with-sms'][locale.languageCode];
String get verifyWhatsApp =>
localizedValues['verify-with-whatsapp'][locale.languageCode];
String get lastLoginAt => localizedValues['last-login'][locale.languageCode];
String get lastLoginWith =>
localizedValues['last-login-with'][locale.languageCode];
String get verifyFingerprint2 =>
localizedValues['verify-fingerprint'][locale.languageCode];
String get verificationMessage =>
localizedValues['verification_message'][locale.languageCode];
String get validationMessage =>
localizedValues['validation_message'][locale.languageCode];
String get addAssessment => String get addAssessment =>
localizedValues['addAssessment'][locale.languageCode]; localizedValues['addAssessment'][locale.languageCode];
String get assessment => localizedValues['assessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode];
String get physicalSystemExamination =>
localizedValues['physicalSystemExamination'][locale.languageCode];
String get searchExamination =>
localizedValues['searchExamination'][locale.languageCode];
String get addExamination =>
localizedValues['addExamination'][locale.languageCode];
String get doc => localizedValues['doc'][locale.languageCode];
String get patientNoDetailErrMsg =>
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 chiefComplaintEmptyMsg => String get chiefComplaintEmptyMsg =>
localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; localizedValues['chiefComplaintEmptyMsg'][locale.languageCode];
String get physicalSystemExamination => String get physicalSystemExamination =>

@ -70,8 +70,8 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthViewModel authProv = Provider.of<AuthViewModel>(context); AuthViewModel authProv = Provider.of<AuthViewModel>(context);
var imeiModel = {'IMEI': _platformImei}; // var imeiModel = {'IMEI': _platformImei};
_loginTypeFuture = authProv.selectDeviceImei(imeiModel); // _loginTypeFuture = authProv.selectDeviceImei(imeiModel);
return FutureBuilder( return FutureBuilder(
future: Future.wait([_loggedUserFuture, _loginTypeFuture]), future: Future.wait([_loggedUserFuture, _loginTypeFuture]),
builder: (BuildContext context, AsyncSnapshot snapshot) { builder: (BuildContext context, AsyncSnapshot snapshot) {

@ -224,26 +224,29 @@ class _LoginFormState extends State<LoginForm> {
} }
login(context, AuthViewModel authProv, Function changeLoadingStata) { login(context, AuthViewModel authProv, Function changeLoadingStata) {
FocusScopeNode currentFocus = FocusScope.of(context); showLoading();
changeLoadingStata(true);
if (loginFormKey.currentState.validate()) { if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save(); loginFormKey.currentState.save();
sharedPref.setInt(PROJECT_ID, userInfo.projectID); sharedPref.setInt(PROJECT_ID, userInfo.projectID);
authProv.login(userInfo).then((res) { authProv.login(userInfo).then((res) {
changeLoadingStata(false); //changeLoadingStata(false);
hideLoading();
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
// insertDeviceImei(res, authProv); // insertDeviceImei(res, authProv);
saveObjToString(LOGGED_IN_USER, res); saveObjToString(LOGGED_IN_USER, res);
sharedPref.remove(LAST_LOGIN_USER);
sharedPref.setString(TOKEN, res['LogInTokenID']); sharedPref.setString(TOKEN, res['LogInTokenID']);
print("token" + res['LogInTokenID']); print("token" + res['LogInTokenID']);
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (BuildContext context) => VerificationMethodsScreen(password: userInfo.password,))); Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (BuildContext context) => VerificationMethodsScreen(
password: userInfo.password,
)));
} else { } else {
// handel error // handel error
helpers.showErrorToast(res['ErrorEndUserMessage']); helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
print('$err'); hideLoading();
changeLoadingStata(false); changeLoadingStata(false);
helpers.showErrorToast(err); helpers.showErrorToast(err);
}); });
@ -273,7 +276,11 @@ class _LoginFormState extends State<LoginForm> {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setSharedPref('platformImei', _platformImei); setSharedPref('platformImei', _platformImei);
saveObjToString(LOGGED_IN_USER, preRes); saveObjToString(LOGGED_IN_USER, preRes);
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (BuildContext context) => VerificationMethodsScreen(password: userInfo.password,)));
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (BuildContext context) => VerificationMethodsScreen(
password: userInfo.password,
)));
// save imei on shared preferance // save imei on shared preferance
} else { } else {
@ -350,4 +357,18 @@ class _LoginFormState extends State<LoginForm> {
primaryFocus.unfocus(); primaryFocus.unfocus();
} }
showLoading() {
showDialog(
context: context,
builder: (BuildContext context) {
return Center(
child: CircularProgressIndicator(),
);
});
}
hideLoading() {
Navigator.pop(context);
}
} }

@ -1,11 +1,23 @@
import 'dart:io' show Platform; import 'dart:io' show Platform;
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/core/model/imei_details.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart';
import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart';
import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.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/otp/sms-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
@ -40,6 +52,17 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Future _loggedUserFuture; Future _loggedUserFuture;
var _loggedUser; var _loggedUser;
var verificationMethod; var verificationMethod;
GetIMEIDetailsModel user;
final LocalAuthentication auth = LocalAuthentication();
var _availableBiometrics;
ProjectViewModel projectsProvider;
var isMoreOption = false;
var onlySMSBox = false;
static BuildContext _context;
var loginTokenID;
bool authenticated;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -50,6 +73,13 @@ class _VerificationMethodsState extends State<VerificationMethods> {
sharedPref.getObj(LOGGED_IN_USER).then((userInfo) { sharedPref.getObj(LOGGED_IN_USER).then((userInfo) {
_loggedUser = userInfo; _loggedUser = userInfo;
}); });
sharedPref.getObj(LAST_LOGIN_USER).then((lastLogin) {
if (lastLogin != null) {
user = GetIMEIDetailsModel.fromJson(lastLogin);
}
});
print(user);
} }
@override @override
@ -63,6 +93,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthViewModel authProv = Provider.of<AuthViewModel>(context); AuthViewModel authProv = Provider.of<AuthViewModel>(context);
projectsProvider = Provider.of<ProjectViewModel>(context);
return FutureBuilder( return FutureBuilder(
future: Future.wait([_loggedUserFuture]), future: Future.wait([_loggedUserFuture]),
builder: (BuildContext context, AsyncSnapshot snapshot) { builder: (BuildContext context, AsyncSnapshot snapshot) {
@ -75,186 +106,212 @@ class _VerificationMethodsState extends State<VerificationMethods> {
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} else { } else {
return Container( return Container(
width: SizeConfig.realScreenWidth * 0.80, width: SizeConfig.realScreenWidth,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text(
hideSilentMethods()
? TranslationBase.of(context).firstStep
: TranslationBase.of(context).pleaseChoose,
style: TextStyle(
fontSize: 3.5 * SizeConfig.textMultiplier,
),
),
SizedBox(
height: 20,
),
Container( Container(
height: SizeConfig.realScreenHeight * 0.6, height: SizeConfig.realScreenHeight * 0.6,
child: CustomScrollView( child: Column(
primary: false, children: <Widget>[
slivers: <Widget>[ user != null && isMoreOption == false
SliverPadding( ? Column(
padding: const EdgeInsets.all(0), mainAxisAlignment:
sliver: SliverGrid.count( MainAxisAlignment.spaceEvenly,
// childAspectRatio: 0.7, crossAxisAlignment:
crossAxisSpacing: 0, CrossAxisAlignment.start,
mainAxisSpacing: 5,
crossAxisCount: 2,
children: <Widget>[ children: <Widget>[
Visibility( AppText(
visible: hideSilentMethods() ? false : true, TranslationBase.of(context)
child: buildFingerprintMethod( .welcomeBack +
context, authProv), ' ' +
replacement: user.doctorName,
buildWhatsAppMethod(context, authProv), fontSize:
SizeConfig.textMultiplier * 3.5,
), ),
Visibility( SizedBox(
visible: hideSilentMethods() ? false : true, height: 20,
child: buildFaceIDMethod(context, authProv),
replacement:
buildSMSMethod(context, authProv),
), ),
Visibility( AppText(
visible: TranslationBase.of(context)
hideSilentMethods() ? false : true, .accountInfo,
child: buildWhatsAppMethod( fontSize:
context, authProv)), SizeConfig.textMultiplier * 2.5,
Visibility(
visible: hideSilentMethods() ? false : true,
child: buildSMSMethod(context, authProv),
), ),
], SizedBox(
height: 20,
), ),
Card(
color: Colors.grey[300],
child: Row(
children: <Widget>[
Flexible(
child: ListTile(
title: Text(
TranslationBase.of(context)
.lastLoginAt,
textAlign: TextAlign.center,
overflow:
TextOverflow.ellipsis,
), ),
subtitle: Text(
// user. != null
// ? formatDate(Helpers
// .convertStringToDate(
// user
// .))
// : user !=
// null
// ? formatDate(Helpers
// .convertStringToDate(user
// .createdOn))
//:
'--',
overflow:
TextOverflow.ellipsis,
textAlign:
TextAlign.center),
)),
Flexible(
child: ListTile(
title: Text(
TranslationBase.of(
context)
.lastLoginWith,
overflow:
TextOverflow.ellipsis,
textAlign:
TextAlign.center),
subtitle: Text(
getType(user.logInTypeID,
context),
overflow:
TextOverflow.ellipsis,
textAlign:
TextAlign.center),
))
], ],
), )),
// height: 500,
),
SizedBox(
// height: 20,
)
], ],
)
: Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
this.onlySMSBox == false
? AppText(
TranslationBase.of(context)
.verifyLoginWith,
fontSize: SizeConfig
.textMultiplier *
3.5,
textAlign: TextAlign.left,
)
: AppText(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize: SizeConfig
.textMultiplier *
2.5,
textAlign: TextAlign.start,
), ),
); ]),
} user != null && isMoreOption == false
} ? Column(
}); mainAxisAlignment:
} MainAxisAlignment.start,
crossAxisAlignment:
/* CrossAxisAlignment.start,
*@author: Elham Rababah children: <Widget>[
*@Date:28/5/2020 Row(
*@param: BuildContext context, AuthProvider authProv mainAxisAlignment:
*@return: Center widget MainAxisAlignment.center,
*@desc: buildSMSMethod Methods widget children: <Widget>[
*/ Expanded(
Center buildSMSMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod(
context,
'assets/images/verification_sms_icon.png',
TranslationBase.of(context).sms, () {
sendActivationCodeByOtpNotificationType(1, authProv);
});
}
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: build WhatsApp Methods widget
*/
Center buildWhatsAppMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod(
context,
'assets/images/verification_whatsapp_icon.png',
TranslationBase.of(context).whatsApp, () {
sendActivationCodeByOtpNotificationType(2, authProv);
});
}
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: build FaceID Methods widget
*/
Center buildFaceIDMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod(
context,
'assets/images/verification_faceid_icon.png',
TranslationBase.of(context).faceId, () {
sendActivationCodeByOtpNotificationType(3, authProv);
});
}
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: build Fingerprint Methods widget
*/
Center buildFingerprintMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod(
context,
'assets/images/verification_fingerprint_icon.png',
TranslationBase.of(context).fingerprint, () {
sendActivationCodeByOtpNotificationType(4, authProv);
});
}
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: build Verification Methods widget
*/
Center buildVerificationMethod(context, url, dec, Function fun) {
return Center(
child: InkWell( child: InkWell(
onTap: fun, onTap: () => {
child: Container( authenticateUser(
// height: SizeConfig.heightMultiplier *2, 3,
height: SizeConfig.heightMultiplier * 19, BiometricType
width: SizeConfig.widthMultiplier * 37, .face
.index,
padding: EdgeInsets.all(10), authProv)
decoration: BoxDecoration( },
border: Border.all( child: getButton(
width: 1, user.logInTypeID,
color: HexColor( authProv))),
'#CCCCCC') // <--- border width here Expanded(
child:
getButton(5, authProv))
])
])
: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: getButton(
3, authProv)),
Expanded(
child: getButton(
2, authProv))
],
)
: SizedBox(),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child:
getButton(1, authProv)),
Expanded(
child: getButton(4, authProv))
],
), ),
borderRadius: BorderRadius.all(Radius.circular(10))), ]),
Expanded(
flex: 1,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Container( user != null
margin: EdgeInsetsDirectional.only( ? Row(
top: SizeConfig.heightMultiplier * 0.5), children: <Widget>[
child: Image.asset( Expanded(
url, child: Button(
height: SizeConfig.heightMultiplier * 10, title:
fit: BoxFit.cover, TranslationBase.of(context)
), .useAnotherAccount,
), onTap: () {
SizedBox( Navigator.of(context)
height: 10, .pushNamed(LOGIN);
), },
Text( )),
dec, ],
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2),
) )
: SizedBox(),
], ],
), ),
), )
],
))
],
), ),
); );
} }
}
});
}
bool hideSilentMethods() { bool hideSilentMethods() {
return verificationMethod == 4 || verificationMethod == 3 ? true : false; return verificationMethod == 4 || verificationMethod == 3 ? true : false;
@ -267,25 +324,20 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: *@return:
*@desc: send Activation Code By Otp Notification Type *@desc: send Activation Code By Otp Notification Type
*/ */
sendActivationCodeByOtpNotificationType(oTPSendType, AuthViewModel authProv) async { sendActivationCodeByOtpNotificationType(
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);
int projectID = await sharedPref.getInt(PROJECT_ID); int projectID = await sharedPref.getInt(PROJECT_ID);
ActivationCodeModel activationCodeModel = ActivationCodeModel( ActivationCodeModel activationCodeModel = ActivationCodeModel(
facilityId: projectID, facilityId: projectID,
generalid: "Cs2020@2016\$2958",
memberID: _loggedUser['List_MemberInformation'][0]['MemberID'], memberID: _loggedUser['List_MemberInformation'][0]['MemberID'],
zipCode: _loggedUser['ZipCode'], zipCode: _loggedUser['ZipCode'],
mobileNumber: _loggedUser['MobileNumber'], mobileNumber: _loggedUser['MobileNumber'],
otpSendType: oTPSendType.toString(),
password: widget.password); password: widget.password);
Map<String, dynamic> model = {
"OTP_SendType": oTPSendType
};
try { try {
authProv authProv
.sendActivationCodeForDoctorApp(activationCodeModel) .sendActivationCodeForDoctorApp(activationCodeModel)
@ -293,38 +345,497 @@ class _VerificationMethodsState extends State<VerificationMethods> {
widget.changeLoadingStata(false); 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(VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); sharedPref.setString(
VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]);
sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]);
Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, this.startSMSService(oTPSendType, authProv);
arguments: {'model': model});
} else { } else {
print(res['ErrorEndUserMessage']); print(res['ErrorEndUserMessage']);
helpers.showErrorToast(res['ErrorEndUserMessage']); helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}) }).catchError((err) {
.catchError((err) {
print('$err'); print('$err');
widget.changeLoadingStata(false); widget.changeLoadingStata(false);
helpers.showErrorToast(); helpers.showErrorToast();
}); });
} catch (e) {} } catch (e) {}
} 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,
// arguments: {'verificationMethod': oTPSendType});
}
}
}
sendActivationCodeVerificationScreen(
oTPSendType, AuthViewModel authProv) async {
// TODO : build enum for verfication method
if (oTPSendType == 1 || oTPSendType == 2) {
widget.changeLoadingStata(true);
ActivationCodeModel2 activationCodeModel = ActivationCodeModel2(
facilityId: user.projectID,
memberID: user.doctorID,
zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user.mobile,
oTPSendType: oTPSendType,
isMobileFingerPrint: 1,
vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID);
try {
authProv
.sendActivationCodeVerificationScreen(activationCodeModel)
.then((res) {
widget.changeLoadingStata(false);
if (res['MessageStatus'] == 1) {
print("VerificationCode : " + res["VerificationCode"]);
sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]);
sharedPref.setString(
VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]);
sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]);
this.startSMSService(oTPSendType, authProv);
} else {
print(res['ErrorEndUserMessage']);
helpers.showErrorToast(res['ErrorEndUserMessage']);
}
}).catchError((err) {
print('$err');
widget.changeLoadingStata(false);
helpers.showErrorToast();
});
} catch (e) {}
} else { } else {
// TODO route to this page with parameters to inicate we should present 2 option // TODO route to this page with parameters to inicate we should present 2 option
if (Platform.isAndroid && oTPSendType == 3) { if (Platform.isAndroid && oTPSendType == 3) {
helpers.showErrorToast('Your device not support this feature'); helpers.showErrorToast('Your device not support this feature');
} else { } else {
Navigator.of(context).push(MaterialPageRoute( // Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => // builder: (BuildContext context) =>
VerificationMethodsScreen(password: widget.password,))); // VerificationMethodsScreen(password: widget.password,)));
// Navigator.of(context).pushNamed(VERIFICATION_METHODS, // Navigator.of(context).pushNamed(VERIFICATION_METHODS,
// arguments: {'verificationMethod': oTPSendType}); // arguments: {'verificationMethod': oTPSendType});
} }
} }
} }
Widget getButton(flag, authProv) {
switch (flag) {
case 2:
return InkWell(
onTap: () => {authenticateUser(2, true, authProv)},
child: RoundedContainer(
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
child: Column(
children: <Widget>[
Image.asset(
'assets/images/login/104.png',
height: SizeConfig.imageSizeMultiplier * 13,
width: SizeConfig.imageSizeMultiplier * 16,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).verifyWhatsApp,
fontSize: SizeConfig.textMultiplier * 2,
textAlign: TextAlign.center,
)
],
),
)));
break;
case 1:
return InkWell(
onTap: () => {authenticateUser(1, true, authProv)},
child: RoundedContainer(
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/login/103.png',
height: SizeConfig.imageSizeMultiplier * 13,
width: SizeConfig.imageSizeMultiplier * 16,
),
projectsProvider.isArabic
? SizedBox(
height: 20,
)
: SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).verifySMS,
fontSize: projectsProvider.isArabic
? SizeConfig.textMultiplier * 1.8
: SizeConfig.textMultiplier * 2,
textAlign: TextAlign.center,
)
],
),
)));
break;
case 3:
return InkWell(
onTap: () => {
authenticateUser(3, BiometricType.fingerprint.index, authProv)
},
child: RoundedContainer(
backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
child: Column(
children: <Widget>[
Image.asset(
'assets/images/login/102.png',
height: SizeConfig.imageSizeMultiplier * 13,
width: SizeConfig.imageSizeMultiplier * 16,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).verifyFingerprint,
fontSize: SizeConfig.textMultiplier * 2,
textAlign: TextAlign.center,
)
],
),
)));
break;
case 4:
return InkWell(
onTap: () =>
{authenticateUser(4, BiometricType.face.index, authProv)},
child: RoundedContainer(
backgroundColor: checkIfBiometricAvailable(BiometricType.face)
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/login/101.png',
height: SizeConfig.imageSizeMultiplier * 13,
width: SizeConfig.imageSizeMultiplier * 16,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).verifyFaceID,
fontSize: SizeConfig.textMultiplier * 2,
textAlign: TextAlign.center,
)
],
),
)));
break;
default:
return InkWell(
onTap: () => {
setState(() {
isMoreOption = true;
})
},
child: RoundedContainer(
backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
child: Column(
children: <Widget>[
Image.asset(
'assets/images/login/more_icon.png',
height: SizeConfig.imageSizeMultiplier * 13,
width: SizeConfig.imageSizeMultiplier * 16,
),
projectsProvider.isArabic
? SizedBox(
height: 15,
)
: SizedBox(
height: 10,
),
AppText(
TranslationBase.of(context).moreVerification,
fontSize: SizeConfig.textMultiplier * 2,
textAlign: TextAlign.center,
)
],
),
)));
}
}
getType(type, context) {
switch (type) {
case 1:
return TranslationBase.of(context).verifySMS;
break;
case 3:
return TranslationBase.of(context).verifyFingerprint;
break;
case 4:
return TranslationBase.of(context).verifyFaceID;
break;
case 2:
return TranslationBase.of(context).verifyWhatsApp;
break;
default:
return TranslationBase.of(context).verifySMS;
break;
}
}
bool checkIfBiometricAvailable(BiometricType biometricType) {
bool isAvailable = false;
if (_availableBiometrics != null) {
for (var i = 0; i < _availableBiometrics.length; i++) {
if (biometricType == _availableBiometrics[i]) isAvailable = true;
}
}
return isAvailable;
}
formatDate(date) {
return DateFormat('MMM dd, yyy, kk:mm').format(date);
}
authenticateUser(type, isActive, authProv) {
//GifLoaderDialogUtils.showMyDialog(context);
// if (type == 2 || type == 3) {
// fingrePrintBefore = type;
// }
//this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type;
switch (type) {
case 1:
this.loginWithSMS(1, isActive, authProv);
break;
case 2:
this.loginWithSMS(2, isActive, authProv);
break;
case 3:
this.loginWithFingurePrintFace(3, isActive, authProv);
break;
case 4:
this.loginWithFingurePrintFace(4, isActive, authProv);
break;
default:
break;
}
// sharedPref.setInt(LAST_LOGIN,
// this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN);
}
loginWithSMS(type, isActive, 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 {
var availableBiometrics;
try {
availableBiometrics = await auth.getAvailableBiometrics();
} on PlatformException catch (e) {
print(e);
}
if (!mounted) return;
setState(() {
_availableBiometrics = availableBiometrics;
});
}
sendActivationCode(type, authProv) async {
if (user != null) {
sendActivationCodeVerificationScreen(type, authProv);
} else {
sendActivationCodeByOtpNotificationType(type, authProv);
}
}
startSMSService(type, authProv) {
sharedPref.setInt(OTP_TYPE, type);
new SMSOTP(
context,
type,
_loggedUser['MobileNumber'],
(value) {
showDialog(
context: context,
builder: (BuildContext context) {
return Center(
child: CircularProgressIndicator(),
);
});
this.checkActivationCode(authProv, value: value);
},
() => {
Navigator.pop(context),
print('Faild..'),
},
).displayDialog(context);
}
loginWithFingurePrintFace(type, isActive, authProv) async {
if (isActive == 1) {
// this.startBiometricLoginIfAvailable();
authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: true);
if (user.logInTypeID == 1 || user.logInTypeID == 2) {
this.onlySMSBox = true;
} else {
this.checkActivationCode(authProv);
}
// 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 {
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel(
zipCode: _loggedUser['ZipCode'],
mobileNumber: _loggedUser['MobileNumber'],
projectID: await sharedPref.getInt(PROJECT_ID),
logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID),
activationCode: value,
oTPSendType: await sharedPref.getInt(OTP_TYPE),
generalid: "Cs2020@2016\$2958");
authProv
.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp)
.then((res) async {
widget.changeLoadingStata(false);
if (res['MessageStatus'] == 1) {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
if (res['List_DoctorProfile'] != null) {
loginProcessCompleted(res['List_DoctorProfile'][0], authProv);
} else {
ClinicModel clinic =
ClinicModel.fromJson(res['List_DoctorsClinic'][0]);
getDocProfiles(clinic, authProv);
}
} else {
//changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']);
}
}).catchError((err) {
//changeLoadingStata(false);
helpers.showErrorToast(err);
});
}
loginProcessCompleted(Map<String, dynamic> profile, authProv) {
var doctor = DoctorProfileModel.fromJson(profile);
authProv.setDoctorProfile(doctor);
sharedPref.setObj(DOCTOR_PROFILE, profile);
projectsProvider.isLogin = true;
Navigator.of(context).pushReplacementNamed(HOME);
}
getDocProfiles(ClinicModel clinicInfo, authProv) {
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: clinicInfo.doctorID,
clinicID: clinicInfo.clinicID,
license: true,
projectID: clinicInfo.projectID,
tokenID: '',
languageID: 2);
authProv.getDocProfiles(docInfo.toJson()).then((res) {
if (res['MessageStatus'] == 1) {
loginProcessCompleted(res['DoctorProfileList'][0], authProv);
} else {
// changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']);
}
}).catchError((err) {
// changeLoadingStata(false);
helpers.showErrorToast(err);
});
}
} }

@ -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,
),
),
),
);
}
}

@ -0,0 +1,346 @@
import 'dart:async';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/material.dart';
import 'dart:math';
import 'package:provider/provider.dart';
class SMSOTP {
final type;
final mobileNo;
final Function onSuccess;
final Function onFailure;
final context;
int remainingTime = 600;
Future<Null> timer;
static BuildContext _context;
static bool _loading;
SMSOTP(
this.context,
this.type,
this.mobileNo,
this.onSuccess,
this.onFailure,
);
final verifyAccountForm = GlobalKey<FormState>();
TextEditingController digit1 = TextEditingController(text: "");
TextEditingController digit2 = TextEditingController(text: "");
TextEditingController digit3 = TextEditingController(text: "");
TextEditingController digit4 = TextEditingController(text: "");
Map verifyAccountFormValue = {
'digit1': '',
'digit2': '',
'digit3': '',
'digit4': '',
};
final focusD1 = FocusNode();
final focusD2 = FocusNode();
final focusD3 = FocusNode();
final focusD4 = FocusNode();
String errorMsg;
ProjectViewModel projectProvider;
String displayTime = '';
displayDialog(BuildContext context) async {
return showDialog(
context: context,
builder: (context) {
projectProvider = Provider.of(context);
return AlertDialog(
title: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
IconButton(
icon: Icon(Icons.close),
onPressed: () {
Navigator.pop(context);
this.onFailure();
},
)
],
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0))),
content: StatefulBuilder(builder: (context, setState) {
if (displayTime == '') {
startTimer(setState);
}
return Container(
color: Colors.white,
height: SizeConfig.realScreenHeight * 0.5,
width: SizeConfig.realScreenWidth * 0.8,
child: Center(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
type == 1
? Image.asset('assets/images/login/103.png')
: Image.asset('assets/images/login/104.png'),
Padding(
padding: EdgeInsets.only(top: 5),
child: AppText(
TranslationBase.of(context).verificationMessage +
' XXXXXX' +
mobileNo
.toString()
.substring(mobileNo.toString().length - 3),
textAlign: TextAlign.center,
)),
Form(
key: verifyAccountForm,
child: Padding(
padding: EdgeInsets.only(top: 20),
child: Directionality(
textDirection: TextDirection.ltr,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
textInputAction: TextInputAction.next,
style: buildTextStyle(),
autofocus: true,
maxLength: 1,
controller: digit1,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onSaved: (val) {},
validator: validateCodeDigit,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD2);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD2);
verifyAccountFormValue['digit1'] =
val.trim();
checkValue();
}
},
),
),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD2,
textInputAction: TextInputAction.next,
maxLength: 1,
controller: digit2,
textAlign: TextAlign.center,
style: buildTextStyle(),
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onSaved: (val) {},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD3);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD3);
verifyAccountFormValue['digit2'] =
val.trim();
checkValue();
}
},
validator: validateCodeDigit),
),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD3,
textInputAction: TextInputAction.next,
maxLength: 1,
controller: digit3,
textAlign: TextAlign.center,
style: buildTextStyle(),
keyboardType: TextInputType.number,
decoration:
buildInputDecoration(context),
onSaved: (val) {},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD4);
verifyAccountFormValue['digit3'] =
val.trim();
checkValue();
}
},
validator: validateCodeDigit)),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD4,
maxLength: 1,
textAlign: TextAlign.center,
style: buildTextStyle(),
controller: digit4,
keyboardType: TextInputType.number,
decoration:
buildInputDecoration(context),
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) {
if (val.length == 1) {
verifyAccountFormValue['digit4'] =
val.trim();
checkValue();
}
},
validator: validateCodeDigit)),
],
)),
),
),
Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
TranslationBase.of(context).validationMessage +
' ' +
displayTime,
color: Colors.red,
textAlign: TextAlign.center,
))
],
))),
);
}),
);
});
}
TextStyle buildTextStyle() {
return TextStyle(
fontSize: SizeConfig.textMultiplier * 3,
);
}
InputDecoration buildInputDecoration(BuildContext context) {
return InputDecoration(
counterText: " ",
// ts/images/password_icon.png
// contentPadding: EdgeInsets.only(top: 20, bottom: 20),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).primaryColor),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
);
}
String validateCodeDigit(value) {
if (value.isEmpty) {
return ' ';
} else if (value.length == 3) {
print(value);
} else {
return null;
}
}
checkValue() {
//print(verifyAccountFormValue);
if (verifyAccountForm.currentState.validate()) {
onSuccess(digit1.text.toString() +
digit2.text.toString() +
digit3.text.toString() +
digit4.text.toString());
}
}
getSecondsAsDigitalClock(int inputSeconds) {
var sec_num =
int.parse(inputSeconds.toString()); // don't forget the second param
var hours = (sec_num / 3600).floor();
var minutes = ((sec_num - hours * 3600) / 60).floor();
var seconds = sec_num - hours * 3600 - minutes * 60;
var minutesString = "";
var secondsString = "";
minutesString =
minutes < 10 ? "0" + minutes.toString() : minutes.toString();
secondsString =
seconds < 10 ? "0" + seconds.toString() : seconds.toString();
return minutesString + ":" + secondsString;
}
startTimer(setState) {
this.remainingTime--;
setState(() {
displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
});
timer = Future.delayed(Duration(seconds: 1), () {
if (this.remainingTime > 0) {
startTimer(setState);
} else {
Navigator.pop(context);
}
});
}
static void showLoadingDialog(BuildContext context, bool _loading) async {
_context = context;
if (_loading == false) {
Navigator.of(context).pop();
return;
}
_loading = true;
await showDialog(
context: _context,
barrierDismissible: false,
builder: (BuildContext context) {
return SimpleDialog(
elevation: 0.0,
backgroundColor: Colors.transparent,
children: <Widget>[
Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
),
)
],
);
});
}
static void hideSMSBox(context) {
Navigator.pop(context);
}
}

@ -59,22 +59,49 @@ class _DynamicElementsState extends State<DynamicElements> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration({String hintText,
String selectedText, bool isDropDown,IconData icon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
)
;
}
return LayoutBuilder( return LayoutBuilder(
builder: (ctx, constraints) { builder: (ctx, constraints) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox(
height: 10,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, onTap: ()=> _presentDatePicker('_selectedFromDate'),
hintText: TranslationBase.of(context).fromDate, hintText: TranslationBase.of(context).fromDate,
controller: _fromDateController, controller: _fromDateController,
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onTap: () {
_presentDatePicker('_selectedFromDate');
},
onSaved: (value) { onSaved: (value) {
if (_fromDateController.text.toString().trim().isEmpty) { if (_fromDateController.text.toString().trim().isEmpty) {
widget._patientSearchFormValues.From = "0"; widget._patientSearchFormValues.From = "0";
@ -82,12 +109,14 @@ class _DynamicElementsState extends State<DynamicElements> {
widget._patientSearchFormValues.From = _fromDateController.text.replaceAll("/", "-"); widget._patientSearchFormValues.From = _fromDateController.text.replaceAll("/", "-");
} }
}, },
readOnly: true,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, readOnly: true,
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.toDate, .toDate,

@ -37,7 +37,7 @@ class PatientReferralItemWidget extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Center( Center(
child: AppText( child: AppText(
patientName, "${patientName}",
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
@ -48,9 +48,10 @@ class PatientReferralItemWidget extends StatelessWidget {
color: Color(0xFF4BA821), color: Color(0xFF4BA821),
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
child: AppText( child: AppText(
referralStatus == "46" referralStatus
/*referralStatus == "46"
? TranslationBase.of(context).approved ? TranslationBase.of(context).approved
: TranslationBase.of(context).rejected, : TranslationBase.of(context).rejected*/,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,

@ -1,19 +1,33 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.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/screens/base/base_view.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/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PatientPageHeaderWidget extends StatelessWidget { class PatientPageHeaderWidget extends StatelessWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
PatientPageHeaderWidget(this.patient); PatientPageHeaderWidget(this.patient);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return BaseView<SOAPViewModel>(
onModelReady: (model) async {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: patient.patientMRN,
episodeId: patient.episodeNo,
appointmentNo: patient.appointmentNo,
doctorID: '',
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP);
},
builder: (_, model, w) => Container(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
@ -66,10 +80,13 @@ class PatientPageHeaderWidget extends StatelessWidget {
), ),
], ],
), ),
AppText( NetworkBaseView(
"ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", baseViewModel: model,
child: model.patientAllergiesList.isNotEmpty ?AppText(
"ALLERGIC TO: "+model.getAllergicNames(),
color: Color(0xFFB9382C), color: Color(0xFFB9382C),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) : AppText(''),
), ),
], ],
), ),
@ -87,6 +104,6 @@ class PatientPageHeaderWidget extends StatelessWidget {
), ),
], ],
), ),
); ));
} }
} }

@ -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,
)) ))
]), ]),
); );

@ -1,7 +1,14 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
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/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/network_base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -17,12 +24,16 @@ 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});
PatiantInformtion patient; PatiantInformtion patient;
String patientType; String patientType;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SliverGrid.count( return BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => SliverGrid.count(
crossAxisSpacing: 10, crossAxisSpacing: 10,
mainAxisSpacing: 20, mainAxisSpacing: 20,
crossAxisCount: 2, crossAxisCount: 2,
@ -32,26 +43,36 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
nameLine1: TranslationBase.of(context).createNew, isDisable: patient.episodeNo != 0 ? true : false,nameLine1: TranslationBase.of(context).createNew,
nameLine2: TranslationBase.of(context).episode, nameLine2: TranslationBase.of(context).episode,
route: CREATE_EPISODE, route: CREATE_EPISODE,
icon: 'create-episod.png'), onTap: () async {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: patient.appointmentNo,
patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel);
patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(CREATE_EPISODE,
arguments: {'patient': patient});
},
isLoading: model.state == ViewState.BusyLocal,icon: 'create-episod.png'),
if (int.parse(patientType) == 7) if (int.parse(patientType) == 7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
nameLine1: TranslationBase.of(context).update, isDisable: patient.episodeNo == 0 ? true : false,nameLine1: TranslationBase.of(context).update,
nameLine2: TranslationBase.of(context).episode, nameLine2: TranslationBase.of(context).episode,
route: UPDATE_EPISODE, route: UPDATE_EPISODE,
icon: 'modilfy-episode.png'), icon: 'modilfy-episode.png'),if (int.parse(patientType) == 7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital, nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs, nameLine2: TranslationBase.of(context).signs,
route: (selectedPatientType == 6 || selectedPatientType == 7) route: VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN
? PATIENT_VITAL_SIGN */,
: VITAL_SIGN_DETAILS,
icon: 'heartbeat.png'), icon: 'heartbeat.png'),
if (selectedPatientType != 7) if (selectedPatientType != 7)
PatientProfileButton( PatientProfileButton(
@ -68,7 +89,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).previewHealth, nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport, nameLine2: TranslationBase.of(context).summaryReport,
icon: 'radiology-1.png'), icon: 'radiology-1.png'),
if (selectedPatientType != 0 && selectedPatientType != 5) if (selectedPatientType != 0 &&
selectedPatientType != 5 &&
selectedPatientType != 7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -130,7 +153,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf, nameLine2: TranslationBase.of(context).ucaf,
icon: 'lab.png'), icon: 'lab.png'),
]); ],
),
);
} }
} }
@ -189,21 +214,37 @@ 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 isLoading;
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.route,
this.isDisable = false,
this.onTap,
this.isLoading = false,
this.from,
this.to})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
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: () { onTap: isDisable
? null
: onTap != null
? onTap
: () {
navigator(context, this.route); navigator(context, this.route);
}, },
child: Column(children: <Widget>[ child: Column(children: <Widget>[
@ -227,6 +268,7 @@ class PatientProfileButton extends StatelessWidget {
textAlign: TextAlign.left, textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
), ),
if (isLoading) DrAppCircularProgressIndeicator()
], ],
), ),
), ),
@ -245,7 +287,7 @@ class PatientProfileButton extends StatelessWidget {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
// border: Border.all(), // border: Border.all(),
color: Colors.white, color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide( border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB), color: Color(0xffBBBBBB),
@ -265,6 +307,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,33 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class CustomValidationError extends StatelessWidget {
String error;
CustomValidationError({
Key key, this.error,
}) : super(key: key);
@override
Widget build(BuildContext context) {
if(error == null )
error = TranslationBase
.of(context)
.emptyMessage;
return Column(
children: [
SizedBox(
height: 2,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 3),
child: AppText(error, color: Theme
.of(context)
.errorColor, fontSize: 14,),
),
],
);
}
}

@ -19,6 +19,8 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../custom_validation_error.dart';
class UpdateAllergiesWidget extends StatefulWidget { class UpdateAllergiesWidget extends StatefulWidget {
final List<MySelectedAllergy> myAllergiesList; final List<MySelectedAllergy> myAllergiesList;
@ -226,10 +228,11 @@ class _AddAllergiesState extends State<AddAllergies> {
MasterKeyModel _selectedAllergy; MasterKeyModel _selectedAllergy;
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false;
InputDecoration textFieldSelectorDecoration(
InputDecoration textFieldSelectorDecoration(String hintText, String hintText, String selectedText, bool isDropDown,
String selectedText, bool isDropDown,{IconData icon}) { {IconData icon}) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -328,18 +331,24 @@ class _AddAllergiesState extends State<AddAllergies> {
input.toLowerCase()) || input.toLowerCase()) ||
suggestion.nameEn.toLowerCase() suggestion.nameEn.toLowerCase()
.startsWith(input.toLowerCase()), .startsWith(input.toLowerCase()),
):TextField( ) : TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase TranslationBase
.of(context) .of(context)
.selectAllergy, .selectAllergy,
_selectedAllergy != null _selectedAllergy != null
? projectViewModel.isArabic?_selectedAllergy.nameAr: _selectedAllergy.nameEn ? projectViewModel.isArabic
: null, true, icon: EvaIcons.search), ? _selectedAllergy.nameAr
: _selectedAllergy.nameEn
: null,
true,
icon: EvaIcons.search),
enabled: false, enabled: false,
), ),
), ),
), ),
if(isFormSubmitted && _selectedAllergy == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -382,6 +391,8 @@ class _AddAllergiesState extends State<AddAllergies> {
), ),
), ),
), ),
if(isFormSubmitted && _selectedAllergySeverity == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -410,12 +421,18 @@ class _AddAllergiesState extends State<AddAllergies> {
AppButton( AppButton(
title: TranslationBase.of(context).add.toUpperCase(), title: TranslationBase.of(context).add.toUpperCase(),
onPressed: () { onPressed: () {
setState(() {
isFormSubmitted = true;
});
if(_selectedAllergy !=null && _selectedAllergySeverity !=null) {
MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( MySelectedAllergy mySelectedAllergy = new MySelectedAllergy(
remark: remarkController.text, remark: remarkController.text,
selectedAllergy: _selectedAllergy, selectedAllergy: _selectedAllergy,
isChecked: true, isChecked: true,
selectedAllergySeverity: _selectedAllergySeverity,); selectedAllergySeverity: _selectedAllergySeverity,);
widget.addAllergiesFun(mySelectedAllergy); widget.addAllergiesFun(mySelectedAllergy);
}
}, },
), ),
] ]
@ -433,3 +450,4 @@ class _AddAllergiesState extends State<AddAllergies> {

@ -10,6 +10,7 @@ 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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -271,6 +272,9 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
onModelReady: (model) async { onModelReady: (model) async {
if (model.historyFamilyList.length == 0) { if (model.historyFamilyList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryFamily); await model.getMasterLookup(MasterKeysService.HistoryFamily);
setState(() {
});
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -313,7 +317,9 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
}, },
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
MasterKeyCheckboxSearchWidget( NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
masterList: model.historyFamilyList, masterList: model.historyFamilyList,
removeHistory: (history){ removeHistory: (history){
@ -332,7 +338,10 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
}, },
isServiceSelected: (master) =>isServiceSelected(master), isServiceSelected: (master) =>isServiceSelected(master),
), ),
MasterKeyCheckboxSearchWidget( ),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
masterList: model.mergeHistorySurgicalWithHistorySportList, masterList: model.mergeHistorySurgicalWithHistorySportList,
removeHistory: (history){ removeHistory: (history){
@ -351,7 +360,10 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
}, },
isServiceSelected: (master) =>isServiceSelected(master), isServiceSelected: (master) =>isServiceSelected(master),
), ),
MasterKeyCheckboxSearchWidget( ),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
masterList: model.historyMedicalList, masterList: model.historyMedicalList,
removeHistory: (history){ removeHistory: (history){
@ -370,6 +382,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
}, },
isServiceSelected: (master) =>isServiceSelected(master), isServiceSelected: (master) =>isServiceSelected(master),
), ),
),
], ],
), ),
), ),

@ -23,6 +23,8 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'custom_validation_error.dart';
class UpdateAssessmentPage extends StatefulWidget { class UpdateAssessmentPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
List<MySelectedAssessment> mySelectedAssessmentList; List<MySelectedAssessment> mySelectedAssessmentList;
@ -41,7 +43,6 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
bool isAssessmentExpand = false; bool isAssessmentExpand = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async{ onModelReady: (model) async{
@ -152,12 +153,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
model: model); model: model);
}, },
readOnly: true, readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline, suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal suffixIconColor: AppGlobal
.appPrimaryColor, .appPrimaryColor,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) { validator: (value) {
if (value == null) if (value == null)
return TranslationBase return TranslationBase
@ -217,7 +216,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
"Appointment #: ", TranslationBase.of(context).appointmentNo,
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 16,
@ -250,7 +249,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
"Type : ", TranslationBase.of(context).type +':',
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 16,
@ -270,7 +269,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
"Doc : ", TranslationBase.of(context).doc,
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 16,
@ -402,6 +401,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, addSelectedAssessment: (MySelectedAssessment mySelectedAssessment,
bool isUpdate) async { bool isUpdate) async {
setState(() { setState(() {
widget.mySelectedAssessmentList.add(mySelectedAssessment);
}); });
}); });
@ -416,7 +416,6 @@ class AddAssessmentDetails extends StatefulWidget {
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final bool isUpdate; final bool isUpdate;
AddAssessmentDetails( AddAssessmentDetails(
{Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList});
@ -429,6 +428,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -552,6 +552,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
), ),
), ),
if(isFormSubmitted && widget.mySelectedAssessment
.selectedICD == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -598,6 +601,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
), ),
), ),
if(isFormSubmitted && widget.mySelectedAssessment
.selectedDiagnosisCondition == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -644,6 +650,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
), ),
), ),
if(isFormSubmitted && widget.mySelectedAssessment
.selectedDiagnosisType == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -671,9 +680,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 10, height: 10,
), ),
AppButton( AppButton(
title: "Add".toUpperCase(), title: (widget.isUpdate?TranslationBase.of(context).update:TranslationBase.of(context).add).toUpperCase(),
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
setState(() {
isFormSubmitted = true;
});
widget.mySelectedAssessment.remark = widget.mySelectedAssessment.remark =
remarkController.text; remarkController.text;
widget.mySelectedAssessment widget.mySelectedAssessment
@ -695,10 +707,6 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
model: model, model: model,
mySelectedAssessment: widget mySelectedAssessment: widget
.mySelectedAssessment); .mySelectedAssessment);
} else {
helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
} }
}, },
), ),
@ -755,7 +763,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
if (!isUpdate) { if (!isUpdate) {
widget.mySelectedAssessmentList.add(mySelectedAssessment); // widget.mySelectedAssessmentList.add(mySelectedAssessment);
widget.addSelectedAssessment(mySelectedAssessment,isUpdate);
} }
Navigator.of(context).pop(); Navigator.of(context).pop();
} }

@ -315,7 +315,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 25, maxLines: 25,
minLines: 4, minLines: 4,
controller: remarksController, // controller: remarksController,
validator: (value) { validator: (value) {
if (value == null) if (value == null)
return TranslationBase.of(context) return TranslationBase.of(context)
@ -397,10 +397,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
widget.changePageViewIndex(2); widget.changePageViewIndex(2);
} }
} else { } else {
helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
}
widget.changePageViewIndex(2); widget.changePageViewIndex(2);
// helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
}
} }
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {

@ -51,8 +51,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel getGetProgressNoteReqModel =
@ -115,7 +113,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
Column( Column(
children: [ children: [
if(model.patientProgressNoteList.isEmpty) if(model.patientProgressNoteList.isEmpty || progressNoteController.text !='')
Container( Container(
margin: margin:
EdgeInsets.only(left: 10, right: 10, top: 15), EdgeInsets.only(left: 10, right: 10, top: 15),
@ -142,7 +140,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
if (progressNoteController.text.isNotEmpty) if (progressNoteController.text !='')
Container( Container(
margin: margin:
EdgeInsets.only(left: 5, right: 5, top: 15), EdgeInsets.only(left: 5, right: 5, top: 15),
@ -287,13 +285,13 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
planNote: progressNoteController.text, doctorID: '', editedBy: ''); planNote: progressNoteController.text, doctorID: '', editedBy: '');
// if(model.patientProgressNoteList.isEmpty){ if(model.patientProgressNoteList.isEmpty){
await model.postProgressNote(postProgressNoteRequestModel); await model.postProgressNote(postProgressNoteRequestModel);
// }else { }else {
// await model.patchProgressNote(postProgressNoteRequestModel); await model.patchProgressNote(postProgressNoteRequestModel);
//
// } }
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
@ -352,6 +350,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
AppButton( AppButton(
title: "Add".toUpperCase(), title: "Add".toUpperCase(),
onPressed: () { onPressed: () {
setState(() {
print(progressNoteController.text);
});
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
), ),

@ -1,6 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:progress_hud_v2/progress_hud.dart'; import 'package:progress_hud_v2/progress_hud.dart';
import 'loader/gif_loader_container.dart';
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:19/4/2020 *@Date:19/4/2020
@ -41,6 +43,18 @@ class _AppLoaderWidgetState extends State<AppLoaderWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Positioned(child: _progressHUD); return Container(
height: MediaQuery.of(context).size.height,
child: Stack(
children: [
Container(
color: Colors.grey.withOpacity(0.6),
),
Container(child: GifLoaderContainer(), margin: EdgeInsets.only(
bottom: MediaQuery.of(context).size.height * 0.09))
],
),
);
} }
} }

@ -4,10 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
// OWNER : Ibrahim albitar
// DATE : 19-04-2020
// DESCRIPTION : Custom Text Form Field for app.
class AppTextFormField extends FormField<String> { class AppTextFormField extends FormField<String> {
AppTextFormField( AppTextFormField(
{FormFieldSetter<String> onSaved, {FormFieldSetter<String> onSaved,
@ -41,6 +37,7 @@ class AppTextFormField extends FormField<String> {
obscureText: obscureText, obscureText: obscureText,
focusNode: focusNode, focusNode: focusNode,
keyboardType: textInputType, keyboardType: textInputType,
readOnly: readOnly,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(
RegExp(inputFormatter)), RegExp(inputFormatter)),

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save