From 4b7688d62002b5e6bd6f8fc8c7c38988f462128e Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Mon, 26 Apr 2021 15:59:30 +0300 Subject: [PATCH 01/31] showDailog Migration DateUtils Conflict with Material (DateUtils -> AppDateUtils) --- lib/core/model/DischargeReferralPatient.dart | 2 +- lib/core/model/MyReferralPatientModel.dart | 2 +- lib/core/model/PatientMuseResultsModel.dart | 2 +- .../model/Prescriptions/Prescriptions.dart | 2 +- .../Prescriptions/prescriptions_order.dart | 4 +- lib/core/model/labs/patient_lab_orders.dart | 2 +- lib/core/model/radiology/final_radiology.dart | 4 +- lib/core/service/prescription_service.dart | 2 +- .../viewModel/patient-ucaf-viewmodel.dart | 4 +- .../patient-vital-sign-viewmodel.dart | 4 +- ...list_doctor_working_hours_table_model.dart | 2 +- .../list_gt_my_patients_question_model.dart | 2 +- .../lab_orders/lab_orders_res_model.dart | 2 +- .../my_referral_patient_model.dart | 2 +- .../prescription_report_for_in_patient.dart | 6 +-- .../vital_sign/vital_sign_res_model.dart | 2 +- lib/screens/doctor/doctor_repaly_chat.dart | 4 +- .../doctor/patient_arrival_screen.dart | 4 +- lib/screens/home/home_screen.dart | 4 +- .../medical-file/medical_file_details.dart | 4 +- .../medical-file/medical_file_page.dart | 2 +- .../patients/DischargedPatientPage.dart | 6 +-- lib/screens/patients/ECGPage.dart | 4 +- .../ReferralDischargedPatientDetails.dart | 14 +++--- .../ReferralDischargedPatientPage.dart | 4 +- .../patients/insurance_approvals_details.dart | 8 ++-- lib/screens/patients/patients_screen.dart | 16 +++---- .../admission-request-detail-screen.dart | 2 +- .../admission-request_second-screen.dart | 2 +- .../Lab_Result_details_wideget.dart | 4 +- .../profile/lab_result/LineChartCurved.dart | 2 +- .../profile/note/progress_note_screen.dart | 15 ++++--- ...n_patient_prescription_details_screen.dart | 6 +-- .../referral/my-referral-detail-screen.dart | 4 +- .../my-referral-inpatient-screen.dart | 4 +- .../referral/refer-patient-screen.dart | 2 +- .../referral_patient_detail_in-paint.dart | 14 +++--- .../referral/referred-patient-screen.dart | 4 +- .../referred_patient_detail_in-paint.dart | 14 +++--- .../assessment/update_assessment_page.dart | 8 ++-- .../soap_update/plan/update_plan_page.dart | 4 +- .../vital_sign_detail_pain_scale.dart | 2 +- ...al_sign_details_blood_pressurewideget.dart | 4 +- .../vital_sign_details_wideget.dart | 4 +- .../vital_sing_chart_and_detials.dart | 2 +- .../vital_sing_chart_blood_pressure.dart | 2 +- .../prescription/add_prescription_form.dart | 2 +- .../prescription_item_in_patient_page.dart | 4 +- .../prescription/prescription_items_page.dart | 6 +-- .../prescription/prescription_screen.dart | 6 +-- .../prescription_screen_history.dart | 6 +-- .../prescription/prescriptions_page.dart | 8 ++-- .../update_prescription_form.dart | 4 +- lib/screens/procedures/ProcedureCard.dart | 4 +- .../add-rescheduleleave.dart | 6 +-- lib/screens/sick-leave/add-sickleave.dart | 2 +- lib/screens/sick-leave/show-sickleave.dart | 2 +- lib/util/date-utils.dart | 4 +- lib/widgets/auth/verification_methods.dart | 8 ++-- lib/widgets/doctor/doctor_reply_widget.dart | 14 +++--- lib/widgets/doctor/my_schedule_widget.dart | 8 ++-- lib/widgets/patients/PatientCard.dart | 8 ++-- .../profile/PatientProfileButton.dart | 4 +- ...ent-profile-header-new-design-app-bar.dart | 4 +- .../patient-profile-header-new-design.dart | 4 +- ...-profile-header-new-design_in_patient.dart | 6 +-- ..._profile_header_with_appointment_card.dart | 6 +-- ..._header_with_appointment_card_app_bar.dart | 6 +-- .../patients/vital_sign_details_wideget.dart | 2 +- lib/widgets/shared/doctor_card.dart | 4 +- .../loader/gif_loader_dialog_utils.dart | 2 +- .../user-guid/in_patient_doctor_card.dart | 4 +- pubspec.lock | 44 +++++++++---------- pubspec.yaml | 5 +++ 74 files changed, 201 insertions(+), 195 deletions(-) diff --git a/lib/core/model/DischargeReferralPatient.dart b/lib/core/model/DischargeReferralPatient.dart index 523d8d0a..dff63bfc 100644 --- a/lib/core/model/DischargeReferralPatient.dart +++ b/lib/core/model/DischargeReferralPatient.dart @@ -139,7 +139,7 @@ class DischargeReferralPatient { referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; referralStatus = json['ReferralStatus']; - referralDate = DateUtils.convertStringToDate(json['ReferralDate']); + referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; referralResponseOn = json['ReferralResponseOn']; diff --git a/lib/core/model/MyReferralPatientModel.dart b/lib/core/model/MyReferralPatientModel.dart index f2c9c425..797109dd 100644 --- a/lib/core/model/MyReferralPatientModel.dart +++ b/lib/core/model/MyReferralPatientModel.dart @@ -159,7 +159,7 @@ class MyReferralPatientModel { referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; referralStatus = json['ReferralStatus']; - referralDate = DateUtils.convertStringToDate(json['ReferralDate']); + referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; referralResponseOn = json['ReferralResponseOn']; diff --git a/lib/core/model/PatientMuseResultsModel.dart b/lib/core/model/PatientMuseResultsModel.dart index 8b10de83..401fd1a7 100644 --- a/lib/core/model/PatientMuseResultsModel.dart +++ b/lib/core/model/PatientMuseResultsModel.dart @@ -42,7 +42,7 @@ class PatientMuseResultsModel { imageURL = json['ImageURL']; createdBy = json['CreatedBy']; createdOn = json['CreatedOn']; - createdOnDateTime = DateUtils.getDateTimeFromServerFormat(json['CreatedOn']); + createdOnDateTime = AppDateUtils.getDateTimeFromServerFormat(json['CreatedOn']); } Map toJson() { diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart index 78bc9105..c47a813a 100644 --- a/lib/core/model/Prescriptions/Prescriptions.dart +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -86,7 +86,7 @@ class Prescriptions { clinicID = json['ClinicID']; companyName = json['CompanyName']; despensedStatus = json['Despensed_Status']; - dischargeDate = DateUtils.convertStringToDate(json['DischargeDate']); + dischargeDate = AppDateUtils.convertStringToDate(json['DischargeDate']); dischargeNo = json['DischargeNo']; doctorID = json['DoctorID']; doctorImageURL = json['DoctorImageURL']; diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart index 4f77f7ec..f51420ec 100644 --- a/lib/core/model/Prescriptions/prescriptions_order.dart +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -79,10 +79,10 @@ class PrescriptionsOrder { status = json['Status']; description = json['Description']; descriptionN = json['DescriptionN']; - createdOn = DateUtils.convertStringToDate(json['CreatedOn']); + createdOn = AppDateUtils.convertStringToDate(json['CreatedOn']); serviceID = json['ServiceID']; createdBy = json['CreatedBy']; - editedOn = DateUtils.convertStringToDate(json['EditedOn']); + editedOn = AppDateUtils.convertStringToDate(json['EditedOn']); editedBy = json['EditedBy']; channel = json['Channel']; clientRequestID = json['ClientRequestID']; diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 6f989543..af60f86f 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -95,7 +95,7 @@ class PatientLabOrders { isRead = json['IsRead']; nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; - orderDate = DateUtils.convertStringToDate(json['OrderDate']); + orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); orderNo = json['OrderNo'].toString(); patientID = json['PatientID'].toString(); projectID = json['ProjectID'].toString(); diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 1d406b81..b2551a18 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -96,8 +96,8 @@ class FinalRadiology { invoiceNo = json['InvoiceNo']; doctorID = json['DoctorID']; clinicID = json['ClinicID']; - orderDate = DateUtils.convertStringToDate(json['OrderDate']); - reportDate = DateUtils.convertStringToDate(json['ReportDate']); + orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); + reportDate = AppDateUtils.convertStringToDate(json['ReportDate']); reportData = json['ReportData']; imageURL = json['ImageURL']; procedureID = json['ProcedureID']; diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index dc74901e..720cd28e 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -218,7 +218,7 @@ class PrescriptionService extends LookupService { "Prescription": { "objPatientInfo": { "Gender": patient.gender == 1 ? 'Male' : 'Female', - "Age": DateUtils.convertDateFromServerFormat( + "Age": AppDateUtils.convertDateFromServerFormat( patient.dateofBirth, 'dd/MM/yyyy') }, "objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index dc76884d..e8040156 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -61,10 +61,10 @@ class UcafViewModel extends BaseViewModel { String from; String to; if (from == null || from == "0") { - from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } if (to == null || to == "0") { - to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } // await _ucafService.getPatientVitalSignsHistory(patient, from, to); diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 6786ad92..6ca63a30 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -46,10 +46,10 @@ class VitalSignsViewModel extends BaseViewModel { String to, bool isInPatient) async { setState(ViewState.Busy); if (from == null || from == "0") { - from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } if (to == null || to == "0") { - to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 9b64e588..4712d285 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -15,7 +15,7 @@ class ListDoctorWorkingHoursTable { }); ListDoctorWorkingHoursTable.fromJson(Map json) { - date = DateUtils.convertStringToDate(json['Date']); + date = AppDateUtils.convertStringToDate(json['Date']); dayName = json['DayName']; workingHours = json['WorkingHours']; projectName = json['ProjectName']; diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index 33a314e3..35d09812 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -70,7 +70,7 @@ class ListGtMyPatientsQuestions { patientID = json['PatientID']; doctorID = json['DoctorID']; requestType = json['RequestType']; - requestDate = DateUtils.convertStringToDate(json['RequestDate']) ; + requestDate = AppDateUtils.convertStringToDate(json['RequestDate']) ; requestTime = json['RequestTime']; remarks = json['Remarks']; status = json['Status']; diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/models/patient/lab_orders/lab_orders_res_model.dart index 893b49ae..7f463933 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -62,7 +62,7 @@ class LabOrdersResModel { status = json['Status']; createdBy = json['CreatedBy']; createdByN = json['CreatedByN']; - createdOn = DateUtils.convertStringToDate(json['CreatedOn']); + createdOn = AppDateUtils.convertStringToDate(json['CreatedOn']); editedBy = json['EditedBy']; editedByN = json['EditedByN']; editedOn = json['EditedOn']; diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/models/patient/my_referral/my_referral_patient_model.dart index ab14a82f..f1506f8e 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/models/patient/my_referral/my_referral_patient_model.dart @@ -142,7 +142,7 @@ class MyReferralPatientModel { referralResponseOn = json['ReferralResponseOn']; priority = json['Priority']; frequency = json['Frequency']; - mAXResponseTime = DateUtils.convertStringToDate(json['MAXResponseTime']); + mAXResponseTime = AppDateUtils.convertStringToDate(json['MAXResponseTime']); age = json['Age']; frequencyDescription = json['FrequencyDescription']; genderDescription = json['GenderDescription']; diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/models/patient/prescription/prescription_report_for_in_patient.dart index 8e643866..21cb13b1 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -125,7 +125,7 @@ class PrescriptionReportForInPatient { orderNo = json['OrderNo']; patientID = json['PatientID']; pharmacyRemarks = json['PharmacyRemarks']; - prescriptionDatetime = DateUtils.convertStringToDate(json['PrescriptionDatetime']); + prescriptionDatetime = AppDateUtils.convertStringToDate(json['PrescriptionDatetime']); prescriptionNo = json['PrescriptionNo']; processedBy = json['ProcessedBy']; projectID = json['ProjectID']; @@ -138,11 +138,11 @@ class PrescriptionReportForInPatient { routeId = json['RouteId']; routeN = json['RouteN']; setupID = json['SetupID']; - startDatetime = DateUtils.convertStringToDate(json['StartDatetime']) ; + startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']) ; status = json['Status']; statusDescription = json['StatusDescription']; statusDescriptionN = json['StatusDescriptionN']; - stopDatetime = DateUtils.convertStringToDate(json['StopDatetime']); + stopDatetime = AppDateUtils.convertStringToDate(json['StopDatetime']); unitofMeasurement = json['UnitofMeasurement']; unitofMeasurementDescription = json['UnitofMeasurementDescription']; unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/models/patient/vital_sign/vital_sign_res_model.dart index 09bb1797..78af108d 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_res_model.dart @@ -170,7 +170,7 @@ class VitalSignResModel { triageCategory = json['TriageCategory']; gCScore = json['GCScore']; lineItemNo = json['LineItemNo']; - vitalSignDate = json['VitalSignDate'] !=null? DateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); + vitalSignDate = json['VitalSignDate'] !=null? AppDateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); actualTimeTaken = json['ActualTimeTaken']; sugarLevel = json['SugarLevel']; fBS = json['FBS']; diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 1c019ca6..14e446e8 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -164,14 +164,14 @@ class DoctorReplayChat extends StatelessWidget { children: [ AppText( - reply.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), + reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w600, color: Colors.white, fontSize: 14, ), AppText( - reply.createdOn !=null?DateUtils.getHour(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getHour(DateTime.now()), + reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), fontSize: 14, fontFamily: 'Poppins', color: Colors.white, diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 3b1467d2..e8e155b0 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -24,9 +24,9 @@ class _PatientArrivalScreen extends State PatientMobileNumber: "0", PatientIdentificationID: "0", PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 39fc7a8c..daddd788 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -959,11 +959,11 @@ class _HomeScreenState extends State { PatientID: 0, From: isInpatient == true ? '0' - : DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + : AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), To: isInpatient == true ? '0' - : DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + : AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 828210e0..dda0925f 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -113,7 +113,7 @@ class _MedicalFileDetailsState extends State { isMedicalFile: true, episode: episode, vistDate: - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( vistDate, ), isArabic: projectViewModel.isArabic)}', ), @@ -620,7 +620,7 @@ class _MedicalFileDetailsState extends State { 'Order Date: ', ), AppText( - DateUtils.getDateFormatted( + AppDateUtils.getDateFormatted( DateTime .parse( model diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index f0ee6445..41a67ac8 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -166,7 +166,7 @@ class _MedicalFilePageState extends State { .timelines[index] .doctorImage, appointmentDate: - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( model.medicalFileList[0].entityList[0] .timelines[index].date, ), diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 0e61702d..011b628e 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -270,7 +270,7 @@ class _DischargedPatientState extends State { style: TextStyle(fontSize: 14)), new TextSpan( text: model.filterData[index].admissionDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), @@ -294,7 +294,7 @@ class _DischargedPatientState extends State { style: TextStyle(fontSize: 14)), new TextSpan( text: model.filterData[index].dischargeDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), @@ -309,7 +309,7 @@ class _DischargedPatientState extends State { fontSize: 14,fontWeight: FontWeight.w300, ), AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 6d1b5370..33692628 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -100,8 +100,8 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - AppText('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), - AppText('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), + AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), + AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), ], ), ), diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index b0ec6105..63923ecc 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -75,8 +75,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -123,7 +123,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { : Colors.red[700], ), AppText( - DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), + AppDateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -145,7 +145,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.admissionDate, "dd MMM,yyyy"), fontFamily: 'Poppins', @@ -170,7 +170,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.dischargeDate, "dd MMM,yyyy"), fontFamily: 'Poppins', @@ -195,7 +195,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.dischargeDate, "dd MMM,yyyy"), fontFamily: 'Poppins', @@ -439,7 +439,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime, "dd MMM,yyyy"), fontFamily: 'Poppins', diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 6da969d1..0705fddd 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -67,8 +67,8 @@ class _ReferralDischargedPatientPageState extends State { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -273,7 +273,7 @@ class _InsuranceApprovalsDetailsState extends State { color: Colors.grey[500], ), AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -614,7 +614,7 @@ class _InsuranceApprovalsDetailsState extends State { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -630,7 +630,7 @@ class _InsuranceApprovalsDetailsState extends State { ), if(model.insuranceApproval[indexInsurance].expiryDate!=null) AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 95cf80f5..92648ffc 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -90,9 +90,9 @@ class _PatientsScreenState extends State { PatientMobileNumber: "0", PatientIdentificationID: "0", PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", @@ -861,30 +861,30 @@ class _PatientsScreenState extends State { filterPatient(item, model) { if (item == 'Tomorrow') { - _patientSearchFormValues.To = DateUtils.convertDateToFormat( + _patientSearchFormValues.To = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1), 'yyyy-MM-dd'); - _patientSearchFormValues.From = DateUtils.convertDateToFormat( + _patientSearchFormValues.From = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1), 'yyyy-MM-dd'); } else if (item == 'Next Week') { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( + _patientSearchFormValues.From = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1), 'yyyy-MM-dd'); - _patientSearchFormValues.To = DateUtils.convertDateToFormat( + _patientSearchFormValues.To = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), 'yyyy-MM-dd'); } else { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( + _patientSearchFormValues.From = AppDateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); - _patientSearchFormValues.To = DateUtils.convertDateToFormat( + _patientSearchFormValues.To = AppDateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index 20a93ff6..bbc968b0 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -96,7 +96,7 @@ class _AdmissionRequestDetailScreenState Helpers.textFieldSelectorDecoration( TranslationBase.of(context).date, selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 05a43460..cb4395d0 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -197,7 +197,7 @@ class _AdmissionRequestSecondScreenState hintText: TranslationBase.of(context) .expectedAdmissionDate, dropDownText: _expectedAdmissionDate != null - ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" : null, enabled: false, isTextFieldHasSuffix: true, diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index 112680e8..697d16d2 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -87,14 +87,14 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResult.forEach((vital) { - var date = DateUtils.convertStringToDate(vital.verifiedOnDateTime); + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); tableRow.add(TableRow(children: [ Container( child: Container( padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic? DateUtils.getWeekDayArabic(date.weekday): DateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtils.getMonthArabic(date.month) : DateUtils.getMonth(date.month)} ${date.year}', + '${projectViewModel.isArabic? AppDateUtils.getWeekDayArabic(date.weekday): AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index d0e61c10..25d10771 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -105,7 +105,7 @@ class LineChartCurvedState extends State { rotateAngle:-65, getTitles: (value) { print(value); - DateTime date = DateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); + DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); if (widget.labResult.length < 8) { if (widget.labResult.length > value.toInt()) { return '${date.day}/ ${date.year}'; diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 443bff8d..78e055ff 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -456,13 +456,13 @@ class _ProgressNoteState extends State { index] .createdOn != null - ? DateUtils.getDayMonthYearDateFormatted( - DateUtils.getDateTimeFromServerFormat( + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.getDateTimeFromServerFormat( model .patientProgressNoteList[ index] .createdOn)) - : DateUtils + : AppDateUtils .getDayMonthYearDateFormatted( DateTime.now()), fontWeight: FontWeight.w600, @@ -474,13 +474,13 @@ class _ProgressNoteState extends State { index] .createdOn != null - ? DateUtils.getHour(DateUtils + ? AppDateUtils.getHour(AppDateUtils .getDateTimeFromServerFormat( model .patientProgressNoteList[ index] .createdOn)) - : DateUtils.getHour( + : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, @@ -530,7 +530,7 @@ class _ProgressNoteState extends State { showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showDialog( context: context, - child: Center( + builder: (ctx) => Center( child: Container( width: MediaQuery .of(context) @@ -606,7 +606,8 @@ class _ProgressNoteState extends State { ), ), ), - )); + ) + ); } diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index a7aab586..ca8be2c0 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -96,11 +96,11 @@ class _InpatientPrescriptionDetailsScreenState key: 'UOM'), buildTableRow( des: - '${DateUtils.getDate(prescription.startDatetime)}', + '${AppDateUtils.getDate(prescription.startDatetime)}', key: 'Start Date'), buildTableRow( des: - '${DateUtils.getDate(prescription.stopDatetime)}', + '${AppDateUtils.getDate(prescription.stopDatetime)}', key: 'Stop Date'), buildTableRow( des: '${prescription.noOfDoses}', @@ -115,7 +115,7 @@ class _InpatientPrescriptionDetailsScreenState key: 'Pharmacy Remarks'), buildTableRow( des: - '${DateUtils.getDate(prescription.prescriptionDatetime)}', + '${AppDateUtils.getDate(prescription.prescriptionDatetime)}', key: 'Prescription Date'), buildTableRow( des: '${prescription.refillID}', diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 71edabb6..2adef799 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -30,10 +30,10 @@ class MyReferralDetailScreen extends StatelessWidget { return BaseView( onModelReady: (model) => model.getPatientDetails( - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(), "yyyy-MM-dd"), - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( DateTime.now().toString(), "yyyy-MM-dd"), pendingReferral.patientID, pendingReferral.sourceAppointmentNo), diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index f3bbf698..fcbd11b7 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -64,8 +64,8 @@ class MyReferralInPatientScreen extends StatelessWidget { referralStatusCode: model.myReferralPatients[index].referralStatus, patientName: model.myReferralPatients[index].patientName, patientGender: model.myReferralPatients[index].gender, - referredDate: DateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), - referredTime: DateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), + referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), + referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), patientID: "${model.myReferralPatients[index].patientID}", isSameBranch: false, isReferral: true, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 2d9ca8dc..6a25b9a1 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -434,7 +434,7 @@ class _PatientMakeReferralScreenState extends State { height: screenSize.height * 0.075, hintText: TranslationBase.of(context).date, dropDownText: appointmentDate != null - ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" + ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" : null, enabled: false, isTextFieldHasSuffix: true, diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index cc2c7136..2a0407aa 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -76,8 +76,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -102,8 +102,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Padding( @@ -153,7 +153,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { : Colors.red[700], ), AppText( - DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), + AppDateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -189,7 +189,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), AppText( - DateUtils.getTimeHHMMA(referredPatient.referralDate,), + AppDateUtils.getTimeHHMMA(referredPatient.referralDate,), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -333,7 +333,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime, "dd MMM,yyyy"), fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index ceb35929..a4027e00 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -75,12 +75,12 @@ class ReferredPatientScreen extends StatelessWidget { "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", patientGender: model.getReferredPatientItem(index).gender, - referredDate: DateUtils.convertDateFromServerFormat( + referredDate: AppDateUtils.convertDateFromServerFormat( model .getReferredPatientItem(index) .referralDate, "dd/MM/yyyy"), - referredTime: DateUtils.convertDateFromServerFormat( + referredTime: AppDateUtils.convertDateFromServerFormat( model .getReferredPatientItem(index) .referralDate, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index 07c4b38e..a5c62248 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -76,9 +76,9 @@ class ReferredPatientDetailScreen extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat( + "from": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat( + "to": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), }); }, @@ -102,9 +102,9 @@ class ReferredPatientDetailScreen extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat( + "from": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat( + "to": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), }); }, @@ -157,7 +157,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { : Colors.red[700], ), AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.referralDate, "dd MMM,yyyy"), fontFamily: 'Poppins', @@ -194,7 +194,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.referralDate, "hh:mm a"), fontFamily: 'Poppins', @@ -337,7 +337,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime, "dd MMM,yyyy"), fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index bea229bb..bdf55541 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -389,12 +389,12 @@ class _UpdateAssessmentPageState extends State { children: [ AppText( assessment.createdOn != null - ? DateUtils + ? AppDateUtils .getDayMonthYearDateFormatted( DateTime.parse( assessment .createdOn)) - : DateUtils + : AppDateUtils .getDayMonthYearDateFormatted( DateTime.now()), fontWeight: FontWeight @@ -402,11 +402,11 @@ class _UpdateAssessmentPageState extends State { fontSize: 14, ), AppText( assessment.createdOn != null - ? DateUtils.getHour( + ? AppDateUtils.getHour( DateTime.parse( assessment .createdOn)) - : DateUtils.getHour( + : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight .w600, diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 55b86022..5b26dfe3 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -169,7 +169,7 @@ class _UpdatePlanPageState extends State { ], ), AppText( - widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), + widget.patientProgressNote.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w600, fontSize: 14, @@ -192,7 +192,7 @@ class _UpdatePlanPageState extends State { ], ), AppText( - widget.patientProgressNote.createdOn !=null?DateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getHour(DateTime.now()), + widget.patientProgressNote.createdOn !=null?AppDateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, ) diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart index ef6bc48f..ffd8422d 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart @@ -251,7 +251,7 @@ class VitalSignDetailPainScale extends StatelessWidget { padding: EdgeInsets.all(8), child: Center( child: AppText( - "${DateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", + "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.6, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index a6170f6f..1e593af7 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -154,7 +154,7 @@ class _VitalSignDetailsWidgetState extends State { widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey1]; DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(vital.createdOn); + AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( @@ -162,7 +162,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(10), color: Colors.white, child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${DateUtils.getHour(elementDate)}', + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(elementDate.weekday) : AppDateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(elementDate.month) : AppDateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${AppDateUtils.getHour(elementDate)}', // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index f058ac3e..cec53580 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -111,7 +111,7 @@ class _VitalSignDetailsWidgetState extends State { widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey]; DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(vital.createdOn); + AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( @@ -119,7 +119,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${DateUtils.getHour(elementDate)}', + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(elementDate.weekday) : AppDateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(elementDate.month) : AppDateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${AppDateUtils.getHour(elementDate)}', // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index f59f6c23..17b9ebed 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -101,7 +101,7 @@ class VitalSingChartAndDetials extends StatelessWidget { vitalList.reversed.toList().forEach( (element) { DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(element.createdOn); + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey] != null && element.toJson()[viewKey]?.toInt() != 0) timeSeriesData.add( diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index ba27a793..ed1f444e 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -115,7 +115,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { vitalList.reversed.toList().forEach( (element) { DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(element.createdOn); + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey1]?.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 2352ae32..1cb6b3f0 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -984,7 +984,7 @@ class _PrescriptionFormWidgetState extends State { context) .date, selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index af0f66e5..5c1f4fed 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -321,7 +321,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, @@ -337,7 +337,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 06d9634c..8051beae 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -34,7 +34,7 @@ class PrescriptionItemsPage extends StatelessWidget { clinic: prescriptions.clinicDescription, branch: prescriptions.name, isPrescriptions: true, - appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), + appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), doctorName: prescriptions.doctorName, profileUrl: prescriptions.doctorImageURL, ), @@ -75,7 +75,7 @@ class PrescriptionItemsPage extends StatelessWidget { onTap: (){ showDialog( context: context, - child: ShowImageDialog( + builder: (ctx) => ShowImageDialog( imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, ) ); @@ -164,7 +164,7 @@ class PrescriptionItemsPage extends StatelessWidget { onTap: (){ showDialog( context: context, - child: ShowImageDialog( + builder: (ctx) => ShowImageDialog( imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, ) ); diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 3b207d5a..6608f108 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -226,7 +226,7 @@ class _NewPrescriptionScreenState extends State { 13.5, ), AppText( - DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != + AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != null ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) .month) @@ -249,7 +249,7 @@ class _NewPrescriptionScreenState extends State { .green, ), AppText( - DateUtils.getTimeFormated(DateTime.parse(model + AppDateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] .entityList[ @@ -289,7 +289,7 @@ class _NewPrescriptionScreenState extends State { Expanded( child: AppText( - DateUtils.getDateFormatted(DateTime.parse(model + AppDateUtils.getDateFormatted(DateTime.parse(model .prescriptionList[0] .entityList[index] .startDate)), diff --git a/lib/screens/prescription/prescription_screen_history.dart b/lib/screens/prescription/prescription_screen_history.dart index cf038ff6..5ce98c54 100644 --- a/lib/screens/prescription/prescription_screen_history.dart +++ b/lib/screens/prescription/prescription_screen_history.dart @@ -125,7 +125,7 @@ class _NewPrescriptionHistoryScreenState 13.5, ), AppText( - DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != + AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != null ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) .month) @@ -148,7 +148,7 @@ class _NewPrescriptionHistoryScreenState .green, ), AppText( - DateUtils.getTimeFormated(DateTime.parse(model + AppDateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] .entityList[ @@ -187,7 +187,7 @@ class _NewPrescriptionHistoryScreenState Expanded( child: AppText( - DateUtils.getDateFormatted(DateTime.parse(model + AppDateUtils.getDateFormatted(DateTime.parse(model .prescriptionList[0] .entityList[index] .startDate)), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 19ce09e4..330aa827 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -121,7 +121,7 @@ class PrescriptionsPage extends StatelessWidget { .clinicDescription, isPrescriptions: true, appointmentDate: - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( model.prescriptionsList[index] .appointmentDate, ), @@ -168,12 +168,12 @@ class PrescriptionsPage extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - startOn: DateUtils + startOn: AppDateUtils .getDateTimeFromServerFormat( model.inPatientPrescription[index] .startDatetime, ), - stopOn: DateUtils + stopOn: AppDateUtils .getDateTimeFromServerFormat( model.inPatientPrescription[index] .stopDatetime, @@ -189,7 +189,7 @@ class PrescriptionsPage extends StatelessWidget { clinic: 'basheer', isPrescriptions: true, appointmentDate: - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( model.inPatientPrescription[index] .prescriptionDatetime, ), diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 378909ad..d6048da2 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -664,11 +664,11 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: Helpers .textFieldSelectorDecoration( - DateUtils.getDateFormatted( + AppDateUtils.getDateFormatted( DateTime.parse( widget.startDate)), selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 5b882c94..f18422ee 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -99,13 +99,13 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate))}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index c7c52745..2e0a284f 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -90,7 +90,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { padding: EdgeInsets.only(top: 10), child: AppText( - DateUtils + AppDateUtils .convertStringToDateFormat( item.createdOn, 'yyyy-MM-dd HH:mm'), @@ -124,7 +124,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { AppText(TranslationBase.of(context) .startDate), AppText( - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( item.dateTimeFrom, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, @@ -145,7 +145,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { AppText(TranslationBase.of(context) .endDate), AppText( - DateUtils + AppDateUtils .convertStringToDateFormat( item.dateTimeTo, 'yyyy-MM-dd HH:mm'), diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 7820b16c..45d79aed 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -184,7 +184,7 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils + AppDateUtils .convertStringToDateFormat( item.startDate, 'dd-MMM-yyyy'), diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 31f186f1..3fbb3287 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -117,7 +117,7 @@ class ShowSickLeaveScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils + AppDateUtils .convertStringToDateFormat( item.startDate, 'dd-MMM-yyyy'), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index d380ee93..82a6158d 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:intl/intl.dart'; -class DateUtils { +class AppDateUtils { static String convertDateToFormat(DateTime dateTime, String dateFormat) { return DateFormat(dateFormat).format(dateTime); } @@ -298,7 +298,7 @@ class DateUtils { static String getAgeByBirthday(dynamic birthday, BuildContext context) { // https://leechy.dev/calculate-dates-diff-in-dart - DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); + DateTime birthDate = AppDateUtils.getDateTimeFromServerFormat(birthday); final now = DateTime.now(); int years = now.year - birthDate.year; int months = now.month - birthDate.month; diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 48d93f54..72c564dc 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -183,13 +183,13 @@ class _VerificationMethodsState extends State { child: ListTile( title: AppText( user.editedOn != null - ? getDate(DateUtils + ? getDate(AppDateUtils .convertStringToDate( user .editedOn)) : user.createdOn != null - ? getDate(DateUtils + ? getDate(AppDateUtils .convertStringToDate( user.createdOn)) : '--', @@ -201,13 +201,13 @@ class _VerificationMethodsState extends State { ), subtitle: AppText( user.editedOn != null - ? getTime(DateUtils + ? getTime(AppDateUtils .convertStringToDate( user .editedOn)) : user.createdOn != null - ? getTime(DateUtils + ? getTime(AppDateUtils .convertStringToDate( user.createdOn)) : '--', diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 55173809..7817ba3c 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -66,19 +66,19 @@ class _DoctorReplyWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .day .toString() + " " + - DateUtils.getMonth( - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getMonth( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .month) .toString() .substring(0, 3) + ' ' + - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .year .toString(), @@ -86,12 +86,12 @@ class _DoctorReplyWidgetState extends State { fontWeight: FontWeight.w600, ), AppText( - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .hour .toString() + ":"+ - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .minute .toString(), @@ -216,7 +216,7 @@ class _DoctorReplyWidgetState extends State { style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index e4112cf2..54df8cd9 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -33,13 +33,13 @@ class MyScheduleWidget extends StatelessWidget { height: 10, ), AppText( - projectViewModel.isArabic?DateUtils.getWeekDayArabic(workingHoursTable.date.weekday): DateUtils.getWeekDay(workingHoursTable.date.weekday) , + projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable.date.weekday): AppDateUtils.getWeekDay(workingHoursTable.date.weekday) , fontSize: 16, fontFamily: 'Poppins', // fontSize: 18 ), AppText( - ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', fontSize: 14, fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -51,7 +51,7 @@ class MyScheduleWidget extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.55, child: CardWithBgWidget( - bgColor: DateUtils.isToday(workingHoursTable.date) + bgColor: AppDateUtils.isToday(workingHoursTable.date) ? Colors.green[500] : Colors.transparent, // hasBorder: false, @@ -59,7 +59,7 @@ class MyScheduleWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (DateUtils.isToday(workingHoursTable.date)) + if (AppDateUtils.isToday(workingHoursTable.date)) AppText( "Today", fontSize: 1.8 * SizeConfig.textMultiplier, diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 5dcedc7e..a3362f3a 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -87,7 +87,7 @@ class PatientCard extends StatelessWidget { ) : patientInfo.arrivedOn != null ? AppText( - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( patientInfo.arrivedOn, 'MM-dd-yyyy HH:mm'), fontFamily: 'Poppins', @@ -231,7 +231,7 @@ class PatientCard extends StatelessWidget { style: TextStyle(fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), @@ -260,7 +260,7 @@ class PatientCard extends StatelessWidget { new TextSpan( text: patientInfo.admissionDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), @@ -273,7 +273,7 @@ class PatientCard extends StatelessWidget { fontSize: 15, ), AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index a9db021f..84b1b292 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -117,10 +117,10 @@ class PatientProfileButton extends StatelessWidget { return; if (from == null) { - from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } if (to == null) { - to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } if(arrivalType == null){ arrivalType = "0"; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 48454af4..c3c9adf9 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -139,7 +139,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ) : AppText( patient.arrivedOn != null - ? DateUtils.convertStringToDateFormat( + ? AppDateUtils.convertStringToDateFormat( patient.arrivedOn, 'MM-dd-yyyy HH:mm') : '', @@ -258,7 +258,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget style: TextStyle(fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 27984614..04e2ad42 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -139,7 +139,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { fontWeight: FontWeight.w600, ) : AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate(patient.arrivedOn)), + AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.arrivedOn)), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) @@ -258,7 +258,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { style: TextStyle(fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart index 272fc238..3beddd1a 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart @@ -124,7 +124,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { Row( children: [ AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( patient.admissionDate, "hh:mm a"), fontWeight: FontWeight.bold, fontSize: 1.4 * SizeConfig.textMultiplier, @@ -143,7 +143,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { fontSize: 1.2 * SizeConfig.textMultiplier, ), AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( patient.admissionDate, "dd MMM,yyyy"), fontSize: 1.4 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700), @@ -184,7 +184,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { fontSize: 1.2 * SizeConfig.textMultiplier, ), AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 1.4 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700), ], diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart index acbb5f05..f3e01316 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -174,7 +174,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { FontWeight.w600, ) : AppText( - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( patient .arrivedOn, 'MM-dd-yyyy HH:mm'), @@ -334,7 +334,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ??"": patient.dateofBirth??"", context)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ??"": patient.dateofBirth??"", context)}", style: TextStyle( fontWeight: FontWeight.w700, @@ -446,7 +446,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), ) ], diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 0adfac4d..2e47b211 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -164,7 +164,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget fontWeight: FontWeight.w600, ) : AppText( - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( patient.arrivedOn, 'MM-dd-yyyy HH:mm'), fontFamily: 'Poppins', @@ -284,7 +284,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget style: TextStyle(fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], @@ -408,7 +408,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), ), AppText( - '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', fontSize: 14, ) ], diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index 8635f597..b8314b03 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -90,7 +90,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 1c889d9d..af7d084c 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -67,14 +67,14 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), if (!isPrescriptions&& isShowTime) AppText( - '${DateUtils.getHour(appointmentDate)}', + '${AppDateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, diff --git a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart index 9b45bba1..bf383fff 100644 --- a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart +++ b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart @@ -5,7 +5,7 @@ import 'gif_loader_container.dart'; class GifLoaderDialogUtils { static showMyDialog(BuildContext context) { - showDialog(context: context, child: GifLoaderContainer()); + showDialog(context: context, builder: (ctx) => GifLoaderContainer()); } static hideDialog(BuildContext context) { diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart index 47ced262..9197a4a1 100644 --- a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart +++ b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart @@ -63,14 +63,14 @@ class InPatientDoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), if (!isPrescriptions) AppText( - '${DateUtils.getHour(appointmentDate)}', + '${AppDateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, diff --git a/pubspec.lock b/pubspec.lock index 9d52ce65..dee0b11c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.5.0" autocomplete_textfield: dependency: "direct main" description: @@ -63,7 +63,7 @@ packages: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" build: dependency: transitive description: @@ -140,14 +140,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" charts_common: dependency: transitive description: @@ -196,7 +196,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" code_builder: dependency: transitive description: @@ -210,7 +210,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" connectivity: dependency: "direct main" description: @@ -336,7 +336,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" ffi: dependency: transitive description: @@ -552,7 +552,7 @@ packages: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.16.1" + version: "0.17.0-nullsafety.2" io: dependency: transitive description: @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3" json_annotation: dependency: transitive description: @@ -601,14 +601,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" mime: dependency: transitive description: @@ -657,7 +657,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" path_drawing: dependency: transitive description: @@ -886,7 +886,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.0" speech_to_text: dependency: "direct main" description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" sticky_headers: dependency: "direct main" description: @@ -914,7 +914,7 @@ packages: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" stream_transform: dependency: transitive description: @@ -928,21 +928,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.2.19" timing: dependency: transitive description: @@ -963,7 +963,7 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" url_launcher: dependency: "direct main" description: @@ -1012,7 +1012,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" video_player: dependency: transitive description: @@ -1091,5 +1091,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" - flutter: ">=1.22.0 <2.0.0" + dart: ">=2.12.0-0.0 <3.0.0" + flutter: ">=1.22.0" diff --git a/pubspec.yaml b/pubspec.yaml index 347b7a62..214e6d46 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,6 +16,11 @@ version: 1.0.0+1 environment: sdk: ">=2.8.0 <3.0.0" + +dependency_overrides: + intl: 0.17.0-nullsafety.2 + + dependencies: flutter: sdk: flutter From 4eba6d9f5a0b606c2046f70949a282de3afa82f6 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 3 May 2021 17:12:49 +0300 Subject: [PATCH 02/31] Project refactoring --- .../post_prescrition_req_model.dart | 0 .../prescription_model.dart | 0 .../prescription_req_model.dart | 0 lib/core/model/{ => auth}/imei_details.dart | 0 .../model/{ => auth}/insert_imei_model.dart | 0 .../{ => insurance}/insurance_approval.dart | 0 .../insurance_approval_in_patient_model.dart | 0 .../medical_file_model.dart | 0 .../medical_file_request_model.dart | 0 .../PatientMuseResultsModel.dart | 0 .../PatientSearchRequestModel.dart | 0 .../DischargeReferralPatient.dart | 0 .../MyReferralPatientModel.dart | 0 .../model/{ => referral}/ReferralRequest.dart | 0 .../get_medication_response_model.dart | 0 .../item_by_medicine_model.dart | 0 .../item_by_medicine_request_model.dart | 0 .../{ => search_drug}/search_drug_model.dart | 0 .../search_drug_request_model.dart | 0 .../sick_leave_patient_model.dart | 0 .../sick_leave_patient_request_model.dart | 0 lib/core/service/PatientMuseService.dart | 29 -- lib/core/service/{ => home}/auth_service.dart | 2 +- .../service/{ => home}/dasboard_service.dart | 0 .../{ => home}/doctor_reply_service.dart | 0 .../service/{ => home}/schedule_service.dart | 0 .../DischargedPatientService.dart | 24 +- .../MyReferralPatientService.dart | 18 +- .../service/patient/PatientMuseService.dart | 25 ++ .../{ => patient}/ReferralService.dart | 3 +- .../service/patient/out_patient_service.dart | 10 +- .../patient-doctor-referral-service.dart | 54 ++-- .../patientInPatientService.dart | 4 +- .../{ => patient}/patient_service.dart | 0 .../referral_patient_service.dart | 0 .../referred_patient_service.dart | 0 .../patient-admission-request-service.dart | 0 .../insurance}/InsuranceCardService.dart | 4 +- .../lab_order}/labs_service.dart | 22 +- .../medical_report}/medical_file_service.dart | 4 +- .../prescription}/medicine_service.dart | 0 .../prescription}/prescription_service.dart | 14 +- .../prescription}/prescriptions_service.dart | 2 +- .../procedure}/procedure_service.dart | 0 .../radiology/radiology_service.dart | 57 ++++ .../sick_leave}/sickleave_service.dart | 11 +- .../soap}/SOAP_service.dart | 224 +++++++------- .../ucaf}/patient-ucaf-service.dart | 102 +++--- .../patient-vital-signs-service.dart | 0 lib/core/service/radiology_service.dart | 59 ---- .../viewModel/DischargedPatientViewModel.dart | 9 +- lib/core/viewModel/InsuranceViewModel.dart | 6 +- lib/core/viewModel/PatientMuseViewModel.dart | 8 +- .../viewModel/PatientSearchViewModel.dart | 90 +++--- lib/core/viewModel/SOAP_view_model.dart | 95 +++--- lib/core/viewModel/auth_view_model.dart | 4 +- lib/core/viewModel/dashboard_view_model.dart | 2 +- .../viewModel/doctor_replay_view_model.dart | 8 +- lib/core/viewModel/imei_view_model.dart | 4 +- lib/core/viewModel/labs_view_model.dart | 10 +- .../viewModel/medical_file_view_model.dart | 4 +- lib/core/viewModel/medicine_view_model.dart | 6 +- .../patient-admission-request-viewmodel.dart | 37 ++- .../viewModel/patient-referral-viewmodel.dart | 24 +- .../viewModel/patient-ucaf-viewmodel.dart | 6 +- .../patient-vital-sign-viewmodel.dart | 8 +- lib/core/viewModel/patient_view_model.dart | 15 +- .../viewModel/prescription_view_model.dart | 10 +- .../viewModel/prescriptions_view_model.dart | 39 +-- lib/core/viewModel/procedure_View_model.dart | 28 +- lib/core/viewModel/radiology_view_model.dart | 8 +- lib/core/viewModel/referral_view_model.dart | 11 +- lib/core/viewModel/referred_view_model.dart | 9 +- lib/core/viewModel/schedule_view_model.dart | 5 +- lib/core/viewModel/sick_leave_view_model.dart | 2 +- lib/locator.dart | 52 ++-- lib/screens/auth/login_screen.dart | 2 +- lib/screens/home/home_screen.dart | 2 +- .../medicine/medicine_search_screen.dart | 2 +- .../patients/PatientsInPatientScreen.dart | 109 ++++--- .../ReferralDischargedPatientDetails.dart | 141 ++++----- .../out_patient/filter_date_page.dart | 140 +++------ .../out_patient/out_patient_screen.dart | 292 +++++++++--------- .../patient_search_screen_new.dart | 44 ++- .../patient_search/patients_screen_new.dart | 248 ++++++++------- .../patients/patient_search/time_bar.dart | 40 ++- .../profile/UCAF/UCAF-detail-screen.dart | 2 +- .../referral/AddReplayOnReferralPatient.dart | 25 +- .../referral_patient_detail_in-paint.dart | 41 ++- .../subjective/medication/add_medication.dart | 2 +- .../prescription/add_prescription_form.dart | 4 +- .../update_prescription_form.dart | 6 +- lib/screens/sick-leave/add-sickleave.dart | 15 +- lib/widgets/auth/verification_methods.dart | 2 +- lib/widgets/otp/sms-popup.dart | 2 +- 95 files changed, 1145 insertions(+), 1142 deletions(-) rename lib/core/model/{ => Prescriptions}/post_prescrition_req_model.dart (100%) rename lib/core/model/{ => Prescriptions}/prescription_model.dart (100%) rename lib/core/model/{ => Prescriptions}/prescription_req_model.dart (100%) rename lib/core/model/{ => auth}/imei_details.dart (100%) rename lib/core/model/{ => auth}/insert_imei_model.dart (100%) rename lib/core/model/{ => insurance}/insurance_approval.dart (100%) rename lib/core/model/{ => insurance}/insurance_approval_in_patient_model.dart (100%) rename lib/core/model/{ => medical_report}/medical_file_model.dart (100%) rename lib/core/model/{ => medical_report}/medical_file_request_model.dart (100%) rename lib/core/model/{ => patient_muse}/PatientMuseResultsModel.dart (100%) rename lib/core/model/{ => patient_muse}/PatientSearchRequestModel.dart (100%) rename lib/core/model/{ => referral}/DischargeReferralPatient.dart (100%) rename lib/core/model/{ => referral}/MyReferralPatientModel.dart (100%) rename lib/core/model/{ => referral}/ReferralRequest.dart (100%) rename lib/core/model/{ => search_drug}/get_medication_response_model.dart (100%) rename lib/core/model/{ => search_drug}/item_by_medicine_model.dart (100%) rename lib/core/model/{ => search_drug}/item_by_medicine_request_model.dart (100%) rename lib/core/model/{ => search_drug}/search_drug_model.dart (100%) rename lib/core/model/{ => search_drug}/search_drug_request_model.dart (100%) rename lib/core/model/{ => sick_leave}/sick_leave_patient_model.dart (100%) rename lib/core/model/{ => sick_leave}/sick_leave_patient_request_model.dart (100%) delete mode 100644 lib/core/service/PatientMuseService.dart rename lib/core/service/{ => home}/auth_service.dart (94%) rename lib/core/service/{ => home}/dasboard_service.dart (100%) rename lib/core/service/{ => home}/doctor_reply_service.dart (100%) rename lib/core/service/{ => home}/schedule_service.dart (100%) rename lib/core/service/{ => patient}/DischargedPatientService.dart (81%) rename lib/core/service/{ => patient}/MyReferralPatientService.dart (81%) create mode 100644 lib/core/service/patient/PatientMuseService.dart rename lib/core/service/{ => patient}/ReferralService.dart (93%) rename lib/core/service/{ => patient}/patient-doctor-referral-service.dart (89%) rename lib/core/service/{ => patient}/patientInPatientService.dart (87%) rename lib/core/service/{ => patient}/patient_service.dart (100%) rename lib/core/service/{ => patient}/referral_patient_service.dart (100%) rename lib/core/service/{ => patient}/referred_patient_service.dart (100%) rename lib/core/service/{ => patient_medical_file/admission_request}/patient-admission-request-service.dart (100%) rename lib/core/service/{ => patient_medical_file/insurance}/InsuranceCardService.dart (91%) rename lib/core/service/{ => patient_medical_file/lab_order}/labs_service.dart (94%) rename lib/core/service/{ => patient_medical_file/medical_report}/medical_file_service.dart (87%) rename lib/core/service/{ => patient_medical_file/prescription}/medicine_service.dart (100%) rename lib/core/service/{ => patient_medical_file/prescription}/prescription_service.dart (91%) rename lib/core/service/{ => patient_medical_file/prescription}/prescriptions_service.dart (99%) rename lib/core/service/{ => patient_medical_file/procedure}/procedure_service.dart (100%) create mode 100644 lib/core/service/patient_medical_file/radiology/radiology_service.dart rename lib/core/service/{ => patient_medical_file/sick_leave}/sickleave_service.dart (95%) rename lib/core/service/{ => patient_medical_file/soap}/SOAP_service.dart (61%) rename lib/core/service/{ => patient_medical_file/ucaf}/patient-ucaf-service.dart (67%) rename lib/core/service/{ => patient_medical_file/vital_sign}/patient-vital-signs-service.dart (100%) delete mode 100644 lib/core/service/radiology_service.dart diff --git a/lib/core/model/post_prescrition_req_model.dart b/lib/core/model/Prescriptions/post_prescrition_req_model.dart similarity index 100% rename from lib/core/model/post_prescrition_req_model.dart rename to lib/core/model/Prescriptions/post_prescrition_req_model.dart diff --git a/lib/core/model/prescription_model.dart b/lib/core/model/Prescriptions/prescription_model.dart similarity index 100% rename from lib/core/model/prescription_model.dart rename to lib/core/model/Prescriptions/prescription_model.dart diff --git a/lib/core/model/prescription_req_model.dart b/lib/core/model/Prescriptions/prescription_req_model.dart similarity index 100% rename from lib/core/model/prescription_req_model.dart rename to lib/core/model/Prescriptions/prescription_req_model.dart diff --git a/lib/core/model/imei_details.dart b/lib/core/model/auth/imei_details.dart similarity index 100% rename from lib/core/model/imei_details.dart rename to lib/core/model/auth/imei_details.dart diff --git a/lib/core/model/insert_imei_model.dart b/lib/core/model/auth/insert_imei_model.dart similarity index 100% rename from lib/core/model/insert_imei_model.dart rename to lib/core/model/auth/insert_imei_model.dart diff --git a/lib/core/model/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart similarity index 100% rename from lib/core/model/insurance_approval.dart rename to lib/core/model/insurance/insurance_approval.dart diff --git a/lib/core/model/insurance_approval_in_patient_model.dart b/lib/core/model/insurance/insurance_approval_in_patient_model.dart similarity index 100% rename from lib/core/model/insurance_approval_in_patient_model.dart rename to lib/core/model/insurance/insurance_approval_in_patient_model.dart diff --git a/lib/core/model/medical_file_model.dart b/lib/core/model/medical_report/medical_file_model.dart similarity index 100% rename from lib/core/model/medical_file_model.dart rename to lib/core/model/medical_report/medical_file_model.dart diff --git a/lib/core/model/medical_file_request_model.dart b/lib/core/model/medical_report/medical_file_request_model.dart similarity index 100% rename from lib/core/model/medical_file_request_model.dart rename to lib/core/model/medical_report/medical_file_request_model.dart diff --git a/lib/core/model/PatientMuseResultsModel.dart b/lib/core/model/patient_muse/PatientMuseResultsModel.dart similarity index 100% rename from lib/core/model/PatientMuseResultsModel.dart rename to lib/core/model/patient_muse/PatientMuseResultsModel.dart diff --git a/lib/core/model/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart similarity index 100% rename from lib/core/model/PatientSearchRequestModel.dart rename to lib/core/model/patient_muse/PatientSearchRequestModel.dart diff --git a/lib/core/model/DischargeReferralPatient.dart b/lib/core/model/referral/DischargeReferralPatient.dart similarity index 100% rename from lib/core/model/DischargeReferralPatient.dart rename to lib/core/model/referral/DischargeReferralPatient.dart diff --git a/lib/core/model/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart similarity index 100% rename from lib/core/model/MyReferralPatientModel.dart rename to lib/core/model/referral/MyReferralPatientModel.dart diff --git a/lib/core/model/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart similarity index 100% rename from lib/core/model/ReferralRequest.dart rename to lib/core/model/referral/ReferralRequest.dart diff --git a/lib/core/model/get_medication_response_model.dart b/lib/core/model/search_drug/get_medication_response_model.dart similarity index 100% rename from lib/core/model/get_medication_response_model.dart rename to lib/core/model/search_drug/get_medication_response_model.dart diff --git a/lib/core/model/item_by_medicine_model.dart b/lib/core/model/search_drug/item_by_medicine_model.dart similarity index 100% rename from lib/core/model/item_by_medicine_model.dart rename to lib/core/model/search_drug/item_by_medicine_model.dart diff --git a/lib/core/model/item_by_medicine_request_model.dart b/lib/core/model/search_drug/item_by_medicine_request_model.dart similarity index 100% rename from lib/core/model/item_by_medicine_request_model.dart rename to lib/core/model/search_drug/item_by_medicine_request_model.dart diff --git a/lib/core/model/search_drug_model.dart b/lib/core/model/search_drug/search_drug_model.dart similarity index 100% rename from lib/core/model/search_drug_model.dart rename to lib/core/model/search_drug/search_drug_model.dart diff --git a/lib/core/model/search_drug_request_model.dart b/lib/core/model/search_drug/search_drug_request_model.dart similarity index 100% rename from lib/core/model/search_drug_request_model.dart rename to lib/core/model/search_drug/search_drug_request_model.dart diff --git a/lib/core/model/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart similarity index 100% rename from lib/core/model/sick_leave_patient_model.dart rename to lib/core/model/sick_leave/sick_leave_patient_model.dart diff --git a/lib/core/model/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart similarity index 100% rename from lib/core/model/sick_leave_patient_request_model.dart rename to lib/core/model/sick_leave/sick_leave_patient_request_model.dart diff --git a/lib/core/service/PatientMuseService.dart b/lib/core/service/PatientMuseService.dart deleted file mode 100644 index 35e5fe7b..00000000 --- a/lib/core/service/PatientMuseService.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart'; -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; - -class PatientMuseService extends BaseService { - List patientMuseResultsModelList = List(); - - getECGPatient({int patientType, int patientOutSA,int patientID}) async { - Map body = Map(); - body['PatientType'] = patientType==7 ? 1: patientType; - body['PatientOutSA'] = patientOutSA; - body['PatientID'] = patientID; - hasError = false; - await baseAppClient.post( - GET_ECG, - onSuccess: (dynamic response, int statusCode) { - patientMuseResultsModelList.clear(); - response['HIS_GetPatientMuseResultsList'].forEach((v) { - patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: body - ); - } -} diff --git a/lib/core/service/auth_service.dart b/lib/core/service/home/auth_service.dart similarity index 94% rename from lib/core/service/auth_service.dart rename to lib/core/service/home/auth_service.dart index adb2d646..1aa9a88e 100644 --- a/lib/core/service/auth_service.dart +++ b/lib/core/service/home/auth_service.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/imei_details.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/imei_details.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart'; diff --git a/lib/core/service/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart similarity index 100% rename from lib/core/service/dasboard_service.dart rename to lib/core/service/home/dasboard_service.dart diff --git a/lib/core/service/doctor_reply_service.dart b/lib/core/service/home/doctor_reply_service.dart similarity index 100% rename from lib/core/service/doctor_reply_service.dart rename to lib/core/service/home/doctor_reply_service.dart diff --git a/lib/core/service/schedule_service.dart b/lib/core/service/home/schedule_service.dart similarity index 100% rename from lib/core/service/schedule_service.dart rename to lib/core/service/home/schedule_service.dart diff --git a/lib/core/service/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart similarity index 81% rename from lib/core/service/DischargedPatientService.dart rename to lib/core/service/patient/DischargedPatientService.dart index 2d43afc6..ca595045 100644 --- a/lib/core/service/DischargedPatientService.dart +++ b/lib/core/service/patient/DischargedPatientService.dart @@ -1,14 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/DischargeReferralPatient.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class DischargedPatientService extends BaseService { List myDischargedPatients = List(); - + List myDischargeReferralPatients = List(); - Future getDischargedPatient() async { + Future getDischargedPatient() async { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); @@ -63,14 +63,14 @@ class DischargedPatientService extends BaseService { myDischargeReferralPatients.clear(); await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { - if (response['List_MyDischargeReferralPatient'] != null) { - response['List_MyDischargeReferralPatient'].forEach((v) { - myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v)); - }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + if (response['List_MyDischargeReferralPatient'] != null) { + response['List_MyDischargeReferralPatient'].forEach((v) { + myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } } diff --git a/lib/core/service/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart similarity index 81% rename from lib/core/service/MyReferralPatientService.dart rename to lib/core/service/patient/MyReferralPatientService.dart index f58cea48..ffa982b0 100644 --- a/lib/core/service/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; @@ -42,23 +42,25 @@ class MyReferralInPatientService extends BaseService { ); } - Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { + Future replay( + String referredDoctorRemarks, MyReferralPatientModel referral) async { hasError = false; await getDoctorProfile(); - RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = + RequestAddReferredDoctorRemarks(); _requestAddReferredDoctorRemarks.projectID = referral.projectID; - _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); + _requestAddReferredDoctorRemarks.admissionNo = + referral.admissionNo.toString(); _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = + referredDoctorRemarks; _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; _requestAddReferredDoctorRemarks.patientID = referral.patientID; _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; await baseAppClient.post( ADD_REFERRED_DOCTOR_REMARKS, body: _requestAddReferredDoctorRemarks.toJson(), - onSuccess: (dynamic body, int statusCode) { - - }, + onSuccess: (dynamic body, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient/PatientMuseService.dart b/lib/core/service/patient/PatientMuseService.dart new file mode 100644 index 00000000..8c821104 --- /dev/null +++ b/lib/core/service/patient/PatientMuseService.dart @@ -0,0 +1,25 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientMuseResultsModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class PatientMuseService extends BaseService { + List patientMuseResultsModelList = List(); + + getECGPatient({int patientType, int patientOutSA, int patientID}) async { + Map body = Map(); + body['PatientType'] = patientType == 7 ? 1 : patientType; + body['PatientOutSA'] = patientOutSA; + body['PatientID'] = patientID; + hasError = false; + await baseAppClient.post(GET_ECG, + onSuccess: (dynamic response, int statusCode) { + patientMuseResultsModelList.clear(); + response['HIS_GetPatientMuseResultsList'].forEach((v) { + patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/ReferralService.dart b/lib/core/service/patient/ReferralService.dart similarity index 93% rename from lib/core/service/ReferralService.dart rename to lib/core/service/patient/ReferralService.dart index 2887abde..64f473d9 100644 --- a/lib/core/service/ReferralService.dart +++ b/lib/core/service/patient/ReferralService.dart @@ -1,9 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/ReferralRequest.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/ReferralRequest.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ReferralService extends BaseService { - Future referralPatient( {int admissionNo, String roomID, diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart index 606bfc5d..339f6a93 100644 --- a/lib/core/service/patient/out_patient_service.dart +++ b/lib/core/service/patient/out_patient_service.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -7,8 +7,8 @@ class OutPatientService extends BaseService { List _patientList = []; List get patientList => _patientList; - - Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { + Future getOutPatient( + PatientSearchRequestModel patientSearchRequestModel) async { hasError = false; await baseAppClient.post( GET_MY_OUT_PATIENT, @@ -25,7 +25,9 @@ class OutPatientService extends BaseService { body: patientSearchRequestModel.toJson(), ); } - Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { + + Future getPatientFileInformation( + PatientSearchRequestModel patientSearchRequestModel) async { hasError = false; await baseAppClient.post( PRM_SEARCH_PATIENT, diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart similarity index 89% rename from lib/core/service/patient-doctor-referral-service.dart rename to lib/core/service/patient/patient-doctor-referral-service.dart index 680adada..c83c74c9 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patien import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; -import 'base/lookup-service.dart'; +import '../base/lookup-service.dart'; class PatientReferralService extends LookupService { List projectsList = []; @@ -56,7 +56,8 @@ class PatientReferralService extends LookupService { Map body = Map(); body['isSameBranch'] = false; - await baseAppClient.post(GET_REFERRAL_FACILITIES, onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_REFERRAL_FACILITIES, + onSuccess: (response, statusCode) async { projectsList = response['ProjectInfo']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -102,7 +103,8 @@ class PatientReferralService extends LookupService { ); } - Future getDoctorsList(PatiantInformtion patient ,int clinicId, int branchId) async { + Future getDoctorsList( + PatiantInformtion patient, int clinicId, int branchId) async { hasError = false; DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); @@ -112,22 +114,16 @@ class PatientReferralService extends LookupService { _doctorsByClinicIdRequest.patientID = patient.patientId; _doctorsByClinicIdRequest.gender = patient.gender; - - await baseAppClient.postPatient( - PATIENT_GET_DOCTOR_BY_CLINIC_Hospital, - onSuccess: (dynamic response, int statusCode) { - doctorsList.clear(); - response['DoctorList'].forEach((v) { - doctorsList.add(ClinicDoctor.fromJson(v)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: _doctorsByClinicIdRequest.toJson(), - patient: patient - ); + await baseAppClient.postPatient(PATIENT_GET_DOCTOR_BY_CLINIC_Hospital, + onSuccess: (dynamic response, int statusCode) { + doctorsList.clear(); + response['DoctorList'].forEach((v) { + doctorsList.add(ClinicDoctor.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _doctorsByClinicIdRequest.toJson(), patient: patient); } Future getMyReferredPatient() async { @@ -215,7 +211,8 @@ class PatientReferralService extends LookupService { ); } - Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { + Future responseReferral( + PendingReferral pendingReferral, bool isAccepted) async { hasError = false; DoctorProfileModel doctorProfile = await getDoctorProfile(); @@ -242,13 +239,8 @@ class PatientReferralService extends LookupService { ); } - Future makeReferral( - PatiantInformtion patient, - String isoStringDate, - int projectID, - int clinicID, - int doctorID, - String remarks) async { + Future makeReferral(PatiantInformtion patient, String isoStringDate, + int projectID, int clinicID, int doctorID, String remarks) async { hasError = false; Map body = Map(); @@ -304,8 +296,8 @@ class PatientReferralService extends LookupService { ); } - - Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { + Future verifyReferralDoctorRemarks( + MyReferredPatientModel referredPatient) async { hasError = false; Map body = Map(); @@ -315,9 +307,7 @@ class PatientReferralService extends LookupService { await baseAppClient.post( Verify_Referral_Doctor_Remarks, - onSuccess: (dynamic response, int statusCode) { - - }, + onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart similarity index 87% rename from lib/core/service/patientInPatientService.dart rename to lib/core/service/patient/patientInPatientService.dart index 3e0ba4a4..c06cc6b7 100644 --- a/lib/core/service/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -13,7 +13,7 @@ class PatientInPatientService extends BaseService { if (isMyInpatient) { requestModel.doctorID = doctorProfile.doctorID; - }else { + } else { requestModel.doctorID = 0; } diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient/patient_service.dart similarity index 100% rename from lib/core/service/patient_service.dart rename to lib/core/service/patient/patient_service.dart diff --git a/lib/core/service/referral_patient_service.dart b/lib/core/service/patient/referral_patient_service.dart similarity index 100% rename from lib/core/service/referral_patient_service.dart rename to lib/core/service/patient/referral_patient_service.dart diff --git a/lib/core/service/referred_patient_service.dart b/lib/core/service/patient/referred_patient_service.dart similarity index 100% rename from lib/core/service/referred_patient_service.dart rename to lib/core/service/patient/referred_patient_service.dart diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart similarity index 100% rename from lib/core/service/patient-admission-request-service.dart rename to lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart diff --git a/lib/core/service/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart similarity index 91% rename from lib/core/service/InsuranceCardService.dart rename to lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index b736c34f..6bdf5f79 100644 --- a/lib/core/service/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/insurance_approval_request_model.dart'; -import 'package:doctor_app_flutter/core/model/insurance_approval.dart'; -import 'package:doctor_app_flutter/core/model/insurance_approval_in_patient_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/insurance/insurance_approval.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/insurance/insurance_approval_in_patient_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/service/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart similarity index 94% rename from lib/core/service/labs_service.dart rename to lib/core/service/patient_medical_file/lab_order/labs_service.dart index 8af2121f..4eee522a 100644 --- a/lib/core/service/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_r import 'package:doctor_app_flutter/core/model/labs/request_send_lab_report_email.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'base/base_service.dart'; +import '../../base/base_service.dart'; class LabsService extends BaseService { List patientLabOrdersList = List(); @@ -25,16 +25,16 @@ class LabsService extends BaseService { body['isDentalAllowedBackend'] = false; url = GET_Patient_LAB_ORDERS; } - patientLabOrdersList=[]; + patientLabOrdersList = []; patientLabOrdersList.clear(); await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { - patientLabOrdersList=[]; + patientLabOrdersList = []; if (!isInpatient) { response['ListPLO'].forEach((hospital) { patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); }); - var asd=""; + var asd = ""; } else { response['List_GetLabOreders'].forEach((hospital) { patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); @@ -69,14 +69,13 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.orderNo = orderNo; body = _requestPatientLabSpecialResult.toJson(); - await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, + patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); response['ListPLSR'].forEach((hospital) { patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); }); - }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -84,7 +83,9 @@ class LabsService extends BaseService { } Future getPatientLabResult( - {PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { + {PatientLabOrders patientLabOrder, + PatiantInformtion patient, + bool isInpatient}) async { hasError = false; String url = ""; @@ -107,16 +108,15 @@ class LabsService extends BaseService { patientLabSpecialResult.clear(); labResultList.clear(); - if(isInpatient){ + if (isInpatient) { response['List_GetLabNormal'].forEach((hospital) { labResultList.add(LabResult.fromJson(hospital)); }); - }else { + } else { response['ListPLR'].forEach((lab) { labResultList.add(LabResult.fromJson(lab)); }); } - }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/medical_file_service.dart b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart similarity index 87% rename from lib/core/service/medical_file_service.dart rename to lib/core/service/patient_medical_file/medical_report/medical_file_service.dart index 75fade97..d80b89fa 100644 --- a/lib/core/service/medical_file_service.dart +++ b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; -import 'package:doctor_app_flutter/core/model/medical_file_request_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/medical_report/medical_file_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/medical_report/medical_file_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class MedicalFileService extends BaseService { diff --git a/lib/core/service/medicine_service.dart b/lib/core/service/patient_medical_file/prescription/medicine_service.dart similarity index 100% rename from lib/core/service/medicine_service.dart rename to lib/core/service/patient_medical_file/prescription/medicine_service.dart diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart similarity index 91% rename from lib/core/service/prescription_service.dart rename to lib/core/service/patient_medical_file/prescription/prescription_service.dart index dc74901e..7df9d38b 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/model/item_by_medicine_request_model.dart'; -import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/item_by_medicine_request_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_req_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/search_drug_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; @@ -109,7 +109,7 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future getMedicationList({String drug =''}) async { + Future getMedicationList({String drug = ''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; await baseAppClient.post(SEARCH_DRUG, diff --git a/lib/core/service/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart similarity index 99% rename from lib/core/service/prescriptions_service.dart rename to lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index 90d65de9..eb860141 100644 --- a/lib/core/service/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:flutter/cupertino.dart'; -import 'base/base_service.dart'; +import '../../base/base_service.dart'; class PrescriptionsService extends BaseService { List prescriptionsList = List(); diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart similarity index 100% rename from lib/core/service/procedure_service.dart rename to lib/core/service/patient_medical_file/procedure/procedure_service.dart diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart new file mode 100644 index 00000000..7cf17753 --- /dev/null +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -0,0 +1,57 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/cupertino.dart'; + +import '../../base/base_service.dart'; + +class RadiologyService extends BaseService { + List finalRadiologyList = List(); + String url = ''; + + Future getRadImageURL( + {int invoiceNo, + int lineItem, + int projectId, + @required PatiantInformtion patient}) async { + hasError = false; + final Map body = new Map(); + body['InvoiceNo'] = invoiceNo; + body['LineItemNo'] = lineItem; + body['ProjectID'] = projectId; + + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, + onSuccess: (dynamic response, int statusCode) { + url = response['Data']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPatientRadOrders(PatiantInformtion patient, + {isInPatient = false}) async { + String url = GET_PATIENT_ORDERS; + final Map body = new Map(); + if (isInPatient) { + url = GET_IN_PATIENT_ORDERS; + body['ProjectID'] = patient.projectId; + } + + hasError = false; + await baseAppClient.postPatient(url, patient: patient, + onSuccess: (dynamic response, int statusCode) { + finalRadiologyList = []; + String label = "ListRAD"; + if (isInPatient) { + label = "List_GetRadOreders"; + } + response[label].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart similarity index 95% rename from lib/core/service/sickleave_service.dart rename to lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 1bfb8df8..c16a2d31 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart'; -import 'package:doctor_app_flutter/core/model/sick_leave_patient_request_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/sick_leave/sick_leave_patient_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/sick_leave/sick_leave_patient_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; @@ -31,7 +31,6 @@ class SickLeaveService extends BaseService { dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic _sickLeaveResponse; - List getAllSickLeavePatient = List(); SickLeavePatientRequestModel _sickLeavePatientRequestModel = @@ -101,8 +100,8 @@ class SickLeaveService extends BaseService { await baseAppClient.postPatient( GET_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { - // Future.value(response); - getAllSickLeavePatient=[]; + // Future.value(response); + getAllSickLeavePatient = []; response['List_SickLeave'].forEach((v) { getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); @@ -119,7 +118,7 @@ class SickLeaveService extends BaseService { _sickLeavePatientRequestModel = SickLeavePatientRequestModel( patientID: patientMRN, patientTypeID: 2, patientType: 1); hasError = false; - getAllSickLeavePatient =[]; + getAllSickLeavePatient = []; getAllSickLeavePatient.clear(); await baseAppClient.postPatient( GET_SICK_LEAVE_PATIENT, diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart similarity index 61% rename from lib/core/service/SOAP_service.dart rename to lib/core/service/patient_medical_file/soap/SOAP_service.dart index 901445bf..b2e0d603 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -22,15 +22,15 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; -import 'base/lookup-service.dart'; +import '../../base/lookup-service.dart'; class SOAPService extends LookupService { - List patientChiefComplaintList = []; - List patientAllergiesList = []; - List patientHistoryList = []; - List patientPhysicalExamList = []; - List patientProgressNoteList = []; - List patientAssessmentList = []; + List patientChiefComplaintList = []; + List patientAllergiesList = []; + List patientHistoryList = []; + List patientPhysicalExamList = []; + List patientProgressNoteList = []; + List patientAssessmentList = []; int episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { @@ -55,13 +55,12 @@ class SOAPService extends LookupService { await baseAppClient.post(POST_EPISODE, onSuccess: (dynamic response, int statusCode) { - - print("Success"); - episodeID = response['EpisodeID']; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: postEpisodeReqModel.toJson()); + print("Success"); + episodeID = response['EpisodeID']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postEpisodeReqModel.toJson()); } Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { @@ -69,11 +68,11 @@ class SOAPService extends LookupService { await baseAppClient.post(POST_ALLERGY, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: postAllergyRequestModel.toJson()); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postAllergyRequestModel.toJson()); } Future postHistories( @@ -81,11 +80,11 @@ class SOAPService extends LookupService { hasError = false; await baseAppClient.post(POST_HISTORY, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: postHistoriesRequestModel.toJson()); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postHistoriesRequestModel.toJson()); } Future postChiefComplaint( @@ -93,7 +92,7 @@ class SOAPService extends LookupService { hasError = false; await baseAppClient.post(POST_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { - print("Success"); + print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -136,18 +135,16 @@ class SOAPService extends LookupService { }, body: postAssessmentRequestModel.toJson()); } - - Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { hasError = false; await baseAppClient.post(PATCH_ALLERGY, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: patchAllergyRequestModel.toJson()); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchAllergyRequestModel.toJson()); } Future patchHistories( @@ -155,11 +152,11 @@ class SOAPService extends LookupService { hasError = false; await baseAppClient.post(PATCH_HISTORY, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: patchHistoriesRequestModel.toJson()); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchHistoriesRequestModel.toJson()); } Future patchChiefComplaint( @@ -167,11 +164,11 @@ class SOAPService extends LookupService { hasError = false; await baseAppClient.post(PATCH_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: patchChiefComplaintRequestModel.toJson()); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchChiefComplaintRequestModel.toJson()); } Future patchPhysicalExam( @@ -179,11 +176,11 @@ class SOAPService extends LookupService { hasError = false; await baseAppClient.post(PATCH_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: patchPhysicalExamRequestModel.toJson()); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchPhysicalExamRequestModel.toJson()); } Future patchProgressNote( @@ -191,11 +188,11 @@ class SOAPService extends LookupService { hasError = false; await baseAppClient.post(PATCH_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: patchProgressNoteRequestModel.toJson()); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchProgressNoteRequestModel.toJson()); } Future patchAssessment( @@ -203,111 +200,106 @@ class SOAPService extends LookupService { hasError = false; await baseAppClient.post(PATCH_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: patchAssessmentRequestModel.toJson()); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchAssessmentRequestModel.toJson()); } - - Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; - await baseAppClient.post (GET_ALLERGY, + await baseAppClient.post(GET_ALLERGY, onSuccess: (dynamic response, int statusCode) { - print("Success"); - patientAllergiesList.clear(); + print("Success"); + patientAllergiesList.clear(); - response['List_Allergies']['entityList'].forEach((v) { - patientAllergiesList.add(GetAllergiesResModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: generalGetReqForSOAP.toJson()); + response['List_Allergies']['entityList'].forEach((v) { + patientAllergiesList.add(GetAllergiesResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: generalGetReqForSOAP.toJson()); } - Future getPatientHistories( - GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, + {bool isFirst = false}) async { hasError = false; await baseAppClient.post(GET_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); - if (isFirst) - patientHistoryList.clear(); + if (isFirst) patientHistoryList.clear(); response['List_History']['entityList'].forEach((v) { patientHistoryList.add(GetHistoryResModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = error; - }, body: getHistoryReqModel.toJson()); + super.error = error; + }, body: getHistoryReqModel.toJson()); } Future getPatientChiefComplaint( GetChiefComplaintReqModel getChiefComplaintReqModel) async { hasError = false; - await baseAppClient.post (GET_CHIEF_COMPLAINT, + await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { - print("Success"); - patientChiefComplaintList.clear(); - response['List_ChiefComplaint']['entityList'].forEach((v) { - patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: getChiefComplaintReqModel.toJson()); + print("Success"); + patientChiefComplaintList.clear(); + response['List_ChiefComplaint']['entityList'].forEach((v) { + patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getChiefComplaintReqModel.toJson()); } Future getPatientPhysicalExam( GetPhysicalExamReqModel getPhysicalExamReqModel) async { hasError = false; - await baseAppClient.post (GET_PHYSICAL_EXAM, + await baseAppClient.post(GET_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { - patientPhysicalExamList.clear(); - response['PhysicalExamList']['entityList'].forEach((v) { - patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v)); - }); - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: getPhysicalExamReqModel.toJson()); + patientPhysicalExamList.clear(); + response['PhysicalExamList']['entityList'].forEach((v) { + patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getPhysicalExamReqModel.toJson()); } Future getPatientProgressNote( GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { hasError = false; - await baseAppClient.post (GET_PROGRESS_NOTE, + await baseAppClient.post(GET_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { - print("Success"); - patientProgressNoteList.clear(); - response['ProgressNoteList']['entityList'].forEach((v) { - patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v)); - }); - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: getGetProgressNoteReqModel.toJson()); + print("Success"); + patientProgressNoteList.clear(); + response['ProgressNoteList']['entityList'].forEach((v) { + patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getGetProgressNoteReqModel.toJson()); } Future getPatientAssessment( GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; - await baseAppClient.post (GET_ASSESSMENT, + await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { - print("Success"); - patientAssessmentList.clear(); - response['AssessmentList']['entityList'].forEach((v) { - patientAssessmentList.add(GetAssessmentResModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: getAssessmentReqModel.toJson()); + print("Success"); + patientAssessmentList.clear(); + response['AssessmentList']['entityList'].forEach((v) { + patientAssessmentList.add(GetAssessmentResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getAssessmentReqModel.toJson()); } } diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart similarity index 67% rename from lib/core/service/patient-ucaf-service.dart rename to lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index e53df1d0..478d48f3 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/prescription_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; @@ -8,11 +8,10 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class UcafService extends LookupService { - - List patientChiefComplaintList = []; + List patientChiefComplaintList = []; List patientVitalSignsHistory = []; - List patientAssessmentList = []; - List orderProcedureList = []; + List patientAssessmentList = []; + List orderProcedureList = []; PrescriptionModel prescriptionList; Future getPatientChiefComplaint(PatiantInformtion patient) async { @@ -23,27 +22,28 @@ class UcafService extends LookupService { body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; - await baseAppClient.post (GET_CHIEF_COMPLAINT, + await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { - print("Success"); - patientChiefComplaintList.clear(); - response['List_ChiefComplaint']['entityList'].forEach((v) { - patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + print("Success"); + patientChiefComplaintList.clear(); + response['List_ChiefComplaint']['entityList'].forEach((v) { + patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } - Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { + Future getInPatientVitalSignHistory( + PatiantInformtion patient, bool isInPatient) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; body['PatientTypeID'] = 1; - if(isInPatient){ + if (isInPatient) { body['InOutPatientType'] = 1; - }else { + } else { body['InOutPatientType'] = 2; } @@ -104,17 +104,17 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post (GET_ASSESSMENT, + await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { - print("Success"); - patientAssessmentList.clear(); - response['AssessmentList']['entityList'].forEach((v) { - patientAssessmentList.add(GetAssessmentResModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + print("Success"); + patientAssessmentList.clear(); + response['AssessmentList']['entityList'].forEach((v) { + patientAssessmentList.add(GetAssessmentResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } Future getPrescription(PatiantInformtion patient) async { @@ -129,11 +129,12 @@ class UcafService extends LookupService { prescriptionList = null; await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { - prescriptionList = PrescriptionModel.fromJson(response['PrescriptionList']); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + prescriptionList = + PrescriptionModel.fromJson(response['PrescriptionList']); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } Future getOrderProcedures(PatiantInformtion patient) async { @@ -143,17 +144,17 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post (GET_ORDER_PROCEDURE, + await baseAppClient.post(GET_ORDER_PROCEDURE, onSuccess: (dynamic response, int statusCode) { - print("Success"); - orderProcedureList.clear(); - response['OrderedProcedureList']['entityList'].forEach((v) { - orderProcedureList.add(OrderProcedure.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + print("Success"); + orderProcedureList.clear(); + response['OrderedProcedureList']['entityList'].forEach((v) { + orderProcedureList.add(OrderProcedure.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } Future postUCAF(PatiantInformtion patient) async { @@ -162,13 +163,12 @@ class UcafService extends LookupService { body['PatientMRN'] = patient.patientMRN; body['AppointmentNo'] = patient.appointmentNo; - await baseAppClient.post (POST_UCAF, + await baseAppClient.post(POST_UCAF, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } - -} \ No newline at end of file +} diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart similarity index 100% rename from lib/core/service/patient-vital-signs-service.dart rename to lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart diff --git a/lib/core/service/radiology_service.dart b/lib/core/service/radiology_service.dart deleted file mode 100644 index 42a79098..00000000 --- a/lib/core/service/radiology_service.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/cupertino.dart'; - -import 'base/base_service.dart'; - -class RadiologyService extends BaseService { - List finalRadiologyList = List(); - String url = ''; - - Future getRadImageURL({int invoiceNo, int lineItem, int projectId,@required PatiantInformtion patient}) async { - hasError = false; - final Map body = new Map(); - body['InvoiceNo'] = invoiceNo; - body['LineItemNo'] = lineItem; - body['ProjectID'] = projectId; - - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, - patient: patient, - onSuccess: (dynamic response, int statusCode) { - url = response['Data']; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } - - Future getPatientRadOrders(PatiantInformtion patient , {isInPatient = false}) async { - String url = GET_PATIENT_ORDERS; - final Map body = new Map(); - if(isInPatient) { - url = GET_IN_PATIENT_ORDERS; - body['ProjectID'] = patient.projectId; - } - - - hasError = false; - await baseAppClient.postPatient(url, - patient: patient, - onSuccess: (dynamic response, int statusCode) { - finalRadiologyList = []; - String label = "ListRAD"; - if(isInPatient) { - label ="List_GetRadOreders"; - } - response[label].forEach((radiology) { - finalRadiologyList.add(FinalRadiology.fromJson(radiology)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body:body); - } - - - - -} diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 1c1ed4d1..6e130abe 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/DischargedPatientService.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/DischargedPatientService.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import '../../locator.dart'; @@ -12,7 +12,6 @@ class DischargedPatientViewModel extends BaseViewModel { List get myDischargedPatient => _dischargedPatientService.myDischargedPatients; - List filterData = []; searchData(String str) { @@ -39,16 +38,16 @@ class DischargedPatientViewModel extends BaseViewModel { } } - Future getDischargedPatient() async { setState(ViewState.Busy); await _dischargedPatientService.getDischargedPatient(); if (_dischargedPatientService.hasError) { error = _dischargedPatientService.error; setState(ViewState.Error); - } else{ + } else { filterData = myDischargedPatient; - setState(ViewState.Idle);} + setState(ViewState.Idle); + } } Future gtMyDischargeReferralPatient() async { diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index 54e61635..e41d68bd 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/insurance_approval.dart'; -import 'package:doctor_app_flutter/core/model/insurance_approval_in_patient_model.dart'; -import 'package:doctor_app_flutter/core/service/InsuranceCardService.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/insurance/insurance_approval.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/insurance/insurance_approval_in_patient_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart index 890b24d6..68826e04 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -1,15 +1,15 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart'; -import 'package:doctor_app_flutter/core/service/PatientMuseService.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientMuseResultsModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/PatientMuseService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import '../../locator.dart'; class PatientMuseViewModel extends BaseViewModel { - PatientMuseService _patientMuseService = locator(); - List get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList; + List get patientMuseResultsModelList => + _patientMuseService.patientMuseResultsModelList; getECGPatient({int patientType, int patientOutSA, int patientID}) async { setState(ViewState.Busy); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 8192b1a8..ce33c5f5 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,15 +1,15 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; -import 'package:doctor_app_flutter/core/service/patientInPatientService.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/patientInPatientService.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; import 'base_view_model.dart'; -class PatientSearchViewModel extends BaseViewModel{ +class PatientSearchViewModel extends BaseViewModel { OutPatientService _outPatientService = locator(); List get patientList => _outPatientService.patientList; @@ -24,10 +24,14 @@ class PatientSearchViewModel extends BaseViewModel{ if (strExist) { filterData = []; for (var i = 0; i < _outPatientService.patientList.length; i++) { - String firstName = _outPatientService.patientList[i].firstName.toUpperCase(); - String lastName = _outPatientService.patientList[i].lastName.toUpperCase(); - String mobile = _outPatientService.patientList[i].mobileNumber.toUpperCase(); - String patientID = _outPatientService.patientList[i].patientId.toString(); + String firstName = + _outPatientService.patientList[i].firstName.toUpperCase(); + String lastName = + _outPatientService.patientList[i].lastName.toUpperCase(); + String mobile = + _outPatientService.patientList[i].mobileNumber.toUpperCase(); + String patientID = + _outPatientService.patientList[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) || @@ -43,19 +47,19 @@ class PatientSearchViewModel extends BaseViewModel{ } } - getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async { - if(isLocalBusy) { + getOutPatient(PatientSearchRequestModel patientSearchRequestModel, + {bool isLocalBusy = false}) async { + if (isLocalBusy) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } - await getDoctorProfile(isGetProfile: true); + await getDoctorProfile(isGetProfile: true); patientSearchRequestModel.doctorID = doctorProfile.doctorID; - await _outPatientService.getOutPatient( - patientSearchRequestModel); + await _outPatientService.getOutPatient(patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error; - if(isLocalBusy) { + if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { setState(ViewState.Error); @@ -66,10 +70,11 @@ class PatientSearchViewModel extends BaseViewModel{ } } - getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, + {bool isLocalBusy = false}) async { setState(ViewState.Busy); - await _outPatientService.getPatientFileInformation( - patientSearchRequestModel); + await _outPatientService + .getPatientFileInformation(patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error; setState(ViewState.Error); @@ -79,30 +84,21 @@ class PatientSearchViewModel extends BaseViewModel{ } } - - - getPatientBasedOnDate ( - {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, - bool isSearchWithKeyInfo })async { + getPatientBasedOnDate( + {item, + PatientSearchRequestModel patientSearchRequestModel, + PatientType selectedPatientType, + bool isSearchWithKeyInfo}) async { String dateTo; String dateFrom; if (item == 'Previous') { - - selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month-1, - DateTime.now().day); - selectedToDate = DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day-1); - dateTo = DateUtils.convertDateToFormat( - selectedToDate, - 'yyyy-MM-dd'); - dateFrom = DateUtils.convertDateToFormat( - selectedFromDate, - 'yyyy-MM-dd'); - - + selectedFromDate = DateTime( + DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); + selectedToDate = DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); + dateTo = DateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); + dateFrom = DateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); } else if (item == 'Next Week') { - - dateTo = DateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), @@ -117,35 +113,32 @@ class PatientSearchViewModel extends BaseViewModel{ DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); - dateTo= DateUtils.convertDateToFormat( + dateTo = DateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); } PatientSearchRequestModel currentModel = PatientSearchRequestModel(); - currentModel.patientID = patientSearchRequestModel.patientID; - currentModel.firstName = patientSearchRequestModel.firstName; - currentModel.lastName = patientSearchRequestModel.lastName; + currentModel.patientID = patientSearchRequestModel.patientID; + currentModel.firstName = patientSearchRequestModel.firstName; + currentModel.lastName = patientSearchRequestModel.lastName; currentModel.middleName = patientSearchRequestModel.middleName; currentModel.doctorID = patientSearchRequestModel.doctorID; currentModel.from = dateFrom; currentModel.to = dateTo; await getOutPatient(currentModel, isLocalBusy: true); filterData = _outPatientService.patientList; - } - - PatientInPatientService _inPatientService = - locator(); + locator(); List get _inPatientList => _inPatientService.inPatientList; List filteredInPatientItems = List(); Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isFirstTime = true}) async { - await getDoctorProfile(); + await getDoctorProfile(); if (isFirstTime) setState(ViewState.Busy); else @@ -181,12 +174,9 @@ class PatientSearchViewModel extends BaseViewModel{ } notifyListeners(); } else { - if (_inPatientList.length > 0) - filteredInPatientItems.clear(); - filteredInPatientItems.addAll(_inPatientList); + if (_inPatientList.length > 0) filteredInPatientItems.clear(); + filteredInPatientItems.addAll(_inPatientList); notifyListeners(); } } - - } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 274c983f..d73a6ab7 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; -import 'package:doctor_app_flutter/core/service/prescription_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/soap/SOAP_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; @@ -39,10 +39,10 @@ class SOAPViewModel extends BaseViewModel { List get allergySeverityList => _SOAPService.allergySeverityList; - List get historyFamilyList => _SOAPService.historyFamilyList; - List get historyMedicalList => _SOAPService.historyMedicalList; + List get historyMedicalList => + _SOAPService.historyMedicalList; List get historySportList => _SOAPService.historySportList; @@ -82,8 +82,7 @@ class SOAPViewModel extends BaseViewModel { List get patientAssessmentList => _SOAPService.patientAssessmentList; - int get episodeID => - _SOAPService.episodeID; + int get episodeID => _SOAPService.episodeID; get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; @@ -102,11 +101,12 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async { - if(isBusyLocal){ + Future getMasterLookup(MasterKeysService masterKeys, + {bool isBusyLocal = false}) async { + if (isBusyLocal) { + setState(ViewState.Busy); + } else setState(ViewState.Busy); - }else - setState(ViewState.Busy); await _SOAPService.getMasterLookup(masterKeys); if (_SOAPService.hasError) { error = _SOAPService.error; @@ -115,7 +115,6 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { setState(ViewState.BusyLocal); await _SOAPService.postEpisode(postEpisodeReqModel); @@ -136,7 +135,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { + Future postHistories( + PostHistoriesRequestModel postHistoriesRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postHistories(postHistoriesRequestModel); if (_SOAPService.hasError) { @@ -146,7 +146,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + Future postChiefComplaint( + PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel); if (_SOAPService.hasError) { @@ -156,7 +157,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam( + PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); if (_SOAPService.hasError) { @@ -166,7 +168,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote( + PostProgressNoteRequestModel postProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postProgressNote(postProgressNoteRequestModel); if (_SOAPService.hasError) { @@ -176,7 +179,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment( + PostAssessmentRequestModel postAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postAssessment(postAssessmentRequestModel); if (_SOAPService.hasError) { @@ -186,7 +190,6 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchAllergy(patchAllergyRequestModel); @@ -197,7 +200,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { + Future patchHistories( + PostHistoriesRequestModel patchHistoriesRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchHistories(patchHistoriesRequestModel); if (_SOAPService.hasError) { @@ -207,7 +211,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { + Future patchChiefComplaint( + PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel); if (_SOAPService.hasError) { @@ -217,7 +222,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + Future patchPhysicalExam( + PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); if (_SOAPService.hasError) { @@ -227,7 +233,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote( + PostProgressNoteRequestModel patchProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); if (_SOAPService.hasError) { @@ -237,7 +244,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment( + PatchAssessmentReqModel patchAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchAssessment(patchAssessmentRequestModel); if (_SOAPService.hasError) { @@ -259,7 +267,7 @@ class SOAPViewModel extends BaseViewModel { if (isLocalBusy) { setState(ViewState.ErrorLocal); } else - setState(ViewState.Error); + setState(ViewState.Error); } else setState(ViewState.Idle); } @@ -271,16 +279,19 @@ class SOAPViewModel extends BaseViewModel { masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); - if(selectedAllergy != null && element.isChecked) - allergiesString += - (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn )+ ' , '; + if (selectedAllergy != null && element.isChecked) + allergiesString += + (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + + ' , '; }); return allergiesString; } - Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, + {bool isFirst = false}) async { setState(ViewState.Busy); - await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst); + await _SOAPService.getPatientHistories(getHistoryReqModel, + isFirst: isFirst); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.Error); @@ -299,7 +310,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { + Future getPatientPhysicalExam( + GetPhysicalExamReqModel getPhysicalExamReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { @@ -309,7 +321,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote( + GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel); if (_SOAPService.hasError) { @@ -339,6 +352,7 @@ class SOAPViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + // ignore: missing_return MasterKeyModel getOneMasterKey( {@required MasterKeysService masterKeys, dynamic id, int typeId}) { @@ -391,7 +405,8 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySurgical: List result = historySurgicalList.where((element) { - return element.id == id;}).toList(); + return element.id == id; + }).toList(); if (result.isNotEmpty) { return result.first; } @@ -414,12 +429,12 @@ class SOAPViewModel extends BaseViewModel { return result.first; } break; - // case MasterKeysService.physiotherapyGoals: - // listOfPhysiotherapyGoals.clear(); - // entryList.forEach((v) { - // listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v)); - // }); - // break; + // case MasterKeysService.physiotherapyGoals: + // listOfPhysiotherapyGoals.clear(); + // entryList.forEach((v) { + // listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v)); + // }); + // break; case MasterKeysService.DiagnosisType: List result = listOfDiagnosisType.where((element) { @@ -441,7 +456,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.ICD10: List result = listOfICD10.where((element) { - return element.code == id ; + return element.code == id; }).toList(); if (result.isNotEmpty) { return result.first; @@ -450,6 +465,4 @@ class SOAPViewModel extends BaseViewModel { break; } } - - } diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index 4e40fe31..1b79b051 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/core/model/imei_details.dart'; -import 'package:doctor_app_flutter/core/model/insert_imei_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/imei_details.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/insert_imei_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index fede0793..178713c5 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/dasboard_service.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 6da7d904..e0c63a76 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import '../../locator.dart'; @@ -8,7 +8,8 @@ import 'base_view_model.dart'; class DoctorReplayViewModel extends BaseViewModel { DoctorReplyService _doctorReplyService = locator(); - List get listDoctorWorkingHoursTable => _doctorReplyService.listDoctorWorkingHoursTable; + List get listDoctorWorkingHoursTable => + _doctorReplyService.listDoctorWorkingHoursTable; Future getDoctorReply() async { setState(ViewState.Busy); @@ -20,7 +21,8 @@ class DoctorReplayViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future replay(String referredDoctorRemarks, ListGtMyPatientsQuestions model) async { + Future replay( + String referredDoctorRemarks, ListGtMyPatientsQuestions model) async { setState(ViewState.BusyLocal); await _doctorReplyService.replay(referredDoctorRemarks, model); if (_doctorReplyService.hasError) { diff --git a/lib/core/viewModel/imei_view_model.dart b/lib/core/viewModel/imei_view_model.dart index c2d16206..63b26e98 100644 --- a/lib/core/viewModel/imei_view_model.dart +++ b/lib/core/viewModel/imei_view_model.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/imei_details.dart'; -import 'package:doctor_app_flutter/core/service/auth_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/imei_details.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/auth_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart'; diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 020a6184..071ebad6 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; -import 'package:doctor_app_flutter/core/service/labs_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/lab_order/labs_service.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -116,10 +116,14 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResult( - {PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { + {PatientLabOrders patientLabOrder, + PatiantInformtion patient, + bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getPatientLabResult( - patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); + patientLabOrder: patientLabOrder, + patient: patient, + isInpatient: isInpatient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 194e8323..0e2c724f 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; -import 'package:doctor_app_flutter/core/service/medical_file_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/medical_report/medical_file_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index c318d401..b57b2ad5 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/service/medicine_service.dart'; -import 'package:doctor_app_flutter/core/service/prescription_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/medicine_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 9d43ec48..61334494 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -1,38 +1,43 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; -import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import '../../locator.dart'; -class AdmissionRequestViewModel extends BaseViewModel{ - - AdmissionRequestService _admissionRequestService = locator(); +class AdmissionRequestViewModel extends BaseViewModel { + AdmissionRequestService _admissionRequestService = + locator(); List get clinicList => _admissionRequestService.clinicList; List get doctorsList => _admissionRequestService.doctorsList; - List get speciality => _admissionRequestService.specialityList; + List get speciality => _admissionRequestService.specialityList; - List get floorList => _admissionRequestService.floorList; + List get floorList => _admissionRequestService.floorList; - List get wardList => _admissionRequestService.wardList; + List get wardList => _admissionRequestService.wardList; - List get roomCategoryList => _admissionRequestService.roomCategoryList; + List get roomCategoryList => + _admissionRequestService.roomCategoryList; - List get admissionTypeList => _admissionRequestService.listOfAdmissionType; + List get admissionTypeList => + _admissionRequestService.listOfAdmissionType; - List get diagnosisTypesList => _admissionRequestService.diagnosisTypesList; + List get diagnosisTypesList => + _admissionRequestService.diagnosisTypesList; - List get allergiesList => _admissionRequestService.allergiesLookupList; + List get allergiesList => + _admissionRequestService.allergiesLookupList; - List get dietTypesList => _admissionRequestService.dietTypesList; + List get dietTypesList => _admissionRequestService.dietTypesList; - List get icdCodes => _admissionRequestService.icdCodes; + List get icdCodes => _admissionRequestService.icdCodes; - List get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes; + List get listOfDiagnosisSelectionTypes => + _admissionRequestService.listOfDiagnosisSelectionTypes; AdmissionRequest admissionRequestData; @@ -131,7 +136,7 @@ class AdmissionRequestViewModel extends BaseViewModel{ setState(ViewState.Idle); } - Future makeAdmissionRequest() async{ + Future makeAdmissionRequest() async { setState(ViewState.Busy); await _admissionRequestService.makeAdmissionRequest(admissionRequestData); if (_admissionRequestService.hasError) { @@ -151,4 +156,4 @@ class AdmissionRequestViewModel extends BaseViewModel{ setState(ViewState.Idle); } } -} \ No newline at end of file +} diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index aaa0d35e..67544e6f 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/DischargeReferralPatient.dart'; -import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart'; -import 'package:doctor_app_flutter/core/service/DischargedPatientService.dart'; -import 'package:doctor_app_flutter/core/service/MyReferralPatientService.dart'; -import 'package:doctor_app_flutter/core/service/ReferralService.dart'; -import 'package:doctor_app_flutter/core/service/patient-doctor-referral-service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/DischargeReferralPatient.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/MyReferralPatientModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/DischargedPatientService.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/MyReferralPatientService.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/ReferralService.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/patient-doctor-referral-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; @@ -26,7 +26,8 @@ class PatientReferralViewModel extends BaseViewModel { MyReferralInPatientService _myReferralService = locator(); - DischargedPatientService _dischargedPatientService = locator(); + DischargedPatientService _dischargedPatientService = + locator(); List get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients; @@ -165,9 +166,11 @@ class PatientReferralViewModel extends BaseViewModel { } else setState(ViewState.Idle); } - Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async{ + + Future replay( + String referredDoctorRemarks, MyReferralPatientModel referral) async { setState(ViewState.Busy); - await _myReferralService.replay(referredDoctorRemarks,referral); + await _myReferralService.replay(referredDoctorRemarks, referral); if (_myReferralService.hasError) { error = _myReferralService.error; setState(ViewState.ErrorLocal); @@ -366,7 +369,8 @@ class PatientReferralViewModel extends BaseViewModel { patient.roomId = referredPatient.roomID; patient.bedId = referredPatient.bedID; patient.nationalityName = referredPatient.nationalityName; - patient.nationalityFlagURL = '';// TODO from backend referredPatient.nationalityFlagURL; + patient.nationalityFlagURL = + ''; // TODO from backend referredPatient.nationalityFlagURL; patient.age = referredPatient.age; patient.clinicDescription = referredPatient.clinicDescription; return patient; diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index dc76884d..301902a6 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/prescription_model.dart'; -import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; @@ -45,7 +45,7 @@ class UcafViewModel extends BaseViewModel { String respirationBeatPerMinute = "0"; String bloodPressure = "0 / 0"; - resetDataInFirst(){ + resetDataInFirst() { _ucafService.patientAssessmentList = []; _ucafService.orderProcedureList = []; _ucafService.prescriptionList = null; diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 59b13fe8..bb8367a6 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/patient-vital-signs-service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; @@ -52,12 +52,10 @@ class VitalSignsViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - if (isInPatient) { await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); } else { - await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to); - + await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to); } if (_vitalSignService.hasError) { @@ -97,7 +95,7 @@ class VitalSignsViewModel extends BaseViewModel { oxygenation == null || oxygenation == 'null') { oxygenation = - "${element.sAO2.toString()}";/* - ${element.fIO2.toString()}*/ + "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ } if (painScore == null || painScore == "-") { painScore = element.painScore.toString() != 'null' diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 3a45036e..ce34e566 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; -import 'package:doctor_app_flutter/core/service/patient_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; @@ -42,7 +42,8 @@ class PatientViewModel extends BaseViewModel { get insuranceApporvalsList => _patientService.insuranceApporvalsList; - List get patientProgressNoteList => _patientService.patientProgressNoteList; + List get patientProgressNoteList => + _patientService.patientProgressNoteList; List get clinicsList => _patientService.clinicsList; @@ -65,7 +66,7 @@ class PatientViewModel extends BaseViewModel { if (_patientService.hasError) { error = _patientService.error; setState(ViewState.Error); - } else{ + } else { setState(ViewState.Idle); } return localRes; @@ -142,18 +143,18 @@ class PatientViewModel extends BaseViewModel { } Future getPatientProgressNote(patient, {bool isLocalBusy = false}) async { - if(isLocalBusy) { + if (isLocalBusy) { setState(ViewState.BusyLocal); - }else{ + } else { setState(ViewState.Busy); } await _patientService.getPatientProgressNote(patient); if (_patientService.hasError) { error = _patientService.error; - if(isLocalBusy) { + if (isLocalBusy) { setState(ViewState.ErrorLocal); - }else{ + } else { setState(ViewState.Error); } } else diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index c549b2b0..2e959a3d 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -7,10 +7,10 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_pati import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/service/prescription_service.dart'; -import 'package:doctor_app_flutter/core/service/prescriptions_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; @@ -59,7 +59,7 @@ class PrescriptionViewModel extends BaseViewModel { getPrescriptionsInPatient(PatiantInformtion patient) async { setState(ViewState.Busy); - error=""; + error = ""; await _prescriptionsService.getPrescriptionInPatient( mrn: patient.patientId, adn: patient.admissionNo); if (_prescriptionsService.hasError) { diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index 916a6563..4554a48d 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmac import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'package:doctor_app_flutter/core/service/prescriptions_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:flutter/material.dart'; @@ -19,16 +19,16 @@ class PrescriptionsViewModel extends BaseViewModel { List _prescriptionsOrderListClinic = List(); List _prescriptionsOrderListHospital = List(); - List get prescriptionReportList => _prescriptionsService.prescriptionReportList; List get prescriptionsList => _prescriptionsService.prescriptionsList; - List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList ; - List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; - + List get pharmacyPrescriptionsList => + _prescriptionsService.pharmacyPrescriptionsList; + List get prescriptionReportEnhList => + _prescriptionsService.prescriptionReportEnhList; List get prescriptionsOrderList => filterType == FilterType.Clinic @@ -48,6 +48,7 @@ class PrescriptionsViewModel extends BaseViewModel { setState(ViewState.Idle); } } + _getPrescriptionsOrders() async { await _prescriptionsService.getPrescriptionsOrders(); if (_prescriptionsService.hasError) { @@ -97,15 +98,17 @@ class PrescriptionsViewModel extends BaseViewModel { }); } - setFilterType(FilterType filterType) { this.filterType = filterType; notifyListeners(); } - getPrescriptionReport({Prescriptions prescriptions,@required PatiantInformtion patient}) async { + getPrescriptionReport( + {Prescriptions prescriptions, + @required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions,patient: patient); + await _prescriptionsService.getPrescriptionReport( + prescriptions: prescriptions, patient: patient); if (_prescriptionsService.hasError) { error = _prescriptionsService.error; setState(ViewState.ErrorLocal); @@ -114,11 +117,11 @@ class PrescriptionsViewModel extends BaseViewModel { } } - - - getListPharmacyForPrescriptions({int itemId,@required PatiantInformtion patient}) async { + getListPharmacyForPrescriptions( + {int itemId, @required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId,patient: patient); + await _prescriptionsService.getListPharmacyForPrescriptions( + itemId: itemId, patient: patient); if (_prescriptionsService.hasError) { error = _prescriptionsService.error; setState(ViewState.Error); @@ -127,11 +130,12 @@ class PrescriptionsViewModel extends BaseViewModel { } } - - - getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder,@required PatiantInformtion patient}) async { + getPrescriptionReportEnh( + {PrescriptionsOrder prescriptionsOrder, + @required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder,patient: patient); + await _prescriptionsService.getPrescriptionReportEnh( + prescriptionsOrder: prescriptionsOrder, patient: patient); if (_prescriptionsService.hasError) { error = _prescriptionsService.error; setState(ViewState.Error); @@ -139,7 +143,4 @@ class PrescriptionsViewModel extends BaseViewModel { setState(ViewState.Idle); } } - - - } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 8717c84b..1cd0be2f 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -11,9 +11,9 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'package:doctor_app_flutter/core/service/labs_service.dart'; -import 'package:doctor_app_flutter/core/service/procedure_service.dart'; -import 'package:doctor_app_flutter/core/service/radiology_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/lab_order/labs_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/procedure/procedure_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/radiology/radiology_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -43,7 +43,8 @@ class ProcedureViewModel extends BaseViewModel { List get radiologyList => _radiologyService.finalRadiologyList; - List get patientLabOrdersList => _labsService.patientLabOrdersList; + List get patientLabOrdersList => + _labsService.patientLabOrdersList; List get labOrdersResultsList => _labsService.labOrdersResultsList; @@ -51,16 +52,14 @@ class ProcedureViewModel extends BaseViewModel { List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); - - - Future getProcedure({int mrn,String patientType}) async { + Future getProcedure({int mrn, String patientType}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _procedureService.getProcedure(mrn: mrn); if (_procedureService.hasError) { error = _procedureService.error; - if(patientType=="7") + if (patientType == "7") setState(ViewState.ErrorLocal); else setState(ViewState.Error); @@ -135,15 +134,16 @@ class ProcedureViewModel extends BaseViewModel { } else setState(ViewState.Idle); //await getProcedure(mrn: mrn); - } - void getPatientRadOrders(PatiantInformtion patient,{String patientType, bool isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, + {String patientType, bool isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, isInPatient:isInPatient); + await _radiologyService.getPatientRadOrders(patient, + isInPatient: isInPatient); if (_radiologyService.hasError) { error = _radiologyService.error; - if(patientType=="7") + if (patientType == "7") setState(ViewState.ErrorLocal); else setState(ViewState.ErrorLocal); @@ -221,8 +221,6 @@ class ProcedureViewModel extends BaseViewModel { List labResultLists = List(); - - List get labResultListsCoustom { return labResultLists; } @@ -232,7 +230,7 @@ class ProcedureViewModel extends BaseViewModel { await _labsService.getPatientLabOrdersList(patient, isInpatient); if (_labsService.hasError) { error = _labsService.error; - setState(ViewState.Error); + setState(ViewState.Error); } else { setState(ViewState.Idle); } diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index 4e3768dc..92d4c344 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'package:doctor_app_flutter/core/service/radiology_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/radiology/radiology_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:flutter/foundation.dart'; @@ -20,9 +20,11 @@ class RadiologyViewModel extends BaseViewModel { ? _finalRadiologyListClinic : _finalRadiologyListHospital; - void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, + {isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, isInPatient:isInPatient); + await _radiologyService.getPatientRadOrders(patient, + isInPatient: isInPatient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/core/viewModel/referral_view_model.dart b/lib/core/viewModel/referral_view_model.dart index 2e99cc3a..6c2b2858 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -1,14 +1,16 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/referral_patient_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/referral_patient_service.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; class ReferralPatientViewModel extends BaseViewModel { - ReferralPatientService _referralPatientService = locator(); + ReferralPatientService _referralPatientService = + locator(); - List get listMyReferralPatientModel => _referralPatientService.listMyReferralPatientModel; + List get listMyReferralPatientModel => + _referralPatientService.listMyReferralPatientModel; Future getMyReferralPatient() async { setState(ViewState.Busy); @@ -20,7 +22,8 @@ class ReferralPatientViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async { + Future replay( + String referredDoctorRemarks, MyReferralPatientModel model) async { setState(ViewState.BusyLocal); await _referralPatientService.replay(referredDoctorRemarks, model); if (_referralPatientService.hasError) { diff --git a/lib/core/viewModel/referred_view_model.dart b/lib/core/viewModel/referred_view_model.dart index 2aa996f6..f77ea922 100644 --- a/lib/core/viewModel/referred_view_model.dart +++ b/lib/core/viewModel/referred_view_model.dart @@ -1,14 +1,16 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/referred_patient_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/referred_patient_service.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; class ReferredPatientViewModel extends BaseViewModel { - ReferredPatientService _referralPatientService = locator(); + ReferredPatientService _referralPatientService = + locator(); - List get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel; + List get listMyReferredPatientModel => + _referralPatientService.listMyReferredPatientModel; Future getMyReferredPatient() async { setState(ViewState.Busy); @@ -19,5 +21,4 @@ class ReferredPatientViewModel extends BaseViewModel { } else setState(ViewState.Idle); } - } diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index 8aebc4cb..d0e58535 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/schedule_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/schedule_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; import '../../locator.dart'; @@ -8,7 +8,8 @@ import 'base_view_model.dart'; class ScheduleViewModel extends BaseViewModel { ScheduleService _scheduleService = locator(); - List get listDoctorWorkingHoursTable => _scheduleService.listDoctorWorkingHoursTable; + List get listDoctorWorkingHoursTable => + _scheduleService.listDoctorWorkingHoursTable; Future getDoctorSchedule() async { setState(ViewState.Busy); diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index bc80744f..e69eb5bf 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; diff --git a/lib/locator.dart b/lib/locator.dart index 13b51d95..9f22685a 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,10 +1,10 @@ -import 'package:doctor_app_flutter/core/service/auth_service.dart'; -import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; -import 'package:doctor_app_flutter/core/service/medical_file_service.dart'; -import 'package:doctor_app_flutter/core/service/patient_service.dart'; -import 'package:doctor_app_flutter/core/service/prescription_service.dart'; -import 'package:doctor_app_flutter/core/service/procedure_service.dart'; -import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/auth_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/dasboard_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/patient_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/procedure/procedure_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; @@ -14,26 +14,26 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; -import 'core/service/DischargedPatientService.dart'; -import 'core/service/InsuranceCardService.dart'; -import 'core/service/MyReferralPatientService.dart'; -import 'core/service/PatientMuseService.dart'; -import 'core/service/ReferralService.dart'; -import 'core/service/SOAP_service.dart'; -import 'core/service/doctor_reply_service.dart'; -import 'core/service/labs_service.dart'; -import 'core/service/medicine_service.dart'; -import 'core/service/patient-admission-request-service.dart'; -import 'core/service/patient-doctor-referral-service.dart'; -import 'core/service/patient-ucaf-service.dart'; -import 'core/service/patient-vital-signs-service.dart'; +import 'core/service/patient/DischargedPatientService.dart'; +import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart'; +import 'core/service/patient/MyReferralPatientService.dart'; +import 'core/service/patient/PatientMuseService.dart'; +import 'core/service/patient/ReferralService.dart'; +import 'core/service/patient_medical_file/soap/SOAP_service.dart'; +import 'core/service/home/doctor_reply_service.dart'; +import 'core/service/patient_medical_file/lab_order/labs_service.dart'; +import 'core/service/patient_medical_file/prescription/medicine_service.dart'; +import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; +import 'core/service/patient/patient-doctor-referral-service.dart'; +import 'core/service/patient_medical_file/ucaf/patient-ucaf-service.dart'; +import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart'; import 'core/service/patient/out_patient_service.dart'; -import 'core/service/patientInPatientService.dart'; -import 'core/service/prescriptions_service.dart'; -import 'core/service/radiology_service.dart'; -import 'core/service/referral_patient_service.dart'; -import 'core/service/referred_patient_service.dart'; -import 'core/service/schedule_service.dart'; +import 'core/service/patient/patientInPatientService.dart'; +import 'core/service/patient_medical_file/prescription/prescriptions_service.dart'; +import 'core/service/patient_medical_file/radiology/radiology_service.dart'; +import 'core/service/patient/referral_patient_service.dart'; +import 'core/service/patient/referred_patient_service.dart'; +import 'core/service/home/schedule_service.dart'; import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart'; diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index fbba6360..a8e9dddc 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/core/service/auth_service.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/auth_service.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 36f86c85..5af5540f 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 3ce5c1be..34497b4f 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -3,7 +3,7 @@ import 'dart:math'; import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 7d41b3cb..f2ea0f23 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -75,8 +75,7 @@ class _PatientInPatientScreenState extends State { Container( margin: EdgeInsets.all(16.0), child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchPatientName, + hintText: TranslationBase.of(context).searchPatientName, isTextFieldHasSuffix: true, suffixIcon: IconButton( icon: Icon( @@ -101,72 +100,94 @@ class _PatientInPatientScreenState extends State { // const SizedBox( // height: 16, // ), - ...List.generate(model.filteredInPatientItems.length, (index) { - if(_activeTab == 0) + ...List.generate( + model.filteredInPatientItems.length, (index) { + if (_activeTab == 0) return PatientCard( - patientInfo: model.filteredInPatientItems[index], + patientInfo: + model.filteredInPatientItems[index], patientType: "1", arrivalType: "1", isInpatient: true, - isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); + FocusScopeNode currentFocus = + FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model + .filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); }, ); - else if(model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID && _activeTab==1) + else if (model.filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID && + _activeTab == 1) return PatientCard( - patientInfo: model.filteredInPatientItems[index], + patientInfo: + model.filteredInPatientItems[index], patientType: "1", arrivalType: "1", isInpatient: true, - isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); + FocusScopeNode currentFocus = + FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model + .filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); }, ); - else return SizedBox(); + else + return SizedBox(); }), - SizedBox(height: 15,) + SizedBox( + height: 15, + ) ], ), ), ), ) : Expanded( - child: SingleChildScrollView( - child: Container( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable)), + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: + TranslationBase.of(context).noDataAvailable)), + ), ), - ), ], ), ), @@ -201,13 +222,11 @@ class _PatientInPatientScreenState extends State { if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - if (_activeTab==0) { - GifLoaderDialogUtils.showMyDialog( - context); + if (_activeTab == 0) { + GifLoaderDialogUtils.showMyDialog(context); await model.getInPatientList(requestModel, - isMyInpatient: _activeTab == 1, isFirstTime: false); - GifLoaderDialogUtils.hideDialog( - context); + isMyInpatient: _activeTab == 1, isFirstTime: false); + GifLoaderDialogUtils.hideDialog(context); } }, child: Center( diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index 0b664d4b..e27b3033 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/DischargeReferralPatient.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -13,12 +13,12 @@ import 'package:flutter/material.dart'; import '../../routes.dart'; - - class ReferralDischargedPatientDetails extends StatelessWidget { final DischargeReferralPatient referredPatient; - ReferralDischargedPatientDetails(this.referredPatient,); + ReferralDischargedPatientDetails( + this.referredPatient, + ); @override Widget build(BuildContext context) { @@ -68,16 +68,19 @@ class ReferralDischargedPatientDetails extends StatelessWidget { InkWell( onTap: () { PatiantInformtion patient = - model.getPatientFromDischargeReferralPatient(referredPatient); + model.getPatientFromDischargeReferralPatient( + referredPatient); Navigator.of(context) .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", - "isDischargedPatient":true, - "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "isDischargedPatient": true, + "from": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -87,7 +90,6 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ) ]), ), - Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -124,7 +126,9 @@ class ReferralDischargedPatientDetails extends StatelessWidget { : Colors.red[700], ), AppText( - DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), + DateUtils.getDayMonthYearDateFormatted( + referredPatient.referralDate, + ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -132,7 +136,6 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ) ], ), - Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -152,7 +155,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -177,7 +180,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -196,11 +199,11 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - "${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays+1}", + "${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -223,20 +226,19 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), ], ), - Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ AppText( TranslationBase.of(context) @@ -244,7 +246,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: - 1.7 * SizeConfig.textMultiplier, + 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( @@ -252,17 +254,16 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), - ], ), Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( @@ -270,7 +271,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { children: [ Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", @@ -293,13 +294,13 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ AppText( TranslationBase.of(context) - .frequency + + .frequency + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -343,13 +344,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), ], ), - Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -363,11 +363,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - referredPatient.referringClinicDescription, + referredPatient + .referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -390,13 +391,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), ], ), - Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -414,15 +414,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), ], ), - - - Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -462,40 +459,40 @@ class ReferralDischargedPatientDetails extends StatelessWidget { width: 30, ), ), - //TODO from backend - // Container( - // margin: EdgeInsets.only( - // left: 0, - // top: 25, - // right: 0, - // bottom: 0), - // padding: EdgeInsets.only( - // left: 4.0, right: 4.0), - // child: referredPatient.doctorImageURL != - // null - // ? ClipRRect( - // borderRadius: - // BorderRadius.circular(20.0), - // child: Image.network( - // referredPatient.doctorImageURL, - // height: 25, - // width: 30, - // errorBuilder: - // (BuildContext context, - // Object exception, - // StackTrace stackTrace) { - // return Text('No Image'); - // }, - // )) - // : Container( - // child: Image.asset( - // referredPatient.gender == 1 - // ? 'assets/images/male_avatar.png' - // : 'assets/images/female_avatar.png', - // fit: BoxFit.cover, - // ), - // ), - // ), + //TODO from backend + // Container( + // margin: EdgeInsets.only( + // left: 0, + // top: 25, + // right: 0, + // bottom: 0), + // padding: EdgeInsets.only( + // left: 4.0, right: 4.0), + // child: referredPatient.doctorImageURL != + // null + // ? ClipRRect( + // borderRadius: + // BorderRadius.circular(20.0), + // child: Image.network( + // referredPatient.doctorImageURL, + // height: 25, + // width: 30, + // errorBuilder: + // (BuildContext context, + // Object exception, + // StackTrace stackTrace) { + // return Text('No Image'); + // }, + // )) + // : Container( + // child: Image.asset( + // referredPatient.gender == 1 + // ? 'assets/images/male_avatar.png' + // : 'assets/images/female_avatar.png', + // fit: BoxFit.cover, + // ), + // ), + // ), Expanded( flex: 4, child: Container( @@ -575,13 +572,11 @@ class ReferralDischargedPatientDetails extends StatelessWidget { SizedBox( height: 8, ), - ], ), ), ), ), - ], ), ), diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index e4f28ac7..0f64fcad 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -16,7 +16,6 @@ class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; - const FilterDatePage( {Key key, this.outPatientFilterType, this.patientSearchViewModel}) : super(key: key); @@ -34,19 +33,13 @@ class _FilterDatePageState extends State { @override Widget build(BuildContext context) { - var screenSize; return AppScaffold( isShowAppBar: false, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SingleChildScrollView( child: Container( - height: MediaQuery - .of(context) - .size - .height * 1.0, + height: MediaQuery.of(context).size.height * 1.0, child: Padding( padding: EdgeInsets.all(0.0), child: Column( @@ -54,7 +47,7 @@ class _FilterDatePageState extends State { children: [ BottomSheetTitle( title: (OutPatientFilterType.Previous == - widget.outPatientFilterType) + widget.outPatientFilterType) ? " Filter Previous Out Patient" : "Filter Nextweek Out Patient", ), @@ -69,24 +62,18 @@ class _FilterDatePageState extends State { Container( color: Colors.white, child: InkWell( - onTap: () => - selectDate( - context, firstDate: getFirstDate( - widget.outPatientFilterType), - lastDate: getLastDate( - widget.outPatientFilterType)), + onTap: () => selectDate(context, + firstDate: + getFirstDate(widget.outPatientFilterType), + lastDate: + getLastDate(widget.outPatientFilterType)), child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase - .of( - context) - .fromDate, - widget.patientSearchViewModel.selectedFromDate != null - ? "${DateUtils - .convertStringToDateFormat( - widget.patientSearchViewModel.selectedFromDate.toString(), - "yyyy-MM-dd")}" + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).fromDate, + widget.patientSearchViewModel + .selectedFromDate != + null + ? "${DateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( @@ -97,29 +84,25 @@ class _FilterDatePageState extends State { ), ), ), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), Container( color: Colors.white, child: InkWell( - onTap: () => - selectDate( - context, isFromDate: false, - firstDate: getFirstDate( - widget.outPatientFilterType), - lastDate: getLastDate( - widget.outPatientFilterType)), + onTap: () => selectDate(context, + isFromDate: false, + firstDate: + getFirstDate(widget.outPatientFilterType), + lastDate: + getLastDate(widget.outPatientFilterType)), child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase - .of( - context) - .toDate, - widget.patientSearchViewModel.selectedToDate != null - ? "${DateUtils - .convertStringToDateFormat( - widget.patientSearchViewModel.selectedToDate.toString(), - "yyyy-MM-dd")}" + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).toDate, + widget.patientSearchViewModel + .selectedToDate != + null + ? "${DateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( @@ -147,10 +130,7 @@ class _FilterDatePageState extends State { ), border: Border.all(color: HexColor('#707070'), width: 0), ), - height: MediaQuery - .of(context) - .size - .height * 0.1, + height: MediaQuery.of(context).size.height * 0.1, width: double.infinity, child: Column( children: [ @@ -162,10 +142,7 @@ class _FilterDatePageState extends State { widthFactor: .80, child: Center( child: AppButton( - title: - TranslationBase - .of(context) - .search, + title: TranslationBase.of(context).search, padding: 10, color: Color(0xFF359846), onPressed: () async { @@ -178,8 +155,8 @@ class _FilterDatePageState extends State { } else { Duration difference = widget .patientSearchViewModel.selectedToDate - .difference( - widget.patientSearchViewModel.selectedFromDate); + .difference(widget + .patientSearchViewModel.selectedFromDate); if (difference.inDays > 90) { Helpers.showErrorToast( "The difference between from date and end date must be less than 3 months"); @@ -219,8 +196,7 @@ class _FilterDatePageState extends State { ), ], ), - ) - ); + )); } selectDate(BuildContext context, @@ -241,9 +217,9 @@ class _FilterDatePageState extends State { setState(() { this.widget.patientSearchViewModel.selectedFromDate = picked; var date = picked.add(Duration(days: 30)); - if(date.isBefore(lastDate)){ + if (date.isBefore(lastDate)) { this.widget.patientSearchViewModel.selectedToDate = date; - }else + } else this.widget.patientSearchViewModel.selectedToDate = lastDate; }); } else { @@ -257,43 +233,25 @@ class _FilterDatePageState extends State { getFirstDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { return DateTime( - DateTime - .now() - .year -20, DateTime - .now() - .month, DateTime - .now() - .day); + DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); } else { return DateTime( - DateTime - .now() - .year, DateTime - .now() - .month, DateTime - .now() - .day + 1); + DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); } } getLastDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day-1); + return DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); } else { return DateTime( - DateTime - .now() - .year, DateTime - .now() - .month, DateTime - .now() - .day + 7); + DateTime.now().year, DateTime.now().month, DateTime.now().day + 7); } } - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown, + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( @@ -311,11 +269,11 @@ class _FilterDatePageState extends State { hintText: selectedText != null ? selectedText : hintText, suffixIcon: isDropDown ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.keyboard_arrow_down_sharp, - color: Color(0xff2E303A), - ) + ? suffixIcon + : Icon( + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), + ) : null, hintStyle: TextStyle( fontSize: 13, diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 4d0ce94a..eb6f5909 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -40,18 +40,19 @@ class OutPatientsScreen extends StatefulWidget { final bool isSearchAndOut; final String searchKey; - OutPatientsScreen( {this.patientSearchForm, - this.selectedType, - this.isAppbar = true, - this.arrivalType, - this.isView, - this.selectedPatientType, - this.patientSearchRequestModel, - this.isSearchWithKeyInfo = true, - this.isSearch = false, - this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); + this.selectedType, + this.isAppbar = true, + this.arrivalType, + this.isView, + this.selectedPatientType, + this.patientSearchRequestModel, + this.isSearchWithKeyInfo = true, + this.isSearch = false, + this.isInpatient = false, + this.searchKey, + this.isSearchAndOut = false}); @override _OutPatientsScreenState createState() => _OutPatientsScreenState(); @@ -80,20 +81,11 @@ class _OutPatientsScreenState extends State { Widget build(BuildContext context) { authProvider = Provider.of(context); _times = [ - TranslationBase - .of(context) - .previous, - TranslationBase - .of(context) - .today, - TranslationBase - .of(context) - .nextWeek, + TranslationBase.of(context).previous, + TranslationBase.of(context).today, + TranslationBase.of(context).nextWeek, ]; - final screenSize = MediaQuery - .of(context) - .size; - + final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { @@ -104,120 +96,124 @@ class _OutPatientsScreenState extends State { isShowAppBar: true, appBar: HeaderInSearch( title: "My Out patient", - ), baseViewModel: model, body: Column( children: [ - Container( - // color: Colors.red, - height: screenSize.height * 0.070, - decoration: TextFieldsUtils - .containerBorderDecoration( - Color(0Xffffffff), - Color(0xFFCCCCCC), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _times.map((item) { - bool _isActive = _times[_activeLocation] == item - ? true - : false; + Container( + // color: Colors.red, + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _times.map((item) { + bool _isActive = + _times[_activeLocation] == item ? true : false; - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeLocation = _times.indexOf(item); - outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==0?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; - _controller.text=""; - }); - model.searchData(""); - FocusScope.of(context).requestFocus(new FocusNode()); - GifLoaderDialogUtils.showMyDialog(context); - await model.getPatientBasedOnDate(item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget - .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeLocation = _times.indexOf(item); + outPatientFilterType = _activeLocation == 0 + ? OutPatientFilterType.Previous + : _activeLocation == 0 + ? OutPatientFilterType.Today + : OutPatientFilterType.NextWeek; + _controller.text = ""; + }); + model.searchData(""); + FocusScope.of(context).requestFocus(new FocusNode()); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate( + item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: + widget.patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: + TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive + ? Color(0xFFD02127) + : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive + ? Colors.white + : Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), ), ), ), - ); - }).toList(), - ), + ), + ); + }).toList(), ), - + ), SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, height: 75, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), + borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"), ), color: Colors.white), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only( - left: 10, top: 10), + padding: EdgeInsets.only(left: 10, top: 10), child: AppText( - TranslationBase.of( - context) - .searchPatientName, + TranslationBase.of(context).searchPatientName, fontSize: 13, )), AppTextFormField( - // focusNode: focusProject, + // focusNode: focusProject, controller: _controller, - borderColor: Colors.white - , + borderColor: Colors.white, prefix: IconButton( icon: Icon( - _activeLocation !=0 + _activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, color: Colors.black, ), iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - onPressed: _activeLocation !=0 ? null : () { - Navigator.push(context, MaterialPageRoute( - builder: (BuildContext context) => - FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); - }, + padding: EdgeInsets.only(bottom: 30), + onPressed: _activeLocation != 0 + ? null + : () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + FilterDatePage( + outPatientFilterType: + outPatientFilterType, + patientSearchViewModel: + model, + ))); + }, ), - onChanged: (String str) { model.searchData(str); }), @@ -225,58 +221,60 @@ class _OutPatientsScreenState extends State { SizedBox( height: 10.0, ), - Expanded( child: Container( child: model.filterData.isEmpty ? Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, - ), - ) - : ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.filterData.length, - itemBuilder: (BuildContext ctxt, int index) { - if(_activeLocation !=0 || (model.filterData[index].patientStatusType !=null && model.filterData[index].patientStatusType==43)) - return - Padding( - padding: EdgeInsets.all(8.0), - child: PatientCard( - patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, - isFromSearch:widget.isSearchAndOut, - isInpatient: widget.isInpatient, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget - .patientSearchRequestModel.from, - "to": widget - .patientSearchRequestModel.from, - "isSearch": false, - "isInpatient": false, - "arrivalType": "7", - "isSearchAndOut": false, - }); - }, - // isFromSearch: widget.isSearch, + child: ErrorMessage( + error: TranslationBase.of(context) + .youDontHaveAnyPatient, ), - ); - else - return SizedBox(); - })), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + if (_activeLocation != 0 || + (model.filterData[index].patientStatusType != + null && + model.filterData[index] + .patientStatusType == + 43)) + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: patientType, + arrivalType: arrivalType, + isFromSearch: widget.isSearchAndOut, + isInpatient: widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": false, + "isInpatient": false, + "arrivalType": "7", + "isSearchAndOut": false, + }); + }, + // isFromSearch: widget.isSearch, + ), + ); + else + return SizedBox(); + })), ), ], - ) - ), + )), ); } } diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index 5270511d..32166197 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -34,7 +34,7 @@ class _PatientSearchScreenNewState extends State { @override Widget build(BuildContext context) { - authProvider =Provider.of(context); + authProvider = Provider.of(context); return BaseView( onModelReady: (model) async {}, builder: (_, model, w) => AppScaffold( @@ -109,23 +109,23 @@ class _PatientSearchScreenNewState extends State { isTextFieldHasSuffix: false, maxLines: 1, minLines: 1, - inputType:TextInputType.number, + inputType: TextInputType.number, hasBorder: true, controller: patientFileInfoController, inputFormatters: [ FilteringTextInputFormatter.allow( RegExp(ONLY_NUMBERS)) ], - onChanged: (_){}, - validationError: (isFormSubmitted && ( - patientFileInfoController + onChanged: (_) {}, + validationError: (isFormSubmitted && + (patientFileInfoController .text.isEmpty && - firstNameInfoController - .text.isEmpty && - middleNameInfoController - .text.isEmpty && - lastNameFileInfoController - .text.isEmpty)) + firstNameInfoController + .text.isEmpty && + middleNameInfoController + .text.isEmpty && + lastNameFileInfoController + .text.isEmpty)) ? TranslationBase.of(context).emptyMessage : null, ), @@ -260,11 +260,21 @@ class _PatientSearchScreenNewState extends State { isFormSubmitted = true; }); PatientSearchRequestModel patientSearchRequestModel = - PatientSearchRequestModel(doctorID: authProvider.doctorProfile.doctorID); + PatientSearchRequestModel( + doctorID: authProvider.doctorProfile.doctorID); if (showOther) { - patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim(); - patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim(); - patientSearchRequestModel.lastName = lastNameFileInfoController.text.isEmpty?"0":lastNameFileInfoController.text.trim(); + patientSearchRequestModel.firstName = + firstNameInfoController.text.trim().isEmpty + ? "0" + : firstNameInfoController.text.trim(); + patientSearchRequestModel.middleName = + middleNameInfoController.text.trim().isEmpty + ? "0" + : middleNameInfoController.text.trim(); + patientSearchRequestModel.lastName = + lastNameFileInfoController.text.isEmpty + ? "0" + : lastNameFileInfoController.text.trim(); } if (patientFileInfoController.text.isNotEmpty) { @@ -307,7 +317,7 @@ class _PatientSearchScreenNewState extends State { isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, - isSearchAndOut:true, + isSearchAndOut: true, searchKey: patientFileInfoController.text, isInpatient: false, ), diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 7074bda9..b997bbdd 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -36,7 +36,6 @@ class PatientsScreenNew extends StatefulWidget { final bool isSearchAndOut; final String searchKey; - PatientsScreenNew( {this.patientSearchForm, this.selectedType, @@ -47,7 +46,9 @@ class PatientsScreenNew extends StatefulWidget { this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, - this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); + this.isInpatient = false, + this.searchKey, + this.isSearchAndOut = false}); @override _PatientsScreenNewState createState() => _PatientsScreenNewState(); @@ -70,7 +71,6 @@ class _PatientsScreenNewState extends State { PatientModel patient; - @override Widget build(BuildContext context) { authProvider = Provider.of(context); @@ -81,134 +81,130 @@ class _PatientsScreenNewState extends State { ]; final screenSize = MediaQuery.of(context).size; - return BaseView( onModelReady: (model) async { - if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { + if (!widget.isSearchWithKeyInfo && + widget.selectedPatientType == PatientType.OutPatient) { await model.getOutPatient(widget.patientSearchRequestModel); - } else { - await model.getPatientFileInformation(widget.patientSearchRequestModel); - + await model + .getPatientFileInformation(widget.patientSearchRequestModel); } }, builder: (_, model, w) => AppScaffold( - appBarTitle: "Search Patient", - isShowAppBar: true, - appBar: !widget.isSearch && !widget.isInpatient?HeaderInSearch( - title: "My Out patient", - ):HeaderInSearch( - title: "Search for ${widget.searchKey}", - ), - baseViewModel: model, - body: Column( - children: [ - if(!widget.isInpatient && !widget.isSearch) - Container( - // color: Colors.red, - height: screenSize.height * 0.070, - decoration: TextFieldsUtils - .containerBorderDecoration( - Color(0Xffffffff), - Color(0xFFCCCCCC), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item - ? true - : false; - - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeLocation = _locations.indexOf(item); - }); - GifLoaderDialogUtils.showMyDialog(context); - await model.getPatientBasedOnDate(item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget - .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, + appBarTitle: "Search Patient", + isShowAppBar: true, + appBar: !widget.isSearch && !widget.isInpatient + ? HeaderInSearch( + title: "My Out patient", + ) + : HeaderInSearch( + title: "Search for ${widget.searchKey}", + ), + baseViewModel: model, + body: Column( + children: [ + if (!widget.isInpatient && !widget.isSearch) + Container( + // color: Colors.red, + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = + _locations[_activeLocation] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate( + item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: + widget.patientSearchRequestModel, + isSearchWithKeyInfo: + widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: + TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive + ? Color(0xFFD02127) + : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive + ? Colors.white + : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), ), ), ), ), - ), - ); - }).toList(), + ); + }).toList(), + ), ), - ), - - SizedBox(height: 18.5), - Container( - width: SizeConfig.screenWidth * 0.9, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, top: 10), - child: AppText( - TranslationBase.of( - context) - .searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, + SizedBox(height: 18.5), + Container( + width: SizeConfig.screenWidth * 0.9, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), - SizedBox( - height: 10.0, - ), - Expanded( - child: Container( + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Expanded( + child: Container( child: model.filterData.isEmpty ? Center( child: ErrorMessage( @@ -227,8 +223,8 @@ class _PatientsScreenNewState extends State { patientInfo: model.filterData[index], patientType: patientType, arrivalType: arrivalType, - isFromSearch:widget.isSearchAndOut, - isInpatient: widget.isInpatient, + isFromSearch: widget.isSearchAndOut, + isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic Navigator.of(context).pushNamed( @@ -243,17 +239,17 @@ class _PatientsScreenNewState extends State { "isSearch": widget.isSearch, "isInpatient": widget.isInpatient, "arrivalType": "7", - "isSearchAndOut": widget.isSearchAndOut, + "isSearchAndOut": + widget.isSearchAndOut, }); }, - // isFromSearch: widget.isSearch, + // isFromSearch: widget.isSearch, ), ); })), ), - ], - ) - ), + ], + )), ); } } diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart index 0d376b02..a5f694e9 100644 --- a/lib/screens/patients/patient_search/time_bar.dart +++ b/lib/screens/patients/patient_search/time_bar.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -13,15 +13,18 @@ class TimeBar extends StatefulWidget { final PatientSearchRequestModel patientSearchRequestModel; final bool isSearchWithKeyInfo; - - const TimeBar({Key key, this.model, this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo}) : super(key: key); + const TimeBar( + {Key key, + this.model, + this.selectedPatientType, + this.patientSearchRequestModel, + this.isSearchWithKeyInfo}) + : super(key: key); @override _TimeBarState createState() => _TimeBarState(); } class _TimeBarState extends State { - - @override Widget build(BuildContext context) { List _locations = [ @@ -74,25 +77,30 @@ class _TimeBarState extends State { ), )), ), - onTap: () async{ + onTap: () async { setState(() { _activeLocation = _locations.indexOf(item); }); GifLoaderDialogUtils.showMyDialog(context); - await widget.model.getPatientBasedOnDate(item:item,selectedPatientType:widget.selectedPatientType, patientSearchRequestModel:widget.patientSearchRequestModel, isSearchWithKeyInfo:widget.isSearchWithKeyInfo); + await widget.model.getPatientBasedOnDate( + item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: + widget.patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); GifLoaderDialogUtils.hideDialog(context); }), _isActive ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(10), - topRight: Radius.circular(10)), - color: Colors.white), - alignment: Alignment.center, - height: 1, - width: SizeConfig.screenWidth * 0.23, - ) + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10), + topRight: Radius.circular(10)), + color: Colors.white), + alignment: Alignment.center, + height: 1, + width: SizeConfig.screenWidth * 0.23, + ) : Container() ]); }).toList(), diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 16486b49..7db245fe 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/prescription_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index fd5ec6bb..afc5b8b4 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -19,7 +19,6 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; - class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; @@ -33,8 +32,8 @@ class AddReplayOnReferralPatient extends StatefulWidget { _AddReplayOnReferralPatientState(); } -class _AddReplayOnReferralPatientState extends State { - +class _AddReplayOnReferralPatientState + extends State { bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; @@ -46,7 +45,6 @@ class _AddReplayOnReferralPatientState extends State super.initState(); } - @override Widget build(BuildContext context) { return AppScaffold( @@ -84,7 +82,7 @@ class _AddReplayOnReferralPatientState extends State : null, ), Positioned( - top: 0,//MediaQuery.of(context).size.height * 0, + top: 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( @@ -122,16 +120,21 @@ class _AddReplayOnReferralPatientState extends State }); if (progressNoteController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replay(progressNoteController.text.trim(), widget.myReferralInPatientModel); - if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientReferralViewModel.error); + await widget.patientReferralViewModel.replay( + progressNoteController.text.trim(), + widget.myReferralInPatientModel); + if (widget.patientReferralViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientReferralViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast("Your Replay Added Successfully"); + DrAppToastMsg.showSuccesToast( + "Your Replay Added Successfully"); Navigator.of(context).pop(); Navigator.of(context).pop(); } - }else { + } else { Helpers.showErrorToast("You can't add empty replay"); setState(() { isSubmitted = false; diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index cc2c7136..df2bbece 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -19,7 +19,8 @@ import 'AddReplayOnReferralPatient.dart'; class ReferralPatientDetailScreen extends StatelessWidget { final MyReferralPatientModel referredPatient; final PatientReferralViewModel patientReferralViewModel; - ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); + ReferralPatientDetailScreen( + this.referredPatient, this.patientReferralViewModel); @override Widget build(BuildContext context) { @@ -68,16 +69,18 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferralO(referredPatient); + PatiantInformtion patient = model + .getPatientFromReferralO(referredPatient); Navigator.of(context) .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "from": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -94,16 +97,18 @@ class ReferralPatientDetailScreen extends StatelessWidget { children: [ InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferralO(referredPatient); + PatiantInformtion patient = model + .getPatientFromReferralO(referredPatient); Navigator.of(context) .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "from": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), }); }, child: Padding( @@ -153,7 +158,9 @@ class ReferralPatientDetailScreen extends StatelessWidget { : Colors.red[700], ), AppText( - DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), + DateUtils.getDayMonthYearDateFormatted( + referredPatient.referralDate, + ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -189,7 +196,9 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), AppText( - DateUtils.getTimeHHMMA(referredPatient.referralDate,), + DateUtils.getTimeHHMMA( + referredPatient.referralDate, + ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -469,7 +478,6 @@ class ReferralPatientDetailScreen extends StatelessWidget { SizedBox( height: 8, ), - ], ), ), @@ -489,7 +497,12 @@ class ReferralPatientDetailScreen extends StatelessWidget { Navigator.push( context, SlideUpPageRoute( - widget: AddReplayOnReferralPatient(patientReferralViewModel: patientReferralViewModel,myReferralInPatientModel: referredPatient,),),); + widget: AddReplayOnReferralPatient( + patientReferralViewModel: patientReferralViewModel, + myReferralInPatientModel: referredPatient, + ), + ), + ); }, ), ), diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 667bbb4b..c7b54423 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -1,7 +1,7 @@ // ignore: must_be_immutable import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 07bf9d81..11e248af 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 378909ad..6cb4d70d 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -1,8 +1,8 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -664,7 +664,7 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: Helpers .textFieldSelectorDecoration( - DateUtils.getDateFormatted( + DateUtils.getDateFormatted( DateTime.parse( widget.startDate)), selectedDate != null diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 6ee37745..fbc2e516 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; @@ -190,9 +190,10 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils - .convertStringToDate( - item.startDate)), + DateUtils.getDayMonthYearDateFormatted( + DateUtils + .convertStringToDate( + item.startDate)), fontWeight: FontWeight.bold, ), @@ -209,8 +210,10 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils - .convertStringToDate( + DateUtils + .getDayMonthYearDateFormatted( + DateUtils + .convertStringToDate( item.endDate, )), fontWeight: diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 48d93f54..e393c11a 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -1,7 +1,7 @@ import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/core/model/imei_details.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/imei_details.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index fca0d689..0c34e67d 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -77,7 +77,7 @@ class SMSOTP { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(13), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ From 916c1266caaf9815d9328e2814a65469ca1bf59e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 4 May 2021 11:40:14 +0300 Subject: [PATCH 03/31] refactoring home screen --- lib/core/viewModel/dashboard_view_model.dart | 28 +++- .../home/dashboard_slider-item-widget.dart | 37 +++++ lib/screens/home/home_screen.dart | 157 +++--------------- 3 files changed, 83 insertions(+), 139 deletions(-) create mode 100644 lib/screens/home/dashboard_slider-item-widget.dart diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index fede0793..7c6748a5 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -1,12 +1,18 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { DashboardService _dashboardService = locator(); - get dashboardItemsList => _dashboardService.dashboardItemsList; + + List get dashboardItemsList => + _dashboardService.dashboardItemsList; Future getDashboard() async { setState(ViewState.Busy); @@ -17,4 +23,24 @@ class DashboardViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future changeClinic(int clinicId, AuthViewModel authProvider) async { + setState(ViewState.BusyLocal); + await getDoctorProfile(); + ProfileReqModel docInfo = new ProfileReqModel( + doctorID: doctorProfile.doctorID, + clinicID: clinicId, + license: true, + projectID: doctorProfile.projectID, + tokenID: '', + languageID: 2); + + await authProvider.getDocProfiles(docInfo.toJson()).then((res) async { + sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); + setState(ViewState.Idle); + }).catchError((err) { + error = err; + setState(ViewState.ErrorLocal); + }); + } } diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart new file mode 100644 index 00000000..9a42b4b6 --- /dev/null +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -0,0 +1,37 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class DashboardSliderItemWidget extends StatelessWidget { + final DashboardModel item; + + DashboardSliderItemWidget(this.item); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + item.kPIName, + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.bold, + ), + ], + ), + new Container( + height: 130, + child: new ListView( + scrollDirection: Axis.horizontal, + children: + new List.generate(item.summaryoptions.length, (int index) { + return GetActivityButton(item.summaryoptions[index]); + }))) + ], + ); + } +} diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 76dba1cf..a858660b 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; @@ -14,6 +15,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; @@ -24,6 +26,7 @@ import 'package:doctor_app_flutter/screens/patients/patient_search/patient_searc import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; @@ -34,6 +37,7 @@ import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.d import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; @@ -47,7 +51,6 @@ import '../../widgets/shared/rounded_container_widget.dart'; import 'home_page_card.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); -Helpers helpers = Helpers(); class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); @@ -72,7 +75,6 @@ class _HomeScreenState extends State { var clinicName = []; int sliderActiveIndex = 0; var clinicId; - var _patientSearchFormValues; void didChangeDependencies() async { super.didChangeDependencies(); @@ -105,6 +107,7 @@ class _HomeScreenState extends State { } BuildContext myContext; + @override Widget build(BuildContext context) { myContext = context; @@ -143,7 +146,6 @@ class _HomeScreenState extends State { children: [ Container( width: MediaQuery.of(context).size.width * .6, - // // height: 100, child: projectsProvider.doctorClinicsList.length > 0 ? Stack( @@ -210,10 +212,15 @@ class _HomeScreenState extends State { ); }).toList(); }, - onChanged: (newValue) { + onChanged: (newValue) async { clinicId = newValue; - changeClinic( - newValue, context, model); + GifLoaderDialogUtils.showMyDialog( + context); + await model.changeClinic(newValue, authProvider); + GifLoaderDialogUtils + .hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error);} }, items: projectsProvider .doctorClinicsList @@ -309,111 +316,13 @@ class _HomeScreenState extends State { height: 10, ), sliderActiveIndex == 1 - ? Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - model.dashboardItemsList[3] - .kPIName, - fontSize: - SizeConfig.textMultiplier * - 2.2, - fontWeight: FontWeight.bold, - ), - ], - ), - new Container( - height: 130, - child: new ListView( - scrollDirection: - Axis.horizontal, - children: new List.generate( - model - .dashboardItemsList[3] - .summaryoptions - .length, (int index) { - return GetActivityButton(model - .dashboardItemsList[3] - .summaryoptions[index]); - }))) - ], - ) + ? DashboardSliderItemWidget( + model.dashboardItemsList[3]) : sliderActiveIndex == 0 - ? Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - model.dashboardItemsList[6] - .kPIName, - fontSize: SizeConfig - .textMultiplier * - 2.2, - fontWeight: FontWeight.bold, - ), - ], - ), - new Container( - height: 130, - child: new ListView( - scrollDirection: Axis - .horizontal, - children: new List - .generate( - model - .dashboardItemsList[ - 6] - .summaryoptions - .length, - (int index) { - return GetActivityButton(model - .dashboardItemsList[ - 6] - .summaryoptions[index]); - }))) - ], - ) - : Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - model.dashboardItemsList[4] - .kPIName, - fontSize: SizeConfig - .textMultiplier * - 2.2, - fontWeight: FontWeight.bold, - ), - ], - ), - new Container( - height: 130, - child: new ListView( - scrollDirection: Axis - .horizontal, - children: new List - .generate( - model - .dashboardItemsList[ - 4] - .summaryoptions - .length, - (int index) { - return GetActivityButton(model - .dashboardItemsList[ - 4] - .summaryoptions[index]); - }))) - ], - ), + ? DashboardSliderItemWidget( + model.dashboardItemsList[6]) + : DashboardSliderItemWidget( + model.dashboardItemsList[4]), ]))) : SizedBox(), FractionallySizedBox( @@ -810,7 +719,6 @@ class _HomeScreenState extends State { } changeClinic(clinicId, BuildContext context, model) async { - // Navigator.pop(context); changeIsLoading(true); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); @@ -960,31 +868,4 @@ class _HomeScreenState extends State { ])), ]; } - - getRequestHeader(isInpatient) { - _patientSearchFormValues = PatientModel( - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - From: isInpatient == true - ? '0' - : DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - To: isInpatient == true - ? '0' - : DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 1.2, - Channel: 9, - TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - PatientOutSA: false); - } } From 0d867592452375d67b57908d0572507e6d1b7fc4 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 4 May 2021 16:11:48 +0300 Subject: [PATCH 04/31] working on dashboard re-factoring --- lib/core/viewModel/dashboard_view_model.dart | 34 ++ lib/screens/home/dashboard_swipe_widget.dart | 234 +++++++++++ lib/screens/home/home_screen.dart | 404 +++---------------- lib/widgets/dashboard/out_patient_stack.dart | 10 +- lib/widgets/dashboard/row_count.dart | 35 +- lib/widgets/shared/app_texts_widget.dart | 14 +- 6 files changed, 369 insertions(+), 362 deletions(-) create mode 100644 lib/screens/home/dashboard_swipe_widget.dart diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 7c6748a5..a12f3a87 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -1,19 +1,46 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; import '../../locator.dart'; import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { + + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); DashboardService _dashboardService = locator(); List get dashboardItemsList => _dashboardService.dashboardItemsList; + Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthViewModel authProvider) async{ + await projectsProvider.getDoctorClinicsList(); + + // _firebaseMessaging.setAutoInitEnabled(true); + _firebaseMessaging.requestNotificationPermissions( + const IosNotificationSettings( + sound: true, badge: true, alert: true, provisional: true)); + _firebaseMessaging.onIosSettingsRegistered + .listen((IosNotificationSettings settings) { + print("Settings registered: $settings"); + }); + + _firebaseMessaging.getToken().then((String token) async { + if (token != '') { + DEVICE_TOKEN = token; + var request = await sharedPref.getObj(DOCTOR_PROFILE); + authProvider.insertDeviceImei(request).then((value) { + }); + } + }); + } + Future getDashboard() async { setState(ViewState.Busy); await _dashboardService.getDashboard(); @@ -43,4 +70,11 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); }); } + + getPatientCount(DashboardModel inPatientCount) { + int value = 0; + inPatientCount.summaryoptions.forEach((result) => {value += result.value}); + + return value.toString(); + } } diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart new file mode 100644 index 00000000..8f8077d8 --- /dev/null +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -0,0 +1,234 @@ +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +class DashboardSwipeWidget extends StatefulWidget { + final List dashboardItemList; + final DashboardViewModel model; + final Function(int) sliderChange; + + DashboardSwipeWidget(this.dashboardItemList, this.model, this.sliderChange); + + @override + _DashboardSwipeWidgetState createState() => _DashboardSwipeWidgetState(); +} + +class _DashboardSwipeWidgetState extends State { + int sliderActiveIndex = 0; + + @override + Widget build(BuildContext context) { + return Swiper( + onIndexChanged: (index) { + if (mounted) { + setState(() { + sliderActiveIndex = index; + widget.sliderChange(index); + }); + } + }, + itemBuilder: (BuildContext context, int index) { + return getSwipeWidget(widget.dashboardItemList, index); + }, + itemCount: 3, + itemHeight: 300, + pagination: new SwiperCustomPagination( + builder: (BuildContext context, SwiperPluginConfig config) { + return new Stack( + alignment: Alignment.bottomCenter, + children: [ + Positioned( + bottom: 0, + child: Center( + child: InkWell( + onTap: () {}, + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + config.activeIndex == 0 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 1 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 2 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + ], + ), + ), + ), + ), + ) + ], + ); + }), + viewportFraction: 0.9, + // scale: 0.9, + // control: new SwiperControl(), + ); + } + + Widget getSwipeWidget(List dashboardItemList, int index) { + if (index == 1) + return RoundedContainer( + height: MediaQuery.of(context).size.height * 0.35, + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: GetOutPatientStack(dashboardItemList[1]))); + if (index == 0) + return RoundedContainer( + height: MediaQuery.of(context).size.height * 0.35, + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: GetOutPatientStack(dashboardItemList[0]))); + if (index == 2) + return RoundedContainer( + height: MediaQuery.of(context).size.height * 0.35, + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Expanded( + flex: 1, + child: Row( + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Padding( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context) + .patients, + fontSize: 12, + fontWeight: FontWeight.bold, + fontHeight: 0.5,), + AppText(TranslationBase.of(context) + .referral, + fontSize: 22, + fontWeight: FontWeight.bold, + ), + ], + ))), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RowCounts( + dashboardItemList[2] + .summaryoptions[0] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[0] + .value, + Colors.black), + RowCounts( + dashboardItemList[2] + .summaryoptions[1] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[1] + .value, + Colors.grey), + RowCounts( + dashboardItemList[2] + .summaryoptions[2] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[2] + .value, + Colors.red), + ], + ), + ) + ], + )), + ), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + child: GaugeChart( + _createReferralData(widget.dashboardItemList))), + Positioned( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + widget.model + .getPatientCount(dashboardItemList[2]) + .toString(), + fontSize: 30, + fontWeight: FontWeight.bold, + ) + ], + ), + top: MediaQuery.of(context).size.height * 0.12, + left: 0, + right: 0) + ]), + ), + ], + )), + ])); + return Container(); + } + + static List> _createReferralData( + List dashboardItemList) { + final data = [ + new GaugeSegment( + dashboardItemList[2].summaryoptions[0].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[0].value), + charts.MaterialPalette.black), + new GaugeSegment( + dashboardItemList[2].summaryoptions[1].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[1].value), + charts.MaterialPalette.gray.shadeDefault), + new GaugeSegment( + dashboardItemList[2].summaryoptions[2].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[2].value), + charts.MaterialPalette.red.shadeDefault), + ]; + + return [ + new charts.Series( + id: 'Segments', + domainFn: (GaugeSegment segment, _) => segment.segment, + measureFn: (GaugeSegment segment, _) => segment.size, + data: data, + colorFn: (GaugeSegment segment, _) => segment.color, + ) + ]; + } + + static int getValue(value) { + return value == 0 ? 1 : value; + } +} diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index a858660b..dcf2980d 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,57 +1,33 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; +import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; -import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_result_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; -import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../widgets/shared/app_texts_widget.dart'; -import '../../widgets/shared/rounded_container_widget.dart'; import 'home_page_card.dart'; -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); @@ -63,65 +39,25 @@ class HomeScreen extends StatefulWidget { } class _HomeScreenState extends State { - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); - HospitalViewModel hospitalProvider; - AuthViewModel authProvider; - bool isLoading = false; - ProjectViewModel projectsProvider; - var _isInit = true; - DoctorProfileModel profile; bool isExpanded = false; bool isInpatient = false; - var clinicName = []; int sliderActiveIndex = 0; var clinicId; - void didChangeDependencies() async { - super.didChangeDependencies(); - if (_isInit) { - projectsProvider = Provider.of(context); - projectsProvider.getDoctorClinicsList(); - - // _firebaseMessaging.setAutoInitEnabled(true); - _firebaseMessaging.requestNotificationPermissions( - const IosNotificationSettings( - sound: true, badge: true, alert: true, provisional: true)); - _firebaseMessaging.onIosSettingsRegistered - .listen((IosNotificationSettings settings) { - print("Settings registered: $settings"); - }); - clinicName = await sharedPref.getObj(CLINIC_NAME); - print(clinicName); - _firebaseMessaging.getToken().then((String token) async { - if (token != '') { - DEVICE_TOKEN = token; - var request = await sharedPref.getObj(DOCTOR_PROFILE); - authProvider.insertDeviceImei(request).then((value) { - // print(value); - changeIsLoading(false); - }); - } - }); - } - _isInit = false; - } - - BuildContext myContext; - @override Widget build(BuildContext context) { - myContext = context; - hospitalProvider = Provider.of(context); - authProvider = Provider.of(context); - projectsProvider = Provider.of(context); + ProjectViewModel projectsProvider = Provider.of(context); + AuthViewModel authProvider = Provider.of(context); FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } return BaseView( - onModelReady: (model) => model.getDashboard(), + onModelReady: (model) async { + await model.setFirebaseNotification(projectsProvider, authProvider); + await model.getDashboard(); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, @@ -171,36 +107,49 @@ class _HomeScreenState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ - Container( - padding: EdgeInsets.all(2), - margin: EdgeInsets.all(2), - decoration: - new BoxDecoration( - color: Colors.red[800], - borderRadius: - BorderRadius.circular( - 20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - projectsProvider - .doctorClinicsList - .length - .toString(), - style: new TextStyle( - color: Colors.white, - fontSize: - projectsProvider - .isArabic - ? 10 - : 11, - ), - textAlign: - TextAlign.center, - ), + Column( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Container( + padding: + EdgeInsets.all(2), + margin: + EdgeInsets.all(2), + decoration: + new BoxDecoration( + color: + Colors.red[800], + borderRadius: + BorderRadius + .circular( + 20), + ), + constraints: + BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: Center( + child: AppText( + projectsProvider + .doctorClinicsList + .length + .toString(), + color: + Colors.white, + fontSize: + projectsProvider + .isArabic + ? 10 + : 11, + textAlign: + TextAlign + .center, + ), + )), + ], ), AppText(item.clinicName, fontSize: 12, @@ -216,11 +165,15 @@ class _HomeScreenState extends State { clinicId = newValue; GifLoaderDialogUtils.showMyDialog( context); - await model.changeClinic(newValue, authProvider); - GifLoaderDialogUtils - .hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error);} + await model.changeClinic( + newValue, authProvider); + GifLoaderDialogUtils.hideDialog( + context); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } }, items: projectsProvider .doctorClinicsList @@ -251,58 +204,14 @@ class _HomeScreenState extends State { Container( height: MediaQuery.of(context).size.height * 0.35, child: model.dashboardItemsList.length > 0 - ? new Swiper( - onIndexChanged: (index) { - if (mounted) { - setState(() { - sliderActiveIndex = index; - }); - } - }, - itemBuilder: (BuildContext context, int index) { - return getSwipeWidget(model)[index]; + ? DashboardSwipeWidget( + model.dashboardItemsList, + model, + (sliderIndex) { + setState(() { + sliderActiveIndex = sliderIndex; + }); }, - itemCount: 3, - itemHeight: 300, - pagination: new SwiperCustomPagination(builder: - (BuildContext context, - SwiperPluginConfig config) { - return new Stack( - alignment: Alignment.bottomCenter, - children: [ - Positioned( - bottom: 0, - child: Center( - child: InkWell( - onTap: () {}, - child: Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - config.activeIndex == 0 - ? SwiperRoundedPagination( - true) - : SwiperRoundedPagination( - false), - config.activeIndex == 1 - ? SwiperRoundedPagination( - true) - : SwiperRoundedPagination( - false), - config.activeIndex == 2 - ? SwiperRoundedPagination( - true) - : SwiperRoundedPagination( - false), - ], - ))))) - ]); - }), - viewportFraction: 0.9, - // scale: 0.9, - // control: new SwiperControl(), ) : SizedBox()), model.dashboardItemsList.length > 0 @@ -687,185 +596,4 @@ class _HomeScreenState extends State { ); } - static List> _createReferralData(model) { - final data = [ - new GaugeSegment( - model.dashboardItemsList[2].summaryoptions[0].kPIParameter, - getValue(model.dashboardItemsList[1].summaryoptions[0].value), - charts.MaterialPalette.black), - new GaugeSegment( - model.dashboardItemsList[2].summaryoptions[1].kPIParameter, - getValue(model.dashboardItemsList[1].summaryoptions[1].value), - charts.MaterialPalette.gray.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[2].summaryoptions[2].kPIParameter, - getValue(model.dashboardItemsList[1].summaryoptions[2].value), - charts.MaterialPalette.red.shadeDefault), - ]; - - return [ - new charts.Series( - id: 'Segments', - domainFn: (GaugeSegment segment, _) => segment.segment, - measureFn: (GaugeSegment segment, _) => segment.size, - data: data, - colorFn: (GaugeSegment segment, _) => segment.color, - ) - ]; - } - - static int getValue(value) { - return value == 0 ? 1 : value; - } - - changeClinic(clinicId, BuildContext context, model) async { - changeIsLoading(true); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ProfileReqModel docInfo = new ProfileReqModel( - doctorID: doctorProfile.doctorID, - clinicID: clinicId, - license: true, - projectID: doctorProfile.projectID, - tokenID: '', - languageID: 2); - authProvider.getDocProfiles(docInfo.toJson()).then((res) async { - changeIsLoading(false); - sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); - }).catchError((err) { - changeIsLoading(false); - Helpers.showErrorToast(err); - }); - } - - changeIsLoading(bool val) { - setState(() { - this.isLoading = val; - }); - } - - getPatientCount(DashboardModel inPatientCount) { - int value = 0; - inPatientCount.summaryoptions.forEach((result) => {value += result.value}); - - return value.toString(); - } - - List getSwipeWidget(model) { - return [ - RoundedContainer( - height: MediaQuery.of(context).size.height * 0.35, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(model.dashboardItemsList[1]))), - RoundedContainer( - height: MediaQuery.of(context).size.height * 0.35, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(model.dashboardItemsList[0]))), - RoundedContainer( - height: MediaQuery.of(context).size.height * 0.35, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: Row( - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 1, - child: Padding( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context) - .patients, - style: TextStyle( - fontSize: 12, - height: .5, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase.of(context) - .referral, - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins'), - ), - ], - ))), - Expanded( - flex: 2, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - RowCounts( - model.dashboardItemsList[2] - .summaryoptions[0].kPIParameter, - model.dashboardItemsList[2] - .summaryoptions[0].value, - Colors.black), - RowCounts( - model.dashboardItemsList[2] - .summaryoptions[1].kPIParameter, - model.dashboardItemsList[2] - .summaryoptions[1].value, - Colors.grey), - RowCounts( - model.dashboardItemsList[2] - .summaryoptions[2].kPIParameter, - model.dashboardItemsList[2] - .summaryoptions[2].value, - Colors.red), - ], - ), - ) - ], - ))), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - child: GaugeChart(_createReferralData(model))), - Positioned( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - getPatientCount(model.dashboardItemsList[2]) - .toString(), - fontSize: 30, - fontWeight: FontWeight.bold, - ) - ], - ), - top: MediaQuery.of(context).size.height * 0.12, - left: 0, - right: 0) - ]), - ), - ], - )), - ])), - ]; - } } diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index d5da97c6..c09e2757 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -31,7 +31,7 @@ class GetOutPatientStack extends StatelessWidget { Container( height: 150, margin: EdgeInsets.all(5), - width: 40, + width: 35, child: SizedBox(), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.red[50]), @@ -43,7 +43,7 @@ class GetOutPatientStack extends StatelessWidget { margin: EdgeInsets.all(5), padding: EdgeInsets.all(10), height: max != 0 ? (150 * value.value) / max : 0, - width: 40, + width: 35, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.red[300]))), @@ -55,12 +55,14 @@ class GetOutPatientStack extends StatelessWidget { quarterTurns: 1, child: Center( child: Align( - child: AppText( + child: FittedBox( + child: AppText( value.kPIParameter + ' (' + value.value.toString() + ') ', fontSize: 10, textAlign: TextAlign.center, fontWeight: FontWeight.bold, - )), + ), + )), ), )) ]); diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index c56613da..a42cccdf 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -8,31 +8,38 @@ class RowCounts extends StatelessWidget { RowCounts(this.name, this.count, this.c); @override Widget build(BuildContext context) { - return Row( - children: [ - dot(c), - Padding( - padding: EdgeInsets.only(top: 5, bottom: 5), + return Container( + padding: EdgeInsets.only(top: 5, bottom: 5), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + dot(c), + Expanded( child: Row( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - name, - color: Colors.black, - textAlign: TextAlign.center, - fontSize: 12, - textOverflow: TextOverflow.ellipsis, + Expanded( + child: AppText( + name, + color: Colors.black, + textAlign: TextAlign.start, // from TextAlign.center + fontSize: 12, + textOverflow: TextOverflow.ellipsis, + ), ), AppText( ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, - fontSize: 14, + fontSize: 13, fontWeight: FontWeight.bold, ) ], - )), - ], + ), + ), + ], + ), ); } diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 74acff8a..48661a32 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -9,6 +9,7 @@ class AppText extends StatefulWidget { final Color color; final FontWeight fontWeight; final double fontSize; + final double fontHeight; final String fontFamily; final int maxLength; final bool italic; @@ -35,6 +36,7 @@ class AppText extends StatefulWidget { this.fontWeight, this.variant, this.fontSize, + this.fontHeight, this.fontFamily = 'Poppins', this.italic = false, this.maxLength = 60, @@ -121,20 +123,20 @@ class _AppTextState extends State { style: widget.style != null ? _getFontStyle().copyWith( fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color , + color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), - ) + height: widget.fontHeight) : TextStyle( fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color != null - ? widget.color - : Colors.black, + color: + widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1.5 : null, fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', - decoration: widget.textDecoration), + decoration: widget.textDecoration, + height: widget.fontHeight), ), if (widget.readMore && text.length > widget.maxLength && hidden) Positioned( From 4ce9a3c5bffb4c660ff3a0bd102392dcadbb3822 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 5 May 2021 12:32:16 +0300 Subject: [PATCH 05/31] finish home-refactoring --- .../home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/home_page_card.dart | 6 +- lib/screens/home/home_patient_card.dart | 83 +++++ lib/screens/home/home_screen.dart | 323 ++++-------------- lib/widgets/dashboard/activity_button.dart | 8 +- 5 files changed, 149 insertions(+), 273 deletions(-) create mode 100644 lib/screens/home/home_patient_card.dart diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 9a42b4b6..4ee67daf 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -28,7 +28,7 @@ class DashboardSliderItemWidget extends StatelessWidget { child: new ListView( scrollDirection: Axis.horizontal, children: - new List.generate(item.summaryoptions.length, (int index) { + List.generate(item.summaryoptions.length, (int index) { return GetActivityButton(item.summaryoptions[index]); }))) ], diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 2f85ff89..64b870b4 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -26,8 +26,8 @@ class HomePageCard extends StatelessWidget { child: Container( width: 100, height: MediaQuery.of(context).orientation == Orientation.portrait - ? 130 - : 250, + ? 100 + : 200, margin: this.margin, decoration: BoxDecoration( color: !hasBorder @@ -41,7 +41,7 @@ class HomePageCard extends StatelessWidget { : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: AssetImage('assets/images/dashboard/${imageName}'), + image: AssetImage('assets/images/dashboard/$imageName'), fit: BoxFit.cover, colorFilter: new ColorFilter.mode( Colors.black.withOpacity(0.2), BlendMode.dstIn), diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart new file mode 100644 index 00000000..c604fdd7 --- /dev/null +++ b/lib/screens/home/home_patient_card.dart @@ -0,0 +1,83 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/screens/home/home_page_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class HomePatientCard extends StatelessWidget { + final Color backgroundColor; + final IconData cardIcon; + final Color backgroundIconColor; + final String text; + final Color textColor; + final Function onTap; + + HomePatientCard({ + @required this.backgroundColor, + @required this.backgroundIconColor, + @required this.cardIcon, + @required this.text, + @required this.textColor, + @required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return HomePageCard( + color: backgroundColor, + margin: EdgeInsets.all(4), + child: Container( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Stack( + children: [ + Positioned( + bottom: 0.1, + right: 0.5, + width: 23.0, + height: 25.0, + child: Icon( + cardIcon, + size: 60, + color: backgroundIconColor, + ), + ), + Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Icon( + cardIcon, + size: 30, + color: textColor, + ), + SizedBox( + height: 4, + ), + ], + ), + ), + ], + ), + ), + Expanded( + child: Container( + child: AppText( + text, + color: textColor, + textAlign: TextAlign.start, + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ), + ), + ], + ), + ), + hasBorder: false, + onTap: onTap, + ); + } +} diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index dcf2980d..49f83a66 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; +import 'package:doctor_app_flutter/screens/home/home_patient_card.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; @@ -246,90 +247,44 @@ class _HomeScreenState extends State { margin: EdgeInsets.only(top: 10), child: Column( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 10, ), - Row( - children: [ - Container( - width: 150, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).patients, - style: TextStyle( - fontSize: 12, - height: .5, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase.of(context).services, - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins'), - ), - ], - )), + Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patients, + fontSize: 12, + fontWeight: FontWeight.bold, + fontHeight: .5, + ), + AppText( + TranslationBase.of(context).services, + fontSize: 22, + fontWeight: FontWeight.bold, + ), ], - ), + )), SizedBox( height: 10, ), - new Container( - height: 130, - child: new ListView( + Container( + height: 100, + child: ListView( scrollDirection: Axis.horizontal, children: [ - HomePageCard( - color: Color(0xffD02127), - margin: EdgeInsets.all(5), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Stack( - children: [ - Positioned( - bottom: 0.1, - right: 0.5, - width: 23.0, - height: 25.0, - child: Icon( - DoctorApp.inpatient, - size: 65, - color: Colors.white12, - ), - ), - Icon( - DoctorApp.inpatient, - size: 32, - color: Colors.white, - ), - ], - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .inPatient, - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 15, - )) - ], - ), - hasBorder: false, + HomePatientCard( + backgroundColor: Color(0xffD02127), + backgroundIconColor: Colors.white12, + cardIcon: DoctorApp.inpatient, + textColor: Colors.white, + text: + TranslationBase.of(context).inPatient, onTap: () { Navigator.push( context, @@ -339,51 +294,13 @@ class _HomeScreenState extends State { ); }, ), - HomePageCard( - color: Colors.grey[300], - margin: EdgeInsets.all(5), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Stack( - children: [ - Positioned( - bottom: 0.1, - right: 0.5, - width: 23.0, - height: 25.0, - child: Icon( - DoctorApp - .arrival_patients, - size: 65, - color: Colors.white38, - ), - ), - Icon( - DoctorApp.arrival_patients, - size: 35, - color: Colors.black, - ), - ], - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .myOutPatient, - color: Colors.black, - textAlign: TextAlign.start, - fontSize: 15, - )) - ], - ), - hasBorder: false, + HomePatientCard( + backgroundColor: Colors.grey[300], + backgroundIconColor: Colors.white38, + cardIcon: DoctorApp.arrival_patients, + textColor: Colors.black, + text: TranslationBase.of(context) + .myOutPatient, onTap: () { String date = DateUtils.convertDateToFormat( @@ -407,106 +324,30 @@ class _HomeScreenState extends State { )); }, ), - HomePageCard( - color: Color(0xff2B353E), - margin: EdgeInsets.all(5), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Stack( - children: [ - Positioned( - bottom: 0.1, - right: 0.5, - width: 23.0, - height: 25.0, - child: Icon( - DoctorApp.referral_1, - size: 65, - color: Colors.white10 - .withOpacity(0.1), - ), - ), - Icon( - DoctorApp.referral_1, - size: 35, - color: Colors.white, - ), - ], - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .patientsreferral, - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 15, - )) - ], - ), - hasBorder: false, + HomePatientCard( + backgroundColor: Color(0xff2B353E), + backgroundIconColor: Colors.white10, + cardIcon: DoctorApp.referral_1, + textColor: Colors.white, + text: TranslationBase.of(context) + .patientsreferral, onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => PatientReferralScreen(), - // MyReferredPatient(), ), ); }, ), - HomePageCard( - color: Color(0xffD02127), - margin: EdgeInsets.all(5), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Stack( - children: [ - Positioned( - bottom: 0.1, - right: 0.5, - width: 23.0, - height: 25.0, - child: Icon( - DoctorApp.search, - size: 65, - color: Colors.white10, - ), - ), - Icon( - DoctorApp.search, - size: 35, - color: Colors.white, - ), - ], - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .searchPatient, - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 13, - )) - ], - ), - hasBorder: false, + HomePatientCard( + backgroundColor: Color(0xffD02127), + backgroundIconColor: Colors.white10, + cardIcon: DoctorApp.search, + textColor: Colors.white, + text: TranslationBase.of(context) + .searchPatient, onTap: () { Navigator.push( context, @@ -516,51 +357,13 @@ class _HomeScreenState extends State { )); }, ), - HomePageCard( - color: Color(0xffC9C9C9), - margin: EdgeInsets.all(5), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Stack( - children: [ - Positioned( - bottom: 0.1, - right: 0.5, - width: 23.0, - height: 25.0, - child: Icon( - DoctorApp - .search_medicines, - color: Colors.black12, - size: 65, - ), - ), - Icon( - DoctorApp.search_medicines, - size: 40, - color: Color(0xff2B353E), - ), - ], - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .searchMedicine, - color: Color(0xff2B353E), - textAlign: TextAlign.start, - fontSize: 13, - )) - ], - ), - hasBorder: false, + HomePatientCard( + backgroundColor: Color(0xffC9C9C9), + backgroundIconColor: Colors.black12, + cardIcon: DoctorApp.search_medicines, + textColor: Color(0xff2B353E), + text: TranslationBase.of(context) + .searchMedicine, onTap: () { Navigator.push( context, @@ -569,17 +372,8 @@ class _HomeScreenState extends State { MedicineSearchScreen(), )); }, - ) + ), ])), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - width: 8, - ), - ], - ), SizedBox( height: 20, ), @@ -595,5 +389,4 @@ class _HomeScreenState extends State { ), ); } - } diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index 8258a1df..b925870f 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -17,17 +17,17 @@ class GetActivityButton extends StatelessWidget { ), child: Column( crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.all(10), + padding: EdgeInsets.all(8), child: AppText(value.value.toString(), - fontSize: 32, fontWeight: FontWeight.bold)), + fontSize: 28, fontWeight: FontWeight.bold)), Expanded( child: AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: 12, + fontSize: 10, textAlign: TextAlign.center, fontWeight: FontWeight.w600, ), From 4f817810c2c28b25322e20888027922d91fb835e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 5 May 2021 13:24:17 +0300 Subject: [PATCH 06/31] hot fix --- lib/config/localized_values.dart | 1 + lib/screens/home/home_screen.dart | 2 +- lib/util/translations_delegate_base.dart | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d09d33f4..fb01bfb1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -48,6 +48,7 @@ const Map> localizedValues = { 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'}, + 'myInPatient': {'en': 'My InPatients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 49f83a66..3a048f52 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -284,7 +284,7 @@ class _HomeScreenState extends State { cardIcon: DoctorApp.inpatient, textColor: Colors.white, text: - TranslationBase.of(context).inPatient, + TranslationBase.of(context).myInPatient, onTap: () { Navigator.push( context, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index ba69e104..bd9c68d9 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -100,6 +100,7 @@ class TranslationBase { String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; From 06706ad9a6cb332c056feaae239436485872f8d8 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 5 May 2021 13:32:47 +0300 Subject: [PATCH 07/31] Fix prescription item --- .../prescription_item_in_patient_page.dart | 182 ------------------ .../prescription/prescription_items_page.dart | 21 +- 2 files changed, 15 insertions(+), 188 deletions(-) diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index b29a2169..e79c1d8e 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -50,160 +50,6 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { child: Container( child: Column( children: [ - // if (!prescriptions.isInOutPatient) - // ...List.generate( - // model.prescriptionReportList.length, - // (index) => Container( - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white, - // ), - // margin: EdgeInsets.all(12), - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Container( - // margin: - // EdgeInsets.only(left: 18, right: 18), - // child: AppText( - // model.prescriptionReportList[index] - // .itemDescription.isNotEmpty - // ? model - // .prescriptionReportList[index] - // .itemDescription - // : model - // .prescriptionReportList[index] - // .itemDescriptionN, - // bold: true, - // )), - // SizedBox( - // height: 12, - // ), - // Row( - // children: [ - // SizedBox( - // width: 18, - // ), - // Container( - // decoration: BoxDecoration( - // shape: BoxShape.circle, - // border: Border.all( - // width: 0.5, - // color: Colors.grey)), - // height: 55, - // width: 55, - // child: InkWell( - // onTap: () { - // showDialog( - // context: context, - // child: ShowImageDialog( - // imageUrl: model - // .prescriptionReportEnhList[ - // index] - // .imageSRCUrl, - // )); - // }, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Image.network( - // model - // .prescriptionReportList[index] - // .imageSRCUrl, - // fit: BoxFit.cover, - // ), - // ), - // ), - // ), - // SizedBox( - // width: 10, - // ), - // Expanded( - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .route, - // color: Colors.grey, - // ), - // Expanded( - // child: AppText(" " + - // model - // .prescriptionReportList[ - // index] - // .routeN)), - // ], - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .frequency, - // color: Colors.grey, - // ), - // AppText(" " + - // model - // .prescriptionReportList[ - // index] - // .frequencyN ?? - // ''), - // ], - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .dailyDoses, - // color: Colors.grey, - // ), - // AppText(" " + - // model - // .prescriptionReportList[ - // index] - // .doseDailyQuantity ?? - // ''), - // ], - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .duration, - // color: Colors.grey, - // ), - // AppText(" " + - // model - // .prescriptionReportList[ - // index] - // .days - // .toString() ?? - // ''), - // ], - // ), - // SizedBox( - // height: 12, - // ), - // AppText(model - // .prescriptionReportList[ - // index] - // .remarks ?? - // ''), - // ], - // ), - // ) - // ], - // ) - // ], - // ), - // ), - // )) - // else - Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), @@ -233,34 +79,6 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { SizedBox( width: 18, ), - // Container( - // decoration: BoxDecoration( - // shape: BoxShape.circle, - // border: Border.all( - // width: 0.5, color: Colors.grey)), - // height: 55, - // width: 55, - // child: InkWell( - // onTap: () { - // showDialog( - // context: context, - // // child: ShowImageDialog( - // // imageUrl: model - // // .inPatientPrescription[index] - // // .imageSRCUrl, - // // ), - // ); - // }, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // // child: Image.network( - // // model.prescriptionReportEnhList[index] - // // .imageSRCUrl, - // // fit: BoxFit.cover, - // // ), - // ), - // ), - // ), SizedBox( width: 10, ), diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 06d9634c..832c583d 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_head import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/ShowImageDialog.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -169,13 +170,21 @@ class PrescriptionItemsPage extends StatelessWidget { ) ); }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, + child: Stack( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.network( + model.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, - ), + ), + ), + Positioned( + top: 10, + right: 10, + child: Icon(EvaIcons.search,color: Colors.grey,size: 35,)) + ], ), ), ), From f0039b491ee68249c133d760741e06fb1cf0e0df Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 5 May 2021 13:51:57 +0300 Subject: [PATCH 08/31] fix home page --- lib/core/viewModel/dashboard_view_model.dart | 1 + lib/screens/home/home_page_card.dart | 2 +- lib/screens/home/home_screen.dart | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index a12f3a87..faebd0c0 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -20,6 +20,7 @@ class DashboardViewModel extends BaseViewModel { _dashboardService.dashboardItemsList; Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthViewModel authProvider) async{ + setState(ViewState.Busy); await projectsProvider.getDoctorClinicsList(); // _firebaseMessaging.setAutoInitEnabled(true); diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 64b870b4..55919c25 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -24,7 +24,7 @@ class HomePageCard extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: 100, + width: 120, height: MediaQuery.of(context).orientation == Orientation.portrait ? 100 : 200, diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 3a048f52..acfa36b1 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -274,7 +274,7 @@ class _HomeScreenState extends State { height: 10, ), Container( - height: 100, + height: 120, child: ListView( scrollDirection: Axis.horizontal, children: [ From fa194f5e0050f8ef13a3f65cda6e7dd153763833 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 5 May 2021 14:11:26 +0300 Subject: [PATCH 09/31] hot fix --- lib/config/localized_values.dart | 2 +- lib/screens/home/home_page_card.dart | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index fb01bfb1..8a1c2e01 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -48,7 +48,7 @@ const Map> localizedValues = { 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'}, - 'myInPatient': {'en': 'My InPatients', 'ar': 'مرضاي'}, + 'myInPatient': {'en': 'My\nInPatients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 64b870b4..a2200fad 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -48,9 +48,7 @@ class HomePageCard extends StatelessWidget { ) : null, ), - child: Center( - child: child, - ), + child: child, ), ); } From aab7808468a7bc5d128af84ef0db1994328bd12b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 5 May 2021 14:48:22 +0300 Subject: [PATCH 10/31] add medical report page design --- .../medical_report/MedicalReportPage.dart | 125 +++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index f31c754e..6b85fa80 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -1,8 +1,131 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class MedicalReportPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Container(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + bool isInpatient = routeArgs['isInpatient']; + ProjectViewModel projectViewModel = Provider.of(context); + //TODO Jammal + return AppScaffold( + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + patient.patientType.toString() ?? '0', + patientType, + isInpatient: isInpatient, + ), + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Medical", + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + "Report", + bold: true, + fontSize: 22, + ), + ], + ), + ), + AddNewOrder( + onTap: () { + + }, + label: "Create New Medical Report", + ), + ...List.generate( + /*model.patientLabOrdersList.length,*/1, + (index) => CardWithBgWidget( + hasBorder: false, + bgColor: 0==0? Colors.red[700]:Colors.green[700], + widget: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText('On Hold',color: Colors.red,), + AppText( + "Jammal" ?? "", + fontSize: 15, + bold: true, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${DateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + '${DateUtils.getHour(DateTime.now())}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: LargeAvatar( + name: "Jammal", + url: null, + ), + width: 55, + height: 55, + ), + Expanded(child: AppText("")), + Icon( + EvaIcons.eye, + ) + ], + ), + ], + ), + ), + ) + ], + ), + ), + ); } } From 498e65180b1d937e7215981bc6e1ced1338b302f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 14:59:33 +0300 Subject: [PATCH 11/31] refactoring --- lib/landing_page.dart | 2 +- lib/screens/{ => qr_reader}/QR_reader_screen.dart | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename lib/screens/{ => qr_reader}/QR_reader_screen.dart (98%) diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 99e1694f..db43daa9 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/screens/QR_reader_screen.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/screens/qr_reader/QR_reader_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/home/home_screen.dart'; diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart similarity index 98% rename from lib/screens/QR_reader_screen.dart rename to lib/screens/qr_reader/QR_reader_screen.dart index 6b37efbe..57e6cc11 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -15,8 +15,8 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../routes.dart'; -import 'base/base_view.dart'; +import '../../routes.dart'; +import '../base/base_view.dart'; Helpers helpers = Helpers(); @@ -94,7 +94,7 @@ class _QrReaderScreenState extends State { height: 35, ), AppButton( - title : TranslationBase.of(context).scanQr, + title: TranslationBase.of(context).scanQr, onPressed: () { _scanQrAndGetPatient(context, model); }, From 2cf77bac85eec59e452c8ff79cfb509161db7955 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 5 May 2021 16:37:03 +0300 Subject: [PATCH 12/31] fit dashboard design --- lib/config/config.dart | 2 +- lib/widgets/dashboard/out_patient_stack.dart | 70 +++++++++++--------- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index b21ee8ed..ec8efe26 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -337,7 +337,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 = 5.9; +const VERSION_ID = 6.0; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index c09e2757..ad79b106 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -4,7 +4,9 @@ import 'package:flutter/material.dart'; class GetOutPatientStack extends StatelessWidget { final value; + GetOutPatientStack(this.value); + @override Widget build(BuildContext context) { value.summaryoptions @@ -27,44 +29,48 @@ class GetOutPatientStack extends StatelessWidget { } getStack(Summaryoptions value, max) { - return Stack(children: [ - Container( - height: 150, - margin: EdgeInsets.all(5), - width: 35, - child: SizedBox(), + return Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: Colors.red[50]), - ), - Positioned( - bottom: 0, - child: Container( + borderRadius: BorderRadius.circular(6), + color: Colors.red[50], + ), + child: Stack(children: [ + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Container( child: SizedBox(), - margin: EdgeInsets.all(5), padding: EdgeInsets.all(10), height: max != 0 ? (150 * value.value) / max : 0, - width: 35, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.red[300]))), - Container( - height: 150, - margin: EdgeInsets.only(left: 5, top: 5), - padding: EdgeInsets.all(10), - child: RotatedBox( - quarterTurns: 1, - child: Center( - child: Align( - child: FittedBox( - child: AppText( - value.kPIParameter + ' (' + value.value.toString() + ') ', - fontSize: 10, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, + borderRadius: BorderRadius.circular(6), + color: Color(0x63D02127), ), - )), ), - )) - ]); + ), + Container( + height: 150, + margin: EdgeInsets.only(left: 5, top: 5), + padding: EdgeInsets.all(10), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Align( + child: FittedBox( + child: AppText( + value.kPIParameter + ' (' + value.value.toString() + ') ', + fontSize: 10, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + ), + )), + ), + )) + ]), + ), + ); } } From 6107f88c16df45085c0d4ad5003752ed011cd6a5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 6 May 2021 13:37:30 +0300 Subject: [PATCH 13/31] prescription changes --- .../prescription/add_prescription_form.dart | 104 +++++------------- 1 file changed, 29 insertions(+), 75 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index cfb6263b..c295fd28 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -445,85 +445,39 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( - // height: MediaQuery.of(context) - // .size - // .height * - // 0.02, + color: Colors.white, width: MediaQuery.of(context) .size .width * 0.35, - child: AppTextFieldCustom( - isPrscription: true, - inputFormatters: [ - LengthLimitingTextInputFormatter( - 5), - // WhitelistingTextInputFormatter - // .digitsOnly - ], - hintText: - TranslationBase.of( - context) - .strength, - - // fontWeight: FontWeight.w500, - // fontSize: 14.0, - // borderWidth: 0.2, - - controller: - strengthController, - // keyboardType: TextInputType - // .numberWithOptions( - // decimal: true, - // ), - onChanged: (String value) { - setState(() { - strengthChar = - value.length; - }); - if (strengthChar >= 5) { - DrAppToastMsg - .showErrorToast( - TranslationBase.of( - context) - .only5DigitsAllowedForStrength, - ); - } - }, - // onClick: (_) { - // if (_selectedMedication != - // null && - // duration != null && - // frequency != null && - // strengthController - // .text != - // null) { - // model.getBoxQuantity( - // freq: frequency[ - // 'parameterCode'], - // duration: - // duration['id'], - // itemCode: - // _selectedMedication - // .itemId, - // strength: double.parse( - // strengthController - // .text)); - // box = model.boxQuintity; - // - // return; - // } - // }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, - ), + child: TextField( + decoration: + textFieldSelectorDecoration( + "", + 'Strength', //strengthController.text, + false), + enabled: true, + controller: + strengthController, + onChanged: + (String value) { + setState(() { + strengthChar = + value.length; + }); + if (strengthChar >= 5) { + DrAppToastMsg + .showErrorToast( + TranslationBase.of( + context) + .only5DigitsAllowedForStrength, + ); + } + }, + keyboardType: TextInputType + .numberWithOptions( + decimal: true, + )), ), SizedBox( width: 5.0, From 444afa464e11be639e2cc0652b6f0d7b76b504ee Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 6 May 2021 13:40:27 +0300 Subject: [PATCH 14/31] working on feature medical profile --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 3 + .../AddVerifyMedicalReport.dart | 186 ++++++++++++++++++ .../MedicalReportDetailPage.dart | 162 +++++++++++++++ lib/util/translations_delegate_base.dart | 6 +- 5 files changed, 356 insertions(+), 3 deletions(-) create mode 100644 lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart create mode 100644 lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index b21ee8ed..ec8efe26 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -337,7 +337,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 = 5.9; +const VERSION_ID = 6.0; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d09d33f4..71f37657 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -971,4 +971,7 @@ const Map> localizedValues = { "none": {"en": "None", "ar": "لا شيء"}, "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"}, "clearText": {"en": "Clear Text", "ar": "نص واضح"}, + "medicalReportAdd": {"en": "Add Medical Report", "ar": "إضافة تقرير طبي"}, + "medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"}, + "comments": {"en": "Comments", "ar": "تعليقات"}, }; diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart new file mode 100644 index 00000000..1b33aecb --- /dev/null +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -0,0 +1,186 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +class AddVerifyMedicalReport extends StatefulWidget { + final MedicalReportStatus status; + + AddVerifyMedicalReport(this.status); + + @override + _AddVerifyMedicalReportState createState() => _AddVerifyMedicalReportState(); +} + +class _AddVerifyMedicalReportState extends State { + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + + TextEditingController commentController = TextEditingController(); + String commentsError; + + @override + void initState() { + requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + initSpeechState().then((value) => {onVoiceText()}); + } + } + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: widget.status == MedicalReportStatus.ADD + ? TranslationBase.of(context).medicalReportAdd + : TranslationBase.of(context).medicalReportVerify, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + AppTextFieldCustom( + hintText: TranslationBase.of(context) + .sickLeaveComments, + controller: commentController, + maxLines: 30, + minLines: 20, + hasBorder: true, + validationError: commentsError, + ), + Positioned( + top: -2, + //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * + 0.75 + : 15, + child: Column( + children: [ + IconButton( + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), + onPressed: () { + initSpeechState().then( + (value) => {onVoiceText()}); + }, + ), + ], + )), + ], + ), + ], + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(16.0), + child: AppButton( + title: widget.status == MedicalReportStatus.ADD + ? TranslationBase.of(context).medicalReportAdd + : TranslationBase.of(context).medicalReportVerify, + color: Color(0xff359846), + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () { + setState(() { + if (commentController.text == "") { + commentsError = + TranslationBase.of(context).fieldRequired; + } else { + commentsError = null; + } + }); + }, + ), + ), + ], + ), + )); + } + + onVoiceText() async { + new SpeechToText(context: context).showAlertDialog(context); + var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; + bool available = await speech.initialize( + onStatus: statusListener, onError: errorListener); + if (available) { + speech.listen( + onResult: resultListener, + listenMode: stt.ListenMode.confirmation, + localeId: lang == 'en' ? 'en-US' : 'ar-SA', + ); + } else { + print("The user has denied the use of speech recognition."); + } + } + + void errorListener(SpeechRecognitionError error) { + event.setValue({"searchText": 'null'}); + //SpeechToText.closeAlertDialog(context); + print(error); + } + + void statusListener(String status) { + reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + } + + void requestPermissions() async { + Map statuses = await [ + Permission.microphone, + ].request(); + } + + void resultListener(result) { + reconizedWord = result.recognizedWords; + event.setValue({"searchText": reconizedWord}); + + if (result.finalResult == true) { + setState(() { + SpeechToText.closeAlertDialog(context); + speech.stop(); + commentController.text += reconizedWord + '\n'; + }); + } else { + print(result.finalResult); + } + } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } +} + +enum MedicalReportStatus { ADD, VERIFY } diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart new file mode 100644 index 00000000..76ce2951 --- /dev/null +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -0,0 +1,162 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class MedicalReportDetailPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + patientType, + arrivalType, + ), + body: Container( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).medical}", + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), + ), + AppText( + TranslationBase.of(context).report, + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), + ) + ], + ), + ), + Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide( + BorderSide( + color: Colors.white, + width: 1.0, + ), + ), + ), + child: Column( + children: [ + AppText( + TranslationBase.of(context).chiefComplaints, + fontWeight: FontWeight.w700, + fontSize: 2.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + AppText( + "chief complaints data", + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + SizedBox( + height: 8, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 30, + height: 30, + margin: EdgeInsets.only( + left: projectViewModel.isArabic ? 10 : 85, + right: projectViewModel.isArabic ? 85 : 10, + top: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border( + bottom: BorderSide( + color: Colors.grey[400], width: 2.5), + left: BorderSide( + color: Colors.grey[400], width: 2.5), + )), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: LargeAvatar( + name: "doctorName", + url: "doctor avatar", + ), + width: 25, + height: 25, + margin: EdgeInsets.only(top: 10), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + '${TranslationBase.of(context).dr}. replace with doctor name', + fontWeight: FontWeight.w800, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Colors.black, + ), + AppText( + 'replace clinic Description', + fontWeight: FontWeight.w700, + fontSize: 1.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index ba69e104..c95fbd2f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1008,8 +1008,7 @@ class TranslationBase { String get heart => localizedValues['heart'][locale.languageCode]; - String get medicalReport => - localizedValues['medicalReport'][locale.languageCode]; + String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; String get visitDate => localizedValues['visitDate'][locale.languageCode]; @@ -1329,6 +1328,9 @@ class TranslationBase { String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; String get clearText => localizedValues["clearText"][locale.languageCode]; + String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; + String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; + String get comments => localizedValues['comments'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From bc340693baab146305e87c7af11d86e35c6558e2 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 6 May 2021 14:12:32 +0300 Subject: [PATCH 15/31] project refactoring --- .../prescription/prescription_service.dart | 16 +- .../viewModel/PatientSearchViewModel.dart | 30 +- lib/core/viewModel/SOAP_view_model.dart | 7 +- lib/core/viewModel/medicine_view_model.dart | 7 +- .../viewModel/prescription_view_model.dart | 12 +- lib/screens/home/home_screen.dart | 7 +- .../patients/PatientsInPatientScreen.dart | 33 +- .../out_patient/out_patient_screen.dart | 352 +++++++++--------- .../patient_search_result_screen.dart | 125 +++---- .../referral/AddReplayOnReferralPatient.dart | 7 +- .../subjective/medication/add_medication.dart | 2 +- .../prescription/add_prescription_form.dart | 7 +- .../update_prescription_form.dart | 5 +- lib/screens/sick-leave/add-sickleave.dart | 27 +- 14 files changed, 321 insertions(+), 316 deletions(-) diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index 7df9d38b..daca52b9 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -1,12 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart'; + import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/item_by_medicine_request_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_req_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/search_drug_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/search_drug_request_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart'; + import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 418cae3a..c9dede3e 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -71,10 +71,11 @@ class PatientSearchViewModel extends BaseViewModel { } } - getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, + {bool isLocalBusy = false}) async { setState(ViewState.Busy); - await _outPatientService.getPatientFileInformation( - patientSearchRequestModel); + await _outPatientService + .getPatientFileInformation(patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error; setState(ViewState.Error); @@ -84,11 +85,12 @@ class PatientSearchViewModel extends BaseViewModel { } } - - - getPatientBasedOnDate ( - {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, - bool isSearchWithKeyInfo,OutPatientFilterType outPatientFilterType })async { + getPatientBasedOnDate( + {item, + PatientSearchRequestModel patientSearchRequestModel, + PatientType selectedPatientType, + bool isSearchWithKeyInfo, + OutPatientFilterType outPatientFilterType}) async { String dateTo; String dateFrom; if (OutPatientFilterType.Previous == outPatientFilterType) { @@ -128,11 +130,8 @@ class PatientSearchViewModel extends BaseViewModel { currentModel.to = dateTo; await getOutPatient(currentModel, isLocalBusy: true); filterData = _outPatientService.patientList; - } - - PatientInPatientService _inPatientService = locator(); @@ -146,7 +145,7 @@ class PatientSearchViewModel extends BaseViewModel { Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { await getDoctorProfile(); - setState(ViewState.Busy); + setState(ViewState.Busy); if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); @@ -163,12 +162,11 @@ class PatientSearchViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await getDoctorProfile(); filteredInPatientItems.clear(); - if (inPatientList.length > 0) - filteredInPatientItems.addAll(inPatientList); + if (inPatientList.length > 0) filteredInPatientItems.addAll(inPatientList); setState(ViewState.Idle); } - void clearPatientList(){ + void clearPatientList() { _inPatientService.inPatientList = []; _inPatientService.myInPatientList = []; } @@ -197,6 +195,4 @@ class PatientSearchViewModel extends BaseViewModel { notifyListeners(); } } - - } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index d73a6ab7..8b789cbc 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -1,8 +1,9 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/soap/SOAP_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart'; + import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index b57b2ad5..d49b8cc3 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -1,8 +1,9 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/medicine_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; + import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 2e959a3d..89c7c182 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -1,16 +1,18 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; + import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; + import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index ffb6d00b..fcb74718 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -3,7 +3,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; + import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; @@ -503,7 +504,9 @@ class _HomeScreenState extends State { Container( padding: EdgeInsets.all(10), child: AppText( - "My\n"+TranslationBase.of(context).inPatient, + "My\n" + + TranslationBase.of(context) + .inPatient, color: Colors.white, textAlign: TextAlign.start, fontSize: 15, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 796485da..cff3b8ee 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -16,8 +16,8 @@ class PatientInPatientScreen extends StatefulWidget { _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); } -class _PatientInPatientScreenState extends State with SingleTickerProviderStateMixin{ - +class _PatientInPatientScreenState extends State + with SingleTickerProviderStateMixin { TabController _tabController; int _activeTab = 0; @@ -85,7 +85,8 @@ class _PatientInPatientScreenState extends State with Si child: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( - preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( @@ -103,12 +104,18 @@ class _PatientInPatientScreenState extends State with Si indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ - tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), - tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), - tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), + tabWidget(screenSize, _activeTab == 0, + TranslationBase.of(context).inPatientAll, + counter: model.inPatientList.length), + tabWidget( + screenSize, _activeTab == 1, "My InPatients", + counter: model.myIinPatientList.length), + tabWidget(screenSize, _activeTab == 2, + TranslationBase.of(context).discharged), ], ), ), @@ -137,15 +144,13 @@ class _PatientInPatientScreenState extends State with Si ); } - Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}){ - + Widget tabWidget(Size screenSize, bool isActive, String title, + {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -164,9 +169,7 @@ class _PatientInPatientScreenState extends State with Si width: 15, height: 15, decoration: BoxDecoration( - color: isActive - ? Colors.white - : Color(0xFFD02127), + color: isActive ? Colors.white : Color(0xFFD02127), shape: BoxShape.circle, ), child: Center( diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 3968a2b6..c8b547b7 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,9 +1,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; + import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; + import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -42,18 +43,19 @@ class OutPatientsScreen extends StatefulWidget { final bool isSearchAndOut; final String searchKey; - OutPatientsScreen( {this.patientSearchForm, - this.selectedType, - this.isAppbar = true, - this.arrivalType, - this.isView, - this.selectedPatientType, - this.patientSearchRequestModel, - this.isSearchWithKeyInfo = true, - this.isSearch = false, - this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); + this.selectedType, + this.isAppbar = true, + this.arrivalType, + this.isView, + this.selectedPatientType, + this.patientSearchRequestModel, + this.isSearchWithKeyInfo = true, + this.isSearch = false, + this.isInpatient = false, + this.searchKey, + this.isSearchAndOut = false}); @override _OutPatientsScreenState createState() => _OutPatientsScreenState(); @@ -82,20 +84,11 @@ class _OutPatientsScreenState extends State { Widget build(BuildContext context) { authProvider = Provider.of(context); _times = [ - TranslationBase - .of(context) - .previous, - TranslationBase - .of(context) - .today, - TranslationBase - .of(context) - .nextWeek, + TranslationBase.of(context).previous, + TranslationBase.of(context).today, + TranslationBase.of(context).nextWeek, ]; - final screenSize = MediaQuery - .of(context) - .size; - + final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { @@ -106,148 +99,155 @@ class _OutPatientsScreenState extends State { isShowAppBar: true, appBar: PatientSearchHeader( title: "My Out patient", - ), baseViewModel: model, body: Column( children: [ Container( - // color: Colors.red, - height: screenSize.height * 0.070, - decoration: TextFieldsUtils - .containerBorderDecoration( - Color(0Xffffffff), - Color(0xFFCCCCCC), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _times.map((item) { - bool _isActive = _times[_activeLocation] == item - ? true - : false; + // color: Colors.red, + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _times.map((item) { + bool _isActive = + _times[_activeLocation] == item ? true : false; - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeLocation = _times.indexOf(item); - outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==1?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; - _controller.text=""; - }); - model.searchData(""); - FocusScope.of(context).requestFocus(new FocusNode()); - GifLoaderDialogUtils.showMyDialog(context); - await model.getPatientBasedOnDate(item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget - .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - _isActive&&_activeLocation!=0&&model.state == ViewState.Idle ?Container( - padding: EdgeInsets.all(2), - margin: EdgeInsets.symmetric(horizontal: 5), - decoration: - new BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.circular( - 50), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - model.filterData.length.toString(), - style: new TextStyle( - color: Colors.red, - fontSize: 10 - ), - textAlign: - TextAlign.center, - ), - ):Container(), - ], - ), + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeLocation = _times.indexOf(item); + outPatientFilterType = _activeLocation == 0 + ? OutPatientFilterType.Previous + : _activeLocation == 1 + ? OutPatientFilterType.Today + : OutPatientFilterType.NextWeek; + _controller.text = ""; + }); + model.searchData(""); + FocusScope.of(context).requestFocus(new FocusNode()); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate( + item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: + widget.patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo, + outPatientFilterType: outPatientFilterType); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: + TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive + ? Color(0xFFD02127) + : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive + ? Colors.white + : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + _isActive && + _activeLocation != 0 && + model.state == ViewState.Idle + ? Container( + padding: EdgeInsets.all(2), + margin: EdgeInsets.symmetric( + horizontal: 5), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.circular(50), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + model.filterData.length.toString(), + style: new TextStyle( + color: Colors.red, + fontSize: 10), + textAlign: TextAlign.center, + ), + ) + : Container(), + ], ), ), ), ), - ); - }).toList(), - ), + ), + ); + }).toList(), ), + ), SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, height: 75, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), + borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"), ), color: Colors.white), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only( - left: 10, top: 10), + padding: EdgeInsets.only(left: 10, top: 10), child: AppText( - TranslationBase.of( - context) - .searchPatientName, + TranslationBase.of(context).searchPatientName, fontSize: 13, )), AppTextFormField( - // focusNode: focusProject, + // focusNode: focusProject, controller: _controller, - borderColor: Colors.white - , + borderColor: Colors.white, prefix: IconButton( icon: Icon( - _activeLocation !=0 + _activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, color: Colors.black, ), iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - onPressed: _activeLocation !=0 ? null : () { - Navigator.push(context, MaterialPageRoute( - builder: (BuildContext context) => - FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); - }, + padding: EdgeInsets.only(bottom: 30), + onPressed: _activeLocation != 0 + ? null + : () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + FilterDatePage( + outPatientFilterType: + outPatientFilterType, + patientSearchViewModel: + model, + ))); + }, ), - onChanged: (String str) { model.searchData(str); }), @@ -255,58 +255,60 @@ class _OutPatientsScreenState extends State { SizedBox( height: 10.0, ), - Expanded( child: Container( child: model.filterData.isEmpty ? Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, - ), - ) - : ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.filterData.length, - itemBuilder: (BuildContext ctxt, int index) { - if(_activeLocation !=0 || (model.filterData[index].patientStatusType !=null && model.filterData[index].patientStatusType==43)) - return - Padding( - padding: EdgeInsets.all(8.0), - child: PatientCard( - patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, - isFromSearch:widget.isSearchAndOut, - isInpatient: widget.isInpatient, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget - .patientSearchRequestModel.from, - "to": widget - .patientSearchRequestModel.from, - "isSearch": false, - "isInpatient": false, - "arrivalType": "7", - "isSearchAndOut": false, - }); - }, - // isFromSearch: widget.isSearch, + child: ErrorMessage( + error: TranslationBase.of(context) + .youDontHaveAnyPatient, ), - ); - else - return SizedBox(); - })), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + if (_activeLocation != 0 || + (model.filterData[index].patientStatusType != + null && + model.filterData[index] + .patientStatusType == + 43)) + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: patientType, + arrivalType: arrivalType, + isFromSearch: widget.isSearchAndOut, + isInpatient: widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": false, + "isInpatient": false, + "arrivalType": "7", + "isSearchAndOut": false, + }); + }, + // isFromSearch: widget.isSearch, + ), + ); + else + return SizedBox(); + })), ), ], - ) - ), + )), ); } } diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index 9fd92aba..32e7627b 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -31,10 +31,8 @@ class PatientsSearchResultScreen extends StatefulWidget { final bool isSearchAndOut; final String searchKey; - PatientsSearchResultScreen( - { - this.selectedPatientType, + {this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, @@ -52,7 +50,6 @@ class _PatientsSearchResultScreenState int clinicId; AuthViewModel authProvider; - String patientType; String patientTypeTitle; var selectedFilter = 1; @@ -63,77 +60,69 @@ class _PatientsSearchResultScreenState PatientModel patient; - @override Widget build(BuildContext context) { authProvider = Provider.of(context); return BaseView( onModelReady: (model) async { - if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { + if (!widget.isSearchWithKeyInfo && + widget.selectedPatientType == PatientType.OutPatient) { await model.getOutPatient(widget.patientSearchRequestModel); - } else { - await model.getPatientFileInformation(widget.patientSearchRequestModel); - + await model + .getPatientFileInformation(widget.patientSearchRequestModel); } }, builder: (_, model, w) => AppScaffold( - appBarTitle: "Search Patient", - isShowAppBar: true, + appBarTitle: "Search Patient", + isShowAppBar: true, appBar: PatientSearchHeader( title: "Search for ${widget.searchKey}", ), - baseViewModel: model, - body: Column( - children: [ - SizedBox(height: 18.5), - Container( - width: SizeConfig.screenWidth * 0.9, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, top: 10), - child: AppText( - TranslationBase.of( - context) - .searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, + baseViewModel: model, + body: Column( + children: [ + SizedBox(height: 18.5), + Container( + width: SizeConfig.screenWidth * 0.9, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), - SizedBox( - height: 10.0, - ), - Expanded( - child: Container( + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Expanded( + child: Container( child: model.filterData.isEmpty ? Center( child: ErrorMessage( @@ -152,8 +141,8 @@ class _PatientsSearchResultScreenState patientInfo: model.filterData[index], patientType: patientType, arrivalType: arrivalType, - isFromSearch:widget.isSearchAndOut, - isInpatient: widget.isInpatient, + isFromSearch: widget.isSearchAndOut, + isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic Navigator.of(context).pushNamed( @@ -168,17 +157,17 @@ class _PatientsSearchResultScreenState "isSearch": widget.isSearch, "isInpatient": widget.isInpatient, "arrivalType": "7", - "isSearchAndOut": widget.isSearchAndOut, + "isSearchAndOut": + widget.isSearchAndOut, }); }, - // isFromSearch: widget.isSearch, + // isFromSearch: widget.isSearch, ), ); })), ), - ], - ) - ), + ], + )), ); } } diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 1cec9092..a2ea0ebb 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -32,8 +32,8 @@ class AddReplayOnReferralPatient extends StatefulWidget { _AddReplayOnReferralPatientState(); } -class _AddReplayOnReferralPatientState extends State { - +class _AddReplayOnReferralPatientState + extends State { bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; @@ -45,7 +45,6 @@ class _AddReplayOnReferralPatientState extends State super.initState(); } - @override Widget build(BuildContext context) { return AppScaffold( @@ -108,7 +107,7 @@ class _AddReplayOnReferralPatientState extends State ), ), bottomSheet: Container( - height: replayOnReferralController.text.isNotEmpty? 130:70, + height: replayOnReferralController.text.isNotEmpty ? 130 : 70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index c7b54423..69475926 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -1,7 +1,7 @@ // ignore: must_be_immutable import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 9282182a..aabf7b2f 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -2,9 +2,10 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; + import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 6cb4d70d..5d4c6a5b 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -1,8 +1,9 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; + import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 7f63f4d3..c7f6d993 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/sick_leave/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; + import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; @@ -50,11 +52,11 @@ class AddSickLeavScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(!projectsProvider.isArabic) - AppText( - TranslationBase.of(context).patient, - fontWeight: FontWeight.bold, - ), + if (!projectsProvider.isArabic) + AppText( + TranslationBase.of(context).patient, + fontWeight: FontWeight.bold, + ), AppText( TranslationBase.of(context).sickLeave, fontSize: 24, @@ -193,9 +195,10 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils - .convertStringToDate( - item.startDate)), + DateUtils.getDayMonthYearDateFormatted( + DateUtils + .convertStringToDate( + item.startDate)), fontWeight: FontWeight.bold, ), @@ -212,8 +215,10 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils - .convertStringToDate( + DateUtils + .getDayMonthYearDateFormatted( + DateUtils + .convertStringToDate( item.endDate, )), fontWeight: From 74ded739c8c7ff32996f1b8adc3354b9adada4e2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 6 May 2021 15:03:57 +0300 Subject: [PATCH 16/31] fix imports --- lib/core/service/home/auth_service.dart | 2 +- .../service/patient/DischargedPatientService.dart | 2 +- .../service/patient/MyReferralPatientService.dart | 2 +- lib/core/service/patient/PatientMuseService.dart | 2 +- lib/core/service/patient/ReferralService.dart | 2 +- lib/core/service/patient/out_patient_service.dart | 2 +- .../service/patient/patientInPatientService.dart | 2 +- .../insurance/InsuranceCardService.dart | 4 ++-- .../medical_report/medical_file_service.dart | 4 ++-- .../sick_leave/sickleave_service.dart | 5 ++--- .../ucaf/patient-ucaf-service.dart | 2 +- lib/core/viewModel/DischargedPatientViewModel.dart | 2 +- lib/core/viewModel/InsuranceViewModel.dart | 6 +++--- lib/core/viewModel/PatientMuseViewModel.dart | 4 ++-- lib/core/viewModel/PatientSearchViewModel.dart | 4 ++-- lib/core/viewModel/auth_view_model.dart | 4 ++-- lib/core/viewModel/dashboard_view_model.dart | 3 +-- lib/core/viewModel/doctor_replay_view_model.dart | 2 +- lib/core/viewModel/imei_view_model.dart | 4 ++-- lib/core/viewModel/labs_view_model.dart | 2 +- lib/core/viewModel/medical_file_view_model.dart | 4 ++-- .../patient-admission-request-viewmodel.dart | 2 +- lib/core/viewModel/patient-referral-viewmodel.dart | 12 ++++++------ lib/core/viewModel/patient-ucaf-viewmodel.dart | 4 ++-- .../viewModel/patient-vital-sign-viewmodel.dart | 2 +- lib/core/viewModel/patient_view_model.dart | 2 +- lib/core/viewModel/prescriptions_view_model.dart | 2 +- lib/core/viewModel/procedure_View_model.dart | 6 +++--- lib/core/viewModel/radiology_view_model.dart | 2 +- lib/core/viewModel/referral_view_model.dart | 2 +- lib/core/viewModel/referred_view_model.dart | 2 +- lib/core/viewModel/schedule_view_model.dart | 2 +- lib/core/viewModel/sick_leave_view_model.dart | 2 +- lib/landing_page.dart | 2 +- lib/locator.dart | 14 +++++++------- lib/screens/auth/login_screen.dart | 2 +- lib/screens/medicine/medicine_search_screen.dart | 2 +- lib/screens/patients/PatientsInPatientScreen.dart | 2 +- .../patients/ReferralDischargedPatientDetails.dart | 2 +- .../patients/out_patient/filter_date_page.dart | 2 +- .../patient_search_result_screen.dart | 2 +- .../patient_search/patient_search_screen.dart | 2 +- lib/screens/patients/patient_search/time_bar.dart | 2 +- .../patients/profile/UCAF/UCAF-detail-screen.dart | 2 +- .../referral/AddReplayOnReferralPatient.dart | 2 +- .../referral/referral_patient_detail_in-paint.dart | 2 +- lib/widgets/auth/verification_methods.dart | 2 +- pubspec.lock | 6 +++--- 48 files changed, 74 insertions(+), 76 deletions(-) diff --git a/lib/core/service/home/auth_service.dart b/lib/core/service/home/auth_service.dart index 1aa9a88e..b5435a59 100644 --- a/lib/core/service/home/auth_service.dart +++ b/lib/core/service/home/auth_service.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/imei_details.dart'; +import 'package:doctor_app_flutter/core/model/auth/imei_details.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart'; diff --git a/lib/core/service/patient/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart index a31837ad..2b353016 100644 --- a/lib/core/service/patient/DischargedPatientService.dart +++ b/lib/core/service/patient/DischargedPatientService.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/DischargeReferralPatient.dart'; +import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index ffa982b0..536e68a7 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; diff --git a/lib/core/service/patient/PatientMuseService.dart b/lib/core/service/patient/PatientMuseService.dart index 8c821104..c34de9e0 100644 --- a/lib/core/service/patient/PatientMuseService.dart +++ b/lib/core/service/patient/PatientMuseService.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientMuseResultsModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PatientMuseService extends BaseService { diff --git a/lib/core/service/patient/ReferralService.dart b/lib/core/service/patient/ReferralService.dart index 64f473d9..69e2a810 100644 --- a/lib/core/service/patient/ReferralService.dart +++ b/lib/core/service/patient/ReferralService.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/ReferralRequest.dart'; +import 'package:doctor_app_flutter/core/model/referral/ReferralRequest.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ReferralService extends BaseService { diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart index 339f6a93..004bb59f 100644 --- a/lib/core/service/patient/out_patient_service.dart +++ b/lib/core/service/patient/out_patient_service.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/service/patient/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart index 32de0ead..e0bc94a3 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 6bdf5f79..2bb9dac7 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/insurance_approval_request_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/insurance/insurance_approval.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/insurance/insurance_approval_in_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/insurance/insurance_approval.dart'; +import 'package:doctor_app_flutter/core/model/insurance/insurance_approval_in_patient_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart index d80b89fa..42cdafc6 100644 --- a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart +++ b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/medical_report/medical_file_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/medical_report/medical_file_request_model.dart'; +import 'package:doctor_app_flutter/core/model/medical_report/medical_file_model.dart'; +import 'package:doctor_app_flutter/core/model/medical_report/medical_file_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class MedicalFileService extends BaseService { diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index c16a2d31..8113c9a7 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -1,13 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/sick_leave/sick_leave_patient_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/sick_leave/sick_leave_patient_request_model.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -// import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; class SickLeaveService extends BaseService { Map get sickLeavestatisitics => _statistics; diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 478d48f3..db2deb13 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 6e130abe..9df347e2 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/DischargedPatientService.dart'; +import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index e41d68bd..46f48d35 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/insurance/insurance_approval.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/insurance/insurance_approval_in_patient_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart'; +import 'package:doctor_app_flutter/core/model/insurance/insurance_approval.dart'; +import 'package:doctor_app_flutter/core/model/insurance/insurance_approval_in_patient_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/insurance/InsuranceCardService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart index 68826e04..312d6ebb 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientMuseResultsModel.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/PatientMuseService.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsModel.dart'; +import 'package:doctor_app_flutter/core/service/patient/PatientMuseService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index c9dede3e..7a145fff 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/patientInPatientService.dart'; +import 'package:doctor_app_flutter/core/service/patient/patientInPatientService.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index 1b79b051..bb4fd305 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/imei_details.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/insert_imei_model.dart'; +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/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 178713c5..1205699b 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -1,6 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/dasboard_service.dart'; - +import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index e0c63a76..18f1a9f5 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/doctor_reply_service.dart'; +import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/imei_view_model.dart b/lib/core/viewModel/imei_view_model.dart index 63b26e98..f8c45762 100644 --- a/lib/core/viewModel/imei_view_model.dart +++ b/lib/core/viewModel/imei_view_model.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/imei_details.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/auth_service.dart'; +import 'package:doctor_app_flutter/core/model/auth/imei_details.dart'; +import 'package:doctor_app_flutter/core/service/home/auth_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart'; diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 071ebad6..e5a2f9f1 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/lab_order/labs_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 0e2c724f..08e8ce90 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/medical_report/medical_file_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart'; +import 'package:doctor_app_flutter/core/model/medical_report/medical_file_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/medical_report/medical_file_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 61334494..0868b601 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 67544e6f..a414c200 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/DischargeReferralPatient.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/MyReferralPatientModel.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/DischargedPatientService.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/MyReferralPatientService.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/ReferralService.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/patient-doctor-referral-service.dart'; +import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; +import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart'; +import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService.dart'; +import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart'; +import 'package:doctor_app_flutter/core/service/patient/patient-doctor-referral-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 301902a6..cada20f6 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index bb8367a6..98b45c41 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index ce34e566..de40afde 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/patient_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index 4554a48d..b5916bac 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmac import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:flutter/material.dart'; diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 1cd0be2f..32a40e7e 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -11,9 +11,9 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/lab_order/labs_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/procedure/procedure_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/radiology/radiology_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/procedure_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index 92d4c344..d656de6c 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/radiology/radiology_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:flutter/foundation.dart'; diff --git a/lib/core/viewModel/referral_view_model.dart b/lib/core/viewModel/referral_view_model.dart index 6c2b2858..892284e2 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/referral_patient_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/referral_patient_service.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/referred_view_model.dart b/lib/core/viewModel/referred_view_model.dart index f77ea922..173aa60a 100644 --- a/lib/core/viewModel/referred_view_model.dart +++ b/lib/core/viewModel/referred_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/referred_patient_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/referred_patient_service.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index d0e58535..3ee64c9b 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/schedule_service.dart'; +import 'package:doctor_app_flutter/core/service/home/schedule_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index e69eb5bf..b768cc9d 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 99c37e83..0e1e2c48 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -1,7 +1,7 @@ -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/screens/qr_reader/QR_reader_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/home/home_screen.dart'; +import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; diff --git a/lib/locator.dart b/lib/locator.dart index 9f22685a..321b3ffa 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,10 +1,3 @@ -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/auth_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/dasboard_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient/patient_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/procedure/procedure_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; @@ -14,11 +7,18 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; +import 'core/service/home/auth_service.dart'; +import 'core/service/home/dasboard_service.dart'; import 'core/service/patient/DischargedPatientService.dart'; +import 'core/service/patient/patient_service.dart'; import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart'; import 'core/service/patient/MyReferralPatientService.dart'; import 'core/service/patient/PatientMuseService.dart'; import 'core/service/patient/ReferralService.dart'; +import 'core/service/patient_medical_file/medical_report/medical_file_service.dart'; +import 'core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'core/service/patient_medical_file/procedure/procedure_service.dart'; +import 'core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'core/service/patient_medical_file/soap/SOAP_service.dart'; import 'core/service/home/doctor_reply_service.dart'; import 'core/service/patient_medical_file/lab_order/labs_service.dart'; diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index a8e9dddc..77d35bfd 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/home/auth_service.dart'; +import 'package:doctor_app_flutter/core/service/home/auth_service.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 34497b4f..41ccd59e 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -3,7 +3,7 @@ import 'dart:math'; import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index cff3b8ee..60446887 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index 70db59f1..9cdd8615 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/DischargeReferralPatient.dart'; +import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 0f64fcad..c00d362a 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index 32e7627b..3395ead8 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index 115c89e8..b6f9cae8 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart index a5f694e9..a1ee2cab 100644 --- a/lib/screens/patients/patient_search/time_bar.dart +++ b/lib/screens/patients/patient_search/time_bar.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 7db245fe..6890d74f 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index a2ea0ebb..f54a18ac 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index c6745059..a7a6677d 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/referral/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index e393c11a..8162d4ba 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -1,7 +1,7 @@ import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/auth/imei_details.dart'; +import 'package:doctor_app_flutter/core/model/auth/imei_details.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; diff --git a/pubspec.lock b/pubspec.lock index 1a572a0a..825db695 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -615,7 +615,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -907,7 +907,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1098,5 +1098,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0" From cecc1a725d2cd420d3a34510330bd583a68faa29 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 6 May 2021 15:14:06 +0300 Subject: [PATCH 17/31] pescription changes --- lib/core/service/prescription_service.dart | 5 +- .../viewModel/prescription_view_model.dart | 4 +- .../prescription/add_prescription_form.dart | 49 +++++++++++++++++-- 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index dc74901e..8351b7fe 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -1,9 +1,10 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; + import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; @@ -109,7 +110,7 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future getMedicationList({String drug =''}) async { + Future getMedicationList({String drug = ''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; await baseAppClient.post(SEARCH_DRUG, diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index c549b2b0..a28c4ab6 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -1,6 +1,5 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; @@ -9,6 +8,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_ import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/prescription_model.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescriptions_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; @@ -59,7 +59,7 @@ class PrescriptionViewModel extends BaseViewModel { getPrescriptionsInPatient(PatiantInformtion patient) async { setState(ViewState.Busy); - error=""; + error = ""; await _prescriptionsService.getPrescriptionInPatient( mrn: patient.patientId, adn: patient.admissionNo); if (_prescriptionsService.hasError) { diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index c295fd28..7c36867d 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -2,9 +2,9 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -452,8 +452,9 @@ class _PrescriptionFormWidgetState extends State { 0.35, child: TextField( decoration: - textFieldSelectorDecoration( - "", + textFieldSelectorDecorationStreangrh( + strengthController + .text, 'Strength', //strengthController.text, false), enabled: true, @@ -1347,6 +1348,48 @@ class _PrescriptionFormWidgetState extends State { ); } + InputDecoration textFieldSelectorDecorationStreangrh( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), + ) + : null, + hintStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + hintText: selectedText == null || selectedText == "" ? hintText : null, + labelText: + selectedText != null && selectedText != "" ? '\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 15, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + ); + } + openDrugToDrug(model) { showModalBottomSheet( context: context, From 95a6893b59bfe61657fa8507bb09e6976441e605 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 6 May 2021 15:19:42 +0300 Subject: [PATCH 18/31] home design --- lib/screens/home/dashboard_swipe_widget.dart | 33 +++++++------ lib/widgets/dashboard/activity_button.dart | 46 ++++++++++++------- lib/widgets/dashboard/out_patient_stack.dart | 30 ++++++++---- .../shared/rounded_container_widget.dart | 4 -- 4 files changed, 68 insertions(+), 45 deletions(-) diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 8f8077d8..faca68f8 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -40,7 +40,7 @@ class _DashboardSwipeWidgetState extends State { return getSwipeWidget(widget.dashboardItemList, index); }, itemCount: 3, - itemHeight: 300, + // itemHeight: 300, pagination: new SwiperCustomPagination( builder: (BuildContext context, SwiperPluginConfig config) { return new Stack( @@ -82,22 +82,22 @@ class _DashboardSwipeWidgetState extends State { Widget getSwipeWidget(List dashboardItemList, int index) { if (index == 1) return RoundedContainer( - height: MediaQuery.of(context).size.height * 0.35, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + raduis: 16, + margin: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[1]))); if (index == 0) return RoundedContainer( - height: MediaQuery.of(context).size.height * 0.35, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + raduis: 16, + margin: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[0]))); if (index == 2) return RoundedContainer( - height: MediaQuery.of(context).size.height * 0.35, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + raduis: 16, + margin: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( @@ -122,16 +122,19 @@ class _DashboardSwipeWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText(TranslationBase.of(context) - .patients, - fontSize: 12, - fontWeight: FontWeight.bold, - fontHeight: 0.5,), - AppText(TranslationBase.of(context) - .referral, + AppText( + TranslationBase.of(context) + .patients, + fontSize: 12, + fontWeight: FontWeight.bold, + fontHeight: 0.5, + ), + AppText( + TranslationBase.of(context) + .referral, fontSize: 22, fontWeight: FontWeight.bold, - ), + ), ], ))), Expanded( diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index e9001e41..b8f390dd 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -3,7 +3,9 @@ import 'package:flutter/material.dart'; class GetActivityButton extends StatelessWidget { final value; + GetActivityButton(this.value); + @override Widget build(BuildContext context) { return Container( @@ -15,24 +17,34 @@ class GetActivityButton extends StatelessWidget { color: Colors.white, borderRadius: BorderRadius.circular(20), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(8), - child: AppText(value.value.toString(), - fontSize: 30, fontWeight: FontWeight.bold)), - Expanded( - child: AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: 10, - textAlign: TextAlign.center, - fontWeight: FontWeight.w600, + child: Padding( + padding: const EdgeInsets.fromLTRB(8, 8, 8, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + value.value.toString(), + fontSize: 30, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + ), + Expanded( + child: Column( + children: [ + AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: 10, + color: Color(0xFF2B353E), + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + ), + ], + ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index ad79b106..b3b7ed8c 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -33,7 +33,7 @@ class GetOutPatientStack extends StatelessWidget { child: Container( margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), + borderRadius: BorderRadius.circular(8), color: Colors.red[50], ), child: Stack(children: [ @@ -46,7 +46,7 @@ class GetOutPatientStack extends StatelessWidget { padding: EdgeInsets.all(10), height: max != 0 ? (150 * value.value) / max : 0, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), + borderRadius: BorderRadius.circular(8), color: Color(0x63D02127), ), ), @@ -60,13 +60,25 @@ class GetOutPatientStack extends StatelessWidget { child: Center( child: Align( child: FittedBox( - child: AppText( - value.kPIParameter + ' (' + value.value.toString() + ') ', - fontSize: 10, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - ), - )), + child: Row( + children: [ + AppText( + value.kPIParameter, + fontSize: 10, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + AppText( + ' (' + value.value.toString() + ') ', + fontSize: 12, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + ), + ], + ), + )), ), )) ]), diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index e86c85aa..4cfe7b08 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -1,9 +1,5 @@ import 'package:flutter/material.dart'; -// OWNER : Ibrahim albitar -// DATE : 05-04-2020 -// DESCRIPTION : Custom widget for rounded container and custom decoration - class RoundedContainer extends StatefulWidget { final double width; final double height; From 292bc2a97fc0ee0b1f176fb79e83f3712f9ee4a3 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 6 May 2021 15:20:31 +0300 Subject: [PATCH 19/31] prescription changes --- .../prescription/prescription_service.dart | 12 +----------- lib/core/viewModel/prescription_view_model.dart | 8 ++------ lib/screens/prescription/add_prescription_form.dart | 7 ++++--- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index 28769280..a10f0fcc 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -1,22 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; - import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart'; - import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/model/item_by_medicine_request_model.dart'; -import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/prescription_model.dart'; -import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart'; - import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; @@ -119,7 +109,7 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future getMedicationList({String drug =''}) async { + Future getMedicationList({String drug = ''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; await baseAppClient.post(SEARCH_DRUG, diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index cb113350..902268da 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -9,11 +9,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.d import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/prescription_model.dart'; -import 'package:doctor_app_flutter/core/service/prescription_service.dart'; -import 'package:doctor_app_flutter/core/service/prescriptions_service.dart'; + import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; @@ -66,7 +62,7 @@ class PrescriptionViewModel extends BaseViewModel { getPrescriptionsInPatient(PatiantInformtion patient) async { setState(ViewState.Busy); - error=""; + error = ""; await _prescriptionsService.getPrescriptionInPatient( mrn: patient.patientId, adn: patient.admissionNo); if (_prescriptionsService.hasError) { diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 7c36867d..ae394c49 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -2,9 +2,10 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; + import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; From 0bfa74f1c99cf09789fe1c8a71cd1949ff29a54a Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 9 May 2021 12:55:37 +0300 Subject: [PATCH 20/31] ucaf-change --- .../patients/profile/UCAF/UCAF-input-screen.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 5c16d063..503e4efd 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -110,7 +110,7 @@ class _UCAFInputScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CheckboxListTile( + /*CheckboxListTile( title: AppText( TranslationBase.of(context).inPatient, fontWeight: FontWeight.normal, @@ -158,7 +158,7 @@ class _UCAFInputScreenState extends State { ), SizedBox( height: 16, - ), + ),*/ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -289,7 +289,7 @@ class _UCAFInputScreenState extends State { minLines: 1, maxLines: 20, ), - SizedBox( + /*SizedBox( height: 16, ), AppText( @@ -319,11 +319,11 @@ class _UCAFInputScreenState extends State { controlAffinity: ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), - )), + )),*/ SizedBox( height: 8, ), - AppTextFieldCustom( + /* AppTextFieldCustom( hintText: TranslationBase.of(context).other, dropDownText: TranslationBase.of(context).none, enabled: false, @@ -392,7 +392,7 @@ class _UCAFInputScreenState extends State { TranslationBase.of(context).backAbdomen, dropDownText: "BackLNeck", enabled: false, - ), + ),*/ ], ), ), From 4f167d5eec198a60c286aabd6c4ffc6787b04393 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 9 May 2021 13:31:02 +0300 Subject: [PATCH 21/31] comment dependency_overrides --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 214e6d46..5fc7b850 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,8 +17,8 @@ environment: sdk: ">=2.8.0 <3.0.0" -dependency_overrides: - intl: 0.17.0-nullsafety.2 +#dependency_overrides: +# intl: 0.17.0-nullsafety.2 dependencies: From 8e4321b3da255bfe5dc08284a2959b03726f0571 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 9 May 2021 13:43:36 +0300 Subject: [PATCH 22/31] Migration dev to Zohaib branch --- .../viewModel/PatientSearchViewModel.dart | 12 ++--- lib/screens/home/home_screen.dart | 2 +- .../patients/DischargedPatientPage.dart | 3 +- .../ReferralDischargedPatientDetails.dart | 2 +- .../out_patient/filter_date_page.dart | 8 +-- lib/widgets/patients/PatientCard.dart | 6 +-- ...ent-profile-header-new-design-app-bar.dart | 6 +-- pubspec.lock | 51 +++++++++++-------- 8 files changed, 49 insertions(+), 41 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 7a145fff..a0cd68d9 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -98,24 +98,24 @@ class PatientSearchViewModel extends BaseViewModel { DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); selectedToDate = DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); - dateTo = DateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); - dateFrom = DateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); + dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); + dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { - dateTo = DateUtils.convertDateToFormat( + dateTo = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), 'yyyy-MM-dd'); - dateFrom = DateUtils.convertDateToFormat( + dateFrom = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1), 'yyyy-MM-dd'); } else { - dateFrom = DateUtils.convertDateToFormat( + dateFrom = AppDateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); - dateTo = DateUtils.convertDateToFormat( + dateTo = AppDateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index c8dd708d..99eeef91 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -570,7 +570,7 @@ class _HomeScreenState extends State { hasBorder: false, onTap: () { String date = - DateUtils.convertDateToFormat( + AppDateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index f4573f64..7f314c0e 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -335,8 +335,9 @@ class _DischargedPatientState extends State { ), - ), + ),], ), + ),) ); } diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index b55e62b9..f78752ec 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -199,7 +199,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}", + "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate).difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index c00d362a..14ae707b 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -73,7 +73,7 @@ class _FilterDatePageState extends State { widget.patientSearchViewModel .selectedFromDate != null - ? "${DateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( @@ -102,7 +102,7 @@ class _FilterDatePageState extends State { widget.patientSearchViewModel .selectedToDate != null - ? "${DateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( @@ -161,10 +161,10 @@ class _FilterDatePageState extends State { Helpers.showErrorToast( "The difference between from date and end date must be less than 3 months"); } else { - String dateTo = DateUtils.convertDateToFormat( + String dateTo = AppDateUtils.convertDateToFormat( widget.patientSearchViewModel.selectedToDate, 'yyyy-MM-dd'); - String dateFrom = DateUtils.convertDateToFormat( + String dateFrom = AppDateUtils.convertDateToFormat( widget.patientSearchViewModel.selectedFromDate, 'yyyy-MM-dd'); diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index e09167d1..179633e7 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -134,8 +134,8 @@ class PatientCard extends StatelessWidget { ) : patientInfo.arrivedOn != null ? AppText( - AppDateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,) - )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}", + AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.arrivedOn,) + )+" "+ "${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, @@ -143,7 +143,7 @@ class PatientCard extends StatelessWidget { : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? AppText( - "${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}", + "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 48ecc0cf..07bfe8f7 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -291,7 +291,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget new TextSpan( text: patient.admissionDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), @@ -305,12 +305,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), if(isDischargedPatient && patient.dischargeDate!=null) AppText( - "${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700) else AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], diff --git a/pubspec.lock b/pubspec.lock index dee0b11c..ee31002d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0" + version: "2.5.0-nullsafety.1" autocomplete_textfield: dependency: "direct main" description: @@ -63,7 +63,7 @@ packages: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" build: dependency: transitive description: @@ -140,14 +140,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" charts_common: dependency: transitive description: @@ -196,7 +196,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" code_builder: dependency: transitive description: @@ -210,7 +210,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.15.0-nullsafety.3" connectivity: dependency: "direct main" description: @@ -336,7 +336,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" ffi: dependency: transitive description: @@ -445,6 +445,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.11" + flutter_staggered_grid_view: + dependency: "direct main" + description: + name: flutter_staggered_grid_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.4" flutter_svg: dependency: transitive description: @@ -552,7 +559,7 @@ packages: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.17.0-nullsafety.2" + version: "0.16.1" io: dependency: transitive description: @@ -566,7 +573,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.2" json_annotation: dependency: transitive description: @@ -601,14 +608,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -657,7 +664,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.0-nullsafety.1" path_drawing: dependency: transitive description: @@ -886,7 +893,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.0-nullsafety.2" speech_to_text: dependency: "direct main" description: @@ -900,7 +907,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -914,7 +921,7 @@ packages: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" stream_transform: dependency: transitive description: @@ -928,21 +935,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19" + version: "0.2.19-nullsafety.2" timing: dependency: transitive description: @@ -963,7 +970,7 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" url_launcher: dependency: "direct main" description: @@ -1012,7 +1019,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.3" video_player: dependency: transitive description: @@ -1091,5 +1098,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.12.0-0.0 <3.0.0" - flutter: ">=1.22.0" + dart: ">=2.10.0 <2.11.0" + flutter: ">=1.22.0 <2.0.0" From bf589e703eaca0d0d0b2f6b266c6c7137dcc4815 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 9 May 2021 13:47:26 +0300 Subject: [PATCH 23/31] prescreption hot fix --- lib/screens/prescription/add_prescription_form.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index ae394c49..079fb098 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1530,7 +1530,7 @@ class _PrescriptionFormWidgetState extends State { ? model.itemMedicineListUnit[0]['description'] : units['description'], 'FrequencyType': model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'] + ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(), 'Duration': duration['id'].toString(), 'RouteID': model.itemMedicineListRoute.length == 1 From 72ee88d567b893ab60da8c3584d3fa08825f1b0b Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 9 May 2021 13:54:03 +0300 Subject: [PATCH 24/31] working on dashboard --- lib/screens/home/dashboard_swipe_widget.dart | 208 ++++++++++--------- lib/screens/home/home_screen.dart | 24 +-- lib/widgets/dashboard/out_patient_stack.dart | 10 +- lib/widgets/dashboard/row_count.dart | 4 +- 4 files changed, 128 insertions(+), 118 deletions(-) diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index faca68f8..de582dc2 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -27,55 +27,59 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { - return Swiper( - onIndexChanged: (index) { - if (mounted) { - setState(() { - sliderActiveIndex = index; - widget.sliderChange(index); - }); - } - }, - itemBuilder: (BuildContext context, int index) { - return getSwipeWidget(widget.dashboardItemList, index); - }, - itemCount: 3, - // itemHeight: 300, - pagination: new SwiperCustomPagination( - builder: (BuildContext context, SwiperPluginConfig config) { - return new Stack( - alignment: Alignment.bottomCenter, - children: [ - Positioned( - bottom: 0, - child: Center( - child: InkWell( - onTap: () {}, - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - config.activeIndex == 0 - ? SwiperRoundedPagination(true) - : SwiperRoundedPagination(false), - config.activeIndex == 1 - ? SwiperRoundedPagination(true) - : SwiperRoundedPagination(false), - config.activeIndex == 2 - ? SwiperRoundedPagination(true) - : SwiperRoundedPagination(false), - ], + return Container( + // height: MediaQuery.of(context).size.height * 0.35, + height: 230, + child: Swiper( + onIndexChanged: (index) { + if (mounted) { + setState(() { + sliderActiveIndex = index; + widget.sliderChange(index); + }); + } + }, + itemBuilder: (BuildContext context, int index) { + return getSwipeWidget(widget.dashboardItemList, index); + }, + itemCount: 3, + // itemHeight: 300, + pagination: new SwiperCustomPagination( + builder: (BuildContext context, SwiperPluginConfig config) { + return new Stack( + alignment: Alignment.bottomCenter, + children: [ + Positioned( + bottom: 0, + child: Center( + child: InkWell( + onTap: () {}, + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + config.activeIndex == 0 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 1 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 2 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + ], + ), ), ), ), - ), - ) - ], - ); - }), - viewportFraction: 0.9, - // scale: 0.9, - // control: new SwiperControl(), + ) + ], + ); + }), + viewportFraction: 0.9, + // scale: 0.9, + // control: new SwiperControl(), + ), ); } @@ -83,21 +87,21 @@ class _DashboardSwipeWidgetState extends State { if (index == 1) return RoundedContainer( raduis: 16, - margin: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[1]))); if (index == 0) return RoundedContainer( raduis: 16, - margin: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[0]))); if (index == 2) return RoundedContainer( raduis: 16, - margin: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( @@ -112,61 +116,65 @@ class _DashboardSwipeWidgetState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .patients, + fontSize: 12, + fontWeight: FontWeight.bold, + fontHeight: 0.5, + ), + AppText( + TranslationBase.of(context) + .referral, + fontSize: 22, + fontWeight: FontWeight.bold, + ), + ], + )), Expanded( - flex: 1, - child: Padding( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .patients, - fontSize: 12, - fontWeight: FontWeight.bold, - fontHeight: 0.5, - ), - AppText( - TranslationBase.of(context) - .referral, - fontSize: 22, - fontWeight: FontWeight.bold, - ), - ], - ))), - Expanded( - flex: 2, + flex: 1, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - RowCounts( - dashboardItemList[2] - .summaryoptions[0] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black), - RowCounts( - dashboardItemList[2] - .summaryoptions[1] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey), - RowCounts( - dashboardItemList[2] - .summaryoptions[2] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red), + Expanded( + child: RowCounts( + dashboardItemList[2] + .summaryoptions[0] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[0] + .value, + Colors.black), + ), + Expanded( + child: RowCounts( + dashboardItemList[2] + .summaryoptions[1] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[1] + .value, + Colors.grey), + ), + Expanded( + child: RowCounts( + dashboardItemList[2] + .summaryoptions[2] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[2] + .value, + Colors.red), + ), ], ), ) @@ -187,7 +195,7 @@ class _DashboardSwipeWidgetState extends State { widget.model .getPatientCount(dashboardItemList[2]) .toString(), - fontSize: 30, + fontSize: 28, fontWeight: FontWeight.bold, ) ], diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index d3fe217c..4a375d6d 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -202,19 +202,17 @@ class _HomeScreenState extends State { ])), content: Column( children: [ - Container( - height: MediaQuery.of(context).size.height * 0.35, - child: model.dashboardItemsList.length > 0 - ? DashboardSwipeWidget( - model.dashboardItemsList, - model, - (sliderIndex) { - setState(() { - sliderActiveIndex = sliderIndex; - }); - }, - ) - : SizedBox()), + model.dashboardItemsList.length > 0 + ? DashboardSwipeWidget( + model.dashboardItemsList, + model, + (sliderIndex) { + setState(() { + sliderActiveIndex = sliderIndex; + }); + }, + ) + : SizedBox(), model.dashboardItemsList.length > 0 ? FractionallySizedBox( widthFactor: 0.90, diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index b3b7ed8c..2a9109c3 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -19,9 +19,13 @@ class GetOutPatientStack extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - AppText( - value.kPIName, - medium: true, + Container( + height: 30, + child: AppText( + value.kPIName, + medium: true, + fontSize: 14, + ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) ], diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index a42cccdf..a22932f4 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -24,7 +24,7 @@ class RowCounts extends StatelessWidget { name, color: Colors.black, textAlign: TextAlign.start, // from TextAlign.center - fontSize: 12, + fontSize: 11, textOverflow: TextOverflow.ellipsis, ), ), @@ -32,7 +32,7 @@ class RowCounts extends StatelessWidget { ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, - fontSize: 13, + fontSize: 12, fontWeight: FontWeight.bold, ) ], From 27f940b4738ab233c8222d00f82992b4db65a162 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 9 May 2021 14:45:05 +0300 Subject: [PATCH 25/31] home design --- .../home/dashboard_slider-item-widget.dart | 4 +-- lib/widgets/dashboard/activity_button.dart | 29 +++++++------------ 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 4ee67daf..4b7c4f46 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -24,8 +24,8 @@ class DashboardSliderItemWidget extends StatelessWidget { ], ), new Container( - height: 130, - child: new ListView( + height: 110, + child: ListView( scrollDirection: Axis.horizontal, children: List.generate(item.summaryoptions.length, (int index) { diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index b8f390dd..a46fc334 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -9,39 +9,32 @@ class GetActivityButton extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 120, + width: 110, padding: EdgeInsets.all(5), margin: EdgeInsets.all(5), - height: 130, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(20), ), child: Padding( - padding: const EdgeInsets.fromLTRB(8, 8, 8, 0), + padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ AppText( value.value.toString(), - fontSize: 30, + fontSize: 27, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), ), - Expanded( - child: Column( - children: [ - AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: 10, - color: Color(0xFF2B353E), - textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - ), - ], - ), + AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: 10, + color: Color(0xFF2B353E), + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, ), ], ), From 8541ddc0f8e2ec82b1440045aedd9ba3241ec381 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 9 May 2021 15:07:44 +0300 Subject: [PATCH 26/31] fix LabOrderResult --- lib/core/viewModel/labs_view_model.dart | 14 +++----------- .../lab_result/laboratory_result_widget.dart | 7 ++----- .../prescription/add_prescription_form.dart | 6 +++--- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index e5a2f9f1..90e9b327 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -135,17 +135,9 @@ class LabsViewModel extends BaseViewModel { .toList(); if (patientLabOrdersClinic.length != 0) { - var value = - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .where((e) => - e.sampleCollectedOn == element.sampleCollectedOn && - e.resultValue == element.resultValue) - .toList(); - if (value.isEmpty) - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .add(element); + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .add(element); } else { labResultLists .add(LabResultList(filterName: element.testCode, lab: element)); diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index d9132b7a..810f025f 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -128,11 +128,8 @@ class _LaboratoryResultWidgetState extends State { model.labResultLists.length, (index) => LabResultWidget( patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, + filterName: model.labResultLists[index].filterName, + patientLabResultList: model.labResultLists[index].patientLabResultList, patient: widget.patient, isInpatient: widget.isInpatient, ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index a951f480..a3c6e589 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1430,17 +1430,17 @@ class _PrescriptionFormWidgetState extends State { // .join(' '), dose: strengthController.text, doseUnit: model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'] + ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), model: widget.model, duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'] + ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(), route: model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'] + ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), drugId: _selectedMedication.itemId.toString(), strength: strengthController.text, From 50b4b8eb500e1d81f39949f6b53e06f63e633949 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 9 May 2021 16:15:06 +0300 Subject: [PATCH 27/31] dashboard change --- lib/screens/home/dashboard_swipe_widget.dart | 15 +++++++ lib/widgets/dashboard/out_patient_stack.dart | 45 +++++++++++-------- .../shared/rounded_container_widget.dart | 12 +++-- 3 files changed, 50 insertions(+), 22 deletions(-) diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index de582dc2..a6dc12eb 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -87,6 +87,11 @@ class _DashboardSwipeWidgetState extends State { if (index == 1) return RoundedContainer( raduis: 16, + showBorder: true, + borderColor: Colors.white, + shadowWidth: 0.2, + shadowSpreadRadius: 3, + shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), @@ -94,6 +99,11 @@ class _DashboardSwipeWidgetState extends State { if (index == 0) return RoundedContainer( raduis: 16, + showBorder: true, + borderColor: Colors.white, + shadowWidth: 0.2, + shadowSpreadRadius: 3, + shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), @@ -101,6 +111,11 @@ class _DashboardSwipeWidgetState extends State { if (index == 2) return RoundedContainer( raduis: 16, + showBorder: true, + borderColor: Colors.white, + shadowWidth: 0.2, + shadowSpreadRadius: 3, + shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 2a9109c3..2b982e20 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -37,8 +37,15 @@ class GetOutPatientStack extends StatelessWidget { child: Container( margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment( + 0.0, 1.0), // 10% of the width, so there are ten blinds. + colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow + tileMode: TileMode.mirror, // repeats the gradient over the canvas + ), borderRadius: BorderRadius.circular(8), - color: Colors.red[50], + // color: Colors.red[50], ), child: Stack(children: [ Positioned( @@ -64,25 +71,25 @@ class GetOutPatientStack extends StatelessWidget { child: Center( child: Align( child: FittedBox( - child: Row( - children: [ - AppText( - value.kPIParameter, - fontSize: 10, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - AppText( - ' (' + value.value.toString() + ') ', - fontSize: 12, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - ), - ], + child: Row( + children: [ + AppText( + value.kPIParameter, + fontSize: 10, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + AppText( + ' (' + value.value.toString() + ') ', + fontSize: 12, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, ), - )), + ], + ), + )), ), )) ]), diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 4cfe7b08..8364bb79 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -9,6 +9,9 @@ class RoundedContainer extends StatefulWidget { final double elevation; final bool showBorder; final Color borderColor; + final double shadowWidth; + final double shadowSpreadRadius; + final double shadowDy; final bool customCornerRaduis; final double topLeft; final double bottomRight; @@ -27,6 +30,9 @@ class RoundedContainer extends StatefulWidget { this.elevation = 1, this.showBorder = false, this.borderColor = Colors.red, + this.shadowWidth = 0.1, + this.shadowSpreadRadius = 10, + this.shadowDy = 5, this.customCornerRaduis = false, this.topLeft = 0, this.topRight = 0, @@ -59,10 +65,10 @@ class _RoundedContainerState extends State { : BorderRadius.circular(widget.raduis), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(0.1), - spreadRadius: 10, + color: Colors.grey.withOpacity(widget.shadowWidth), + spreadRadius: widget.shadowSpreadRadius, blurRadius: 5, - offset: Offset(0, 5), // changes position of shadow + offset: Offset(0, widget.shadowDy), // changes position of shadow ), ]) : null, From 25fb8ea5ae03a50117327dc8a1c966c04aa15433 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 10 May 2021 12:36:12 +0300 Subject: [PATCH 28/31] hot fix --- lib/config/localized_values.dart | 6 ++++-- lib/screens/patients/profile/UCAF/UCAF-input-screen.dart | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 71f37657..f86c4a02 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -481,8 +481,10 @@ const Map> localizedValues = { 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, 'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'}, 'chiefComplaintsAndSymptoms': { - 'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS", - 'ar': 'شكاوى الرئيس وأعراض أخرى' + 'en': "CHIEF COMPLAINTS", + 'ar': 'شكاوى الرئيس' + // 'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS", + // 'ar': 'شكاوى الرئيس وأعراض أخرى' }, 'patientFeelsPainInHisBackAndCough': { 'en': "Patient Feels pain in his back and cough", diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 503e4efd..5e1b6155 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -263,7 +263,7 @@ class _UCAFInputScreenState extends State { fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), - SizedBox( + /* SizedBox( height: 4, ), AppText( @@ -273,7 +273,7 @@ class _UCAFInputScreenState extends State { fontWeight: FontWeight.normal, color: Color(0xFF575757), fontSize: SizeConfig.textMultiplier * 1.8, - ), + ),*/ SizedBox( height: 8, ), From 0e2b7001365e636118ea970df265e2b1032835a2 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 10 May 2021 14:55:09 +0300 Subject: [PATCH 29/31] vital sign hot fix --- lib/core/viewModel/patient-vital-sign-viewmodel.dart | 4 ++-- .../patient/vital_sign/patient-vital-sign-history.dart | 8 ++++---- .../profile/vital_sign/vital_sign_detail_pain_scale.dart | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 7ce4582a..bab2ff9f 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -98,8 +98,8 @@ class VitalSignsViewModel extends BaseViewModel { "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ } if (painScore == null || painScore == "-") { - painScore = element.painScore.toString() != 'null' - ? element.painScore.toString() + painScore = element.painScoreDesc.toString() != 'null' + ? element.painScoreDesc.toString() : "-"; painLocation = element.painLocation.toString() != 'null' ? element.painLocation.toString() diff --git a/lib/models/patient/vital_sign/patient-vital-sign-history.dart b/lib/models/patient/vital_sign/patient-vital-sign-history.dart index e5f5abd0..ed39a86e 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-history.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-history.dart @@ -29,7 +29,7 @@ class VitalSignHistory { var status; bool isVitalsRequired; var patientID; - var createdOn; + var createdOn; var doctorID; var clinicID; var triageCategory; @@ -52,9 +52,9 @@ class VitalSignHistory { var bloodPressureCuffLocationDesc; var bloodPressureCuffSizeDesc; var bloodPressurePatientPositionDesc; - var clinicName; - var doctorImageURL; - var doctorName; + var clinicName; + var doctorImageURL; + var doctorName; var painScoreDesc; var pulseRhythmDesc; var respirationPatternDesc; diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart index ffd8422d..146a8ddb 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart @@ -102,7 +102,7 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: Center( child: AppText( - "${vitalList[index].painScore ?? "-"}", + "${vitalList[index].painScoreDesc ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.3, From 8399677a0ada8ee386ede7d9d32b5cc097539805 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 10 May 2021 15:12:18 +0300 Subject: [PATCH 30/31] Fix Dubai user issues --- lib/client/base_app_client.dart | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index d6a72ab6..bd4b0cd4 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -67,10 +67,12 @@ class BaseAppClient { await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } - if (body['ProjectID'] != null && - (body['ProjectID'] == 2 || body['ProjectID'] == 3)) { - body['PatientOutSA'] = true; - } + int projectID = await sharedPref.getInt(PROJECT_ID); + if(projectID ==2 || projectID == 3) + body['PatientOutSA'] = true; + else + body['PatientOutSA'] = false; + body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; print("URL : $url"); print("Body : ${json.encode(body)}"); @@ -193,10 +195,11 @@ class BaseAppClient { body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe - if (body['ProjectID'] != null && - (body['ProjectID'] == 2 || body['ProjectID'] == 3)) { + int projectID = await sharedPref.getInt(PROJECT_ID); + if(projectID ==2 || projectID == 3) body['PatientOutSA'] = true; - } + else + body['PatientOutSA'] = false; print("URL : $url"); print("Body : ${json.encode(body)}"); From 8ac040a809c6ced4bacd3fe4b5d51e5f33022218 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 16 May 2021 12:23:57 +0300 Subject: [PATCH 31/31] hot fix --- .../patients/profile/medical_report/MedicalReportPage.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 6b85fa80..8dad1bc4 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -86,13 +86,13 @@ class MedicalReportPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${DateUtils.getHour(DateTime.now())}', + '${AppDateUtils.getHour(DateTime.now())}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14,