Updates & fixes

development-3.3_voipCall
haroon amjad 3 years ago
parent 51a8a93de1
commit 5d4aeff350

@ -30,7 +30,7 @@ android {
signingConfigs {
release {
storeFile file('/Users/nextwo/Desktop/Elham/keys/doctor app key')
storeFile file('/Users/mohamedmekawy/Documents/Work/DoctorApp/android/doctor app key')
storePassword 'Hmgdoctor1234'
keyAlias 'hmgdoctor'
keyPassword 'Hmgdoctor1234'

@ -17,8 +17,8 @@ import android.widget.Toast
import androidx.annotation.NonNull
import com.google.gson.GsonBuilder
import com.hmg.hmgDr.Service.VideoStreamFloatingWidgetService
import com.hmg.hmgDr.model.GetSessionStatusModel
import com.hmg.hmgDr.model.SessionStatusModel
import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.ui.VideoCallResponseListener
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine

@ -1,8 +1,8 @@
package com.hmg.hmgDr.Service;
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.model.GetSessionStatusModel;
import com.hmg.hmgDr.model.SessionStatusModel;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
import retrofit2.Call;

@ -17,6 +17,9 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
import androidx.core.view.GestureDetectorCompat
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel
import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.R
import com.hmg.hmgDr.model.*
import com.hmg.hmgDr.ui.VideoCallContract

@ -1,4 +1,4 @@
package com.hmg.hmgDr.model;
package com.hmg.hmgDr.Model;
import android.os.Parcel;

@ -1,4 +1,4 @@
package com.hmg.hmgDr.model;
package com.hmg.hmgDr.Model;
import android.os.Parcel;
import android.os.Parcelable;

@ -1,4 +1,4 @@
package com.hmg.hmgDr.model;
package com.hmg.hmgDr.Model;
import android.os.Parcel;
import android.os.Parcelable;

@ -1,8 +1,8 @@
package com.hmg.hmgDr.ui;
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.model.GetSessionStatusModel;
import com.hmg.hmgDr.model.SessionStatusModel;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
public interface VideoCallContract {

@ -1,8 +1,8 @@
package com.hmg.hmgDr.ui;
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.model.GetSessionStatusModel;
import com.hmg.hmgDr.model.SessionStatusModel;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
import com.hmg.hmgDr.Service.AppRetrofit;
import com.hmg.hmgDr.Service.SessionStatusAPI;

@ -20,9 +20,9 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.core.view.GestureDetectorCompat
import androidx.fragment.app.DialogFragment
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel
import com.hmg.hmgDr.model.GetSessionStatusModel
import com.hmg.hmgDr.model.SessionStatusModel
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel
import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.R
import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter
import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView
@ -143,6 +143,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
return R.style.dialogTheme
}
@SuppressLint("UseRequireInsteadOfGet")
override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {// FullScreenVideoTheme
val layoutInflater = requireActivity().layoutInflater
this.parentView = onCreateView(layoutInflater, null)

@ -38,6 +38,7 @@ target 'Runner' do
# Plugin Pods
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'
end
post_install do |installer|

@ -5,85 +5,125 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
//const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor";
const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID";
const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime";
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL
const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor';
const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency";
const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID";
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL =
"Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_INSURANCE_APPROVALS_URL =
"Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const PATIENT_REFER_TO_DOCTOR_URL =
"Services/DoctorApplication.svc/REST/ReferToDoctor";
const PATIENT_GET_DOCTOR_BY_CLINIC_URL =
"Services/DoctorApplication.svc/REST/GetDoctorsByClinicID";
const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital =
"Services/Doctors.svc/REST/SearchDoctorsByTime";
const GET_CLINICS_FOR_DOCTOR =
'Services/DoctorApplication.svc/REST/GetClinicsForDoctor';
const PATIENT_GET_LIST_REFERAL_URL =
"Services/Lists.svc/REST/GetList_STPReferralFrequency";
const PATIENT_GET_CLINIC_BY_PROJECT_URL =
"Services/DoctorApplication.svc/REST/GetClinicsByProjectID";
const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics";
const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_REFERRAL_FACILITIES =
'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo';
const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns';
const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN_DATA =
'Services/DoctorApplication.svc/REST/GetVitalSigns';
const GET_PATIENT_LAB_OREDERS =
'Services/DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER';
const GET_LIVECARE_PENDINGLIST =
'Services/DoctorApplication.svc/REST/GetPendingPatientER';
const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient';
const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor";
const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL =
"Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor";
const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport';
const GET_PRESCRIPTION_REPORT =
'Services/Patients.svc/REST/GetPrescriptionReport';
const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions';
const GT_MY_PATIENT_QUESTION =
'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions';
const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM';
const PRM_SEARCH_PATIENT =
'Services/Patients.svc/REST/GetPatientInformation_PRM';
const GET_PATIENT = 'Services/DoctorApplication.svc/REST/';
const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT =
'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient';
const GET_MY_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferralPatient';
const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor';
const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks';
const ADD_REFERRED_DOCTOR_REMARKS =
'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks';
const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_MY_REFERRED_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
const GET_MY_REFERRED_OUT_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals';
const GET_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/PendingReferrals';
const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral';
const CREATE_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral';
const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral';
const RESPONSE_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/RespondReferral';
const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal';
const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF';
const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const GET_DOCTOR_WORKING_HOURS_TABLE =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults';
const GET_PATIENT_LAB_RESULTS =
'Services/DoctorApplication.svc/REST/GetPatientLabResults';
const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New';
const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails';
const INSERT_DEVICE_IMEI =
'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 = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI';
const SELECT_DEVICE_IMEI =
'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode';
const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN =
'Services/DoctorApplication.svc/REST/SendVerificationCode';
const MEMBER_CHECK_ACTIVATION_CODE_NEW =
'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp';
const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp';
const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin';
@ -91,179 +131,268 @@ const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction';
const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices';
const END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI';
const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList';
const GET_DASHBOARD =
'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI';
const GET_SICKLEAVE_STATISTIC =
'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const ARRIVED_PATIENT_URL =
'Services/DoctorApplication.svc/REST/PatientArrivalList';
const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave';
const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave';
const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
const GET_COVERING_DOCTORS =
'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition';
const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition';
const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition';
const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription';
const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription';
const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const UPDATE_RESCHDEULE =
'Services/DoctorApplication.svc/REST/PatchRequisition';
const GET_RESCHEDULE_LEAVE =
'Services/DoctorApplication.svc/REST/GetRequisition';
const GET_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/GetPrescription';
const POST_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/PostPrescription';
const GET_PROCEDURE_LIST =
'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure';
const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient';
const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';
const GET_PATIENT_IN_PATIENT_LIST =
'Services/DoctorApplication.svc/REST/GetMyInPatient';
const Verify_Referral_Doctor_Remarks =
'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription';
const GET_Patient_LAB_SPECIAL_RESULT =
'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT =
'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION =
'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription';
// SOAP
const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies';
const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode';
const POST_EPISODE_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient';
const POST_EPISODE_FOR_IN_PATIENT =
'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient';
const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies';
const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory';
const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
const POST_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE =
'/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment';
const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies';
const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory';
const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint';
const PATCH_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/PatchChiefcomplaint';
const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam';
const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote';
const PATCH_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PatchPhysicalExam';
const PATCH_PROGRESS_NOTE =
'Services/DoctorApplication.svc/REST/PatchProgressNote';
const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment';
const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory';
const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint';
const GET_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/GetChiefcomplaint';
const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam';
const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote';
const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment';
const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure';
const GET_LIST_CATEGORISE =
'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetProcedure';
const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure';
const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription';
const UPDATE_PRESCRIPTION =
'Services/DoctorApplication.svc/REST/PatchPrescription';
const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList';
const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const DRUG_TO_DRUG =
'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors';
const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards';
const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories';
const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_ROOM_CATEGORIES =
'Services/DoctorApplication.svc/REST/GetRoomCategories';
const GET_DIAGNOSIS_TYPES =
'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes';
const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes';
const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';
const POST_ADMISSION_REQUEST =
'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
const GET_ITEM_BY_MEDICINE =
'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';
const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures';
const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity';
const GET_PROCEDURE_VALIDATION =
'Services/DoctorApplication.svc/REST/ValidateProcedures';
const GET_BOX_QUANTITY =
'Services/DoctorApplication.svc/REST/CalculateBoxQuantity';
///GET ECG
const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_INPATIENT =
"Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_REFERRAL_OUT_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_MY_DISCHARGE_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus";
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult';
const GET_IN_PATIENT_ORDERS =
'Services/DoctorApplication.svc/REST/GetPatientRadResult';
///Prescriptions
const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient";
const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient";
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT_NEW =
'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const UPDATE_PROGRESS_NOTE_FOR_INPATIENT =
"Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient";
const CREATE_PROGRESS_NOTE_FOR_INPATIENT =
"Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient";
const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave";
const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient";
const GET_MY_OUT_PATIENT =
"Services/DoctorApplication.svc/REST/GetMyOutPatient";
const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID";
const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport";
const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_LIST =
"Services/Patients.svc/REST/DAPP_ListMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_TEMPLATE =
"Services/Patients.svc/REST/DAPP_GetTemplateByID";
const PATIENT_MEDICAL_REPORT_INSERT =
"Services/Patients.svc/REST/DAPP_InsertMedicalReport";
const PATIENT_MEDICAL_REPORT_VERIFIED =
"Services/Patients.svc/REST/DAPP_VerifiedMedicalReport";
const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet';
const GET_PROCEDURE_TEMPLETE =
'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet';
const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet';
const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet";
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const GET_PROCEDURE_TEMPLETE_DETAILS =
"Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet";
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const DOCTOR_CHECK_HAS_LIVE_CARE =
"Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin";
const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList";
const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList";
const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New";
const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport";
const GET_SICK_LEAVE_DOCTOR_APP = "Services/DoctorApplication.svc/REST/GetAllSickLeaves";
const ADD_REFERRED_REMARKS_NEW =
"Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
const GET_SPECIAL_CLINICAL_CARE_LIST =
"Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList";
const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST =
"Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList";
const INSERT_MEDICAL_REPORT =
"Services/Patients.svc/REST/DAPP_InsertMedicalReport_New";
const UPDATE_MEDICAL_REPORT =
"Services/Patients.svc/REST/DAPP_UpdateMedicalReport";
const GET_SICK_LEAVE_DOCTOR_APP =
"Services/DoctorApplication.svc/REST/GetAllSickLeaves";
const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor";
const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue";
const CREATE_DOCTOR_RESPONSE = "Services/DoctorApplication.svc/REST/CreateDoctorResponse";
const GET_DOCTOR_NOT_REPLIED_COUNTS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts";
const ALL_SPECIAL_LAB_RESULT = "services/Patients.svc/REST/GetPatientLabSpecialResultsALL";
const GET_MEDICATION_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient";
const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
const CREATE_DOCTOR_RESPONSE =
"Services/DoctorApplication.svc/REST/CreateDoctorResponse";
const GET_DOCTOR_NOT_REPLIED_COUNTS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts";
const ALL_SPECIAL_LAB_RESULT =
"services/Patients.svc/REST/GetPatientLabSpecialResultsALL";
const GET_MEDICATION_FOR_IN_PATIENT =
"Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient";
const GET_EPISODE_FOR_INPATIENT =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
///Operation Details Services
const GET_RESERVATIONS = "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails";
const GET_OPERATION_DETAILS = "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails";
const UPDATE_OPERATION_REPORT = "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport";
const GET_RESERVATIONS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails";
const GET_OPERATION_DETAILS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails";
const UPDATE_OPERATION_REPORT =
"Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport";
const NURSING_PROGRESS_NOTE = "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote";
const GET_DIAGNOSIS_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient";
const NURSING_PROGRESS_NOTE =
"Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote";
const GET_DIAGNOSIS_FOR_IN_PATIENT =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient";
const GET_DIABETIC_CHART_VALUES = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues";
const GET_DIABETIC_CHART_VALUES =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues";
const GET_PENDING_ORDERS = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient";
const GET_PENDING_ORDERS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient";
const GET_ADMISSION_ORDERS = "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders";
const GET_ADMISSION_ORDERS =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders";
///Patient Registration Services
const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration";
const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Services/Authentication.svc/REST/CheckActivationCode";
const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration";
const CHECK_PATIENT_FOR_REGISTRATION =
"Services/Authentication.svc/REST/CheckPatientForRegisteration";
const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION =
"Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
const CHECK_ACTIVATION_CODE_FOR_PATIENT =
"Services/Authentication.svc/REST/CheckActivationCode";
const PATIENT_REGISTRATION =
"Services/Authentication.svc/REST/PatientRegistration";
const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo";
/// Discharge Summary
const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary";
const GET_ALL_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary";
const GET_PENDING_DISCHARGE_SUMMARY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary";
const GET_ALL_DISCHARGE_SUMMARY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary";
const VTE_ASSESSMENT =
"Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo";
const VTE_ASSESSMENT = "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo";
const GET_INTERVENTION_MEDICATION =
"Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications";
const GET_INTERVENTION_MEDICATION = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications";
const GET_INTERVENTION_MEDICATION_HISTORY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory";
const GET_INTERVENTION_MEDICATION_HISTORY = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory";
const SET_ACCEPTED_OR_REJECTED =
"Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention";
const SET_ACCEPTED_OR_REJECTED = "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention";
const GET_STP_MASTER_LIST =
"Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList";
const GET_STP_MASTER_LIST = "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList";
const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment";
const DOCTOR_ER_SIGN_ASSESSMENT =
"Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment";
var selectedPatientType = 1;
@ -288,8 +417,26 @@ var SERVICES_PATIANT2 = [
"List_MyReferralPatient",
"patientArrivalList"
];
var SERVICES_PATIANT_HEADER = ["My OutPatient", "My InPatient", "Discharge", "Referred", "Referral Discharge", "Tomorrow", "Referral", "Arrival Patient"];
var SERVICES_PATIANT_HEADER_AR = ["المريض الخارجي", "المريض المنوم", "المريض المعافى", "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", "المريض المحول مني", "المريض الواصل"];
var SERVICES_PATIANT_HEADER = [
"My OutPatient",
"My InPatient",
"Discharge",
"Referred",
"Referral Discharge",
"Tomorrow",
"Referral",
"Arrival Patient"
];
var SERVICES_PATIANT_HEADER_AR = [
"المريض الخارجي",
"المريض المنوم",
"المريض المعافى",
"المريض المحول الي",
"المريض المحال المعافى",
"مريض الغد",
"المريض المحول مني",
"المريض الواصل"
];
const PRIMARY_COLOR = 0xff515B5D;
@ -297,7 +444,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 8.9;
const VERSION_ID = 8.6;
const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true;
@ -309,6 +456,7 @@ const GENERAL_ID = 'Cs2020@2016\$2958';
const PATIENT_TYPE = 1;
const PATIENT_TYPE_ID = 1;
/// Timer Info
const TIMER_MIN = 10;
@ -317,6 +465,7 @@ class AppGlobal {
static Color appRedColor = Color(0xFFD02127);
static Color appGreenColor = Color(0xFF359846);
static Color appTextColor = Color(0xFF2B353E);
static Color scheduleTextColor = Color(0xFF2E303A);
static Color inProgressColor = Color(0xFFCC9B14);
static Color scheduleTextColor = Color(0xFF2E303A);
static Color inProgressColor = Color(0xFFCC9B14);
}

@ -800,7 +800,7 @@ const Map<String, Map<String, String>> localizedValues = {
"open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"},
"fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "},
"searchPatient-name": {
"en": "Search Name, Medical File, Phone Number",
"en": "Search Medical File, Phone Number",
"ar": "اسم البحث ، الملف الطبي ، رقم الهاتف"
},
"reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"},

@ -8,6 +8,7 @@ class GetHospitalsRequestModel {
String sessionID;
bool isLoginForDoctorApp;
String memberID;
String doctorID;
GetHospitalsRequestModel(
{this.languageID,
@ -18,7 +19,9 @@ class GetHospitalsRequestModel {
this.tokenID,
this.sessionID,
this.isLoginForDoctorApp,
this.memberID});
this.memberID,
this.doctorID,
});
GetHospitalsRequestModel.fromJson(Map<String, dynamic> json) {
languageID = json['LanguageID'];
@ -30,6 +33,7 @@ class GetHospitalsRequestModel {
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
memberID = json['MemberID'];
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
@ -43,6 +47,7 @@ class GetHospitalsRequestModel {
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['MemberID'] = this.memberID;
data['DoctorID'] = this.doctorID;
return data;
}
}

@ -34,12 +34,14 @@ class VideoCallService extends BaseService {
await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen(
// TODO MOSA TEST
kToken: startCallRes.openTokenID,
kSessionId: startCallRes.openSessionID,
kApiKey: '46209962',
// kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg",
// kApiKey:'47247954',
// kToken: startCallRes.openTokenID,
// kSessionId: startCallRes.openSessionID,
kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NjM4ZjgxNmFjZjI0ODU2YTk0YTMwMGIxMjFkNmZlY2E5OGJlYWNlZDpzZXNzaW9uX2lkPTJfTVg0ME5qSXdPVGsyTW41LU1UWTNNek0xTURFMk1qSTNPWDVZT0RGMWFVdElaRWRWVldGTlVGYzNObFYxVERWNFRFbC1mbjQmY3JlYXRlX3RpbWU9MTY3MzM1MDE2MiZub25jZT0wLjE5OTUyMjMwNzIyMDAyODczJnJvbGU9bW9kZXJhdG9yJmV4cGlyZV90aW1lPTE2NzM0MzY1NjImaW5pdGlhbF9sYXlvdXRfY2xhc3NfbGlzdD0=",
kSessionId: "2_MX40NjIwOTk2Mn5-MTY3MzM1MDE2MjI3OX5YODF1aUtIZEdVVWFNUFc3NlV1TDV4TEl-fn4",
vcId: patient.vcId,
isRecording: isRecording,
patientName: patient.fullName ??

@ -7,10 +7,10 @@ import 'package:doctor_app_flutter/core/model/auth/imei_details.dart';
import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.dart';
import 'package:doctor_app_flutter/core/model/auth/new_login_information_response_model.dart';
import 'package:doctor_app_flutter/core/model/auth/send_activation_code_for_doctor_app_response_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/user_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class AuthenticationService extends BaseService {
List<GetIMEIDetailsModel> _imeiDetails = [];
@ -19,26 +19,16 @@ class AuthenticationService extends BaseService {
NewLoginInformationModel _loginInfo = NewLoginInformationModel();
NewLoginInformationModel get loginInfo => _loginInfo;
SendActivationCodeForDoctorAppResponseModel
_activationCodeVerificationScreenRes =
SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel
get activationCodeVerificationScreenRes =>
_activationCodeVerificationScreenRes;
SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes =
SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel
get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes;
CheckActivationCodeForDoctorAppResponseModel
_checkActivationCodeForDoctorAppRes =
CheckActivationCodeForDoctorAppResponseModel();
CheckActivationCodeForDoctorAppResponseModel
get checkActivationCodeForDoctorAppRes =>
_checkActivationCodeForDoctorAppRes;
SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _activationCodeVerificationScreenRes;
SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes;
CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel();
CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes;
Map<String, dynamic> _insertDeviceImeiRes = {};
List<DoctorProfileModel> _doctorProfilesList = [];
@ -47,8 +37,7 @@ class AuthenticationService extends BaseService {
Future selectDeviceImei(imei) async {
try {
await baseAppClient.post(SELECT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
_imeiDetails = [];
response['List_DoctorDeviceDetails'].forEach((v) {
_imeiDetails.add(GetIMEIDetailsModel.fromJson(v));
@ -56,7 +45,7 @@ class AuthenticationService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {"IMEI": imei, "TokenID": "@dm!n"});
}, body: {"IMEI": imei});
} catch (error) {
hasError = true;
super.error = error;
@ -67,8 +56,7 @@ class AuthenticationService extends BaseService {
hasError = false;
_loginInfo = NewLoginInformationModel();
try {
await baseAppClient.post(LOGIN_URL,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(LOGIN_URL, onSuccess: (dynamic response, int statusCode) {
_loginInfo = NewLoginInformationModel.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -80,16 +68,12 @@ class AuthenticationService extends BaseService {
}
}
Future sendActivationCodeVerificationScreen(
ActivationCodeForVerificationScreenModel activationCodeModel) async {
Future sendActivationCodeVerificationScreen(ActivationCodeForVerificationScreenModel activationCodeModel) async {
hasError = false;
_activationCodeVerificationScreenRes =
SendActivationCodeForDoctorAppResponseModel();
_activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel();
try {
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN,
onSuccess: (dynamic response, int statusCode) {
_activationCodeVerificationScreenRes =
SendActivationCodeForDoctorAppResponseModel.fromJson(response);
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, onSuccess: (dynamic response, int statusCode) {
_activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -100,16 +84,12 @@ class AuthenticationService extends BaseService {
}
}
Future sendActivationCodeForDoctorApp(
ActivationCodeModel activationCodeModel) async {
Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async {
hasError = false;
_activationCodeForDoctorAppRes =
SendActivationCodeForDoctorAppResponseModel();
_activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel();
try {
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) {
_activationCodeForDoctorAppRes =
SendActivationCodeForDoctorAppResponseModel.fromJson(response);
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) {
_activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -120,16 +100,12 @@ class AuthenticationService extends BaseService {
}
}
Future checkActivationCodeForDoctorApp(
CheckActivationCodeRequestModel checkActivationCodeRequestModel) async {
Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async {
hasError = false;
_checkActivationCodeForDoctorAppRes =
CheckActivationCodeForDoctorAppResponseModel();
_checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel();
try {
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) {
_checkActivationCodeForDoctorAppRes =
CheckActivationCodeForDoctorAppResponseModel.fromJson(response);
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) {
_checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -144,8 +120,7 @@ class AuthenticationService extends BaseService {
hasError = false;
_insertDeviceImeiRes = {};
try {
await baseAppClient.post(INSERT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
_insertDeviceImeiRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -160,8 +135,7 @@ class AuthenticationService extends BaseService {
Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async {
hasError = false;
try {
await baseAppClient.post(GET_DOC_PROFILES,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) {
_doctorProfilesList.clear();
response['DoctorProfileList'].forEach((v) {
_doctorProfilesList.add(DoctorProfileModel.fromJson(v));

@ -26,6 +26,8 @@ import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/services.dart';
import 'package:local_auth/auth_strings.dart';
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
// import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart';
@ -41,13 +43,20 @@ class AuthenticationViewModel extends BaseViewModel {
NewLoginInformationModel get loginInfo => _authService.loginInfo;
List<DoctorProfileModel> get doctorProfilesList => _authService.doctorProfilesList;
List<DoctorProfileModel> get doctorProfilesList =>
_authService.doctorProfilesList;
SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _authService.activationCodeVerificationScreenRes;
SendActivationCodeForDoctorAppResponseModel
get activationCodeVerificationScreenRes =>
_authService.activationCodeVerificationScreenRes;
SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _authService.activationCodeForDoctorAppRes;
SendActivationCodeForDoctorAppResponseModel
get activationCodeForDoctorAppRes =>
_authService.activationCodeForDoctorAppRes;
CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes;
CheckActivationCodeForDoctorAppResponseModel
get checkActivationCodeForDoctorAppRes =>
_authService.checkActivationCodeForDoctorAppRes;
NewLoginInformationModel loggedUser;
GetIMEIDetailsModel user;
@ -62,6 +71,7 @@ class AuthenticationViewModel extends BaseViewModel {
bool isFromLogin = false;
APP_STATUS appStatus = APP_STATUS.LOADING;
String localToken = "";
bool isHuawei = false;
AuthenticationViewModel({bool checkDeviceInfo = false}) {
getDeviceInfoFromFirebase();
@ -81,20 +91,32 @@ class AuthenticationViewModel extends BaseViewModel {
profileInfo['IMEI'] = token;
profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
profileInfo['BioMetricEnabled'] = true;
profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile;
InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo);
insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description'];
insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN'];
insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN'];
profileInfo['MobileNo'] =
loggedIn != null ? loggedIn['MobileNumber'] : user.mobile;
InsertIMEIDetailsModel insertIMEIDetailsModel =
InsertIMEIDetailsModel.fromJson(profileInfo);
insertIMEIDetailsModel.genderDescription =
profileInfo['Gender_Description'];
insertIMEIDetailsModel.genderDescriptionN =
profileInfo['Gender_DescriptionN'];
insertIMEIDetailsModel.genderDescriptionN =
profileInfo['Gender_DescriptionN'];
insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description'];
insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN'];
insertIMEIDetailsModel.titleDescriptionN =
profileInfo['Title_DescriptionN'];
insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID);
insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID;
insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
insertIMEIDetailsModel.doctorID = loggedIn != null
? loggedIn['List_MemberInformation'][0]['MemberID']
: user.doctorID;
insertIMEIDetailsModel.outSA =
loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
insertIMEIDetailsModel.vidaAuthTokenID =
await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
insertIMEIDetailsModel.password = userInfo.password;
insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString());
insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID
: int.parse(user.editedBy.toString());
await _authService.insertDeviceImei(insertIMEIDetailsModel);
if (_authService.hasError) {
@ -122,22 +144,25 @@ class AuthenticationViewModel extends BaseViewModel {
}
/// send activation code for for msg methods
Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
Future sendActivationCodeVerificationScreen(
AuthMethodTypes authMethodType) async {
setState(ViewState.BusyLocal);
ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel(
iMEI: user.iMEI,
facilityId: user.projectID,
memberID: user.doctorID,
loginDoctorID: int.parse(user.editedBy.toString()),
zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user.mobile,
oTPSendType: authMethodType.getTypeIdService(),
isMobileFingerPrint: 1,
vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID);
ActivationCodeForVerificationScreenModel activationCodeModel =
ActivationCodeForVerificationScreenModel(
iMEI: user.iMEI,
facilityId: user.projectID,
memberID: user.doctorID,
loginDoctorID: int.parse(user.editedBy.toString()),
zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user.mobile,
oTPSendType: authMethodType.getTypeIdService(),
isMobileFingerPrint: 1,
vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user.editedBy.toString());
await _authService.sendActivationCodeVerificationScreen(activationCodeModel);
await _authService
.sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) {
error = _authService.error;
setState(ViewState.ErrorLocal);
@ -146,7 +171,8 @@ class AuthenticationViewModel extends BaseViewModel {
}
/// send activation code for silent login
Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async {
Future sendActivationCodeForDoctorApp(
{AuthMethodTypes authMethodType, String password}) async {
setState(ViewState.BusyLocal);
int projectID = await sharedPref.getInt(PROJECT_ID);
ActivationCodeModel activationCodeModel = ActivationCodeModel(
@ -161,46 +187,59 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID);
await sharedPref.setString(
TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID);
setState(ViewState.Idle);
}
}
/// check activation code for sms and whats app
Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async {
Future checkActivationCodeForDoctorApp(
{String activationCode, bool isSilentLogin = false}) async {
setState(ViewState.BusyLocal);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel(
zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode,
mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user.mobile,
projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID,
logInTokenID: await sharedPref.getString(TOKEN),
activationCode: activationCode ?? '0000',
memberID: userInfo.userID != null ? int.parse(userInfo.userID) : user.doctorID,
password: userInfo.password,
facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken,
loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()),
///loggedUser.listMemberInformation[0].employeeID,
// loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin: isSilentLogin,
generalid: "Cs2020@2016\$2958");
await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel(
zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode,
mobileNumber:
loggedUser != null ? loggedUser.mobileNumber : user.mobile,
projectID: await sharedPref.getInt(PROJECT_ID) != null
? await sharedPref.getInt(PROJECT_ID)
: user.projectID,
logInTokenID: await sharedPref.getString(TOKEN),
activationCode: activationCode ?? '0000',
memberID: userInfo.userID != null
? int.parse(userInfo.userID)
: user.doctorID,
password: userInfo.password,
facilityId: userInfo.projectID != null
? userInfo.projectID.toString()
: user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken,
loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID
: int.parse(user.editedBy.toString()),///loggedUser.listMemberInformation[0].employeeID,
// loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin: isSilentLogin,
generalid: "Cs2020@2016\$2958");
await _authService
.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp);
if (_authService.hasError) {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes);
await setDataAfterSendActivationSuccess(
checkActivationCodeForDoctorAppRes);
setState(ViewState.Idle);
}
}
/// get list of Hospitals
Future getHospitalsList(memberID) async {
GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel();
GetHospitalsRequestModel getHospitalsRequestModel =
GetHospitalsRequestModel();
getHospitalsRequestModel.memberID = memberID;
getHospitalsRequestModel.doctorID = memberID;
await _hospitalsService.getHospitals(getHospitalsRequestModel);
if (_hospitalsService.hasError) {
error = _hospitalsService.error;
@ -231,11 +270,16 @@ class AuthenticationViewModel extends BaseViewModel {
}
/// add  token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async {
setDataAfterSendActivationSuccess(
CheckActivationCodeForDoctorAppResponseModel
sendActivationCodeForDoctorAppResponseModel) async {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(TOKEN,
sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
}
saveObjToString(String key, value) async {
@ -244,23 +288,21 @@ class AuthenticationViewModel extends BaseViewModel {
/// ask user to add his biometric
showIOSAuthMessages() async {
//TODO FOR UPGRADE NEED TO BE TESTED FIRST
// const iosStrings = const IOSAuthMessages(
// cancelButton: 'cancel',
// goToSettingsButton: 'settings',
// goToSettingsDescription: 'Please set up your Touch ID.',
// lockOut: 'Please Enable Your Touch ID');
// try {
// await auth.authenticateWithBiometrics(
// localizedReason: 'Scan your fingerprint to authenticate',
// useErrorDialogs: true,
// stickyAuth: true,
// // iOSAuthStrings: iosStrings);
// } on PlatformException catch (e) {
// DrAppToastMsg.showErrorToast(e.toString());
// }
const iosStrings = const IOSAuthMessages(
cancelButton: 'cancel',
goToSettingsButton: 'settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please Enable Your Touch ID');
try {
await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: true,
iOSAuthStrings: iosStrings);
} on PlatformException catch (e) {
DrAppToastMsg.showErrorToast(e.toString());
}
}
/// add profile to base view model super class
@ -270,7 +312,12 @@ class AuthenticationViewModel extends BaseViewModel {
/// get doctor profile based on clinic model
Future getDoctorProfileBasedOnClinic(ClinicModel clinicInfo) async {
ProfileReqModel docInfo = new ProfileReqModel(doctorID: clinicInfo.doctorID, clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, languageID: 2);
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: clinicInfo.doctorID,
clinicID: clinicInfo.clinicID,
license: true,
projectID: clinicInfo.projectID,
languageID: 2);
///TODO change the lan
await _authService.getDoctorProfileBasedOnClinic(docInfo);
@ -285,12 +332,17 @@ class AuthenticationViewModel extends BaseViewModel {
/// add some logic in case of check activation code is success
onCheckActivationCodeSuccess({bool isSilentLogin = false}) async {
sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) {
localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]);
sharedPref.setString(
TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null &&
checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) {
localSetDoctorProfile(
checkActivationCodeForDoctorAppRes.listDoctorProfile[0]);
} else {
sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic);
ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson());
sharedPref.setObj(
CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic);
ClinicModel clinic = ClinicModel.fromJson(
checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson());
await getDoctorProfileBasedOnClinic(clinic);
}
}
@ -316,14 +368,29 @@ class AuthenticationViewModel extends BaseViewModel {
}
}
// checkIsHuawei() async {
// HmsApiAvailability hmsApiAvailability = HmsApiAvailability();
// await hmsApiAvailability.isHMSAvailable().then((value) {
// isHuawei = value == 0 ? true : false;
// });
// print(isHuawei);
// }
/// call firebase service to check if the user already login in before or not
getDeviceInfoFromFirebase() async {
// await checkIsHuawei();
var token;
_firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) {
_firebaseMessaging.requestPermission();
}
setState(ViewState.Busy);
var token = await _firebaseMessaging.getToken();
try {
token = await _firebaseMessaging.getToken();
} catch(ex) {
print(ex);
}
if (localToken == "") {
localToken = token;
@ -334,8 +401,10 @@ class AuthenticationViewModel extends BaseViewModel {
} else {
if (_authService.dashboardItemsList.length > 0) {
user = _authService.dashboardItemsList[0];
sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID);
sharedPref.setObj(
LAST_LOGIN_USER, _authService.dashboardItemsList[0]);
await sharedPref.setString(
VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID);
this.unverified = true;
}

@ -35,8 +35,7 @@ class VerificationMethodsScreen extends StatefulWidget {
});
@override
_VerificationMethodsScreenState createState() =>
_VerificationMethodsScreenState();
_VerificationMethodsScreenState createState() => _VerificationMethodsScreenState();
}
class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
@ -64,16 +63,13 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 6 : 4),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4),
),
if (authenticationViewModel.isFromLogin)
InkWell(
onTap: () {
authenticationViewModel.setUnverified(false,
isFromLogin: false);
authenticationViewModel
.setAppStatus(APP_STATUS.UNAUTHENTICATED);
authenticationViewModel.setUnverified(false, isFromLogin: false);
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
},
child: Icon(
Icons.arrow_back_ios,
@ -82,30 +78,23 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Column(
children: <Widget>[
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 3 : 4),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4),
),
authenticationViewModel.user != null &&
isMoreOption == false
authenticationViewModel.user != null && isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).welcomeBack,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontWeight: FontWeight.w600,
color: AppGlobal.appTextColor,
letterSpacing: -0.72,
),
AppText(
Utils.convertToTitleCase(
authenticationViewModel.user.doctorName),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
6,
Utils.convertToTitleCase(authenticationViewModel.user.doctorName),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
@ -115,15 +104,12 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
AppText(
TranslationBase.of(context).accountInfo,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
SizedBox(
height: SizeConfig.heightMultiplier * 4),
SizedBox(height: SizeConfig.heightMultiplier * 4),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
@ -131,149 +117,85 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(
color: HexColor('#707070'), width: 0.1),
border: Border.all(color: HexColor('#707070'), width: 0.1),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .5,
padding: EdgeInsets.all(0),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
TranslationBase.of(context)
.lastLoginAt,
TranslationBase.of(context).lastLoginAt,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
letterSpacing: -0.4),
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.55,
width: MediaQuery.of(context).size.width * 0.55,
child: RichText(
text: TextSpan(
text: TranslationBase.of(
context)
.verifyWith +
':',
text: TranslationBase.of(context).verifyWith + ':',
style: TextStyle(
color:
Color(0xFF575757),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600,
fontWeight: FontWeight.w600,
letterSpacing: -0.4),
children: <TextSpan>[
TextSpan(
text: authenticationViewModel
.getType(
authenticationViewModel
.user
.logInTypeID,
context),
text: authenticationViewModel.getType(authenticationViewModel.user.logInTypeID, context),
style: TextStyle(
color: AppGlobal
.appTextColor,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
letterSpacing:
-0.48),
color: AppGlobal.appTextColor,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
letterSpacing: -0.48),
)
]),
),
),
],
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
),
),
Column(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
authenticationViewModel
.user.editedOn !=
null
? AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.editedOn),
isMonthShort: true)
: authenticationViewModel
.user.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.createdOn),
isMonthShort: true)
authenticationViewModel.user.editedOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn), isMonthShort: true)
: authenticationViewModel.user.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn), isMonthShort: true)
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
),
AppText(
authenticationViewModel
.user.editedOn !=
null
? AppDateUtils.getHour(AppDateUtils
.convertStringToDate(
authenticationViewModel
.user.editedOn))
: authenticationViewModel
.user.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.createdOn))
authenticationViewModel.user.editedOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn))
: authenticationViewModel.user.createdOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn))
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: Color(0xFF575757),
)
],
crossAxisAlignment:
CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
)
],
),
@ -286,9 +208,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
//todo add translation
AppText(
"Please Verify",
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.w600,
letterSpacing: -.64,
@ -300,150 +220,90 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
this.onlySMSBox == false
? Container(
margin: EdgeInsets.only(
bottom: 20, top: 30),
child: AppText(
TranslationBase.of(context)
.verifyLoginWith,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
),
)
: AppText(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
textAlign: TextAlign.start,
),
]),
authenticationViewModel.user != null &&
isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.center,
: Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
this.onlySMSBox == false
? Container(
margin: EdgeInsets.only(bottom: 20, top: 30),
child: AppText(
TranslationBase.of(context).verifyLoginWith,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
),
)
: AppText(
TranslationBase.of(context).verifyFingerprint2,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
textAlign: TextAlign.start,
),
]),
authenticationViewModel.user != null && isMoreOption == false
? Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
print("Fingerprint"),
// TODO check this logic it seem it will create bug to us
authenticateUser(AuthMethodTypes.Fingerprint, true)
},
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID),
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)),
),
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.MoreOptions,
onShowMore: () {
setState(() {
isMoreOption = true;
});
},
))
]),
])
: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
// TODO check this logic it seem it will create bug to us
authenticateUser(
AuthMethodTypes
.Fingerprint,
true)
},
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
SelectedAuthMethodTypesService
.getMethodsTypeService(
authenticationViewModel
.user
.logInTypeID),
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
)),
),
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.Fingerprint,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.MoreOptions,
onShowMore: () {
setState(() {
isMoreOption = true;
});
},
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.FaceID,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
))
]),
])
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.Fingerprint,
authenticateUser: (AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.FaceID,
authenticateUser: (AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
))
],
)
: SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType: AuthMethodTypes.SMS,
authenticateUser:
(AuthMethodTypes authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.WhatsApp,
authenticateUser:
(AuthMethodTypes authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
))
],
),
]),
],
)
: SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.SMS,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.WhatsApp,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
))
],
),
]),
// )
],
@ -468,14 +328,12 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
AppButton(
title:
TranslationBase.of(context).useAnotherAccount ?? '',
title: TranslationBase.of(context).useAnotherAccount ?? '',
color: Color(0xFFD02127),
//fontWeight: FontWeight.w700,
onPressed: () {
authenticationViewModel.deleteUser();
authenticationViewModel
.setAppStatus(APP_STATUS.UNAUTHENTICATED);
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
},
),
SizedBox(
@ -489,15 +347,11 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
);
}
sendActivationCodeByOtpNotificationType(
AuthMethodTypes authMethodType) async {
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {
sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async {
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeForDoctorApp(
authMethodType: authMethodType,
password: authenticationViewModel.userInfo.password);
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(authenticationViewModel.error);
GifLoaderDialogUtils.hideDialog(context);
@ -515,19 +369,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel
.sendActivationCodeVerificationScreen(authMethodType);
await authenticationViewModel.sendActivationCodeVerificationScreen(authMethodType);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(authenticationViewModel.error);
} else {
await sharedPref.setString(
TOKEN,
authenticationViewModel
.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {
await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType, isSilentLogin: true);
} else {
@ -537,12 +386,10 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}
authenticateUser(AuthMethodTypes authMethodType, isActive) {
if (authMethodType == AuthMethodTypes.Fingerprint ||
authMethodType == AuthMethodTypes.FaceID) {
if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) {
fingerPrintBefore = authMethodType;
}
this.selectedOption =
fingerPrintBefore != null ? fingerPrintBefore : authMethodType;
this.selectedOption = fingerPrintBefore != null ? fingerPrintBefore : authMethodType;
switch (authMethodType) {
case AuthMethodTypes.SMS:
@ -552,8 +399,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
sendActivationCode(authMethodType);
break;
case AuthMethodTypes.Fingerprint:
this.loginWithFingerPrintOrFaceID(
AuthMethodTypes.Fingerprint, isActive);
this.loginWithFingerPrintOrFaceID(AuthMethodTypes.Fingerprint, isActive);
break;
case AuthMethodTypes.FaceID:
this.loginWithFingerPrintOrFaceID(AuthMethodTypes.FaceID, isActive);
@ -576,9 +422,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
new SMSOTP(
context,
type,
authenticationViewModel.loggedUser != null
? authenticationViewModel.loggedUser.mobileNumber
: authenticationViewModel.user.mobile,
authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile,
(value) {
showDialog(
context: context,
@ -594,18 +438,13 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
).displayDialog(context);
}
loginWithFingerPrintOrFaceID(
AuthMethodTypes authMethodTypes, isActive) async {
loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, isActive) async {
if (isActive) {
await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return;
if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService(
authenticationViewModel.user.logInTypeID) ==
AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(
authenticationViewModel.user.logInTypeID) ==
AuthMethodTypes.FaceID)) {
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes);
} else {
setState(() {
@ -616,8 +455,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}
checkActivationCode({String value, bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(
activationCode: value, isSilentLogin: isSilentLogin);
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value, isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context);
Utils.showErrorToast(authenticationViewModel.error);

@ -361,7 +361,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
planNote: patientProgressNote.planNote,
doctorID: '',
doctorID: widget.patientInfo.doctorId,
editedBy: '');
if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {

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

@ -1,9 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/lookups/patient_lookup.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart';
@ -20,8 +20,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
int projectID;
bool isNotOneAppointment;
VitalSignDetailsScreen(
{this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
@override
Widget build(BuildContext context) {
@ -36,8 +35,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
String assetBasePath = "${imageBasePath}patient/vital_signs/";
return BaseView<VitalSignsViewModel>(
onModelReady: (model) =>
model.getPatientVitalSignHistory(patient, from, to, isInpatient),
onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to, isInpatient),
builder: (_, mode, widget) => AppScaffold(
baseViewModel: mode,
isShowAppBar: true,
@ -76,8 +74,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.23,
width: double.infinity,
padding: EdgeInsets.all(12.0),
margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
@ -101,17 +98,11 @@ class VitalSignDetailsScreen extends StatelessWidget {
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 1
? '${assetBasePath}underweight_BMI.png'
: '${assetBasePath}underweight_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 1 ? '${assetBasePath}underweight_BMI.png' : '${assetBasePath}underweight_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -119,38 +110,26 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiUnderWeight}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontSize: SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null,
fontWeight: FontWeight.w700,
),
AppText(
"(<18.5)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontSize: SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null,
fontWeight: FontWeight.w700,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 2
? '${assetBasePath}health_BMI.png'
: '${assetBasePath}health_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 2 ? '${assetBasePath}health_BMI.png' : '${assetBasePath}health_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -159,40 +138,27 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText(
"${TranslationBase.of(context).normal}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier *
1.15,
fontSize: SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null,
),
),
AppText(
"(18.5-24.9)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 3
? '${assetBasePath}ovrweight_BMI.png'
: '${assetBasePath}ovrweight_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 3 ? '${assetBasePath}ovrweight_BMI.png' : '${assetBasePath}ovrweight_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -200,38 +166,26 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiOverWeight}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.155,
fontSize: SizeConfig.textMultiplier * 1.155,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null,
),
AppText(
"(25-29.9)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.155,
fontSize: SizeConfig.textMultiplier * 1.155,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 4
? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 4 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -239,38 +193,26 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText(
"${TranslationBase.of(context).bmiObese}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null,
),
AppText(
"(30-34.9)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null,
),
],
)),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
mode.getBMIStatus() != 5
? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context)
.size
.height *
0.10,
mode.getBMIStatus() != 5 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10,
),
const SizedBox(
height: 4,
@ -280,24 +222,17 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText(
"${TranslationBase.of(context).bmiObeseExtreme}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier *
1.15,
fontSize: SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null,
),
),
AppText(
"(35<)",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 1.15,
fontSize: SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5
? Color(0XFFD02127)
: null,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null,
),
],
)),
@ -309,8 +244,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
Expanded(
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 16),
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -326,16 +260,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Height,
pageTitle:
TranslationBase.of(
context)
.height,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Height,
pageTitle: TranslationBase.of(context).height,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -345,40 +273,28 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null,
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context)
.height,
imagePath:
"${assetBasePath}height.png",
des: TranslationBase.of(context).height,
imagePath: "${assetBasePath}height.png",
lastVal: mode.heightCm,
unit: TranslationBase.of(context)
.cm,
unit: TranslationBase.of(context).cm,
),
),
),
if (isNotOneAppointment)
InkWell(
onTap: () async {
await locator<AnalyticsService>()
.logEvent(
eventCategory:
"Vital Sign Details Screen",
eventAction:
"Vital Sign Details",
await locator<AnalyticsService>().logEvent(
eventCategory: "Vital Sign Details Screen",
eventAction: "Vital Sign Details",
);
Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey:
vitalSignDetails.Weight,
pageTitle:
TranslationBase.of(
context)
.weight,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Weight,
pageTitle: TranslationBase.of(context).weight,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -387,12 +303,9 @@ class VitalSignDetailsScreen extends StatelessWidget {
);
},
child: VitalSignItem(
des: TranslationBase.of(context)
.weight,
imagePath:
"${assetBasePath}weight.png",
unit: TranslationBase.of(context)
.kg,
des: TranslationBase.of(context).weight,
imagePath: "${assetBasePath}weight.png",
unit: TranslationBase.of(context).kg,
lastVal: mode.weightKg,
),
),
@ -401,16 +314,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Temperature,
pageTitle:
TranslationBase.of(
context)
.temperature,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Temperature,
pageTitle: TranslationBase.of(context).temperature,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -420,13 +327,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null,
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context)
.temperature,
imagePath:
"${assetBasePath}temperature.png",
des: TranslationBase.of(context).temperature,
imagePath: "${assetBasePath}temperature.png",
lastVal: mode.temperatureCelcius,
unit: TranslationBase.of(context)
.tempC,
unit: TranslationBase.of(context).tempC,
),
),
),
@ -435,16 +339,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.heart,
pageTitle:
TranslationBase.of(
context)
.heart,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.heart,
pageTitle: TranslationBase.of(context).heart,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -453,13 +351,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.heart,
imagePath:
"${assetBasePath}heart_rate.png",
des: TranslationBase.of(context).heart,
imagePath: "${assetBasePath}heart_rate.png",
lastVal: mode.hartRat,
unit:
TranslationBase.of(context).bpm,
unit: TranslationBase.of(context).bpm,
),
),
InkWell(
@ -467,16 +362,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Respiration,
pageTitle:
TranslationBase.of(
context)
.respirationRate,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Respiration,
pageTitle: TranslationBase.of(context).respirationRate,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -485,14 +374,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.respirationRate,
imagePath:
"${assetBasePath}respiration_rate.png",
lastVal:
mode.respirationBeatPerMinute,
unit: TranslationBase.of(context)
.respirationSigns,
des: TranslationBase.of(context).respirationRate,
imagePath: "${assetBasePath}respiration_rate.png",
lastVal: mode.respirationBeatPerMinute,
unit: TranslationBase.of(context).respirationSigns,
),
),
InkWell(
@ -500,31 +385,24 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.BloodPressure,
pageTitle:
TranslationBase.of(
context)
.bloodPressure,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.BloodPressure,
pageTitle: TranslationBase.of(context).bloodPressure,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
viewKey1: 'BloodPressureHigher',
viewKey2: 'BloodPressureLower',
),
),
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.bloodPressure,
imagePath:
"${assetBasePath}blood_pressure.png",
des: TranslationBase.of(context).bloodPressure,
imagePath: "${assetBasePath}blood_pressure.png",
lastVal: mode.bloodPressure,
unit: TranslationBase.of(context)
.sysDias,
unit: TranslationBase.of(context).sysDias,
),
),
InkWell(
@ -532,16 +410,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.Oxygenation,
pageTitle:
TranslationBase.of(
context)
.oxygenation,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Oxygenation,
pageTitle: TranslationBase.of(context).oxygenation,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -550,10 +422,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.oxygenation,
imagePath:
"${assetBasePath}oxg.png",
des: TranslationBase.of(context).oxygenation,
imagePath: "${assetBasePath}oxg.png",
lastVal: "${mode.oxygenation}%",
unit: "",
),
@ -563,16 +433,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push(
context,
FadePage(
page:
VitalSignItemDetailsScreen(
pageKey: vitalSignDetails
.PainScale,
pageTitle:
TranslationBase.of(
context)
.painScale,
vitalList: mode
.patientVitalSignsHistory,
page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.PainScale,
pageTitle: TranslationBase.of(context).painScale,
vitalList: mode.patientVitalSignsHistory,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
@ -581,13 +445,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
)
: null,
child: VitalSignItem(
des: TranslationBase.of(context)
.painScale,
imagePath:
"${assetBasePath}painScale.png",
des: TranslationBase.of(context).painScale,
imagePath: "${assetBasePath}painScale.png",
lastVal: mode.painScore,
unit: TranslationBase.of(context)
.severe,
unit: TranslationBase.of(context).severe,
),
),
],

@ -1,11 +1,15 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/lookups/patient_lookup.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -21,9 +25,17 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
String patientType;
String arrivalType;
List<TimeSeriesSales2> timeSeriesData1 = [];
List<TimeSeriesSales2> timeSeriesData2 = [];
final String viewKey1;
final String viewKey2;
VitalSignItemDetailsScreen(
{this.vitalList,
this.pageKey,
@required this.viewKey1,
@required this.viewKey2,
this.pageTitle,
this.patient,
this.patientType,
@ -34,6 +46,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
generateData();
switch (pageKey) {
case vitalSignDetails.BodyMeasurements:
VSchart = [
@ -233,6 +246,15 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
if (vitalListTemp.length != 0 &&
chartInfo['viewKey'] == 'BloodPressure' ||
chartInfo['viewKey'] == 'O2') {
// return LineChartCurvedBloodPressureNew(
// title: projectViewModel.isArabic
// ? chartInfo['nameAr']
// : chartInfo['name'],
// timeSeries1: timeSeriesData1,
// timeSeries2: timeSeriesData2,
// indexes: timeSeriesData1.length ~/ 5.5,
// );
return VitalSingChartBloodPressure(
vitalList: vitalList,
name: projectViewModel.isArabic
@ -252,6 +274,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
? 'BloodPressureLower'
: 'FIO2',
);
}
return vitalListTemp.length != 0
@ -274,4 +297,30 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
),
);
}
generateData() {
if (vitalList.length > 0) {
vitalList.reversed.toList().forEach(
(element) {
if (element.toJson()[viewKey1]?.toInt() != 0)
timeSeriesData1.add(
TimeSeriesSales2(
AppDateUtils.convertStringToDate(element.createdOn),
// new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day),
element.toJson()[viewKey1].toDouble(),
),
);
if (element.toJson()[viewKey2]?.toInt() != 0)
timeSeriesData2.add(
TimeSeriesSales2(
AppDateUtils.convertStringToDate(element.createdOn),
// new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day),
element.toJson()[viewKey2].toDouble(),
),
);
},
);
}
}
}

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -45,7 +46,7 @@ class VitalSingChartBloodPressure extends StatelessWidget {
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12)),
child: LineChartCurvedBloodPressure(
child: LineChartCurvedBloodPressureNew(
title: name,
isOX: title2 == "SAO2",
timeSeries1: timeSeriesData1,

@ -112,6 +112,7 @@ class Utils {
});
}
static TextStyle textStyle(context) =>
TextStyle(color: Theme.of(context).primaryColor);

@ -1,12 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -15,8 +15,7 @@ import 'package:url_launcher/url_launcher.dart';
import 'header_row.dart';
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
with PreferredSizeWidget {
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
@ -27,13 +26,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final Stream<String> videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType,
{this.height = 0.0,
this.isInpatient = false,
this.isDischargedPatient = false,
this.isFromLiveCare = false,
this.videoCallDurationStream});
PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType,
{this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, this.videoCallDurationStream});
@override
Widget build(BuildContext context) {
@ -73,11 +67,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
Expanded(
child: AppText(
patient.firstName != null
? (Utils.capitalize(patient.firstName) +
" " +
Utils.capitalize(patient.lastName))
: Utils.capitalize(patient.fullName ??
patient.patientDetails.fullName),
? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName))
: Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
@ -110,17 +101,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
),
StreamBuilder(
stream: videoCallDurationStream,
builder:
(BuildContext context, AsyncSnapshot<String> snapshot) {
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.hasData && snapshot.data != null)
return InkWell(
onTap: () {},
child: Container(
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(20)),
padding:
EdgeInsets.symmetric(vertical: 2, horizontal: 10),
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text(
snapshot.data,
style: TextStyle(color: Colors.white),
@ -140,9 +127,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
width: 60,
height: 60,
child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -154,58 +139,48 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[int.parse(patientType)] ==
"patientArrivalList"
SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList"
? Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patient.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: AppGlobal.appGreenColor,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
if (patient.patientStatusType != null)
patient.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: AppGlobal.appGreenColor,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
arrivalType == '1' || patient.arrivedOn == null
? AppText(
patient.startTime != null
? patient.startTime
: '',
patient.startTime != null ? patient.startTime : '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: AppText(
patient.arrivedOn != null
? AppDateUtils
.convertStringToDateFormat(
patient.arrivedOn,
'MM-dd-yyyy HH:mm')
: '',
patient.arrivedOn != null ? AppDateUtils.convertStringToDateFormat(patient.arrivedOn, 'MM-dd-yyyy HH:mm') : '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
],
))
: SizedBox(),
if (SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient" &&
!isFromLiveCare)
if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" && !isFromLiveCare)
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).appointmentDate +
" : ",
TranslationBase.of(context).appointmentDate + " : ",
fontSize: 14,
),
patient.startTime != null
@ -230,8 +205,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
),
Container(
child: AppText(
convertDateFormat2(
patient.appointmentDate ?? ''),
convertDateFormat2(patient.appointmentDate ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
@ -261,10 +235,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
child: Container(
alignment: Alignment.centerRight,
child: AppText(
patient.nationalityName ??
patient.nationality ??
patient.nationalityId ??
'',
patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '',
fontWeight: FontWeight.bold,
fontSize: 12,
),
@ -277,9 +248,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
return Text('');
},
))
@ -299,19 +268,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
crossAxisAlignment: CrossAxisAlignment.start,
children: [
HeaderRow(
label: patient.admissionDate == null
? ""
: TranslationBase.of(context).admissionDate +
" : ",
value: patient.admissionDate == null
? ""
: "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}"),
label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ",
value: patient.admissionDate == null ? "" : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}"),
if (patient.admissionDate != null)
HeaderRow(
label:
"${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient &&
patient.dischargeDate != null
label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient && patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
)
@ -336,13 +298,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + "/" + date.day.toString().padLeft(2, '0');
}
return newDate ?? '';
@ -350,8 +307,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
return DateFormat("yyyy-MM-dd").format(tempDate) == DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {

@ -38,7 +38,7 @@ dependencies:
# imei_plugin: ^1.2.0
# flutter_flexible_toast: ^0.1.4
fluttertoast: ^8.0.8
local_auth: ^2.1.3
local_auth: 1.1.8
http_interceptor: ^1.0.2
connectivity: ^3.0.6
@ -71,7 +71,7 @@ dependencies:
get_it: ^7.1.3
#chart
fl_chart: ^0.40.2
fl_chart: ^0.45.0
# Firebase
firebase_messaging: ^14.2.1
@ -93,8 +93,8 @@ dependencies:
file_picker: ^4.6.1
#speech to text
# speech_to_text:
# path: speech_to_text
# speech_to_text:
# path: speech_to_text
speech_to_text: ^6.1.1
quiver: ^3.0.0
@ -187,4 +187,4 @@ flutter:
- asset: assets/fonts/DoctorApp.ttf
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
# see https://flutter.dev/custom-fonts/#from-packages
Loading…
Cancel
Save