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

 Conflicts:
	lib/config/localized_values.dart
	lib/util/translations_delegate_base.dart
merge-requests/254/head
Elham Rababah 6 years ago
commit 23fb2e7297

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

@ -38,22 +38,21 @@ class BaseAppClient {
try { try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
if (profile != null) { if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) if (body['DoctorID'] == null)
body['DoctorID'] = doctorProfile?.doctorID; body['DoctorID'] = doctorProfile?.doctorID;
if (body['DoctorID'] == "") if (body['DoctorID'] == "") body['DoctorID'] = null;
body['DoctorID'] = null; if (body['EditedBy'] == null)
if( body['EditedBy'] ==null)
body['EditedBy'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) { if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID; body['ProjectID'] = doctorProfile?.projectID;
} }
if (body['ClinicID'] == null) if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID; body['ClinicID'] = doctorProfile?.clinicID;
} }
if (body['DoctorID'] == '') { if (body['DoctorID'] == '') {
body['DoctorID'] =null; body['DoctorID'] = null;
} }
if (body['EditedBy'] == '') { if (body['EditedBy'] == '') {
body.remove("EditedBy"); body.remove("EditedBy");
@ -72,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['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); body['VidaAuthTokenID'] =
await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
}
if (body['VidaRefreshTokenID'] == null) {
body['VidaRefreshTokenID'] =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
}
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
@ -94,8 +98,7 @@ class BaseAppClient {
if (!parsed['IsAuthenticated']) { if (!parsed['IsAuthenticated']) {
await helpers.logout(); await helpers.logout();
helpers.showErrorToast('Your session expired Please login agian'); helpers.showErrorToast('Your session expired Please login agian');
} else } else if (parsed['MessageStatus'] == 1) {
if (parsed['MessageStatus'] == 1) {
if (!parsed['IsAuthenticated']) if (!parsed['IsAuthenticated'])
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
else else
@ -130,7 +133,7 @@ class BaseAppClient {
} }
} }
} }
if(error == null || error == "null" || error == "null\n"){ if (error == null || error == "null" || error == "null\n") {
return "This server not work probably in this time"; return "This server not work probably in this time";
} }
return error; return error;

@ -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';
@ -121,7 +131,8 @@ const GET_PRESCRIPTION_LIST =
const POST_PRESCRIPTION_LIST = const POST_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/PostPrescription'; 'Services/DoctorApplication.svc/REST/PostPrescription';
const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetProcedure'; const GET_PROCEDURE_LIST =
'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure';
const GET_PATIENT_ARRIVAL_LIST = const GET_PATIENT_ARRIVAL_LIST =
@ -163,7 +174,11 @@ const GET_CHIEF_COMPLAINT =
const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam';
const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote';
const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment';
const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const GET_ORDER_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const GET_LIST_CATEGORISE =
'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_CATEGORISE_PROCEDURE = const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetProcedure'; 'Services/DoctorApplication.svc/REST/GetProcedure';
@ -171,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;
@ -220,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 this field", "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,16 +539,54 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "There is no Chief Complaint", 'en': "There is no Chief Complaint",
'ar': "ليس هناك شكوى رئيس" 'ar': "ليس هناك شكوى رئيس"
}, },
'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" }, "more-verify": {
'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" }, "en": "More Verification Options",
'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" }, "ar": "المزيد من خيارات التحقق"
'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" }, },
'addExamination': {'en': "Add Examination", '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': { 'patientNoDetailErrMsg': {
'en': "There is no detail for this patient", 'en': "There is no detail for this patient",
'ar': "لا توجد تفاصيل لهذا المريض" 'ar': "لا توجد تفاصيل لهذا المريض"
}, },
'doc': {'en': "Doc :", 'ar':" د: " },
'allergicTO': {'en': "ALLERGIC TO ", 'ar':" حساس من" }, 'allergicTO': {'en': "ALLERGIC TO ", 'ar':" حساس من" },
'normal': {'en': "Normal", 'ar':"عادي" }, 'normal': {'en': "Normal", 'ar':"عادي" },
'abnormal': {'en': "Abnormal", 'ar':" غير عادي" }, 'abnormal': {'en': "Abnormal", 'ar':" غير عادي" },

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

@ -0,0 +1,138 @@
class GetOrderedProcedureModel {
List<EntityList> entityList;
int rowcount;
dynamic statusMessage;
GetOrderedProcedureModel(
{this.entityList, this.rowcount, this.statusMessage});
GetOrderedProcedureModel.fromJson(Map<String, dynamic> json) {
if (json['entityList'] != null) {
entityList = new List<EntityList>();
json['entityList'].forEach((v) {
entityList.add(new EntityList.fromJson(v));
});
}
rowcount = json['rowcount'];
statusMessage = json['statusMessage'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.entityList != null) {
data['entityList'] = this.entityList.map((v) => v.toJson()).toList();
}
data['rowcount'] = this.rowcount;
data['statusMessage'] = this.statusMessage;
return data;
}
}
class EntityList {
String achiCode;
String appointmentDate;
int appointmentNo;
int categoryID;
String clinicDescription;
String cptCode;
int createdBy;
String createdOn;
String doctorName;
bool isApprovalCreated;
bool isApprovalRequired;
bool isCovered;
bool isInvoiced;
bool isReferralInvoiced;
bool isUncoveredByDoctor;
int lineItemNo;
String orderDate;
int orderNo;
int orderType;
String procedureId;
String procedureName;
String remarks;
String status;
String template;
EntityList(
{this.achiCode,
this.appointmentDate,
this.appointmentNo,
this.categoryID,
this.clinicDescription,
this.cptCode,
this.createdBy,
this.createdOn,
this.doctorName,
this.isApprovalCreated,
this.isApprovalRequired,
this.isCovered,
this.isInvoiced,
this.isReferralInvoiced,
this.isUncoveredByDoctor,
this.lineItemNo,
this.orderDate,
this.orderNo,
this.orderType,
this.procedureId,
this.procedureName,
this.remarks,
this.status,
this.template});
EntityList.fromJson(Map<String, dynamic> json) {
achiCode = json['achiCode'];
appointmentDate = json['appointmentDate'];
appointmentNo = json['appointmentNo'];
categoryID = json['categoryID'];
clinicDescription = json['clinicDescription'];
cptCode = json['cptCode'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
doctorName = json['doctorName'];
isApprovalCreated = json['isApprovalCreated'];
isApprovalRequired = json['isApprovalRequired'];
isCovered = json['isCovered'];
isInvoiced = json['isInvoiced'];
isReferralInvoiced = json['isReferralInvoiced'];
isUncoveredByDoctor = json['isUncoveredByDoctor'];
lineItemNo = json['lineItemNo'];
orderDate = json['orderDate'];
orderNo = json['orderNo'];
orderType = json['orderType'];
procedureId = json['procedureId'];
procedureName = json['procedureName'];
remarks = json['remarks'];
status = json['status'];
template = json['template'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['achiCode'] = this.achiCode;
data['appointmentDate'] = this.appointmentDate;
data['appointmentNo'] = this.appointmentNo;
data['categoryID'] = this.categoryID;
data['clinicDescription'] = this.clinicDescription;
data['cptCode'] = this.cptCode;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['doctorName'] = this.doctorName;
data['isApprovalCreated'] = this.isApprovalCreated;
data['isApprovalRequired'] = this.isApprovalRequired;
data['isCovered'] = this.isCovered;
data['isInvoiced'] = this.isInvoiced;
data['isReferralInvoiced'] = this.isReferralInvoiced;
data['isUncoveredByDoctor'] = this.isUncoveredByDoctor;
data['lineItemNo'] = this.lineItemNo;
data['orderDate'] = this.orderDate;
data['orderNo'] = this.orderNo;
data['orderType'] = this.orderType;
data['procedureId'] = this.procedureId;
data['procedureName'] = this.procedureName;
data['remarks'] = this.remarks;
data['status'] = this.status;
data['template'] = this.template;
return data;
}
}

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

@ -0,0 +1,48 @@
class ProcedureCategoryListModel {
List<EntityList> entityList;
int rowcount;
dynamic statusMessage;
ProcedureCategoryListModel(
{this.entityList, this.rowcount, this.statusMessage});
ProcedureCategoryListModel.fromJson(Map<String, dynamic> json) {
if (json['entityList'] != null) {
entityList = new List<EntityList>();
json['entityList'].forEach((v) {
entityList.add(new EntityList.fromJson(v));
});
}
rowcount = json['rowcount'];
statusMessage = json['statusMessage'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.entityList != null) {
data['entityList'] = this.entityList.map((v) => v.toJson()).toList();
}
data['rowcount'] = this.rowcount;
data['statusMessage'] = this.statusMessage;
return data;
}
}
class EntityList {
int categoryId;
String categoryName;
EntityList({this.categoryId, this.categoryName});
EntityList.fromJson(Map<String, dynamic> json) {
categoryId = json['categoryId'];
categoryName = json['categoryName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['categoryId'] = this.categoryId;
data['categoryName'] = this.categoryName;
return data;
}
}

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

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

@ -5,8 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.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> patientVitalSignList = [];
List<VitalSignResModel> patientVitalSignOrderdSubList = []; List<VitalSignResModel> patientVitalSignOrderdSubList = [];
VitalSignData patientVitalSigns; VitalSignData patientVitalSigns;
@ -15,16 +14,17 @@ class VitalSignsService extends BaseService{
patientVitalSigns = null; patientVitalSigns = null;
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = 2954208; //patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo; body['AppointmentNo'] = "2016055308"; //patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo; body['EpisodeID'] = 210011002; //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]);
} }
} }
}, },
@ -35,4 +35,4 @@ class VitalSignsService extends BaseService{
body: body, body: body,
); );
} }
} }

@ -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,15 +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();
//patientMRN: 3120877,
);
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
search: ["Acetaminophen"], //search: ["Acetaminophen"],
vidaAuthTokenID: // vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio", // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
search: ["Amoxicillin"],
//vidaAuthTokenID:
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
); );
PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel _postPrescriptionReqModel =
@ -87,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());
}
} }

@ -1,29 +1,37 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_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:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
class ProcedureService extends BaseService { class ProcedureService extends BaseService {
List<GetProcedureModel> _procedureList = List(); List<GetOrderedProcedureModel> _procedureList = List();
List<GetProcedureModel> get procedureList => _procedureList; List<GetOrderedProcedureModel> get procedureList => _procedureList;
List<CategoriseProcedureModel> _categoriesList = List(); List<CategoriseProcedureModel> _categoriesList = List();
List<CategoriseProcedureModel> get categoriesList => _categoriesList; List<CategoriseProcedureModel> get categoriesList => _categoriesList;
List<Procedures> procedureslist = List(); List<Procedures> procedureslist = List();
List<dynamic> categoryList = [];
GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel =
GetOrderedProcedureRequestModel();
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
clinicId: 17, // clinicId: 17,
pageSize: 10, // pageSize: 10,
pageIndex: 1, // pageIndex: 1,
patientMRN: 3120725, // //patientMRN: 3120725,
//categoryId: null, // //categoryId: null,
vidaAuthTokenID: // vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI",
//
// search: ["lab"],
);
search: ["lab"],
);
GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel(
clinicId: 0, clinicId: 0,
pageSize: 100, pageSize: 100,
@ -33,22 +41,45 @@ class ProcedureService extends BaseService {
vidaAuthTokenID: vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI",
search: ["lab"], //search: ["DENTAL"],
); );
Future getProcedure() async { Future getProcedure({int mrn}) async {
_getOrderedProcedureRequestModel =
GetOrderedProcedureRequestModel(patientMRN: mrn);
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(GET_PROCEDURE_LIST, await baseAppClient.post(GET_PROCEDURE_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_procedureList.add(GetProcedureModel.fromJson(response['ProcedureList'])); _procedureList.add(
GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _getOrderedProcedureRequestModel.toJson());
}
Future getCategory() async {
hasError = false;
await baseAppClient.post(GET_LIST_CATEGORISE,
onSuccess: (dynamic response, int statusCode) {
categoryList = [];
categoryList = response['listProcedureCategories']['entityList'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _getProcedureReqModel.toJson()); }, body: Map());
} }
Future getCategories() async { Future getProcedureCategory({String categoryName}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel(
search: [categoryName],
patientMRN: 0,
pageIndex: 1,
clinicId: 0,
pageSize: 100,
);
hasError = false; hasError = false;
_categoriesList.clear(); _categoriesList.clear();
await baseAppClient.post(GET_CATEGORISE_PROCEDURE, await baseAppClient.post(GET_CATEGORISE_PROCEDURE,

@ -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 {
var loggedIn = await sharedPref.getObj(LOGGED_IN_USER);
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(INSERT_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);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> selectDeviceImei(imei) async {
try {
dynamic localRes;
await baseAppClient.post(SELECT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
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,22 +163,22 @@ 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,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
selectedClinicName = selectedClinicName =
ClinicModel.fromJson(response['List_DoctorsClinic'][0]).clinicName; ClinicModel.fromJson(response['List_DoctorsClinic'][0]).clinicName;
response['List_DoctorsClinic'].forEach((v) { response['List_DoctorsClinic'].forEach((v) {
doctorsClinicList.add(new ClinicModel.fromJson(v)); doctorsClinicList.add(new ClinicModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: checkActivationCodeRequestModel.toJson()); }, body: checkActivationCodeRequestModel.toJson());
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); print(error);
@ -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<PendingReferral> get patientReferral =>
_referralPatientService.patientReferralList;
List<PatiantInformtion> get patientArrivalList => 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);
@ -37,7 +55,7 @@ class PatientReferralViewModel extends BaseViewModel {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
await getBranches(); await getBranches();
} }
Future getBranches() async { Future getBranches() async {

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

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart';
@ -9,15 +10,17 @@ import 'package:doctor_app_flutter/locator.dart';
class ProcedureViewModel extends BaseViewModel { class ProcedureViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
ProcedureService _procedureService = locator<ProcedureService>(); ProcedureService _procedureService = locator<ProcedureService>();
List<GetProcedureModel> get procedureList => _procedureService.procedureList; List<GetOrderedProcedureModel> get procedureList =>
_procedureService.procedureList;
List<CategoriseProcedureModel> get categoriesList => List<CategoriseProcedureModel> get categoriesList =>
_procedureService.categoriesList; _procedureService.categoriesList;
List<dynamic> get categoryList => _procedureService.categoryList;
Future getProcedure() async { Future getProcedure({int mrn}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedure(); await _procedureService.getProcedure(mrn: mrn);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -25,11 +28,11 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getCategories() async { Future getProcedureCategory({String categoryName}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getCategories(); await _procedureService.getProcedureCategory(categoryName: categoryName);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -37,7 +40,20 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { Future getCategory() async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.getCategory();
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postProcedure(
PostProcedureReqModel postProcedureReqModel, int mrn) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
@ -46,12 +62,13 @@ class ProcedureViewModel extends BaseViewModel {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await getProcedure(); await getProcedure(mrn: mrn);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async { Future updateProcedure(
PostProcedureReqModel postProcedureReqModel, int mrn) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
@ -61,5 +78,6 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
await getProcedure(mrn: mrn);
} }
} }

@ -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();
} }
@ -69,7 +72,7 @@ class ProjectViewModel with ChangeNotifier {
sharedPref.setString(APP_Language, 'ar'); sharedPref.setString(APP_Language, 'ar');
} else if (lan != "ar" && currentLanguage != lan) { } else if (lan != "ar" && currentLanguage != lan) {
_appLocale = Locale("en"); _appLocale = Locale("en");
_isArabic = false; _isArabic = false;
currentLanguage = 'en'; currentLanguage = 'en';
sharedPref.setString(APP_Language, 'en'); sharedPref.setString(APP_Language, 'en');
} }

@ -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());

@ -41,32 +41,31 @@ 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,
localizationsDelegates: [ localizationsDelegates: [
TranslationBaseDelegate(), TranslationBaseDelegate(),
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
], ],
supportedLocales: [ supportedLocales: [
const Locale('ar', ''), // Arabic const Locale('ar', ''), // Arabic
const Locale('en', ''), // English const Locale('en', ''), // English
], ],
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.grey, primarySwatch: Colors.grey,
primaryColor: Colors.grey, primaryColor: Colors.grey,
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,
) )),
),
); );
}); });
}, },

@ -8,17 +8,18 @@ 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,
this.channel, this.channel,
this.languageID, this.languageID,
this.versionID, this.versionID,
this.memberID, this.memberID,
this.password, this.password,
this.facilityId, this.facilityId,
this.generalid}); this.otpSendType,
this.generalid});
ActivationCodeModel.fromJson(Map<String, dynamic> json) { ActivationCodeModel.fromJson(Map<String, dynamic> json) {
mobileNumber = json['MobileNumber']; mobileNumber = json['MobileNumber'];
@ -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,21 +12,22 @@ 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,
this.doctorID, this.doctorID,
this.iPAdress, this.iPAdress,
this.channel, this.channel,
this.languageID, this.languageID,
this.projectID, this.projectID,
this.versionID, this.versionID,
this.generalid, this.generalid,
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;
}
}

@ -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 = false; bool _isLoading = true;
ProjectViewModel projectViewModel;
Future<void> getSharedPref() async { AuthService authService = AuthService();
sharedPref.getString('platformImei').then((imei) {
platformImei = imei;
});
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
platformImeiFuture = _prefs.then((SharedPreferences prefs) {
return (prefs.getString('platformImei')); _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);
if (authService.dashboardItemsList.length > 0) {
sharedPref.setObj(
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);
}
// else if (projectViewModel.isLogin) {
// getNotificationCount(token);
// }
}).catchError((err) {
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>(
isShowAppBar: false, onModelReady: (model) => {},
body: SafeArea( builder: (_, model, w) => AppScaffold(
child: ListView(children: <Widget>[ baseViewModel: model,
FutureBuilder( isShowAppBar: false,
future: platformImeiFuture, body: SafeArea(
builder: (BuildContext context, AsyncSnapshot<String> snapshot) { child: (_isLoading == false)
switch (snapshot.connectionState) { ? ListView(children: <Widget>[
case ConnectionState.waiting: Container(
return DrAppCircularProgressIndeicator(); margin:
default: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30),
if (snapshot.hasError) { alignment: Alignment.topLeft,
return Text('Error: ${snapshot.error}'); child: Column(
} else { crossAxisAlignment: CrossAxisAlignment.start,
return Container( children: <Widget>[
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), Column(
alignment: Alignment.topLeft, crossAxisAlignment:
child: Column( CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ AuthHeader(loginType.knownUser),
(platformImei == null) LoginForm(
? Column( changeLoadingStata: changeLoadingStata,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.knownUser),
LoginForm(
changeLoadingStata:
changeLoadingStata,
),
],
)
: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.unknownUser),
KnownUserLogin(),
],
), ),
])); ],
} )
}
}), // : Column(
]), // crossAxisAlignment:
), // CrossAxisAlignment.start,
); // children: <Widget>[
// AuthHeader(loginType.unknownUser),
// KnownUserLogin(),
// ],
// ),
]))
])
: Center(child: CircularProgressIndicator()),
),
));
} }
} }

@ -42,7 +42,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isLoading: _isLoading, isLoading: _isLoading,
isShowAppBar: false, isShowAppBar: false,
body: ListView(children: <Widget>[ body: ListView(children: <Widget>[
Container( Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),

@ -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';
@ -19,6 +20,7 @@ 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';
@ -47,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;
@ -60,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;
} }
@ -87,8 +102,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
PatientMobileNumber: "0", PatientMobileNumber: "0",
PatientIdentificationID: "0", PatientIdentificationID: "0",
PatientID: 0, PatientID: 0,
From: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(), From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
To: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(), .toString(),
To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(),
LanguageID: 2, LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z", stamp: "2020-03-02T13:56:39.170Z",
IPAdress: "11.11.11.11", IPAdress: "11.11.11.11",
@ -670,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,
@ -714,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,
) )
], ],
@ -1008,7 +1025,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
); );
}, },
), ),
SizedBox(width: 8,), SizedBox(
width: 8,
),
DashboardItem( DashboardItem(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -1026,7 +1045,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
hasBorder: true, hasBorder: true,
onTap: () { onTap: () {
Navigator.of(context).pushNamed(PATIENTS, arguments: { Navigator.of(context)
.pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues, "patientSearchForm": _patientSearchFormValues,
"selectedType": "7" "selectedType": "7"
}); });

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

@ -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,279 +92,50 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
Container( model.patientReferral.length == 0
margin: ? ReferralForm(model, screenSize)
EdgeInsets.symmetric(vertical: 16, horizontal: 16), : PatientReferralItemWidget(
child: Column( patientName: model.patientReferral[0].patientName,
crossAxisAlignment: CrossAxisAlignment.start, referralStatus: "${model.patientReferral[0].referralStatus}",
children: [ isReferredTo: true,
SizedBox( isSameBranch: model.patientReferral[0]
height: 16, .isReferralDoctorSameBranch,
), referralDoctorName:
AppText( model.patientReferral[0].referredByDoctorInfo,
TranslationBase.of(context).referPatient, clinicDescription: null,
fontWeight: FontWeight.bold, remark:
fontSize: 16, model.patientReferral[0].remarksFromSource
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: referToList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: referToList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
model
.getDoctorBranch()
.then((value) {
_selectedBranch = value;
if (_referTo['id'] == 1) {
model.getClinics(
_selectedBranch['ID']);
}
});
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).referTo,
_referTo != null ? _referTo['name'] : null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.branchesList,
attributeName: 'Desciption',
attributeValueId: 'ID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
model.getClinics(
_selectedBranch['ID']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).branch,
_selectedBranch != null
? _selectedBranch['Desciption']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = null;
_selectedClinic = selectedValue;
model.getClinicDoctors(
_selectedClinic['ClinicID']
.toString());
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinic,
_selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doctor,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () => _selectDate(context, model),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.chooseAppointment,
appointmentDate != null
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).remarks,
null,
false),
enabled: true,
controller: _remarksController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_LETTERS))
],
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
],
),
), ),
], ],
), ),
Container( if (model.patientReferral.length == 0)
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), Container(
child: AppButton( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
title: TranslationBase.of(context).refer, child: AppButton(
color: HexColor("#B8382B"), title: TranslationBase.of(context).refer,
onPressed: () { color: HexColor("#B8382B"),
if (appointmentDate == null || onPressed: () {
_selectedBranch == null || if (appointmentDate == null ||
_selectedClinic == null || _selectedBranch == null ||
_selectedDoctor == null || _selectedClinic == null ||
_remarksController.text == null) return; _selectedDoctor == null ||
model _remarksController.text == null) return;
.makeReferral( model
patient, .makeReferral(
appointmentDate.toIso8601String(), patient,
_selectedBranch['ID'], appointmentDate.toIso8601String(),
_selectedClinic['ClinicID'], _selectedBranch['ID'],
_selectedDoctor['DoctorID'], _selectedClinic['ClinicID'],
_remarksController.text) _selectedDoctor['DoctorID'],
.then((_) { _remarksController.text)
DrAppToastMsg.showSuccesToast( .then((_) {
TranslationBase.of(context).referralSuccessMsg); DrAppToastMsg.showSuccesToast(
Navigator.pop(context); TranslationBase.of(context).referralSuccessMsg);
}); Navigator.pop(context);
}, });
), },
) ),
)
], ],
), ),
), ),
@ -365,6 +144,239 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
); );
} }
Widget ReferralForm(PatientReferralViewModel model, Size screenSize) {
return Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).referPatient,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: referToList != null
? () {
ListSelectDialog dialog = ListSelectDialog(
list: referToList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
model.getDoctorBranch().then((value) {
_selectedBranch = value;
if (_referTo['id'] == 1) {
model.getClinics(_selectedBranch['ID']);
}
});
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).referTo,
_referTo != null ? _referTo['name'] : null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
attributeName: 'Desciption',
attributeValueId: 'ID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
model.getClinics(_selectedBranch['ID']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).branch,
_selectedBranch != null
? _selectedBranch['Desciption']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = null;
_selectedClinic = selectedValue;
model.getClinicDoctors(
_selectedClinic['ClinicID'].toString());
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinic,
_selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doctor,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () => _selectDate(context, model),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).chooseAppointment,
appointmentDate != null
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).remarks, null, false),
enabled: true,
controller: _remarksController,
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))
],
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
],
),
);
}
_selectDate(BuildContext context, PatientReferralViewModel model) async { _selectDate(BuildContext context, PatientReferralViewModel model) async {
// https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference
// https://stackoverflow.com/a/63147062/6246772 to customize a date picker // https://stackoverflow.com/a/63147062/6246772 to customize a date picker

@ -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';
@ -300,7 +301,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: model.drugsList, list: model.drugsList,
attributeName: 'GenericName', attributeName: 'Description',
attributeValueId: 'ItemId', attributeValueId: 'ItemId',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
@ -693,7 +694,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 ||
@ -708,26 +710,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(
@ -804,4 +788,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;
});
}
}

@ -19,6 +19,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_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:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.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:doctor_app_flutter/widgets/shared/network_base_view.dart';
@ -40,7 +41,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure(), onModelReady: (model) => model.getProcedure(mrn: patient.patientMRN),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -122,8 +123,11 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
model.getCategories().then((value) { model
addSelectedProcedure(context, model); .getProcedureCategory()
.then((value) {
addSelectedProcedure(
context, model, patient);
}); });
//model.postPrescription(); //model.postPrescription();
@ -208,9 +212,11 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
), ),
), ),
onTap: () { onTap: () {
model.getCategories().then((value) { model
.getProcedureCategory()
.then((value) {
addSelectedProcedure( addSelectedProcedure(
context, model); context, model, patient);
}); });
//model.postPrescription(); //model.postPrescription();
@ -299,7 +305,11 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
15.0, 15.0,
), ),
AppText( AppText(
'Urgent', model.procedureList[0].entityList[index]
.orderType ==
1
? 'Regular'
: 'Urgent',
fontSize: fontSize:
13.0, 13.0,
color: Colors color: Colors
@ -337,18 +347,18 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
FontWeight FontWeight
.w700, .w700,
), ),
Expanded( // Expanded(
child: AppText( // child: AppText(
model // model
.procedureList[ // .procedureList[
0] // 0]
.entityList[ // .entityList[
index] // index]
.price // .price
.toString(), // .toString(),
fontSize: // fontSize:
13.0), // 13.0),
) // )
], ],
), ),
SizedBox( SizedBox(
@ -357,10 +367,19 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
Row( Row(
children: [ children: [
AppText( Expanded(
'Some short remark about the procedure', child:
fontSize: AppText(
13.5, model
.procedureList[
0]
.entityList[
index]
.remarks
.toString(),
fontSize:
13.5,
),
), ),
], ],
), ),
@ -395,7 +414,22 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
0] 0]
.entityList[ .entityList[
index] index]
.procedureName); .procedureName,
patient:
patient,
procedureId: model
.procedureList[
0]
.entityList[
index]
.procedureId,
categoreId: model
.procedureList[
0]
.entityList[
index]
.categoryID
.toString());
}, },
) )
], ],
@ -420,26 +454,36 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
} }
} }
postProcedure({ProcedureViewModel model, String remarks}) async { postProcedure(
{ProcedureViewModel model,
String remarks,
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List(); List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = 2016054575; postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = 200012166; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = 3120725; postProcedureReqModel.patientMRN = patient.patientMRN;
postProcedureReqModel.vidaAuthTokenID = postProcedureReqModel.vidaAuthTokenID =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI';
controls.add( controls.add(
Controls(code: remarks.isEmpty ? '' : remarks, controlValue: 'sssssssss'), Controls(
code: remarks.isEmpty ? 'ssss' : remarks, controlValue: 'sssssssss'),
); );
controlsProcedure.add(
Procedures(category: "02", procedure: "02011009", controls: controls)); entityList.forEach((element) {
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel); await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
@ -449,15 +493,19 @@ postProcedure({ProcedureViewModel model, String remarks}) async {
} }
updateProcedure( updateProcedure(
{ProcedureViewModel model, String remarks, String procedureId}) async { {ProcedureViewModel model,
String remarks,
String procedureId,
PatiantInformtion patient,
String categorieId}) async {
PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List(); List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); List<Procedures> controlsProcedure = List();
updateProcedureReqModel.appointmentNo = 2016054575; updateProcedureReqModel.appointmentNo = patient.appointmentNo;
updateProcedureReqModel.episodeID = 200012166; updateProcedureReqModel.episodeID = patient.episodeNo;
updateProcedureReqModel.patientMRN = 3120725; updateProcedureReqModel.patientMRN = patient.patientMRN;
updateProcedureReqModel.vidaAuthTokenID = updateProcedureReqModel.vidaAuthTokenID =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI';
@ -467,11 +515,11 @@ updateProcedure(
controlValue: 'Testing', controlValue: 'Testing',
), ),
); );
controlsProcedure.add( controlsProcedure.add(Procedures(
Procedures(category: "02", procedure: "02011002", controls: controls)); category: categorieId, procedure: procedureId, controls: controls));
updateProcedureReqModel.procedures = controlsProcedure; updateProcedureReqModel.procedures = controlsProcedure;
await model.updateProcedure(updateProcedureReqModel); await model.updateProcedure(updateProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
@ -480,114 +528,176 @@ updateProcedure(
} }
} }
void addSelectedProcedure(context, ProcedureViewModel model) { void addSelectedProcedure(
context, ProcedureViewModel model, PatiantInformtion patient) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
builder: (BuildContext bc) { builder: (BuildContext bc) {
return AddSelectedProcedure( return AddSelectedProcedure(
model: model, model: model,
patient: patient,
); );
}); });
} }
class AddSelectedProcedure extends StatefulWidget { class AddSelectedProcedure extends StatefulWidget {
final ProcedureViewModel model; final ProcedureViewModel model;
final PatiantInformtion patient;
const AddSelectedProcedure({Key key, this.model}) : super(key: key); const AddSelectedProcedure({Key key, this.model, this.patient})
: super(key: key);
@override @override
_AddSelectedProcedureState createState() => _AddSelectedProcedureState(); _AddSelectedProcedureState createState() =>
_AddSelectedProcedureState(patient: patient, model: model);
} }
class _AddSelectedProcedureState extends State<AddSelectedProcedure> { class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedProcedureState({this.patient, this.model});
TextEditingController procedureController = TextEditingController(); TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List(); List<EntityList> entityList = List();
dynamic selectedCategory;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return NetworkBaseView( final screenSize = MediaQuery.of(context).size;
baseViewModel: widget.model, return BaseView<ProcedureViewModel>(
child: SingleChildScrollView( onModelReady: (model) => model.getCategory(),
child: Container( builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
height: 810, NetworkBaseView(
child: Padding( baseViewModel: model,
padding: EdgeInsets.all(12.0), child: SingleChildScrollView(
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, height: 810,
children: [ child: Padding(
AppText( padding: EdgeInsets.all(12.0),
'Select Procedure'.toUpperCase(), child: Column(
fontWeight: FontWeight.w900, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
if (widget.model.categoriesList.length != 0) AppText(
EntityListCheckboxSearchWidget( 'Select Procedure'.toUpperCase(),
model: widget.model, fontWeight: FontWeight.w900,
masterList: widget.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
), ),
SizedBox( Container(
height: 15.0, height: screenSize.height * 0.070,
), child: InkWell(
Column( onTap: model.categoryList != null &&
mainAxisAlignment: MainAxisAlignment.spaceBetween, model.categoryList.length > 0
children: [ ? () {
Container( ListSelectDialog dialog = ListSelectDialog(
decoration: BoxDecoration( list: model.categoryList,
borderRadius: BorderRadius.all(Radius.circular(6.0)), attributeName: 'categoryName',
border: Border.all( attributeValueId: 'categoryId',
width: 1.0, color: HexColor("#CCCCCC"))), okText: TranslationBase.of(context).ok,
child: TextFields( okFunction: (selectedValue) {
hintText: 'Order Type'.toUpperCase(), setState(() {
controller: procedureController, selectedCategory = selectedValue;
model.getProcedureCategory(
categoryName:
selectedCategory['categoryName']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
//model.getProcedureCategory();
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
'Procedure Categorey',
selectedCategory != null
? selectedCategory['categoryName']
: null,
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false,
), ),
), ),
SizedBox( ),
height: 15.0, if (widget.model.categoriesList.length != 0)
), EntityListCheckboxSearchWidget(
TextFields( model: widget.model,
hintText: 'Remarks', masterList: widget.model.categoriesList[0].entityList,
controller: remarksController, removeHistory: (item) {
minLines: 3, setState(() {
maxLines: 5, entityList.remove(item);
), });
SizedBox( },
height: 50.0, addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
), ),
Container( SizedBox(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), height: 15.0,
child: Wrap( ),
alignment: WrapAlignment.center, Column(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
AppButton( children: [
title: 'add Selected Procedures'.toUpperCase(), Container(
onPressed: () { decoration: BoxDecoration(
Navigator.pop(context); borderRadius:
postProcedure( BorderRadius.all(Radius.circular(6.0)),
model: widget.model, border: Border.all(
remarks: remarksController.text); width: 1.0, color: HexColor("#CCCCCC"))),
}, child: TextFields(
), hintText: 'Order Type'.toUpperCase(),
], controller: procedureController,
),
), ),
), SizedBox(
], height: 15.0,
) ),
], TextFields(
hintText: 'Remarks',
controller: remarksController,
minLines: 3,
maxLines: 5,
),
SizedBox(
height: 50.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'add Selected Procedures'.toUpperCase(),
onPressed: () {
Navigator.pop(context);
postProcedure(
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
],
)
],
),
), ),
), ),
), ),
@ -603,10 +713,46 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
} }
return false; return false;
} }
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
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
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
} }
void updateProcedureForm(context, {String procedureName}) { void updateProcedureForm(context,
ProcedureViewModel procedureViewModel = ProcedureViewModel(); {String procedureName,
PatiantInformtion patient,
String procedureId,
String categoreId}) {
ProcedureViewModel model = ProcedureViewModel();
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
TextEditingController orderController = TextEditingController(); TextEditingController orderController = TextEditingController();
showModalBottomSheet( showModalBottomSheet(
@ -666,7 +812,10 @@ void updateProcedureForm(context, {String procedureName}) {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
updateProcedure( updateProcedure(
model: procedureViewModel, categorieId: categoreId,
procedureId: procedureId,
patient: patient,
model: model,
remarks: remarksController.text); remarks: remarksController.text);
// authorizationForm(context); // authorizationForm(context);
}, },

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

@ -346,15 +346,17 @@ 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)));
} }
String parseHtmlString(String htmlString) { String parseHtmlString(String htmlString) {
final document = parse(htmlString); final document = parse(htmlString);
final String parsedString = parse(document.body.text).documentElement.text; final String parsedString = parse(document.body.text).documentElement.text;
@ -380,11 +382,11 @@ class Helpers {
hintText: selectedText != null ? selectedText : hintText, hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown suffixIcon: isDropDown
? suffixIcon != null ? suffixIcon != null
? suffixIcon ? suffixIcon
: Icon( : Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
color: dropDownColor != null ? dropDownColor : Colors.black, color: dropDownColor != null ? dropDownColor : Colors.black,
) )
: null, : null,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 14, fontSize: 14,
@ -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,

@ -544,26 +544,78 @@ class TranslationBase {
localizedValues['referralEmptyMsg'][locale.languageCode]; localizedValues['referralEmptyMsg'][locale.languageCode];
String get referralSuccessMsg => String get referralSuccessMsg =>
localizedValues['referralSuccessMsg'][locale.languageCode]; localizedValues['referralSuccessMsg'][locale.languageCode];
String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; String get diagnoseType =>
localizedValues['diagnoseType'][locale.languageCode];
String get condition => localizedValues['condition'][locale.languageCode]; String get condition => localizedValues['condition'][locale.languageCode];
String get id => localizedValues['id'][locale.languageCode]; String get id => localizedValues['id'][locale.languageCode];
String get quantity => localizedValues['quantity'][locale.languageCode]; String get quantity => localizedValues['quantity'][locale.languageCode];
String get codeNo => localizedValues['codeNo'][locale.languageCode]; String get codeNo => localizedValues['codeNo'][locale.languageCode];
String get covered => localizedValues['covered'][locale.languageCode]; String get covered => localizedValues['covered'][locale.languageCode];
String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; String get approvalRequired =>
String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; localizedValues['approvalRequired'][locale.languageCode];
String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; String get uncoveredByDoctor =>
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 =>
localizedValues['addAssessment'][locale.languageCode];
String get assessment => localizedValues['assessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode];
String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode];
String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; String get physicalSystemExamination =>
String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; localizedValues['physicalSystemExamination'][locale.languageCode];
String get addExamination => localizedValues['addExamination'][locale.languageCode]; String get searchExamination =>
String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; localizedValues['searchExamination'][locale.languageCode];
String get addExamination =>
localizedValues['addExamination'][locale.languageCode];
String get doc => localizedValues['doc'][locale.languageCode]; String get doc => localizedValues['doc'][locale.languageCode];
String get allergicTO=> localizedValues['allergicTO'][locale.languageCode]; String get allergicTO=> localizedValues['allergicTO'][locale.languageCode];
String get normal=> localizedValues['normal'][locale.languageCode]; String get normal=> localizedValues['normal'][locale.languageCode];
String get abnormal=> localizedValues['abnormal'][locale.languageCode]; String get abnormal=> localizedValues['abnormal'][locale.languageCode];
String get patientNoDetailErrMsg =>
localizedValues['patientNoDetailErrMsg'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -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,66 +106,205 @@ 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, children: <Widget>[
crossAxisCount: 2, AppText(
children: <Widget>[ TranslationBase.of(context)
Visibility( .welcomeBack +
visible: hideSilentMethods() ? false : true, ' ' +
child: buildFingerprintMethod( user.doctorName,
context, authProv), fontSize:
replacement: SizeConfig.textMultiplier * 3.5,
buildWhatsAppMethod(context, authProv), ),
), SizedBox(
Visibility( height: 20,
visible: hideSilentMethods() ? false : true, ),
child: buildFaceIDMethod(context, authProv), AppText(
replacement: TranslationBase.of(context)
buildSMSMethod(context, authProv), .accountInfo,
), fontSize:
Visibility( SizeConfig.textMultiplier * 2.5,
visible: ),
hideSilentMethods() ? false : true, SizedBox(
child: buildWhatsAppMethod( height: 20,
context, authProv)), ),
Visibility( Card(
visible: hideSilentMethods() ? false : true, color: Colors.grey[300],
child: buildSMSMethod(context, authProv), child: Row(
), children: <Widget>[
], Flexible(
), child: ListTile(
), title: Text(
], TranslationBase.of(context)
), .lastLoginAt,
// height: 500, textAlign: TextAlign.center,
), overflow:
SizedBox( TextOverflow.ellipsis,
// height: 20, ),
) 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),
))
],
)),
],
)
: 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,
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
authenticateUser(
3,
BiometricType
.face
.index,
authProv)
},
child: getButton(
user.logInTypeID,
authProv))),
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))
],
),
]),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
user != null
? Row(
children: <Widget>[
Expanded(
child: Button(
title:
TranslationBase.of(context)
.useAnotherAccount,
onTap: () {
Navigator.of(context)
.pushNamed(LOGIN);
},
)),
],
)
: SizedBox(),
],
),
)
],
))
], ],
), ),
); );
@ -143,119 +313,6 @@ class _VerificationMethodsState extends State<VerificationMethods> {
}); });
} }
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: buildSMSMethod Methods widget
*/
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(
onTap: fun,
child: Container(
// height: SizeConfig.heightMultiplier *2,
height: SizeConfig.heightMultiplier * 19,
width: SizeConfig.widthMultiplier * 37,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: HexColor(
'#CCCCCC') // <--- border width here
),
borderRadius: BorderRadius.all(Radius.circular(10))),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsetsDirectional.only(
top: SizeConfig.heightMultiplier * 0.5),
child: Image.asset(
url,
height: SizeConfig.heightMultiplier * 10,
fit: BoxFit.cover,
),
),
SizedBox(
height: 10,
),
Text(
dec,
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2),
)
],
),
),
),
);
}
bool hideSilentMethods() { bool hideSilentMethods() {
return verificationMethod == 4 || verificationMethod == 3 ? true : false; return verificationMethod == 4 || verificationMethod == 3 ? true : false;
} }
@ -267,64 +324,518 @@ 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)
.then((res) { .then((res) {
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(
sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]);
Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]);
arguments: {'model': model}); this.startSMSService(oTPSendType, authProv);
} 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,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);
}
}

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

@ -316,6 +316,34 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.2.1" version: "5.2.1"
firebase_core:
dependency: transitive
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.3"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1+1"
firebase_messaging:
dependency: "direct main"
description:
name: firebase_messaging
url: "https://pub.dartlang.org"
source: hosted
version: "7.0.3"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:

@ -59,6 +59,8 @@ dependencies:
#Dependency Injection #Dependency Injection
get_it: ^4.0.2 get_it: ^4.0.2
#firebase
firebase_messaging: ^7.0.0
#GIF image #GIF image
flutter_gifimage: ^1.0.1 flutter_gifimage: ^1.0.1
@ -95,7 +97,7 @@ flutter:
assets: assets:
- assets/images/ - assets/images/
- assets/images/dashboard/ - assets/images/dashboard/
- assets/images/login/
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware. # https://flutter.dev/assets-and-images/#resolution-aware.

Loading…
Cancel
Save