From 27b4450dac8414ffa74321ccdb9e813331239cd8 Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Mon, 19 Apr 2021 12:26:58 +0300 Subject: [PATCH 001/102] versionID changed to 5.5 --- lib/core/service/patient-doctor-referral-service.dart | 2 +- lib/core/viewModel/hospital_view_model.dart | 2 +- lib/models/doctor/profile_req_Model.dart | 2 +- lib/models/patient/get_clinic_by_project_id_request.dart | 2 +- .../patient/get_list_stp_referral_frequency_request.dart | 2 +- lib/models/patient/insurance_aprovals_request.dart | 2 +- lib/models/patient/lab_orders/lab_orders_req_model.dart | 2 +- lib/models/patient/orders_request.dart | 2 +- lib/models/patient/prescription/prescription_req_model.dart | 2 +- lib/models/patient/progress_note_request.dart | 2 +- lib/models/patient/radiology/radiology_req_model.dart | 2 +- lib/models/patient/refer_to_doctor_request.dart | 2 +- lib/models/patient/vital_sign/vital_sign_req_model.dart | 2 +- lib/models/pharmacies/pharmacies_List_request_model.dart | 2 +- lib/models/pharmacies/pharmacies_items_request_model.dart | 4 ++-- lib/screens/QR_reader_screen.dart | 2 +- lib/screens/dashboard_screen.dart | 2 +- lib/screens/doctor/patient_arrival_screen.dart | 2 +- lib/screens/patients/patient_search_screen.dart | 2 +- lib/screens/patients/patients_screen.dart | 2 +- lib/widgets/auth/login_form.dart | 4 ++-- lib/widgets/auth/verfiy_account.dart | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 1677bbce..989d0a3c 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -29,7 +29,7 @@ class PatientReferralService extends LookupService { "LanguageID": 1, "stamp": "2020-02-26T13:51:44.111Z", "IPAdress": "11.11.11.11", - "VersionID": 1.2, + "VersionID": 5.5, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", diff --git a/lib/core/viewModel/hospital_view_model.dart b/lib/core/viewModel/hospital_view_model.dart index 7865a40f..dbb5e4fb 100644 --- a/lib/core/viewModel/hospital_view_model.dart +++ b/lib/core/viewModel/hospital_view_model.dart @@ -13,7 +13,7 @@ class HospitalViewModel with ChangeNotifier { "LanguageID": 1, "stamp": "2020-02-26T13:51:44.111Z", "IPAdress": "11.11.11.11", - "VersionID": 1.2, + "VersionID": 5.5, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 6a850811..8f2ef985 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -29,7 +29,7 @@ class ProfileReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=1.2, + this.versionID=5.5, this.channel=9, this.sessionID='E2bsEeYEJo', this.tokenID, diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index 862fbab4..09198dc0 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -40,7 +40,7 @@ class ClinicByProjectIdRequest { this.languageID = 2, this.stamp = "2020-06-03T11:18:19.979Z", this.iPAdress = "11.11.11.11", - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index 3b3c2655..f524aa37 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -37,7 +37,7 @@ class STPReferralFrequencyRequest { {this.languageID = 2, this.stamp = "2020-06-03T11:18:19.986Z", this.iPAdress = "11.11.11.11", - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index e36355d8..63e7926a 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -45,7 +45,7 @@ class InsuranceAprovalsRequest { this.languageID = 2, this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', - this.versionID = 1.2, + this.versionID = 5.5, this.tokenID , this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, diff --git a/lib/models/patient/lab_orders/lab_orders_req_model.dart b/lib/models/patient/lab_orders/lab_orders_req_model.dart index 0295ce8d..a97f4093 100644 --- a/lib/models/patient/lab_orders/lab_orders_req_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_req_model.dart @@ -28,7 +28,7 @@ class LabOrdersReqModel { this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=1.2, + this.versionID=5.5, this.channel=9, this.sessionID='E2bsEeYEJo', this.isLoginForDoctorApp =true, diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart index 5e1283fa..1372cfd6 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/models/patient/orders_request.dart @@ -49,7 +49,7 @@ class OrdersRequest { this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, - this.versionID = 1.2, + this.versionID = 5.5, this.patientOutSA = false}); OrdersRequest.fromJson(Map json) { diff --git a/lib/models/patient/prescription/prescription_req_model.dart b/lib/models/patient/prescription/prescription_req_model.dart index 45ca2d74..9141c282 100644 --- a/lib/models/patient/prescription/prescription_req_model.dart +++ b/lib/models/patient/prescription/prescription_req_model.dart @@ -27,7 +27,7 @@ class PrescriptionReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress = '11.11.11.11', - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, this.sessionID = 'E2bsEeYEJo', this.tokenID, diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index ce38b56e..fe0add5f 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -49,7 +49,7 @@ class ProgressNoteRequest { this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, - this.versionID = 1.2, + this.versionID = 5.5, this.patientOutSA = false}); ProgressNoteRequest.fromJson(Map json) { diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/models/patient/radiology/radiology_req_model.dart index b39fb393..47154d8b 100644 --- a/lib/models/patient/radiology/radiology_req_model.dart +++ b/lib/models/patient/radiology/radiology_req_model.dart @@ -25,7 +25,7 @@ class RadiologyReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress = '11.11.11.11', - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, this.sessionID = 'E2bsEeYEJo', this.tokenID, diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart index 28eb488b..83db54f4 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -84,7 +84,7 @@ class ReferToDoctorRequest { this.languageID = 2, this.stamp = "2020-06-03T11:26:42.358Z", this.iPAdress = "11.11.11.11", - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, @required this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index ddd1f7d2..61e3fcf2 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -31,7 +31,7 @@ class VitalSignReqModel { this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=1.2, + this.versionID=5.5, this.channel=9, this.sessionID='E2bsEeYEJo', this.isLoginForDoctorApp=true, diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/models/pharmacies/pharmacies_List_request_model.dart index 33588345..90b5c378 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -26,7 +26,7 @@ class PharmaciesListRequestModel { this.languageID = 2, this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', - this.versionID = 5.3, + this.versionID = 5.5, this.tokenID, this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index 9602a803..8d6b9b46 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -10,7 +10,7 @@ class PharmaciesItemsRequestModel { String pHRItemName; int pageIndex = 0; int pageSize = 20; - double versionID = 5.3; + double versionID = 5.5; int channel = 3; int languageID = 2; String iPAdress = "10.20.10.20"; @@ -24,7 +24,7 @@ class PharmaciesItemsRequestModel { {this.pHRItemName, this.pageIndex = 0, this.pageSize = 20, - this.versionID = 5.3, + this.versionID = 5.5, this.channel = 3, this.languageID = 2, this.iPAdress = "10.20.10.20", diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 2ddb4049..2645f7a4 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -45,7 +45,7 @@ class _QrReaderScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "@dm!n", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index c249c0bc..1b3022f9 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -72,7 +72,7 @@ class _DashboardScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index d5a254e8..3dc63a7b 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -30,7 +30,7 @@ class _PatientArrivalScreen extends State LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 51750e38..ecb27d3c 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -63,7 +63,7 @@ class _PatientSearchScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 482d6d80..eac01964 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -98,7 +98,7 @@ class _PatientsScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 9fc50008..e5c685bd 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -52,7 +52,7 @@ class _LoginFormState extends State { projectID: 15, languageID: 2, iPAdress: "11.11.11.11", - versionID: 1.2, + versionID: 5.5, channel: 9, sessionID: "i1UJwCTSqt"); @@ -386,7 +386,7 @@ class _LoginFormState extends State { "ProjectName": "", "DoctorImageURL": "UNKNOWN", "LogInTokenID": preRes['LogInTokenID'], - "VersionID": 5.3 + "VersionID": 5.5 }; authProv.insertDeviceImei(imeiInfo).then((res) { if (res['MessageStatus'] == 1) { diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 587c248c..66a53857 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -356,7 +356,7 @@ class _VerifyAccountState extends State { "LanguageID": 2, "stamp": "2020-02-26T14:48:27.221Z", "IPAdress": "11.11.11.11", - "VersionID": 1.2, + "VersionID": 5.5, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", From cb67dcc9e105fa649898d7f9d462985426888f9f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 13:21:29 +0300 Subject: [PATCH 002/102] first step from search --- lib/config/config.dart | 1 + lib/core/enum/patient_type.dart | 2 + lib/core/model/PatientSearchRequestModel.dart | 27 +- .../service/patient/out_patient_service.dart | 45 ++ .../viewModel/PatientSearchViewModel.dart | 33 + lib/locator.dart | 2 + lib/screens/home/home_screen.dart | 39 + .../patient_search_screen_new.dart | 302 ++++++++ .../patient_search/patients_screen_new.dart | 732 ++++++++++++++++++ lib/widgets/patients/PatientCard.dart | 203 ++--- 10 files changed, 1276 insertions(+), 110 deletions(-) create mode 100644 lib/core/enum/patient_type.dart create mode 100644 lib/core/service/patient/out_patient_service.dart create mode 100644 lib/screens/patients/patient_search/patient_search_screen_new.dart create mode 100644 lib/screens/patients/patient_search/patients_screen_new.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 5c704152..09f4f586 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -277,6 +277,7 @@ const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; +const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; var selectedPatientType = 1; diff --git a/lib/core/enum/patient_type.dart b/lib/core/enum/patient_type.dart new file mode 100644 index 00000000..efea543c --- /dev/null +++ b/lib/core/enum/patient_type.dart @@ -0,0 +1,2 @@ +enum PatientType { inPatient, OutPatient } + diff --git a/lib/core/model/PatientSearchRequestModel.dart b/lib/core/model/PatientSearchRequestModel.dart index 72b1aa9e..7691cadb 100644 --- a/lib/core/model/PatientSearchRequestModel.dart +++ b/lib/core/model/PatientSearchRequestModel.dart @@ -8,17 +8,20 @@ class PatientSearchRequestModel { int patientID; String from; String to; + int searchType; + String mobileNo; + String identificationNo; PatientSearchRequestModel( - {this.doctorID, - this.firstName, - this.middleName, - this.lastName, - this.patientMobileNumber, - this.patientIdentificationID, - this.patientID, - this.from, - this.to}); + {this.doctorID =0, + this.firstName ="0", + this.middleName="0", + this.lastName="0", + this.patientMobileNumber="0", + this.patientIdentificationID="0", + this.patientID =0, + this.from="0", + this.to="0"}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; @@ -30,6 +33,9 @@ class PatientSearchRequestModel { patientID = json['PatientID']; from = json['From']; to = json['To']; + searchType = json['SearchType']; + mobileNo = json['MobileNo']; + identificationNo = json['IdentificationNo']; } Map toJson() { @@ -43,6 +49,9 @@ class PatientSearchRequestModel { data['PatientID'] = this.patientID; data['From'] = this.from; data['To'] = this.to; + data['SearchType'] = this.searchType; + data['MobileNo'] = this.mobileNo; + data['IdentificationNo'] = this.identificationNo; return data; } } diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart new file mode 100644 index 00000000..606bfc5d --- /dev/null +++ b/lib/core/service/patient/out_patient_service.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class OutPatientService extends BaseService { + List _patientList = []; + List get patientList => _patientList; + + + Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { + hasError = false; + await baseAppClient.post( + GET_MY_OUT_PATIENT, + onSuccess: (dynamic response, int statusCode) { + _patientList.clear(); + response['List_MyOutPatient'].forEach((v) { + _patientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: patientSearchRequestModel.toJson(), + ); + } + Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { + hasError = false; + await baseAppClient.post( + PRM_SEARCH_PATIENT, + onSuccess: (dynamic response, int statusCode) { + _patientList.clear(); + response['GetPatientFileInformation_PRMList'].forEach((v) { + _patientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: patientSearchRequestModel.toJson(), + ); + } +} diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index ea0e5cec..455e8788 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,5 +1,38 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +import '../../locator.dart'; import 'base_view_model.dart'; class PatientSearchViewModel extends BaseViewModel{ + OutPatientService _outPatientService = locator(); + + List get patientList => _outPatientService.patientList; + + getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { + setState(ViewState.Busy); + await _outPatientService.getOutPatient( + patientSearchRequestModel); + if (_outPatientService.hasError) { + error = _outPatientService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { + setState(ViewState.Busy); + await _outPatientService.getPatientFileInformation( + patientSearchRequestModel); + if (_outPatientService.hasError) { + error = _outPatientService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } } \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 3aabd46b..a52482a4 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -27,6 +27,7 @@ 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/out_patient_service.dart'; import 'core/service/prescriptions_service.dart'; import 'core/service/radiology_service.dart'; import 'core/service/referral_patient_service.dart'; @@ -80,6 +81,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReferralService()); locator.registerLazySingleton(() => MyReferralInPatientService()); locator.registerLazySingleton(() => DischargedPatientService()); + locator.registerLazySingleton(() => OutPatientService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 39fc7a8c..47bc1d0b 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart' import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -464,6 +465,44 @@ class _HomeScreenState extends State { child: new ListView( scrollDirection: Axis.horizontal, children: [ + HomePageCard( + color: Colors.black, + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.search, + size: 32, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + "New:"+TranslationBase.of(context) + .searchPatient, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 13, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientSearchScreenNew(), + )); + }, + ), HomePageCard( color: Colors.red[800], margin: EdgeInsets.all(5), diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart new file mode 100644 index 00000000..f383cf40 --- /dev/null +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -0,0 +1,302 @@ +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/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/screens/patients/patient_search/patients_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class PatientSearchScreenNew extends StatefulWidget { + @override + _PatientSearchScreenNewState createState() => _PatientSearchScreenNewState(); +} + +class _PatientSearchScreenNewState extends State { + bool showOther = false; + bool isFormSubmitted = false; + TextEditingController patientFileInfoController = TextEditingController(); + TextEditingController firstNameInfoController = TextEditingController(); + TextEditingController middleNameInfoController = TextEditingController(); + TextEditingController lastNameFileInfoController = TextEditingController(); + PatientType selectedPatientType = PatientType.inPatient; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Center( + child: Column( + children: [ + BottomSheetTitle( + title: TranslationBase.of(context).searchPatient), + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + 'Patient Type', + fontWeight: FontWeight.w600, + ), + Row( + children: [ + Row( + children: [ + Radio( + activeColor: Color(0xFFB9382C), + value: PatientType.inPatient, + groupValue: selectedPatientType, + onChanged: (value) { + setState(() { + selectedPatientType = + PatientType.inPatient; + }); + }, + ), + Text('InPatient'), + ], + ), + Row( + children: [ + Radio( + activeColor: Color(0xFFB9382C), + value: PatientType.OutPatient, + groupValue: selectedPatientType, + onChanged: (value) { + setState(() { + selectedPatientType = + PatientType.OutPatient; + }); + }, + ), + Text('OutPatient'), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Container( + margin: + EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .patpatientIDMobilenationalientID, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: patientFileInfoController, + validationError: (isFormSubmitted && ( + patientFileInfoController + .text.isEmpty && + firstNameInfoController + .text.isEmpty && + middleNameInfoController + .text.isEmpty && + lastNameFileInfoController + .text.isEmpty)) + ? TranslationBase.of(context).emptyMessage + : null, + ), + ), + SizedBox( + height: 5, + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + InkWell( + child: this.showOther == false + ? AppText( + TranslationBase.of(context) + .searchWithOther, + color: Colors.red, + fontWeight: FontWeight.bold, + ) + : AppText( + TranslationBase.of(context) + .hideOtherCriteria, + color: Colors.red, + fontWeight: FontWeight.bold), + onTap: () { + setState(() { + this.showOther = !this.showOther; + }); + }, + ) + ], + ), + SizedBox( + height: 30, + ), + if (showOther) + Column( + children: [ + AppTextFieldCustom( + hintText: + TranslationBase.of(context).firstName, + controller: firstNameInfoController, + maxLines: 1, + minLines: 1, + hasBorder: true, + onChanged: (_) {}, + // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + hintText: + TranslationBase.of(context).middleName, + controller: middleNameInfoController, + maxLines: 1, + minLines: 1, + onChanged: (_) {}, + hasBorder: true, + // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + hintText: + TranslationBase.of(context).lastName, + controller: lastNameFileInfoController, + maxLines: 1, + minLines: 1, + onChanged: (_) {}, + hasBorder: true, + // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + ), + SizedBox( + height: 10, + ), + ], + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ), + ])), + ), + ], + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + title: TranslationBase.of(context).search, + onPressed: () { + onSubmitSearch(); + }, + color: Colors.red[800], + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ), + ); + } + + onSubmitSearch() { + GifLoaderDialogUtils.showMyDialog(context); + setState(() { + isFormSubmitted = true; + }); + PatientSearchRequestModel patientSearchRequestModel = + PatientSearchRequestModel(); + 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(); + } + + if (patientFileInfoController.text.isNotEmpty) { + if (patientFileInfoController.text.length == 10 && + (patientFileInfoController.text[0] == '2' || + patientFileInfoController.text[0] == '1')) { + patientSearchRequestModel.identificationNo = + patientFileInfoController.text; + patientSearchRequestModel.searchType = 2; + patientSearchRequestModel.patientID = 0; + } else if ((patientFileInfoController.text.length == 10 || + patientFileInfoController.text.length == 9) && + ((patientFileInfoController.text[0] == '0' && + patientFileInfoController.text[1] == '5') || + patientFileInfoController.text[0] == '5')) { + patientSearchRequestModel.mobileNo = patientFileInfoController.text; + patientSearchRequestModel.searchType = 0; + } else { + patientSearchRequestModel.patientID = + int.parse(patientFileInfoController.text); + patientSearchRequestModel.searchType = 1; + } + } + + GifLoaderDialogUtils.hideDialog(context); + + if (patientFileInfoController.text.isNotEmpty || + firstNameInfoController.text.isNotEmpty || + middleNameInfoController.text.isNotEmpty || + lastNameFileInfoController.text.isNotEmpty) { + setState(() { + isFormSubmitted = false; + }); + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => PatientsScreenNew( + selectedPatientType: selectedPatientType, + patientSearchRequestModel: patientSearchRequestModel, + isSearchWithKeyInfo: + patientFileInfoController.text.isNotEmpty ? true : false, + ), + ), + ); + } + } +} diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart new file mode 100644 index 00000000..5b3b5a77 --- /dev/null +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -0,0 +1,732 @@ +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 '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'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.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/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class PatientsScreenNew extends StatefulWidget { + final patientSearchForm; + final selectedType; + final isAppbar; + final arrivalType; + final isView; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; + final bool isSearchWithKeyInfo; + + PatientsScreenNew( + {this.patientSearchForm, + this.selectedType, + this.isAppbar = true, + this.arrivalType, + this.isView, + this.selectedPatientType, + this.patientSearchRequestModel, + this.isSearchWithKeyInfo = true}); + + @override + _PatientsScreenNewState createState() => _PatientsScreenNewState(); +} + +class _PatientsScreenNewState extends State { + List lItems; + + List parsed; + + List date; + List unFilterDate; + + int clinicId; + AuthViewModel authProvider; + + Color sideColor = Colors.black; + List responseModelList; + List responseModelList2; + final String url = "assets/images/"; + final String avatarMale = "user_male.svg"; //'working_male.svg';//'user.svg'; + final String avatarFemale = 'user_female.svg'; + final String assetName = 'assets/image.svg'; + + List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; + + int _activeLocation = 0; + bool isInpatient = false; + String patientType; + bool isSearch = false; + String patientTypeTitle; + var _isLoading = true; + var selectedFilter = 1; + bool _isError = false; + String error = ""; + String arrivalType; + ProjectViewModel projectsProvider; + var isView; + final _controller = TextEditingController(); + + PatientModel patient; + var _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); + + searchData(String str) { + this.responseModelList = this.responseModelList2; + var strExist = str.length > 0 ? true : false; + if (strExist) { + List filterData = []; + + for (var i = 0; i < responseModelList2.length; i++) { + String firstName = responseModelList[i].firstName.toUpperCase(); + String lastName = responseModelList[i].lastName.toUpperCase(); + String mobile = responseModelList[i].mobileNumber.toUpperCase(); + String patientID = responseModelList[i].patientId.toString(); + + if (firstName.contains(str.toUpperCase()) || + lastName.contains(str.toUpperCase()) || + mobile.contains(str) || + patientID.contains(str)) { + filterData.add(responseModelList[i]); + } + } + + setState(() { + this.responseModelList = filterData; + }); + } else { + setState(() { + this.responseModelList = this.responseModelList2; + }); + } + } + + convertDateFormat(String str) { + String timeConvert; + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + @override + Widget build(BuildContext context) { + authProvider = Provider.of(context); + _locations = [ + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; + //TranslationBase.of(context).all, + projectsProvider = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + + // patient = widget.patientSearchForm != null + // ? widget.patientSearchForm + // : routeArgs['patientSearchForm']; + // + // patientType = widget.selectedType != null + // ? widget.selectedType + // : routeArgs['selectedType']; + // arrivalType = widget.arrivalType != null + // ? widget.arrivalType + // : routeArgs['arrivalType']; + // if (routeArgs != null && routeArgs.containsKey("isSearch")) { + // isSearch = routeArgs['isSearch']; + // } + // if (routeArgs != null && routeArgs.containsKey("isSearch")) { + // isView = routeArgs['isView']; + // } + // if (routeArgs != null && routeArgs.containsKey('activeFilter')) { + // _activeLocation = routeArgs['activeFilter']; + // } + // if (routeArgs != null && routeArgs.containsKey('isInpatient')) { + // isInpatient = routeArgs['isInpatient']; + // } + + // if (!projectsProvider.isArabic) + // patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; + // else + // patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)]; + + return BaseView( + onModelReady: (model) async { + if(widget.isSearchWithKeyInfo) { + await model.getPatientFileInformation(widget.patientSearchRequestModel); + } else { + // ignore: unrelated_type_equality_checks + if(widget.selectedPatientType == PatientType.OutPatient) { + await model.getOutPatient(widget.patientSearchRequestModel); + } else { + // TODO handel inPatient case + } + } + }, + builder: (_, model, w) => AppScaffold( + appBarTitle: "Search Patient", + isShowAppBar: widget.isAppbar, + // isLoading: _isLoading, + baseViewModel: model, + body: model.patientList.isEmpty + ? Column( + children: [ + Column(children: [ + SizedBox( + height: 10.0, + ), + if (widget.selectedPatientType == PatientType.OutPatient) + Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10)), + child: ClinicList( + clinicId: clinicId, + onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + }, + )), + Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.height * + 0.03), + // child: _locationBar(context) + child: + widget.selectedPatientType == PatientType.OutPatient + ? _locationBar(context, model) + : Container(), + ) + ]), + Container( + margin: EdgeInsets.only( + top: MediaQuery.of(context).size.height * 0.10), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText(TranslationBase.of(context) + .youDontHaveAnyPatient), + ) + ], + ), + ), + ), + ], + ) + : Container( + color: Colors.grey[200], + child: ListView( + scrollDirection: Axis.vertical, + children: [ + Container( + child:model.patientList.isEmpty + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 0, 0, 0, 0), //250 + child: + DrAppCircularProgressIndeicator(), + )), + ), + ], + ) + : 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), + ), + onChanged: (String str) { + this.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context) + .size + .height * + 0.03), + // child: _locationBar(context) + child: widget.selectedPatientType == PatientType.OutPatient? _locationBar(context, model) + : Container(), + ), + SizedBox( + height: 10.0, + ), + Container( + child: (model.patientList.isNotEmpty) + ? Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: model.patientList + .map((PatiantInformtion + item) { + return PatientCard( + patientInfo: item, + patientType: + patientType, + arrivalType: + arrivalType, + isInpatient: + isInpatient, + onTap: () { + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType": + patientType, + "from": patient + .getFrom, + "to": patient + .getTo, + "isSearch": + isSearch, + "isInpatient": + isInpatient, + "arrivalType": + arrivalType, + "isInpatient": + isInpatient + }); + }, + ); + }).toList(), + ) + : Center( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + SizedBox( + height: 100, + ), + Image.asset( + 'assets/images/no-data.png'), + Padding( + padding: + const EdgeInsets + .all(8.0), + child: AppText( + TranslationBase.of( + context) + .youDontHaveAnyPatient), + ) + ], + ), + )), + ], + ), + ) + ], + ), + ) + ), + ); + } + + changeClinic(clinicId, BuildContext context, model) async { + GifLoaderDialogUtils.showMyDialog(context); + 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(), allowChangeProfile: false) + .then((profileList) async { + print(profileList['DoctorProfileList'][0]); + int val2 = int.parse(patientType); + + GetPatientArrivalListRequestModel getPatientArrivalListRequestModel = + GetPatientArrivalListRequestModel( + from: patient.From, + to: patient.To, + clinicID: profileList['DoctorProfileList'][0]['ClinicID'], + doctorID: + profileList['DoctorProfileList'][0]['DoctorID'].toString(), + patientMRN: patient.getPatientID, + pageIndex: 0, + pageSize: 0); + + model + .getPatientList( + getPatientArrivalListRequestModel.toJson(), patientType) + .then((res) { + setState(() { + if (res != null && res['MessageStatus'] == 1) { + if (val2 == 7) { + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + var localList = []; + if (res["patientArrivalList"]["entityList"] == null) { + res["patientArrivalList"]["entityList"] = []; + } + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient = { + ...v, + ...v["patientDetails"] + }; + localList.add(mergedPatient); + }); + lItems = localList; + } + } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList.sort((a, b) { + DateTime now = DateTime.now(); + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); + String formattedDate = + DateFormat('yyyy-MM-dd ' + a.startTime).format(now); + DateTime dateTimeA = dateFormat.parse(formattedDate); + String formattedDateB = + DateFormat('yyyy-MM-dd ' + b.startTime).format(now); + DateTime dateTimeB = dateFormat.parse(formattedDateB); + var adate = dateTimeA; //a.startTime; + var bdate = dateTimeB; + return adate.compareTo(bdate); + }); + responseModelList2 = responseModelList; + _isError = false; + } else { + _isError = true; + error = model.error ?? + res['ErrorEndUserMessage'] ?? + res['ErrorMessage']; + } + + _isLoading = false; + }); + GifLoaderDialogUtils.hideDialog(context); + }).catchError((error) { + Helpers.showErrorToast(error.toString()); + GifLoaderDialogUtils.hideDialog(context); + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + Helpers.showErrorToast(err); + }); + } + + Widget _locationBar(BuildContext _context, model) { + return Container( + height: MediaQuery.of(context).size.height * 0.0619, + width: SizeConfig.screenWidth * 0.94, + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: BorderRadius.circular(12.5), + // border: Border.all( + // width: 0.5, + // ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.058, + width: SizeConfig.screenWidth * 0.2334, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12.5), + topRight: Radius.circular(12.5), + topLeft: Radius.circular(9.5), + bottomLeft: Radius.circular(9.5)), + color: _isActive ? HexColor("#B8382B") : Colors.white, + ), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + + fontWeight: FontWeight.normal, + ), + ), + )), + ), + onTap: () { + //filterBooking(item.toString()); + + setState(() { + _activeLocation = _locations.indexOf(item); + }); + filterPatient(item.toString(), model); + }), + _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, + ) + : Container() + ]); + }).toList(), + ), + ); + } + + filterPatient(item, model) { + if (item == 'Tomorrow') { + _patientSearchFormValues.To = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + _patientSearchFormValues.From = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + } else if (item == 'Next Week') { + _patientSearchFormValues.From = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + + _patientSearchFormValues.To = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 6), + 'yyyy-MM-dd'); + } else { + _patientSearchFormValues.From = DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + _patientSearchFormValues.To = DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + } + searchPatient(model); + } + + searchPatient(model) { + GifLoaderDialogUtils.showMyDialog(context); + int val2 = int.parse(patientType); + GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; + if (val2 == 0) { + patient = PatientModel( + From: _patientSearchFormValues.From, + To: _patientSearchFormValues.To, + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + ); + } + + model + .getPatientList( + val2 == 7 ? getPatientArrivalListRequestModel.toJson() : patient, + patientType, + isView: isView) + .then((res) { + setState(() { + GifLoaderDialogUtils.hideDialog(context); + if (res != null && res['MessageStatus'] == 1) { + if (val2 == 7) { + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + var localList = []; + if (res["patientArrivalList"]["entityList"] == null) { + res["patientArrivalList"]["entityList"] = []; + } + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient = { + ...v, + ...v["patientDetails"] + }; + localList.add(mergedPatient); + }); + lItems = localList; + } + } else { + if (isView == false && val2 == 1) { + lItems = res['GetPatientFileInformation_PRMList'] + .where((i) => i['PatientTypeDescription'] == 'Permanent File') + .toList(); + } else { + lItems = res[SERVICES_PATIANT2[val2]]; + } + } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + if (val2 == 7) { + responseModelList.sort((a, b) { + if (b.startTime != null && b.startTime != null) { + try { + DateTime now = DateTime.now(); + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); + String formattedDate = + DateFormat('yyyy-MM-dd ' + a.startTime).format(now); + DateTime dateTimeA = dateFormat.parse(formattedDate); + String formattedDateB = + DateFormat('yyyy-MM-dd ' + b.startTime).format(now); + DateTime dateTimeB = dateFormat.parse(formattedDateB); + var adate = dateTimeA; //a.startTime; + var bdate = dateTimeB; + return adate.compareTo(bdate); + } on Exception catch (_) { + print('never reached'); + var adate = a.startTime; //a.startTime; + var bdate = b.startTime; + return adate.compareTo(bdate); + } + } else { + var adate = convertDateFormat(a.appointmentDate); + var bdate = convertDateFormat(b.appointmentDate); + return bdate.compareTo(adate); + } + }); + } + responseModelList2 = responseModelList; + _isError = false; + } else { + _isError = true; + error = + model.error ?? res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + } + + _isLoading = false; + }); + }).catchError((error) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + _isError = true; + _isLoading = false; + this.error = error.toString(); + }); + }); + } +} diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 5dcedc7e..dad33425 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -35,18 +35,18 @@ class PatientCard extends StatelessWidget { color: Colors.white, ), child: Stack(children: [ - if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") - Container( - height: MediaQuery.of(context).size.height * .20, - width: 5, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10)), - color: patientInfo.patientStatusType == 43 - ? Colors.green[500] - : Colors.red[800], - )), + // if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") + // Container( + // height: MediaQuery.of(context).size.height * .20, + // width: 5, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.only( + // topLeft: Radius.circular(10), + // bottomLeft: Radius.circular(10)), + // color: patientInfo.patientStatusType == 43 + // ? Colors.green[500] + // : Colors.red[800], + // )), Container( padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( @@ -55,48 +55,48 @@ class PatientCard extends StatelessWidget { SizedBox( height: 10, ), - SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" - ? Padding( - padding: EdgeInsets.only(left: 12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - patientInfo.patientStatusType == 43 - ? AppText( - TranslationBase.of(context).arrivedP, - color: Colors.green, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), - this.arrivalType == '1' - ? AppText( - patientInfo.startTime != null - ? patientInfo.startTime - : patientInfo.startTimes, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) - : patientInfo.arrivedOn != null - ? AppText( - DateUtils.convertStringToDateFormat( - patientInfo.arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) - : SizedBox() - ], - )) - : SizedBox(), + // SERVICES_PATIANT2[int.parse(patientType)] == + // "List_MyOutPatient" + // ? Padding( + // padding: EdgeInsets.only(left: 12.0), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // patientInfo.patientStatusType == 43 + // ? AppText( + // TranslationBase.of(context).arrivedP, + // color: Colors.green, + // fontWeight: FontWeight.bold, + // fontFamily: 'Poppins', + // fontSize: 12, + // ) + // : AppText( + // TranslationBase.of(context).notArrived, + // color: Colors.red[800], + // fontWeight: FontWeight.bold, + // fontFamily: 'Poppins', + // fontSize: 12, + // ), + // this.arrivalType == '1' + // ? AppText( + // patientInfo.startTime != null + // ? patientInfo.startTime + // : patientInfo.startTimes, + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // ) + // : patientInfo.arrivedOn != null + // ? AppText( + // DateUtils.convertStringToDateFormat( + // patientInfo.arrivedOn, + // 'MM-dd-yyyy HH:mm'), + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // ) + // : SizedBox() + // ], + // )) + // : SizedBox(), Padding( padding: EdgeInsets.only(left: 12.0), child: Row( @@ -213,32 +213,32 @@ class PatientCard extends StatelessWidget { ), ), ), - if (SERVICES_PATIANT2[int.parse(patientType)] != - "List_MyInPatient") - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: - TranslationBase.of(context).age + - " : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: - "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ], - ), - ), - ), + // if (SERVICES_PATIANT2[int.parse(patientType)] != + // "List_MyInPatient") + // Container( + // child: RichText( + // text: new TextSpan( + // style: new TextStyle( + // fontSize: 2.0 * SizeConfig.textMultiplier, + // color: Colors.black, + // fontFamily: 'Poppins', + // ), + // children: [ + // new TextSpan( + // text: + // TranslationBase.of(context).age + + // " : ", + // style: TextStyle(fontSize: 14)), + // new TextSpan( + // text: + // "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + // style: TextStyle( + // fontWeight: FontWeight.w700, + // fontSize: 15)), + // ], + // ), + // ), + // ), if (isInpatient == true) Container( child: RichText( @@ -370,27 +370,28 @@ class PatientCard extends StatelessWidget { //) ])) ]), - SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" - ? Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(4), - child: Image.asset( - patientInfo.appointmentType == - 'Regular' && - patientInfo.visitTypeId == 100 - ? 'assets/images/livecare.png' - : patientInfo.appointmentType == - 'Walkin' - ? 'assets/images/walkin.png' - : 'assets/images/booked.png', - height: 25, - width: 35, - )), - ]) - : (isInpatient == true) + // SERVICES_PATIANT2[int.parse(patientType)] == + // "List_MyOutPatient" + // ? Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Container( + // padding: EdgeInsets.all(4), + // child: Image.asset( + // patientInfo.appointmentType == + // 'Regular' && + // patientInfo.visitTypeId == 100 + // ? 'assets/images/livecare.png' + // : patientInfo.appointmentType == + // 'Walkin' + // ? 'assets/images/walkin.png' + // : 'assets/images/booked.png', + // height: 25, + // width: 35, + // )), + // ]) + // : + (isInpatient == true) ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ From 357e01c846033eb8b4c591e7a045a6ba4649feec Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 13:52:54 +0300 Subject: [PATCH 003/102] hot fixes --- lib/config/localized_values.dart | 2 +- lib/core/model/radiology/final_radiology.dart | 2 +- .../service/patient-vital-signs-service.dart | 18 ++- .../patient-vital-sign-viewmodel.dart | 13 +- .../my_referred_patient_model.dart | 4 +- .../profile/lab_result/labs_home_page.dart | 130 +++++++++-------- .../radiology/radiology_details_page.dart | 12 +- .../radiology/radiology_home_page.dart | 132 ++++++++++-------- .../referral/referred-patient-screen.dart | 3 +- .../referred_patient_detail_in-paint.dart | 2 +- .../prescription/add_prescription_form.dart | 113 +-------------- .../shared/buttons/secondary_button.dart | 8 +- lib/widgets/shared/doctor_card.dart | 5 +- 13 files changed, 191 insertions(+), 253 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cfad087a..ee4181e3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -782,7 +782,7 @@ const Map> localizedValues = { }, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, - "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, 'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"}, 'searchPatient-name': { diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 1d406b81..fdccf5f5 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -125,7 +125,7 @@ class FinalRadiology { orderNo = json['OrderNo']; projectName = json['ProjectName']; qR = json['QR']; - isLiveCareAppodynamicment = json['IsLiveCareAppodynamicment']; + isLiveCareAppodynamicment = json['IsLiveCareAppointment']; reportDataHTML = json['ReportDataHTML']; reportDataTextdynamic = json['ReportDataTextdynamic']; // speciality = json['Speciality'].cast(); diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 71307ddc..4dd16859 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -71,14 +71,19 @@ class VitalSignsService extends BaseService { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; - body['PatientTypeID'] = 1; - if(isInPatient){ - body['InOutPatientType'] = 1; - }else { - body['InOutPatientType'] = 2; + body['PatientTypeID'] = patient.patientType; + // if(isInPatient){ + body['InOutPatientType'] = 0; + // }else { + // body['InOutPatientType'] = 2; + // } + + if (patient.appointmentNo != null && patient.projectId != null) { + body['TransNo'] = patient.appointmentNo; + body['ProjectID'] = patient.projectId; } - await baseAppClient.post( + await baseAppClient.postPatient( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); @@ -93,6 +98,7 @@ class VitalSignsService extends BaseService { super.error = error.toString(); }, body: body, + patient: patient ); } } diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 6786ad92..f9cbfc8d 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -52,12 +52,13 @@ class VitalSignsViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); - // if (isInPatient) { - // await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); - // } else { - // await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); - // } + + if (isInPatient) { + await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); + } else { + await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + + } if (_vitalSignService.hasError) { error = _vitalSignService.error; diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index cc0381d8..44a427f7 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -64,6 +64,7 @@ class MyReferredPatientModel { String referralClinicDescription; String referringDoctorName; bool isReferralDoctorSameBranch; + String referralStatusDesc; MyReferredPatientModel({ this.rowID, @@ -128,7 +129,7 @@ class MyReferredPatientModel { this.referringDoctorName, this.isReferralDoctorSameBranch, this.referralDoctorName, - this.referralClinicDescription, + this.referralClinicDescription,this.referralStatusDesc }); MyReferredPatientModel.fromJson(Map json) { @@ -194,6 +195,7 @@ class MyReferredPatientModel { referringDoctorName = json['ReferringDoctorName']; referralDoctorName = json['ReferralDoctorName']; referralClinicDescription = json['ReferralClinicDescription']; + referralStatusDesc = json['ReferralStatusDesc']; } Map toJson() { diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 1cdc5987..dd3e0995 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.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'; @@ -37,7 +38,7 @@ class _LabsHomePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getLabs(patient, isInpatient: isInpatient), + onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], @@ -105,42 +106,7 @@ class _LabsHomePageState extends State { )), ); },label: 'Apply for New Lab Order',), - if(!isInpatient) - Container( - margin: EdgeInsets.only(right: 8), - width: double.maxFinite, - child: InkWell( - onTap: (){ - setState(() { - isInpatient= true; - }); - model.getLabs(patient, isInpatient: true); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Inpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), - if(isInpatient) - Container( - width: double.maxFinite, - margin: EdgeInsets.only(right: 8), - child: InkWell( - onTap: (){ - setState(() { - isInpatient= false; - }); - model.getLabs(patient, isInpatient: false); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Outpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), + ...List.generate( model.patientLabOrdersList.length, (index) => Column( @@ -149,26 +115,80 @@ class _LabsHomePageState extends State { children: model .patientLabOrdersList[index].patientLabOrdersList .map((labOrder) { - return DoctorCard( - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, - arrivalType: arrivalType, - patientType: patientType, + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: labOrder.isLiveCareAppointment + ? Colors.red[900] + : !labOrder.isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + + ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + labOrder.isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !labOrder.isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: labOrder, + patient: patient, + arrivalType: arrivalType, + patientType: patientType, + ), + ), + ), + doctorName: labOrder.doctorName, + invoiceNO: ' ${labOrder.invoiceNo}', + profileUrl: labOrder.doctorImageURL, + branch: labOrder.projectName, + clinic: labOrder.clinicDescription, + appointmentDate: labOrder.orderDate, + orderNo: labOrder.orderNo, + isShowTime: false, + ), ), - ), + ], ), - doctorName: labOrder.doctorName, - invoiceNO: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - branch: labOrder.projectName, - clinic: labOrder.clinicDescription, - appointmentDate: labOrder.orderDate, - orderNo: labOrder.orderNo, - isShowTime: false, ); }).toList(), ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 4f3b5be2..acc79d19 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -64,17 +64,18 @@ class RadiologyDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - AppText(TranslationBase.of(context).generalResult), - SizedBox( - height: 5, + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),), ), + Padding( padding: const EdgeInsets.all(8.0), child: AppText( '${finalRadiology.reportData.trim()}', textAlign: TextAlign.start, fontSize: 17, - color: Colors.grey, + color: Color(0xff575757), ), ), SizedBox( @@ -94,8 +95,9 @@ class RadiologyDetailsPage extends StatelessWidget { margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: SecondaryButton( - color: Colors.red[600], + color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", + textColor: Color(0xffFFFFFF), onTap: () { launch(model.radImageURL); }, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index ec34bcd1..6c709e83 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.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'; @@ -24,6 +25,7 @@ class _RadiologyHomePageState extends State { PatiantInformtion patient; String arrivalType; bool isInpatient; + @override void didChangeDependencies() { super.didChangeDependencies(); @@ -38,8 +40,8 @@ class _RadiologyHomePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => - model.getPatientRadOrders(patient, patientType: patientType, isInPatient: isInpatient), + onModelReady: (model) => model.getPatientRadOrders(patient, + patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -112,63 +114,81 @@ class _RadiologyHomePageState extends State { }, label: 'Apply for Radiology Order', ), - if(!isInpatient) - Container( - width: double.maxFinite, - margin: EdgeInsets.only(right: 8), - child: InkWell( - onTap: (){ - setState(() { - isInpatient = true; - }); - model.getPatientRadOrders(patient, patientType: patientType, isInPatient: true); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Inpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), - if(isInpatient) - Container( - margin: EdgeInsets.only(right: 8), - width: double.maxFinite, - child: InkWell( - onTap: (){ - setState(() { - isInpatient = false; - }); - model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Outpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), ...List.generate( model.radiologyList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], - patient: patient, + (index) => Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, ), - ), - ), - child: DoctorCard( - doctorName: model.radiologyList[index].doctorName, - profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: '${model.radiologyList[index].invoiceNo}', - branch: '${model.radiologyList[index].projectName}', - clinic: model.radiologyList[index].clinicDescription, - appointmentDate: - !isInpatient?model.radiologyList[index].orderDate : - model.radiologyList[index].reportDate, + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: model.radiologyList[index].isLiveCareAppodynamicment + ? Colors.red[900] + : !model.radiologyList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + + ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: model.radiologyList[index].clinicDescription, + appointmentDate: !isInpatient + ? model.radiologyList[index].orderDate + : model.radiologyList[index].reportDate, + onTap: () { + Navigator.push( + context, + FadePage( + page: RadiologyDetailsPage( + finalRadiology: model.radiologyList[index], + patient: patient, + ), + ), + ); + }, + ), + ), + ], ), )), if (model.radiologyList.isEmpty && diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index ceb35929..23bbb2b9 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -66,8 +66,7 @@ class ReferredPatientScreen extends StatelessWidget { ); }, child: PatientReferralItemWidget( - referralStatus: - "${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}", + referralStatus:model.getReferredPatientItem(index).referralStatusDesc, referralStatusCode: model .getReferredPatientItem(index) .referralStatus, 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..a9ca6c27 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 @@ -146,7 +146,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + referredPatient.referralStatusDesc, fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 2352ae32..c99bb063 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -284,118 +284,7 @@ class _PrescriptionFormWidgetState extends State { child: Column( //mainAxisAlignment: MainAxisAlignment.end, children: [ - // Container( - // height: MediaQuery.of(context).size.height * - // 0.070, - // color: Colors.white, - // child: InkWell( - // onTap: model.allMedicationList != null - // ? () { - // Helpers.hideKeyboard(context); - // setState(() { - // _selectedMedication = null; - // model.getItem( - // itemID: _selectedMedication - // .itemId); - // }); - // } - // : null, - // child: _selectedMedication == null - // ? AutoCompleteTextField< - // GetMedicationResponseModel>( - // onFocusChanged: (__) { - // if (_selectedMedication != - // null) { - // model.getItem( - // itemID: - // _selectedMedication - // .itemId); - // uom = _selectedMedication.uom; - // } else { - // null; - // } - // 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; - // } - // }, - // decoration: - // textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // _selectedMedication != null - // ? _selectedMedication - // .genericName - // : null, - // true, - // ), - // itemSubmitted: (item) => setState( - // () => _selectedMedication = - // item), - // key: key, - // suggestions: - // model.allMedicationList, - // itemBuilder: (context, - // suggestion) => - // new Padding( - // child: AppText(suggestion - // .description + - // '/' + - // suggestion - // .genericName), - // padding: - // EdgeInsets.all(15.0)), - // itemSorter: (a, b) => 1, - // suggestionsAmount: 7, - // itemFilter: (suggestion, input) => - // suggestion.genericName.toLowerCase().startsWith( - // input.toLowerCase()) || - // suggestion.description - // .toLowerCase() - // .startsWith(input - // .toLowerCase()) || - // suggestion.keywords - // .toLowerCase() - // .startsWith( - // input.toLowerCase()), - // ) - // : TextField( - // onEditingComplete: () { - // model.getItem( - // itemID: _selectedMedication - // .itemId); - // }, - // decoration: textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // _selectedMedication != null - // ? _selectedMedication - // .description + - // ('${_selectedMedication.genericName}') - // : null, - // false, - // suffixIcon: - // Icon(Icons.search)), - // enabled: false, - // ), - // ), - // ), + FractionallySizedBox( widthFactor: 0.9, child: Container( diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index acd99c99..48c65baf 100644 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ b/lib/widgets/shared/buttons/secondary_button.dart @@ -238,11 +238,9 @@ class _SecondaryButtonState extends State widget.label, style: TextStyle( color: widget.textColor, - fontSize: widget.small ? 12.0 : 15.0, - // fontWeight: FontWeight.w800, - fontFamily: projectViewModel.isArabic - ? 'Cairo' - : 'Poppins'), + fontSize: 16, + fontWeight: FontWeight.w700, + fontFamily: 'Poppins'), ), ) ], diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 1c889d9d..778ce3c8 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -20,6 +20,7 @@ class DoctorCard extends StatelessWidget { final String clinic; final bool isShowEye; final bool isShowTime; + final bool isNoMargin; DoctorCard( {this.doctorName, @@ -31,13 +32,13 @@ class DoctorCard extends StatelessWidget { this.orderNo, this.isPrescriptions = false, this.clinic, - this.isShowEye = true, this.isShowTime= true}); + this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.all(10), + margin: EdgeInsets.all(!isNoMargin? 10:0), decoration: BoxDecoration( border: Border.all( width: 0.5, From 3e24278d89398ed3891082244fd11c218abb15c3 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 26 Apr 2021 14:59:37 +0300 Subject: [PATCH 004/102] in-patient re-design --- lib/config/config.dart | 3 + lib/config/localized_values.dart | 1 + lib/core/model/PatientSearchRequestModel.dart | 18 +- lib/core/service/patientInPatientService.dart | 36 ++++ .../viewModel/PatientSearchViewModel.dart | 53 ++++- lib/locator.dart | 2 + lib/screens/home/home_screen.dart | 26 ++- .../patients/PatientsInPatientScreen.dart | 189 ++++++++++++++++++ lib/util/translations_delegate_base.dart | 2 + .../shared/text_fields/text_fields_utils.dart | 4 +- 10 files changed, 312 insertions(+), 22 deletions(-) create mode 100644 lib/core/service/patientInPatientService.dart create mode 100644 lib/screens/patients/PatientsInPatientScreen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 5c704152..e930aef9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -152,6 +152,9 @@ const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_PATIENT_IN_PATIENT_LIST = + 'Services/DoctorApplication.svc/REST/GetMyInPatient'; + const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cfad087a..eec509a9 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': 'My InPatients', 'ar': 'المريض الداخلي'}, + 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, diff --git a/lib/core/model/PatientSearchRequestModel.dart b/lib/core/model/PatientSearchRequestModel.dart index 72b1aa9e..e758d5e8 100644 --- a/lib/core/model/PatientSearchRequestModel.dart +++ b/lib/core/model/PatientSearchRequestModel.dart @@ -10,15 +10,15 @@ class PatientSearchRequestModel { String to; PatientSearchRequestModel( - {this.doctorID, - this.firstName, - this.middleName, - this.lastName, - this.patientMobileNumber, - this.patientIdentificationID, - this.patientID, - this.from, - this.to}); + {this.doctorID = 0, + this.firstName = "0", + this.middleName = "0", + this.lastName = "0", + this.patientMobileNumber = "0", + this.patientIdentificationID = "0", + this.patientID = 0, + this.from = "0", + this.to = "0"}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; diff --git a/lib/core/service/patientInPatientService.dart b/lib/core/service/patientInPatientService.dart new file mode 100644 index 00000000..3e0ba4a4 --- /dev/null +++ b/lib/core/service/patientInPatientService.dart @@ -0,0 +1,36 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class PatientInPatientService extends BaseService { + List inPatientList = List(); + + Future getInPatientList( + PatientSearchRequestModel requestModel, bool isMyInpatient) async { + hasError = false; + await getDoctorProfile(); + + if (isMyInpatient) { + requestModel.doctorID = doctorProfile.doctorID; + }else { + requestModel.doctorID = 0; + } + + await baseAppClient.post( + GET_PATIENT_IN_PATIENT_LIST, + onSuccess: (dynamic response, int statusCode) { + inPatientList.clear(); + + response['List_MyInPatient'].forEach((v) { + inPatientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: requestModel.toJson(), + ); + } +} diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index ea0e5cec..e2d675ca 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,5 +1,54 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/patientInPatientService.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +import '../../locator.dart'; import 'base_view_model.dart'; -class PatientSearchViewModel extends BaseViewModel{ +class PatientSearchViewModel extends BaseViewModel { + PatientInPatientService _inPatientService = + locator(); + + List get _inPatientList => _inPatientService.inPatientList; + List filteredInPatientItems = List(); + + Future getInPatientList(PatientSearchRequestModel requestModel, + {bool isMyInpatient = false}) async { + setState(ViewState.Busy); + await _inPatientService.getInPatientList(requestModel, isMyInpatient); + if (_inPatientService.hasError) { + error = _inPatientService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + filteredInPatientItems.clear(); + filteredInPatientItems.addAll(_inPatientList); + } + } + + void filterSearchResults(String query) { + var strExist = query.length > 0 ? true : false; + if (strExist) { + filteredInPatientItems = []; + for (var i = 0; i < _inPatientList.length; i++) { + String firstName = _inPatientList[i].firstName.toUpperCase(); + String lastName = _inPatientList[i].lastName.toUpperCase(); + String mobile = _inPatientList[i].mobileNumber.toUpperCase(); + String patientID = _inPatientList[i].patientId.toString(); + + if (firstName.contains(query.toUpperCase()) || + lastName.contains(query.toUpperCase()) || + mobile.contains(query) || + patientID.contains(query)) { + filteredInPatientItems.add(_inPatientList[i]); + } + } + notifyListeners(); + } else { + filteredInPatientItems = _inPatientList; + notifyListeners(); + } + } -} \ No newline at end of file +} diff --git a/lib/locator.dart b/lib/locator.dart index 3aabd46b..c6ddae3c 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -27,6 +27,7 @@ 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/patientInPatientService.dart'; import 'core/service/prescriptions_service.dart'; import 'core/service/radiology_service.dart'; import 'core/service/referral_patient_service.dart'; @@ -80,6 +81,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReferralService()); locator.registerLazySingleton(() => MyReferralInPatientService()); locator.registerLazySingleton(() => DischargedPatientService()); + locator.registerLazySingleton(() => PatientInPatientService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 39fc7a8c..5b1574df 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_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/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; @@ -30,6 +31,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/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -494,15 +496,21 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { - getRequestHeader(true); - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": - _patientSearchFormValues, - "selectedType": "1", - "arrivalType": "1", - "isInpatient": true - }); + Navigator.push( + context, + FadePage( + page: PatientInPatientScreen(), + ), + ); + // getRequestHeader(true); + // Navigator.of(context) + // .pushNamed(PATIENTS, arguments: { + // "patientSearchForm": + // _patientSearchFormValues, + // "selectedType": "1", + // "arrivalType": "1", + // "isInpatient": true + // }); }, ), HomePageCard( diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart new file mode 100644 index 00000000..e46055d5 --- /dev/null +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -0,0 +1,189 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/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'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; + +import '../../routes.dart'; + +class PatientInPatientScreen extends StatefulWidget { + @override + _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); +} + +class _PatientInPatientScreenState extends State { + PatientSearchRequestModel requestModel = PatientSearchRequestModel(); + int _activeTab = 0; + + TextEditingController _searchController = TextEditingController(); + + @override + void dispose() { + _searchController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return BaseView( + onModelReady: (model) => model.getInPatientList(requestModel), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + TranslationBase.of(context).inPatient, + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + fontFamily: 'Poppins', + ), + ), + ]), + ), + ), + tabsBar(context, screenSize, model), + model.filteredInPatientItems.length > 0 + ? Expanded( + child: Container( + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchPatientName, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), + controller: _searchController, + onChanged: (value) { + model.filterSearchResults(value); + }), + const SizedBox( + height: 16, + ), + ...model.filteredInPatientItems.map((item) { + return PatientCard( + patientInfo: item, + patientType: "1", + arrivalType: "1", + isInpatient: true, + onTap: () { + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": item, + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + }).toList(), + ], + ), + ), + ), + ) + : Container( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable)), + ], + ), + ), + ); + } + + Widget tabsBar( + BuildContext context, Size screenSize, PatientSearchViewModel model) { + List _tabs = [ + TranslationBase.of(context).inPatientAll.toUpperCase(), + TranslationBase.of(context).inPatient.toUpperCase(), + ]; + + return Container( + 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: _tabs.map((item) { + bool _isActive = _tabs[_activeTab] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeTab = _tabs.indexOf(item); + }); + // GifLoaderDialogUtils.showMyDialog( + // context); + await model.getInPatientList(requestModel, + isMyInpatient: _activeTab == 1); + }, + 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(), + ), + ); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 4645a5e0..3d431f9d 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -101,6 +101,8 @@ class TranslationBase { String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get operations => localizedValues['operations'][locale.languageCode]; String get patientServices => diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 660f7918..54c7e494 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -4,11 +4,11 @@ class TextFieldsUtils{ static BoxDecoration containerBorderDecoration( Color containerColor, Color borderColor, - {double borderWidth = -1}) { + {double borderWidth = -1, double borderRadius = 12}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(12)), + borderRadius: BorderRadius.all(Radius.circular(borderRadius)), border: Border.fromBorderSide(BorderSide( color: borderColor, width: borderWidth == -1 ? 2.0 : borderWidth, From 058a6d9e8cc3493bd5cd2d0ea1bc2a40d0981825 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 26 Apr 2021 15:00:44 +0300 Subject: [PATCH 005/102] sick leave service --- lib/core/model/sick_leave_patient_model.dart | 22 ++- lib/core/service/sickleave_service.dart | 48 +++--- lib/core/viewModel/sick_leave_view_model.dart | 11 ++ lib/screens/sick-leave/add-sickleave.dart | 163 +++++++++--------- 4 files changed, 137 insertions(+), 107 deletions(-) diff --git a/lib/core/model/sick_leave_patient_model.dart b/lib/core/model/sick_leave_patient_model.dart index e0637845..3c78f1ff 100644 --- a/lib/core/model/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave_patient_model.dart @@ -1,3 +1,5 @@ +import 'package:doctor_app_flutter/widgets/shared/StarRating.dart'; + class SickLeavePatientModel { String setupID; int projectID; @@ -30,8 +32,10 @@ class SickLeavePatientModel { dynamic patientName; String projectName; String qR; - List speciality; + // List speciality; String strRequestDate; + String startDate; + String endDate; SickLeavePatientModel( {this.setupID, @@ -65,11 +69,14 @@ class SickLeavePatientModel { this.patientName, this.projectName, this.qR, - this.speciality, - this.strRequestDate}); + // this.speciality, + this.strRequestDate, + this.startDate, + this.endDate}); SickLeavePatientModel.fromJson(Map json) { setupID = json['SetupID']; + projectID = json['ProjectID']; patientID = json['PatientID']; patientType = json['PatientType']; @@ -100,13 +107,16 @@ class SickLeavePatientModel { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; - speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); strRequestDate = json['StrRequestDate']; + startDate = json['StartDate']; + endDate = json['EndDate']; } Map toJson() { final Map data = new Map(); data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; data['PatientType'] = this.patientType; @@ -137,8 +147,10 @@ class SickLeavePatientModel { data['PatientName'] = this.patientName; data['ProjectName'] = this.projectName; data['QR'] = this.qR; - data['Speciality'] = this.speciality; + // data['Speciality'] = this.speciality; data['StrRequestDate'] = this.strRequestDate; + data['StartDate'] = this.startDate; + data['EndDate'] = this.endDate; return data; } } diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index bba9b31f..90785a7b 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -98,13 +98,13 @@ class SickLeaveService extends BaseService { Future getSickLeave(patientMRN) async { hasError = false; - await baseAppClient.post( + await baseAppClient.postPatient( GET_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { Future.value(response); - _getAllsickLeave.clear(); - response['SickLeavesList']['entityList'].forEach((v) { - _getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v)); + _getAllsickLeavePatient.clear(); + response['List_SickLeave'].forEach((v) { + _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -115,26 +115,26 @@ class SickLeaveService extends BaseService { ); } - // Future getSickLeavePatient(patientMRN) async { - // _sickLeavePatientRequestModel = - // SickLeavePatientRequestModel(patientID: patientMRN, patientType: 1); - // hasError = false; - // await baseAppClient.post( - // GET_SICK_LEAVE_PATIENT, - // onSuccess: (dynamic response, int statusCode) { - // Future.value(response); - // _getAllsickLeavePatient.clear(); - // response['List_SickLeave'].forEach((v) { - // _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); - // }); - // }, - // onFailure: (String error, int statusCode) { - // hasError = true; - // super.error = error; - // }, - // body: _sickLeavePatientRequestModel.toJson(), - // ); - // } + Future getSickLeavePatient(patientMRN) async { + _sickLeavePatientRequestModel = SickLeavePatientRequestModel( + patientID: patientMRN, patientTypeID: 2, patientType: 1); + hasError = false; + await baseAppClient.postPatient( + GET_SICK_LEAVE_PATIENT, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + _getAllsickLeavePatient.clear(); + response['List_SickLeave'].forEach((v) { + _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _sickLeavePatientRequestModel.toJson(), + ); + } Future getRescheduleLeave() async { hasError = false; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index d959f3aa..f5ddd676 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -10,6 +10,7 @@ class SickLeaveViewModel extends BaseViewModel { SickLeaveService _sickLeaveService = locator(); get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get getAllSIckLeave => _sickLeaveService.getAllSickLeave; + get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient; List get allOffTime => _sickLeaveService.getOffTimeList; List get allReasons => _sickLeaveService.getReasons; List get coveringDoctors => _sickLeaveService.coveringDoctorsList; @@ -56,6 +57,16 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getSickLeavePatient(patientMRN) async { + setState(ViewState.Busy); + await _sickLeaveService.getSickLeavePatient(patientMRN); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future getRescheduleLeave() async { setState(ViewState.Busy); await _sickLeaveService.getRescheduleLeave(); diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 7820b16c..444e76bd 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/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'; @@ -22,7 +23,7 @@ class AddSickLeavScreen extends StatelessWidget { patient = routeArgs['patient']; return BaseView( onModelReady: (model) => - model.getSickLeave(patient.patientMRN ?? patient.patientId), + model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -102,25 +103,26 @@ class AddSickLeavScreen extends StatelessWidget { ], ) : SizedBox(), - model.getAllSIckLeave.length > 0 + model.getAllSIckLeavePatient.length > 0 ? Column( - children: model.getAllSIckLeave - .map((GetAllSickLeaveResponse item) { + children: model.getAllSIckLeavePatient + .map((SickLeavePatientModel item) { return RoundedContainer( margin: EdgeInsets.all(10), child: Column( children: [ Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - width: 5.0, - ))), + // decoration: BoxDecoration( + // border: Border( + // left: BorderSide( + // // color: item.status == 1 + // // ? Colors.yellow[800] + // // : item.status == 2 + // // ? Colors.green + // // : Colors.black, + // color: Colors.red, + // width: 5.0, + // ))), padding: EdgeInsets.all(10), child: Row( mainAxisAlignment: @@ -139,35 +141,37 @@ class AddSickLeavScreen extends StatelessWidget { Container( padding: EdgeInsets.all(3), child: AppText( - item.status == 1 - ? TranslationBase.of( - context) - .hold - : item.status == 2 - ? TranslationBase - .of( - context) - .active - : TranslationBase - .of(context) - .all, + item.doctorName, + // item.status == 1 + // ? TranslationBase.of( + // context) + // .hold + // : item.status == 2 + // ? TranslationBase + // .of( + // context) + // .active + // : TranslationBase + // .of(context) + // .all, fontWeight: FontWeight.bold, - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, + // color: item.status == 1 + // ? Colors.yellow[800] + // : item.status == 2 + // ? Colors.green + // : Colors.black, + color: Colors.red, ), ), Row( children: [ + AppText(TranslationBase + .of(context) + .daysSickleave + + ": "), AppText( - TranslationBase.of( - context) - .daysSickleave), - AppText( - item.noOfDays + item.sickLeaveDays .toString(), fontWeight: FontWeight.bold, @@ -183,52 +187,55 @@ class AddSickLeavScreen extends StatelessWidget { ' ', ), Flexible( - child: AppText( - DateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), - fontWeight: - FontWeight.bold, - )) + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: + FontWeight.bold, + ), + ) ], ), Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - item.remarks ?? "", + children: [ + AppText( + TranslationBase.of( + context) + .endDate + + ' ', + ), + Flexible( + child: AppText( + DateUtils + .convertStringToDateFormat( + item.endDate, + 'dd-MMM-yyyy'), + fontWeight: + FontWeight.bold, ), - // (item.status == 1 || - // item.status == 2) - // ? IconButton( - // icon: Image.asset( - // 'assets/images/edit.png'), - // - // // color: Colors.green, //Colors.black, - // onPressed: () => { - // if (item.status == - // 1) - // { - // DrAppToastMsg.showErrorToast( - // TranslationBase.of( - // context) - // .sickleaveonhold) - // } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - // }, - // ) - // : SizedBox() - ]), + ) + ], + ), + Row(children: [ + AppText(TranslationBase.of( + context) + .branch + + ": "), + AppText( + item.projectName ?? "", + ), + ]), + Row(children: [ + AppText(TranslationBase.of( + context) + .clinic + + ": "), + AppText( + item.clinicName ?? "", + ), + ]), ], ), SizedBox( From 20f7664b4c47d9c3e4c09746b0fe31c06054d474 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 15:09:39 +0300 Subject: [PATCH 006/102] fix issue --- .../viewModel/PatientSearchViewModel.dart | 77 +++++- lib/screens/home/home_screen.dart | 63 ++--- .../patient_search_screen_new.dart | 2 +- ...n_new.dart => patients_screen_search.dart} | 251 +++++------------- .../patients/patient_search/time_bar.dart | 102 +++++++ 5 files changed, 264 insertions(+), 231 deletions(-) rename lib/screens/patients/patient_search/{patients_screen_new.dart => patients_screen_search.dart} (75%) create mode 100644 lib/screens/patients/patient_search/time_bar.dart diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 455e8788..fc37cbed 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,7 +1,9 @@ +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/service/patient/out_patient_service.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'; @@ -11,19 +13,29 @@ class PatientSearchViewModel extends BaseViewModel{ List get patientList => _outPatientService.patientList; - getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { - setState(ViewState.Busy); + getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async { + if(isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + await _outPatientService.getOutPatient( patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error; + if(isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { setState(ViewState.Busy); await _outPatientService.getPatientFileInformation( patientSearchRequestModel); @@ -35,4 +47,63 @@ class PatientSearchViewModel extends BaseViewModel{ } } + + + getPatientBasedOnDate ( + {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, + bool isSearchWithKeyInfo })async { + String dateTo; + String dateFrom; + if (item == 'Tomorrow') { + dateTo = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + dateFrom = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + } else if (item == 'Next Week') { + + + dateTo = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 6), + 'yyyy-MM-dd'); + + dateFrom = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + } else { + dateFrom = DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + 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.middleName = patientSearchRequestModel.middleName; + currentModel.from = dateFrom; + currentModel.to = dateTo; + + + if(isSearchWithKeyInfo) { + await getPatientFileInformation(currentModel); + } else { + if(selectedPatientType == PatientType.OutPatient) { + await getOutPatient(currentModel, isLocalBusy: true); + } else { + // TODO handel inPatient case + } + } + + } + } \ No newline at end of file diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 47bc1d0b..f81cb803 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -465,44 +465,6 @@ class _HomeScreenState extends State { child: new ListView( scrollDirection: Axis.horizontal, children: [ - HomePageCard( - color: Colors.black, - margin: EdgeInsets.all(5), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.search, - size: 32, - color: Colors.white, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - "New:"+TranslationBase.of(context) - .searchPatient, - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 13, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PatientSearchScreenNew(), - )); - }, - ), HomePageCard( color: Colors.red[800], margin: EdgeInsets.all(5), @@ -574,15 +536,22 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { - getRequestHeader(false); - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": - _patientSearchFormValues, - "selectedType": "0", - "arrivalType": "1", - "isInpatient": false - }); + // getRequestHeader(false); + // Navigator.of(context) + // .pushNamed(PATIENTS, arguments: { + // "patientSearchForm": + // _patientSearchFormValues, + // "selectedType": "0", + // "arrivalType": "1", + // "isInpatient": false + // }); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientSearchScreenNew(), + )); }, ), HomePageCard( 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 f383cf40..7da76ec2 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/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/screens/patients/patient_search/patients_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_search.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_search.dart similarity index 75% rename from lib/screens/patients/patient_search/patients_screen_new.dart rename to lib/screens/patients/patient_search/patients_screen_search.dart index 5b3b5a77..d78f41d2 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_search.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/patients/PatientCard.dart'; @@ -23,7 +23,6 @@ import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.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/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; @@ -92,27 +91,6 @@ class _PatientsScreenNewState extends State { final _controller = TextEditingController(); PatientModel patient; - var _patientSearchFormValues = PatientModel( - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 1.2, - Channel: 9, - TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - PatientOutSA: false); - searchData(String str) { this.responseModelList = this.responseModelList2; var strExist = str.length > 0 ? true : false; @@ -217,8 +195,7 @@ class _PatientsScreenNewState extends State { }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", - isShowAppBar: widget.isAppbar, - // isLoading: _isLoading, + isShowAppBar: false, baseViewModel: model, body: model.patientList.isEmpty ? Column( @@ -227,18 +204,20 @@ class _PatientsScreenNewState extends State { SizedBox( height: 10.0, ), - if (widget.selectedPatientType == PatientType.OutPatient) - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(10)), - child: ClinicList( - clinicId: clinicId, - onClinicChange: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); + if (widget.selectedPatientType == + PatientType.OutPatient && + !widget.isSearchWithKeyInfo) + Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10)), + child: ClinicList( + clinicId: clinicId, + onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); }, )), Padding( @@ -247,7 +226,8 @@ class _PatientsScreenNewState extends State { 0.03), // child: _locationBar(context) child: - widget.selectedPatientType == PatientType.OutPatient + (widget.selectedPatientType == PatientType.OutPatient && + widget.isSearchWithKeyInfo) ? _locationBar(context, model) : Container(), ) @@ -298,6 +278,47 @@ class _PatientsScreenNewState extends State { ) : Column( children: [ + + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 115, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: 60), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize:20, + color: Colors.black), + children: [ + new TextSpan( + + text: "Search for 1111", + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 22)), + ], + ), + ), + ], + ), + ], + ), + ), + ), SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, @@ -351,7 +372,9 @@ class _PatientsScreenNewState extends State { .height * 0.03), // child: _locationBar(context) - child: widget.selectedPatientType == PatientType.OutPatient? _locationBar(context, model) + child: widget.selectedPatientType == + PatientType.OutPatient && !widget.isSearchWithKeyInfo + ? _locationBar(context, model) : Container(), ), SizedBox( @@ -522,6 +545,7 @@ class _PatientsScreenNewState extends State { }); } + //TODO Replace it with time bar. Widget _locationBar(BuildContext _context, model) { return Container( height: MediaQuery.of(context).size.height * 0.0619, @@ -567,13 +591,17 @@ class _PatientsScreenNewState extends State { ), )), ), - onTap: () { - //filterBooking(item.toString()); - + onTap: () async { setState(() { _activeLocation = _locations.indexOf(item); }); - filterPatient(item.toString(), model); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate(item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: widget + .patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); }), _isActive ? Container( @@ -592,141 +620,4 @@ class _PatientsScreenNewState extends State { ), ); } - - filterPatient(item, model) { - if (item == 'Tomorrow') { - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - } else if (item == 'Next Week') { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 6), - 'yyyy-MM-dd'); - } else { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); - } - searchPatient(model); - } - - searchPatient(model) { - GifLoaderDialogUtils.showMyDialog(context); - int val2 = int.parse(patientType); - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; - if (val2 == 0) { - patient = PatientModel( - From: _patientSearchFormValues.From, - To: _patientSearchFormValues.To, - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - ); - } - - model - .getPatientList( - val2 == 7 ? getPatientArrivalListRequestModel.toJson() : patient, - patientType, - isView: isView) - .then((res) { - setState(() { - GifLoaderDialogUtils.hideDialog(context); - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } else { - if (isView == false && val2 == 1) { - lItems = res['GetPatientFileInformation_PRMList'] - .where((i) => i['PatientTypeDescription'] == 'Permanent File') - .toList(); - } else { - lItems = res[SERVICES_PATIANT2[val2]]; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - if (val2 == 7) { - responseModelList.sort((a, b) { - if (b.startTime != null && b.startTime != null) { - try { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - } on Exception catch (_) { - print('never reached'); - var adate = a.startTime; //a.startTime; - var bdate = b.startTime; - return adate.compareTo(bdate); - } - } else { - var adate = convertDateFormat(a.appointmentDate); - var bdate = convertDateFormat(b.appointmentDate); - return bdate.compareTo(adate); - } - }); - } - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = - model.error ?? res['ErrorEndUserMessage'] ?? res['ErrorMessage']; - } - - _isLoading = false; - }); - }).catchError((error) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { - _isError = true; - _isLoading = false; - this.error = error.toString(); - }); - }); - } } diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart new file mode 100644 index 00000000..0d376b02 --- /dev/null +++ b/lib/screens/patients/patient_search/time_bar.dart @@ -0,0 +1,102 @@ +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 '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'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class TimeBar extends StatefulWidget { + final PatientSearchViewModel model; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; + final bool isSearchWithKeyInfo; + + + 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 = [ + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; + int _activeLocation = 0; + return Container( + height: MediaQuery.of(context).size.height * 0.0619, + width: SizeConfig.screenWidth * 0.94, + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: BorderRadius.circular(12.5), + // border: Border.all( + // width: 0.5, + // ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.058, + width: SizeConfig.screenWidth * 0.2334, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12.5), + topRight: Radius.circular(12.5), + topLeft: Radius.circular(9.5), + bottomLeft: Radius.circular(9.5)), + color: _isActive ? HexColor("#B8382B") : Colors.white, + ), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + + fontWeight: FontWeight.normal, + ), + ), + )), + ), + 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); + 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, + ) + : Container() + ]); + }).toList(), + ), + ); + } +} From 963e4b637357144594ff81305817c6f5d08e1702 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 15:11:49 +0300 Subject: [PATCH 007/102] fix issue --- .../patients/patient_search/patient_search_screen_new.dart | 2 +- .../{patients_screen_search.dart => patients_screen_new.dart} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/screens/patients/patient_search/{patients_screen_search.dart => patients_screen_new.dart} (100%) 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 7da76ec2..f383cf40 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/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/screens/patients/patient_search/patients_screen_search.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/patient_search/patients_screen_search.dart b/lib/screens/patients/patient_search/patients_screen_new.dart similarity index 100% rename from lib/screens/patients/patient_search/patients_screen_search.dart rename to lib/screens/patients/patient_search/patients_screen_new.dart From cc7d64e9d158e6125833a4ffdee19ad41b2bf115 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 15:24:13 +0300 Subject: [PATCH 008/102] fix merge issue --- lib/core/viewModel/PatientSearchViewModel.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 9548f306..74c4c363 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -111,9 +111,11 @@ class PatientSearchViewModel extends BaseViewModel{ } } -class PatientSearchViewModel extends BaseViewModel { + + + PatientInPatientService _inPatientService = - locator(); + locator(); List get _inPatientList => _inPatientService.inPatientList; List filteredInPatientItems = List(); @@ -156,4 +158,5 @@ class PatientSearchViewModel extends BaseViewModel { } } + } From 286d883c9bd845a926afa0776047211f93abe117 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 26 Apr 2021 15:37:19 +0300 Subject: [PATCH 009/102] in-patient re-design --- .../viewModel/PatientSearchViewModel.dart | 17 +++-- .../patients/PatientsInPatientScreen.dart | 69 ++++++++++++------- 2 files changed, 55 insertions(+), 31 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index e2d675ca..90a04c52 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -14,16 +14,20 @@ class PatientSearchViewModel extends BaseViewModel { List filteredInPatientItems = List(); Future getInPatientList(PatientSearchRequestModel requestModel, - {bool isMyInpatient = false}) async { - setState(ViewState.Busy); + {bool isMyInpatient = false, bool isFirstTime = true}) async { + if (isFirstTime) + setState(ViewState.Busy); + else + setState(ViewState.BusyLocal); await _inPatientService.getInPatientList(requestModel, isMyInpatient); if (_inPatientService.hasError) { error = _inPatientService.error; setState(ViewState.Error); } else { - setState(ViewState.Idle); filteredInPatientItems.clear(); - filteredInPatientItems.addAll(_inPatientList); + if (_inPatientList.length > 0) + filteredInPatientItems.addAll(_inPatientList); + setState(ViewState.Idle); } } @@ -46,9 +50,10 @@ class PatientSearchViewModel extends BaseViewModel { } notifyListeners(); } else { - filteredInPatientItems = _inPatientList; + if (_inPatientList.length > 0) + filteredInPatientItems.clear(); + filteredInPatientItems.addAll(_inPatientList); notifyListeners(); } } - } diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index e46055d5..ba8b5f0a 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/model/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'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -71,32 +72,35 @@ class _PatientInPatientScreenState extends State { ), ), tabsBar(context, screenSize, model), + Container( + margin: EdgeInsets.all(16.0), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchPatientName, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), + controller: _searchController, + onChanged: (value) { + model.filterSearchResults(value); + }), + ), model.filteredInPatientItems.length > 0 ? Expanded( child: Container( - margin: EdgeInsets.all(16.0), + margin: EdgeInsets.symmetric(horizontal: 16.0), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchPatientName, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - ), - onPressed: () {}, - ), - controller: _searchController, - onChanged: (value) { - model.filterSearchResults(value); - }), - const SizedBox( - height: 16, - ), + // const SizedBox( + // height: 16, + // ), ...model.filteredInPatientItems.map((item) { return PatientCard( patientInfo: item, @@ -104,6 +108,11 @@ class _PatientInPatientScreenState extends State { arrivalType: "1", isInpatient: true, onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + Navigator.of(context) .pushNamed(PATIENTS_PROFILE, arguments: { "patient": item, @@ -122,9 +131,13 @@ class _PatientInPatientScreenState extends State { ), ), ) - : Container( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable)), + : Expanded( + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable)), + ), + ), ], ), ), @@ -155,10 +168,16 @@ class _PatientInPatientScreenState extends State { setState(() { _activeTab = _tabs.indexOf(item); }); - // GifLoaderDialogUtils.showMyDialog( - // context); + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + GifLoaderDialogUtils.showMyDialog( + context); await model.getInPatientList(requestModel, - isMyInpatient: _activeTab == 1); + isMyInpatient: _activeTab == 1, isFirstTime: false); + GifLoaderDialogUtils.hideDialog( + context); }, child: Center( child: Container( From 975260df2a1dcf83ed67e94c01f0590712a78a46 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 26 Apr 2021 15:57:09 +0300 Subject: [PATCH 010/102] Search Profile Patient update --- .../profile/patient_profile_screen.dart | 14 +- ...rofile_medical_info_widget_in_patient.dart | 6 +- .../profile_medical_info_widget_search.dart | 649 ++++++++++++++---- pubspec.lock | 8 +- 4 files changed, 529 insertions(+), 148 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 749c0885..9e011ce9 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -58,7 +58,7 @@ class PatientProfileScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - !isFromSearch && isInpatient/*patientType == "1"*/ + !isFromSearch && isInpatient /*patientType == "1"*/ ? PatientProfileHeaderNewDesignInPatient( patient, patientType, arrivalType) : PatientProfileHeaderNewDesign( @@ -76,8 +76,9 @@ class PatientProfileScreen extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - isInpatient:isInpatient, - isDischargedPatient: isDischargedPatient, + isInpatient: isInpatient, + isDischargedPatient: + isDischargedPatient, ) : isFromSearch ? ProfileMedicalInfoWidgetSearch( @@ -86,7 +87,9 @@ class PatientProfileScreen extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - isInpatient:false + isInpatient: false, + isDischargedPatient: + isDischargedPatient, ) : ProfileMedicalInfoWidget( patient: patient, @@ -94,8 +97,7 @@ class PatientProfileScreen extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - isInpatient:isInpatient - ), + isInpatient: isInpatient), ], ), ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index f01f96f3..eea3bfbb 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -16,15 +16,15 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { final bool isInpatient; final bool isDischargedPatient; - - ProfileMedicalInfoWidgetInPatient( {Key key, this.patient, this.patientType, this.arrivalType, this.from, - this.to, this.isInpatient, this.isDischargedPatient = false}); + this.to, + this.isInpatient, + this.isDischargedPatient = false}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index edca6000..c03367bc 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/routes.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/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -14,6 +15,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { final String patientType; final String arrivalType; final bool isInpatient; + final bool isDischargedPatient; ProfileMedicalInfoWidgetSearch( {Key key, @@ -21,146 +23,523 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { this.patientType, this.arrivalType, this.from, - this.to, this.isInpatient}); + this.to, + this.isInpatient, + this.isDischargedPatient}); + TabController _tabController; + void initState() { + _tabController = TabController(length: 2); + } + + void dispose() { + _tabController.dispose(); + } @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) async {}, - builder: (_, model, w) => GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient:isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - (int.parse(patientType) == 7 || int.parse(patientType) == 6) - ? PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png') - : PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: SHOW_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.admissionNo != null && patient.admissionNo != "0") - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - if (patient.admissionNo != null && patient.admissionNo != "0") - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", - icon: 'patient/Progress_notes.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - // isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - ], + builder: (_, model, w) => DefaultTabController( + length: 2, + initialIndex: isInpatient ? 0 : 1, + child: SizedBox( + height: MediaQuery.of(context).size.height * 1.0, + width: double.infinity, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + toolbarHeight: 55, + elevation: 0, + bottom: TabBar( + controller: _tabController, + indicator: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10), // Creates border + color: Color(0xffD02126), + ), + //isScrollable: true, + + //indicatorWeight: 4.0, + indicatorColor: Colors.red[500], + + // labelPadding: + // EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), + unselectedLabelColor: Color(0xff5A6168), + labelColor: Colors.white, + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('Inpatient Info'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('OutPatient Info'), + ), + ), + ]), + ), + body: Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0), + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + if (isInpatient) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + if (isInpatient) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", + icon: 'patient/Progress_notes.png'), + ], + ), + ], + ), + ), + ), + ), + + // GridView.count( + // shrinkWrap: true, + // physics: NeverScrollableScrollPhysics(), + // crossAxisSpacing: 10, + // mainAxisSpacing: 10, + // childAspectRatio: 1 / 1.0, + // crossAxisCount: 3, + // children: [ + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // from: from, + // to: to, + // nameLine1: TranslationBase.of(context).vital, + // nameLine2: TranslationBase.of(context).signs, + // route: VITAL_SIGN_DETAILS, + // icon: 'patient/vital_signs.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: MEDICAL_FILE, + // nameLine1: + // "Health", //TranslationBase.of(context).medicalReport, + // nameLine2: + // "Summary", //TranslationBase.of(context).summaryReport, + // icon: 'patient/health_summary.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: LAB_RESULT, + // nameLine1: TranslationBase.of(context).lab, + // nameLine2: TranslationBase.of(context).result, + // icon: 'patient/lab_results.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // isInPatient: isInpatient, + // route: RADIOLOGY_PATIENT, + // nameLine1: TranslationBase.of(context).radiology, + // nameLine2: TranslationBase.of(context).service, + // icon: 'patient/health_summary.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: PATIENT_ECG, + // nameLine1: TranslationBase.of(context).patient, + // nameLine2: "ECG", + // icon: 'patient/patient_sick_leave.png'), + // (int.parse(patientType) == 7 || + // int.parse(patientType) == 6) + // ? PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PRESCRIPTION_NEW, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: + // TranslationBase.of(context).prescription, + // icon: 'patient/order_prescription.png') + // : PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PRESCRIPTION_NEW, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: + // TranslationBase.of(context).prescription, + // icon: 'patient/order_prescription.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PROCEDURE, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: TranslationBase.of(context).procedures, + // icon: 'patient/Order_Procedures.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: PATIENT_INSURANCE_APPROVALS_NEW, + // nameLine1: TranslationBase.of(context).insurance, + // nameLine2: TranslationBase.of(context).service, + // icon: 'patient/vital_signs.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: SHOW_SICKLEAVE, + // nameLine1: TranslationBase.of(context).patientSick, + // nameLine2: TranslationBase.of(context).leave, + // icon: 'patient/patient_sick_leave.png'), + // if (patient.admissionNo != null && + // patient.admissionNo != "0") + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: PROGRESS_NOTE, + // nameLine1: TranslationBase.of(context).progress, + // nameLine2: TranslationBase.of(context).note, + // icon: 'patient/Progress_notes.png'), + // if (patient.admissionNo != null && + // patient.admissionNo != "0") + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_NOTE, + // nameLine1: "Order", //"Text", + // nameLine2: "Sheet", + // icon: 'patient/Progress_notes.png'), + // if (patient.appointmentNo != null && + // patient.appointmentNo != 0) + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: REFER_PATIENT_TO_DOCTOR, + // // isDisable: patient.patientStatusType != 43 ? true : false, + // nameLine1: TranslationBase.of(context).referral, + // nameLine2: TranslationBase.of(context).patient, + // icon: 'patient/refer_patient.png'), + // ], + // ), ), ); } diff --git a/pubspec.lock b/pubspec.lock index 9d52ce65..e9386145 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive 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-nullsafety.2" sticky_headers: dependency: "direct main" description: @@ -1091,5 +1091,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From c12818f1d07640ec622158bc303bbb006dc72fd3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 18:04:10 +0300 Subject: [PATCH 011/102] fix search issue --- lib/screens/home/home_screen.dart | 2 +- .../patient_search/patients_screen_new.dart | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 7c8a9442..84cc7575 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -714,7 +714,7 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => - PatientSearchScreen(), + PatientSearchScreenNew(), )); }, ), diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index d78f41d2..2597d397 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -396,25 +396,22 @@ class _PatientsScreenNewState extends State { isInpatient: isInpatient, onTap: () { + // TODO change the parameter to daynamic Navigator.of(context) .pushNamed( PATIENTS_PROFILE, arguments: { "patient": item, "patientType": - patientType, - "from": patient - .getFrom, - "to": patient - .getTo, + "1", + "from": widget.patientSearchRequestModel.from, + "to": widget.patientSearchRequestModel.from, "isSearch": isSearch, "isInpatient": isInpatient, "arrivalType": - arrivalType, - "isInpatient": - isInpatient + "7", }); }, ); From 46b4ea25eaac13e1837bb45c3164d38daa6ad8ba Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 18:35:46 +0300 Subject: [PATCH 012/102] fix search part --- .../patient_search/patients_screen_new.dart | 97 ++++++++++++------- 1 file changed, 61 insertions(+), 36 deletions(-) diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 2597d397..714359f0 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -25,6 +25,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; @@ -151,7 +152,7 @@ class _PatientsScreenNewState extends State { //TranslationBase.of(context).all, projectsProvider = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - + int _activeTab = 0; // patient = widget.patientSearchForm != null // ? widget.patientSearchForm // : routeArgs['patientSearchForm']; @@ -180,6 +181,13 @@ class _PatientsScreenNewState extends State { // else // patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)]; + List _tabs = [ + TranslationBase.of(context).inPatientAll.toUpperCase(), + TranslationBase.of(context).inPatient.toUpperCase(), + ]; + final screenSize = MediaQuery.of(context).size; + + return BaseView( onModelReady: (model) async { if(widget.isSearchWithKeyInfo) { @@ -278,47 +286,64 @@ class _PatientsScreenNewState extends State { ) : Column( children: [ + BottomSheetTitle(title: "Search for 1111",), - Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - height: 115, - child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), - margin: EdgeInsets.only(top: 60), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize:20, - color: Colors.black), - children: [ - new TextSpan( - - text: "Search for 1111", - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 22)), - ], + + 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(() { + // _activeTab = _locations.indexOf(item); + // }); + 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(), ), ), + SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, From 5daadc836934ef3cc6a593b7419a161033b7b932 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 19:12:07 +0300 Subject: [PATCH 013/102] commit --- .../patients/patient_search/header.dart | 39 +++ .../patient_search_screen_new.dart | 1 + .../patient_search/patients_screen_new.dart | 296 +++++------------- 3 files changed, 114 insertions(+), 222 deletions(-) create mode 100644 lib/screens/patients/patient_search/header.dart diff --git a/lib/screens/patients/patient_search/header.dart b/lib/screens/patients/patient_search/header.dart new file mode 100644 index 00000000..eb404e70 --- /dev/null +++ b/lib/screens/patients/patient_search/header.dart @@ -0,0 +1,39 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class HeaderInSearch extends StatelessWidget { + final String title; + + const HeaderInSearch({Key key, this.title}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + title, + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + fontFamily: 'Poppins', + ), + ), + ]), + ), + ); + } +} 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 f383cf40..5325a07e 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -294,6 +294,7 @@ class _PatientSearchScreenNewState extends State { patientSearchRequestModel: patientSearchRequestModel, isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, + isSearch: true, ), ), ); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 714359f0..32fa1766 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/header.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/patients/PatientCard.dart'; @@ -41,6 +41,8 @@ class PatientsScreenNew extends StatefulWidget { final PatientType selectedPatientType; final PatientSearchRequestModel patientSearchRequestModel; final bool isSearchWithKeyInfo; + final bool isSearch; + final bool isInpatient; PatientsScreenNew( {this.patientSearchForm, @@ -50,7 +52,9 @@ class PatientsScreenNew extends StatefulWidget { this.isView, this.selectedPatientType, this.patientSearchRequestModel, - this.isSearchWithKeyInfo = true}); + this.isSearchWithKeyInfo = true, + this.isSearch = false, + this.isInpatient = false}); @override _PatientsScreenNewState createState() => _PatientsScreenNewState(); @@ -78,9 +82,7 @@ class _PatientsScreenNewState extends State { List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; - bool isInpatient = false; String patientType; - bool isSearch = false; String patientTypeTitle; var _isLoading = true; var selectedFilter = 1; @@ -205,144 +207,82 @@ class _PatientsScreenNewState extends State { appBarTitle: "Search Patient", isShowAppBar: false, baseViewModel: model, - body: model.patientList.isEmpty - ? Column( - children: [ - Column(children: [ - SizedBox( - height: 10.0, - ), - if (widget.selectedPatientType == - PatientType.OutPatient && - !widget.isSearchWithKeyInfo) - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(10)), - child: ClinicList( - clinicId: clinicId, - onClinicChange: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - }, - )), - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height * - 0.03), - // child: _locationBar(context) - child: - (widget.selectedPatientType == PatientType.OutPatient && - widget.isSearchWithKeyInfo) - ? _locationBar(context, model) - : Container(), - ) - ]), - Container( - margin: EdgeInsets.only( - top: MediaQuery.of(context).size.height * 0.10), - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .youDontHaveAnyPatient), - ) - ], - ), - ), - ), - ], - ) - : Container( + body: Container( color: Colors.grey[200], child: ListView( scrollDirection: Axis.vertical, children: [ Container( - child:model.patientList.isEmpty - ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Center( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 0, 0, 0, 0), //250 - child: - DrAppCircularProgressIndeicator(), - )), - ), - ], - ) - : Column( + child: Column( children: [ - BottomSheetTitle(title: "Search for 1111",), - - - 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(() { - // _activeTab = _locations.indexOf(item); - // }); - 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, + if(widget.isSearch) + HeaderInSearch( + title: "Search for 1111", + ), + if(!widget.isSearch && !widget.isInpatient) + HeaderInSearch( + title: "Search for 1111", + ), + if(!widget.isInpatient) + 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(() { + // _activeTab = _locations.indexOf(item); + // }); + 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( @@ -390,18 +330,6 @@ class _PatientsScreenNewState extends State { SizedBox( height: 10.0, ), - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context) - .size - .height * - 0.03), - // child: _locationBar(context) - child: widget.selectedPatientType == - PatientType.OutPatient && !widget.isSearchWithKeyInfo - ? _locationBar(context, model) - : Container(), - ), SizedBox( height: 10.0, ), @@ -419,7 +347,7 @@ class _PatientsScreenNewState extends State { arrivalType: arrivalType, isInpatient: - isInpatient, + widget.isInpatient, onTap: () { // TODO change the parameter to daynamic Navigator.of(context) @@ -432,9 +360,9 @@ class _PatientsScreenNewState extends State { "from": widget.patientSearchRequestModel.from, "to": widget.patientSearchRequestModel.from, "isSearch": - isSearch, + widget.isSearch, "isInpatient": - isInpatient, + widget.isInpatient, "arrivalType": "7", }); @@ -566,80 +494,4 @@ class _PatientsScreenNewState extends State { Helpers.showErrorToast(err); }); } - - //TODO Replace it with time bar. - Widget _locationBar(BuildContext _context, model) { - return Container( - height: MediaQuery.of(context).size.height * 0.0619, - width: SizeConfig.screenWidth * 0.94, - decoration: BoxDecoration( - color: Color(0Xffffffff), - borderRadius: BorderRadius.circular(12.5), - // border: Border.all( - // width: 0.5, - // ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.058, - width: SizeConfig.screenWidth * 0.2334, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(12.5), - topRight: Radius.circular(12.5), - topLeft: Radius.circular(9.5), - bottomLeft: Radius.circular(9.5)), - color: _isActive ? HexColor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - - fontWeight: FontWeight.normal, - ), - ), - )), - ), - 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); - }), - _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, - ) - : Container() - ]); - }).toList(), - ), - ); - } } From 403fece0087ede7c76709318438e16fc5ecf6837 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 20:40:48 +0300 Subject: [PATCH 014/102] commit things --- lib/screens/home/home_screen.dart | 25 +-- .../patient_search_screen_new.dart | 1 + .../patient_search/patients_screen_new.dart | 211 +----------------- lib/widgets/patients/PatientCard.dart | 2 +- 4 files changed, 21 insertions(+), 218 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 84cc7575..53a338a9 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -2,6 +2,8 @@ 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/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'; @@ -13,11 +15,11 @@ 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/medicine/medicine_search_screen.dart'; -import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_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/patient_search/patient_search_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -40,7 +42,6 @@ import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; -import '../../routes.dart'; import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart'; import 'home_page_card.dart'; @@ -544,21 +545,19 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { - // getRequestHeader(false); - // Navigator.of(context) - // .pushNamed(PATIENTS, arguments: { - // "patientSearchForm": - // _patientSearchFormValues, - // "selectedType": "0", - // "arrivalType": "1", - // "isInpatient": false - // }); - Navigator.push( context, MaterialPageRoute( builder: (context) => - PatientSearchScreenNew(), + PatientsScreenNew( + isSearch: false, + isInpatient: false, + patientSearchRequestModel: + PatientSearchRequestModel(), + selectedPatientType: + PatientType.OutPatient, + isSearchWithKeyInfo: false, + ), )); }, ), 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 5325a07e..f9fadbc5 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -295,6 +295,7 @@ class _PatientSearchScreenNewState extends State { isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, + isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, ), ), ); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 32fa1766..3e4819ea 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -1,5 +1,3 @@ -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'; @@ -7,28 +5,20 @@ 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'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/header.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/patients/PatientCard.dart'; -import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.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/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable @@ -72,76 +62,19 @@ class _PatientsScreenNewState extends State { AuthViewModel authProvider; Color sideColor = Colors.black; - List responseModelList; - List responseModelList2; - final String url = "assets/images/"; - final String avatarMale = "user_male.svg"; //'working_male.svg';//'user.svg'; - final String avatarFemale = 'user_female.svg'; - final String assetName = 'assets/image.svg'; - List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; String patientType; String patientTypeTitle; - var _isLoading = true; var selectedFilter = 1; - bool _isError = false; - String error = ""; String arrivalType; ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); PatientModel patient; - searchData(String str) { - this.responseModelList = this.responseModelList2; - var strExist = str.length > 0 ? true : false; - if (strExist) { - List filterData = []; - - for (var i = 0; i < responseModelList2.length; i++) { - String firstName = responseModelList[i].firstName.toUpperCase(); - String lastName = responseModelList[i].lastName.toUpperCase(); - String mobile = responseModelList[i].mobileNumber.toUpperCase(); - String patientID = responseModelList[i].patientId.toString(); - - if (firstName.contains(str.toUpperCase()) || - lastName.contains(str.toUpperCase()) || - mobile.contains(str) || - patientID.contains(str)) { - filterData.add(responseModelList[i]); - } - } - - setState(() { - this.responseModelList = filterData; - }); - } else { - setState(() { - this.responseModelList = this.responseModelList2; - }); - } - } - convertDateFormat(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } @override Widget build(BuildContext context) { @@ -151,38 +84,6 @@ class _PatientsScreenNewState extends State { TranslationBase.of(context).tomorrow, TranslationBase.of(context).nextWeek, ]; - //TranslationBase.of(context).all, - projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - int _activeTab = 0; - // patient = widget.patientSearchForm != null - // ? widget.patientSearchForm - // : routeArgs['patientSearchForm']; - // - // patientType = widget.selectedType != null - // ? widget.selectedType - // : routeArgs['selectedType']; - // arrivalType = widget.arrivalType != null - // ? widget.arrivalType - // : routeArgs['arrivalType']; - // if (routeArgs != null && routeArgs.containsKey("isSearch")) { - // isSearch = routeArgs['isSearch']; - // } - // if (routeArgs != null && routeArgs.containsKey("isSearch")) { - // isView = routeArgs['isView']; - // } - // if (routeArgs != null && routeArgs.containsKey('activeFilter')) { - // _activeLocation = routeArgs['activeFilter']; - // } - // if (routeArgs != null && routeArgs.containsKey('isInpatient')) { - // isInpatient = routeArgs['isInpatient']; - // } - - // if (!projectsProvider.isArabic) - // patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; - // else - // patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)]; - List _tabs = [ TranslationBase.of(context).inPatientAll.toUpperCase(), TranslationBase.of(context).inPatient.toUpperCase(), @@ -192,15 +93,12 @@ class _PatientsScreenNewState extends State { return BaseView( onModelReady: (model) async { - if(widget.isSearchWithKeyInfo) { - await model.getPatientFileInformation(widget.patientSearchRequestModel); + if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { + await model.getOutPatient(widget.patientSearchRequestModel); + } else { - // ignore: unrelated_type_equality_checks - if(widget.selectedPatientType == PatientType.OutPatient) { - await model.getOutPatient(widget.patientSearchRequestModel); - } else { - // TODO handel inPatient case - } + await model.getPatientFileInformation(widget.patientSearchRequestModel); + } }, builder: (_, model, w) => AppScaffold( @@ -221,7 +119,7 @@ class _PatientsScreenNewState extends State { ), if(!widget.isSearch && !widget.isInpatient) HeaderInSearch( - title: "Search for 1111", + title: "My Out patient", ), if(!widget.isInpatient) Container( @@ -244,9 +142,6 @@ class _PatientsScreenNewState extends State { return Expanded( child: InkWell( onTap: () async { - // setState(() { - // _activeTab = _locations.indexOf(item); - // }); setState(() { _activeLocation = _locations.indexOf(item); }); @@ -324,7 +219,7 @@ class _PatientsScreenNewState extends State { bottom: 30), ), onChanged: (String str) { - this.searchData(str); + // this.searchData(str); }), ])), SizedBox( @@ -402,96 +297,4 @@ class _PatientsScreenNewState extends State { ), ); } - - changeClinic(clinicId, BuildContext context, model) async { - GifLoaderDialogUtils.showMyDialog(context); - 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(), allowChangeProfile: false) - .then((profileList) async { - print(profileList['DoctorProfileList'][0]); - int val2 = int.parse(patientType); - - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel = - GetPatientArrivalListRequestModel( - from: patient.From, - to: patient.To, - clinicID: profileList['DoctorProfileList'][0]['ClinicID'], - doctorID: - profileList['DoctorProfileList'][0]['DoctorID'].toString(), - patientMRN: patient.getPatientID, - pageIndex: 0, - pageSize: 0); - - model - .getPatientList( - getPatientArrivalListRequestModel.toJson(), patientType) - .then((res) { - setState(() { - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList.sort((a, b) { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - }); - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = model.error ?? - res['ErrorEndUserMessage'] ?? - res['ErrorMessage']; - } - - _isLoading = false; - }); - GifLoaderDialogUtils.hideDialog(context); - }).catchError((error) { - Helpers.showErrorToast(error.toString()); - GifLoaderDialogUtils.hideDialog(context); - }); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - Helpers.showErrorToast(err); - }); - } } diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index dad33425..43a4b79d 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -265,7 +265,7 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w700, fontSize: 15)), ]))), - if (isInpatient == true) + if (patientInfo.admissionDate != null) Row( children: [ AppText( From b5a90bd6580d8d3fc59d2fbaf5f815e13a1d08ee Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 20:55:26 +0300 Subject: [PATCH 015/102] finish search --- .../patient_search_screen_new.dart | 1 + .../patient_search/patients_screen_new.dart | 18 ++++-------------- 2 files changed, 5 insertions(+), 14 deletions(-) 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 f9fadbc5..14d65831 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -295,6 +295,7 @@ class _PatientSearchScreenNewState extends State { isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, + searchKey: patientFileInfoController.text, isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, ), ), diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 3e4819ea..bd2920dc 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -33,6 +33,8 @@ class PatientsScreenNew extends StatefulWidget { final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; + final String searchKey; + PatientsScreenNew( {this.patientSearchForm, @@ -44,24 +46,16 @@ class PatientsScreenNew extends StatefulWidget { this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, - this.isInpatient = false}); + this.isInpatient = false, this.searchKey}); @override _PatientsScreenNewState createState() => _PatientsScreenNewState(); } class _PatientsScreenNewState extends State { - List lItems; - - List parsed; - - List date; - List unFilterDate; - int clinicId; AuthViewModel authProvider; - Color sideColor = Colors.black; List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; @@ -84,10 +78,6 @@ class _PatientsScreenNewState extends State { TranslationBase.of(context).tomorrow, TranslationBase.of(context).nextWeek, ]; - List _tabs = [ - TranslationBase.of(context).inPatientAll.toUpperCase(), - TranslationBase.of(context).inPatient.toUpperCase(), - ]; final screenSize = MediaQuery.of(context).size; @@ -115,7 +105,7 @@ class _PatientsScreenNewState extends State { children: [ if(widget.isSearch) HeaderInSearch( - title: "Search for 1111", + title: "Search for ${widget.searchKey}", ), if(!widget.isSearch && !widget.isInpatient) HeaderInSearch( From 3927c40d7e3750163f639fd3ebe691d416b0f0ef Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 21:09:15 +0300 Subject: [PATCH 016/102] Fix Patient Profile --- .../profile/patient_profile_screen.dart | 552 +++++++++++++----- .../patient-profile-header-new-design.dart | 3 +- ...-profile-header-new-design_in_patient.dart | 5 +- 3 files changed, 396 insertions(+), 164 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 9e011ce9..4e1c288f 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -1,40 +1,54 @@ -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_in_patient.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.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/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - import '../../../routes.dart'; -// ignore: must_be_immutable -class PatientProfileScreen extends StatelessWidget { + +class PatientProfileScreen extends StatefulWidget { + @override + _PatientProfileScreenState createState() => _PatientProfileScreenState(); +} + +class _PatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { PatiantInformtion patient; + bool isFromSearch = false; + bool isInpatient = false; + bool isDischargedPatient = false; + String patientType; + String arrivalType; + String from; + String to; + TabController _tabController; + @override + void initState() { + _tabController = TabController(length: 2,vsync:this); + super.initState(); + } + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } @override - Widget build(BuildContext context) { + void didChangeDependencies() { + super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - ProjectViewModel projectViewModel = Provider.of(context); - - patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - String from = routeArgs['from']; - String to = routeArgs['to']; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; if (routeArgs.containsKey("isSearch")) { isFromSearch = routeArgs['isSearch']; } @@ -44,156 +58,370 @@ class PatientProfileScreen extends StatelessWidget { if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; } + } + @override + Widget build(BuildContext context) { return BaseView( builder: (_, patientViewModel, w) => AppScaffold( - baseViewModel: patientViewModel, - appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: false, - body: Container( - color: Color(0XFFF2F2F2), - child: Stack( - children: [ - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - !isFromSearch && isInpatient /*patientType == "1"*/ - ? PatientProfileHeaderNewDesignInPatient( - patient, patientType, arrivalType) - : PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), - Expanded( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: SingleChildScrollView( - child: Column( - children: [ - isInpatient - ? ProfileMedicalInfoWidgetInPatient( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - isInpatient: isInpatient, - isDischargedPatient: - isDischargedPatient, - ) - : isFromSearch - ? ProfileMedicalInfoWidgetSearch( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - isInpatient: false, - isDischargedPatient: - isDischargedPatient, - ) - : ProfileMedicalInfoWidget( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - isInpatient: isInpatient), - ], + baseViewModel: patientViewModel, + appBarTitle: TranslationBase.of(context).patientProfile, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + body: SingleChildScrollView( + child: Column( + children: [ + DefaultTabController( + length: 2, + initialIndex: isInpatient ? 0 : 1, + child: SizedBox( + height: MediaQuery.of(context).size.height * 1.0, + width: double.infinity, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + toolbarHeight: 65, + elevation: 0, + bottom: TabBar( + controller: _tabController, + indicator: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10), // Creates border + color: Color(0xffD02126), + ), + indicatorColor: Colors.red[500], + unselectedLabelColor: Color(0xff5A6168), + labelColor: Colors.white, + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('Inpatient Info'), ), ), - ), - ) - ], + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('OutPatient Info'), + ), + ), + ]), + ), + body: Container( + margin: EdgeInsets.only(top: 10), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + if (isInpatient) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + if (isInpatient) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", + icon: 'patient/Progress_notes.png'), + ], + ), + ], + ), + ), ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 175, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), - ], + ), + ), - ), - )); + ], + ), + ), + )); } } 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..b4d8ce17 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -16,10 +16,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { final String patientType; final String arrivalType; final double height; + final bool isHaveMargin; PatientProfileHeaderNewDesign( this.patient, this.patientType, this.arrivalType, - {this.height = 0.0}); + {this.height = 0.0, this.isHaveMargin=true}); @override Widget build(BuildContext context) { 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..557f78ce 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 @@ -40,7 +40,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { height: height == 0 ? 200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), + // margin: EdgeInsets.only(top: 50), child: Column( children: [ Container( @@ -121,6 +121,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { fontWeight: FontWeight.w700), ], ), + if(patient.admissionDate!=null) Row( children: [ AppText( @@ -136,6 +137,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + if(patient.admissionDate!=null) Row( children: [ AppText( @@ -177,6 +179,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { ) ], ), + if(patient.admissionDate!=null) Row( children: [ AppText( From 686c81463bce93664b31e627752540644a2ecda9 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 21:11:52 +0300 Subject: [PATCH 017/102] Fix Patient Profile --- lib/screens/sick-leave/add-sickleave.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 444e76bd..3b05d8f4 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -188,10 +188,9 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), + DateUtils.getDayMonthYearDateFormatted(DateUtils + .convertStringToDate( + item.startDate)), fontWeight: FontWeight.bold, ), @@ -208,10 +207,10 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils - .convertStringToDateFormat( - item.endDate, - 'dd-MMM-yyyy'), + DateUtils.getDayMonthYearDateFormatted(DateUtils + .convertStringToDate( + item.endDate, + )), fontWeight: FontWeight.bold, ), From 50a240122da93f0148019950eb69b4442ee8386f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 21:35:46 +0300 Subject: [PATCH 018/102] fix date issue --- lib/screens/home/home_screen.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 53a338a9..1435c942 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -545,6 +545,12 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { + + String date = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day ), + 'yyyy-MM-dd'); + Navigator.push( context, MaterialPageRoute( @@ -553,7 +559,7 @@ class _HomeScreenState extends State { isSearch: false, isInpatient: false, patientSearchRequestModel: - PatientSearchRequestModel(), + PatientSearchRequestModel(from: date, to: date), selectedPatientType: PatientType.OutPatient, isSearchWithKeyInfo: false, From b6e698d4e47c329a6a2c73df4b4c92ef2f9b37b4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 21:38:27 +0300 Subject: [PATCH 019/102] fix header --- .../patient_search/patients_screen_new.dart | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index bd2920dc..1e5f7339 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -93,7 +93,12 @@ class _PatientsScreenNewState extends State { }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", - isShowAppBar: false, + isShowAppBar: true, + appBar: !widget.isSearch && !widget.isInpatient?HeaderInSearch( + title: "My Out patient", + ):HeaderInSearch( + title: "Search for ${widget.searchKey}", + ), baseViewModel: model, body: Container( color: Colors.grey[200], @@ -103,14 +108,6 @@ class _PatientsScreenNewState extends State { Container( child: Column( children: [ - if(widget.isSearch) - HeaderInSearch( - title: "Search for ${widget.searchKey}", - ), - if(!widget.isSearch && !widget.isInpatient) - HeaderInSearch( - title: "My Out patient", - ), if(!widget.isInpatient) Container( // color: Colors.red, From f4fd4b26d627bcb7798d318c4b2ef799daee8b8a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 21:41:41 +0300 Subject: [PATCH 020/102] Add filter in outpatient --- .../viewModel/PatientSearchViewModel.dart | 33 ++++++++++++++++--- .../patient_search/patients_screen_new.dart | 4 +-- .../profile/patient_profile_screen.dart | 20 ----------- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 45b73329..816918cd 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -19,6 +19,32 @@ class PatientSearchViewModel extends BaseViewModel{ List get patientList => _outPatientService.patientList; + List filterData = []; + + searchData(String str) { + var strExist = str.length > 0 ? true : false; + 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(); + + if (firstName.contains(str.toUpperCase()) || + lastName.contains(str.toUpperCase()) || + mobile.contains(str) || + patientID.contains(str)) { + filterData.add(_outPatientService.patientList[i]); + } + } + notifyListeners(); + } else { + filterData = _outPatientService.patientList; + notifyListeners(); + } + } + getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async { if(isLocalBusy) { setState(ViewState.BusyLocal); @@ -37,6 +63,7 @@ class PatientSearchViewModel extends BaseViewModel{ } setState(ViewState.Error); } else { + filterData = _outPatientService.patientList; setState(ViewState.Idle); } } @@ -49,6 +76,7 @@ class PatientSearchViewModel extends BaseViewModel{ error = _outPatientService.error; setState(ViewState.Error); } else { + filterData = _outPatientService.patientList; setState(ViewState.Idle); } } @@ -103,12 +131,9 @@ class PatientSearchViewModel extends BaseViewModel{ if(isSearchWithKeyInfo) { await getPatientFileInformation(currentModel); } else { - if(selectedPatientType == PatientType.OutPatient) { await getOutPatient(currentModel, isLocalBusy: true); - } else { - // TODO handel inPatient case } - } + filterData = _outPatientService.patientList; } diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index bd2920dc..ade1e47e 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -219,10 +219,10 @@ class _PatientsScreenNewState extends State { height: 10.0, ), Container( - child: (model.patientList.isNotEmpty) + child: model.patientList.isNotEmpty ? Column( // mainAxisAlignment: MainAxisAlignment.center, - children: model.patientList + children: model.filterData .map((PatiantInformtion item) { return PatientCard( diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 4e1c288f..9cb8a0d4 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -378,7 +378,6 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( - patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -388,26 +387,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), - if (isInpatient) - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - if (isInpatient) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", - icon: 'patient/Progress_notes.png'), ], ), ], From 85288cc01413bad45608d309f2b06937db0d170d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 21:58:04 +0300 Subject: [PATCH 021/102] Add filter in outpatient --- .../patients/patient_search/header.dart | 8 +- .../patient_search/patients_screen_new.dart | 2 +- lib/widgets/patients/PatientCard.dart | 202 +++++++++--------- 3 files changed, 106 insertions(+), 106 deletions(-) diff --git a/lib/screens/patients/patient_search/header.dart b/lib/screens/patients/patient_search/header.dart index eb404e70..0fbcdf1a 100644 --- a/lib/screens/patients/patient_search/header.dart +++ b/lib/screens/patients/patient_search/header.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class HeaderInSearch extends StatelessWidget { +class HeaderInSearch extends StatelessWidget with PreferredSizeWidget { final String title; const HeaderInSearch({Key key, this.title}) : super(key: key); @@ -16,7 +16,7 @@ class HeaderInSearch extends StatelessWidget { ), child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), + margin: EdgeInsets.only(top: 35), child: Row(children: [ IconButton( icon: Icon(Icons.arrow_back_ios), @@ -36,4 +36,8 @@ class HeaderInSearch extends StatelessWidget { ), ); } + + @override + + Size get preferredSize => Size(double.maxFinite,65); } diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index e4e1ed4c..8786bc48 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -206,7 +206,7 @@ class _PatientsScreenNewState extends State { bottom: 30), ), onChanged: (String str) { - // this.searchData(str); + model.searchData(str); }), ])), SizedBox( diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 43a4b79d..f7f39d95 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -35,18 +35,18 @@ class PatientCard extends StatelessWidget { color: Colors.white, ), child: Stack(children: [ - // if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") - // Container( - // height: MediaQuery.of(context).size.height * .20, - // width: 5, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.only( - // topLeft: Radius.circular(10), - // bottomLeft: Radius.circular(10)), - // color: patientInfo.patientStatusType == 43 - // ? Colors.green[500] - // : Colors.red[800], - // )), + if (isInpatient) + Container( + height: MediaQuery.of(context).size.height * .20, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10)), + color: patientInfo.patientStatusType == 43 + ? Colors.green[500] + : Colors.red[800], + )), Container( padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( @@ -55,48 +55,47 @@ class PatientCard extends StatelessWidget { SizedBox( height: 10, ), - // SERVICES_PATIANT2[int.parse(patientType)] == - // "List_MyOutPatient" - // ? Padding( - // padding: EdgeInsets.only(left: 12.0), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // patientInfo.patientStatusType == 43 - // ? AppText( - // TranslationBase.of(context).arrivedP, - // color: Colors.green, - // fontWeight: FontWeight.bold, - // fontFamily: 'Poppins', - // fontSize: 12, - // ) - // : AppText( - // TranslationBase.of(context).notArrived, - // color: Colors.red[800], - // fontWeight: FontWeight.bold, - // fontFamily: 'Poppins', - // fontSize: 12, - // ), - // this.arrivalType == '1' - // ? AppText( - // patientInfo.startTime != null - // ? patientInfo.startTime - // : patientInfo.startTimes, - // fontFamily: 'Poppins', - // fontWeight: FontWeight.w600, - // ) - // : patientInfo.arrivedOn != null - // ? AppText( - // DateUtils.convertStringToDateFormat( - // patientInfo.arrivedOn, - // 'MM-dd-yyyy HH:mm'), - // fontFamily: 'Poppins', - // fontWeight: FontWeight.w600, - // ) - // : SizedBox() - // ], - // )) - // : SizedBox(), + !isInpatient + ? Padding( + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + patientInfo.patientStatusType == 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + this.arrivalType == '1' + ? AppText( + patientInfo.startTime != null + ? patientInfo.startTime + : patientInfo.startTimes, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : patientInfo.arrivedOn != null + ? AppText( + DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate( + patientInfo.arrivedOn, + )), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : SizedBox() + ], + )) + : SizedBox(), Padding( padding: EdgeInsets.only(left: 12.0), child: Row( @@ -213,33 +212,32 @@ class PatientCard extends StatelessWidget { ), ), ), - // if (SERVICES_PATIANT2[int.parse(patientType)] != - // "List_MyInPatient") - // Container( - // child: RichText( - // text: new TextSpan( - // style: new TextStyle( - // fontSize: 2.0 * SizeConfig.textMultiplier, - // color: Colors.black, - // fontFamily: 'Poppins', - // ), - // children: [ - // new TextSpan( - // text: - // TranslationBase.of(context).age + - // " : ", - // style: TextStyle(fontSize: 14)), - // new TextSpan( - // text: - // "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", - // style: TextStyle( - // fontWeight: FontWeight.w700, - // fontSize: 15)), - // ], - // ), - // ), - // ), - if (isInpatient == true) + if (isInpatient) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: + TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), + ), + ), + if (isInpatient ) Container( child: RichText( text: new TextSpan( @@ -370,28 +368,26 @@ class PatientCard extends StatelessWidget { //) ])) ]), - // SERVICES_PATIANT2[int.parse(patientType)] == - // "List_MyOutPatient" - // ? Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // Container( - // padding: EdgeInsets.all(4), - // child: Image.asset( - // patientInfo.appointmentType == - // 'Regular' && - // patientInfo.visitTypeId == 100 - // ? 'assets/images/livecare.png' - // : patientInfo.appointmentType == - // 'Walkin' - // ? 'assets/images/walkin.png' - // : 'assets/images/booked.png', - // height: 25, - // width: 35, - // )), - // ]) - // : - (isInpatient == true) + !isInpatient + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + patientInfo.appointmentType == + 'Regular' && + patientInfo.visitTypeId == 100 + ? 'assets/images/livecare.png' + : patientInfo.appointmentType == + 'Walkin' + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', + height: 25, + width: 35, + )), + ]) + : (isInpatient == true) ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ From 1e68f8fe33abd95105e46d509ef594203a06e580 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 22:11:13 +0300 Subject: [PATCH 022/102] fix small bug --- lib/core/model/PatientSearchRequestModel.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core/model/PatientSearchRequestModel.dart b/lib/core/model/PatientSearchRequestModel.dart index e612ec2a..437c5885 100644 --- a/lib/core/model/PatientSearchRequestModel.dart +++ b/lib/core/model/PatientSearchRequestModel.dart @@ -20,6 +20,9 @@ class PatientSearchRequestModel { this.patientMobileNumber ="0", this.patientIdentificationID ="0", this.patientID =0, + this.searchType =1, + this.mobileNo="", + this.identificationNo="0", this.from ="0", this.to ="0"}); From 8a564b34acd661b10512d561e6529c0da5b26b03 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 26 Apr 2021 22:32:32 +0300 Subject: [PATCH 023/102] add procedure form update --- lib/core/service/procedure_service.dart | 4 +- .../profile/lab_result/labs_home_page.dart | 118 +++---- .../procedures/add-procedure-form.dart | 293 +++++++++++------- .../entity_list_checkbox_search_widget.dart | 4 +- 4 files changed, 240 insertions(+), 179 deletions(-) diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 64d60002..b403edf0 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -76,12 +76,12 @@ class ProcedureService extends BaseService { Future getProcedureCategory({String categoryName, String categoryID}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( - search: [categoryName], + search: ["$categoryName"], patientMRN: 0, pageIndex: 0, clinicId: 0, pageSize: 0, - category: categoryID ?? "01", + category: categoryID ?? null, ); hasError = false; _categoriesList.clear(); diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index dd3e0995..abfcb282 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -55,27 +55,29 @@ class _LabsHomePageState extends State { SizedBox( height: 12, ), - if(model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Lab', - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - AppText( - 'Result', - bold: true, - fontSize: 22, - ), - ], + if (model.patientLabOrdersList.isNotEmpty && + patient.patientStatusType != 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Lab', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + 'Result', + bold: true, + fontSize: 22, + ), + ], + ), ), - ), - if ( patient.patientStatusType!=null && patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -95,18 +97,21 @@ class _LabsHomePageState extends State { ], ), ), - if ( patient.patientStatusType!=null && patient.patientStatusType == 43) - AddNewOrder( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddSelectedLabOrder( - patient: patient, - model: model, - )), - ); - },label: 'Apply for New Lab Order',), - + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + AddNewOrder( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddSelectedLabOrder( + patient: patient, + model: model, + )), + ); + }, + label: 'Apply for New Lab Order', + ), ...List.generate( model.patientLabOrdersList.length, (index) => Column( @@ -116,16 +121,16 @@ class _LabsHomePageState extends State { .patientLabOrdersList[index].patientLabOrdersList .map((labOrder) { return Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(8.0), - ), - color: Colors.white), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), child: Row( children: [ Container( @@ -136,12 +141,11 @@ class _LabsHomePageState extends State { color: labOrder.isLiveCareAppointment ? Colors.red[900] : !labOrder.isInOutPatient - ? Colors.black - : Color(0xffa9a089), + ? Colors.black + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: Radius.circular(8), bottomLeft: Radius.circular(8), - ), ), child: RotatedBox( @@ -150,15 +154,15 @@ class _LabsHomePageState extends State { child: Text( labOrder.isLiveCareAppointment ? TranslationBase.of(context) - .liveCare - .toUpperCase() + .liveCare + .toUpperCase() : !labOrder.isInOutPatient - ? TranslationBase.of(context) - .inPatient - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -193,18 +197,20 @@ class _LabsHomePageState extends State { }).toList(), ), ), - if(model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) + if (model.patientLabOrdersList.isEmpty && + patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 100,), + SizedBox( + height: 100, + ), Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), child: AppText('No Lab Result Found'), ) - ], ), ) diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 17d09159..9a8fe0c5 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; @@ -126,6 +127,7 @@ class _AddSelectedProcedureState extends State { TextEditingController remarksController = TextEditingController(); List entityList = List(); List entityListProcedure = List(); + TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -139,7 +141,7 @@ class _AddSelectedProcedureState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getCategory(), + //onModelReady: (model) => model.getCategory(), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, @@ -159,136 +161,191 @@ class _AddSelectedProcedureState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + 'Please Enter Procedure', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ) + ]), + SizedBox( + height: MediaQuery.of(context).size.height * 0.04, + ), Row( children: [ - AppText( - 'Please Select Category', - fontWeight: FontWeight.w700, - fontSize: 20, + Container( + width: MediaQuery.of(context).size.width * 0.85, + child: AppTextFieldCustom( + hintText: 'Search Procedure here...', + isTextFieldHasSuffix: false, + + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: procedureName, + // onSubmitted: (_) { + // model.getProcedureCategory( + // categoryName: procedureName.text); + // }, + onClick: () { + model.getProcedureCategory( + categoryName: procedureName.text); + }, + ), ), SizedBox( - width: MediaQuery.of(context).size.width * 0.29, + width: MediaQuery.of(context).size.width * 0.02, ), InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), onTap: () { - Navigator.pop(context); + model.getProcedureCategory( + categoryName: procedureName.text); }, + child: Icon( + Icons.search, + size: 25.0, + ), ), ], ), - SizedBox( - height: 10.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.categoryList != null && - model.categoryList.length > 0 - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.categoryList, - attributeName: 'categoryName', - attributeValueId: 'categoryId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - selectedCategory = selectedValue; - model.getProcedureCategory( - categoryName: selectedCategory[ - 'categoryName'], - categoryID: selectedCategory[ - 'categoryId'] <= - 9 - ? "0" + - selectedCategory[ - 'categoryId'] - .toString() - : selectedCategory[ - 'categoryId'] - .toString()); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - //model.getProcedureCategory(); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .procedureCategorise, - selectedCategory != null - ? selectedCategory['categoryName'] - : null, - true, - suffixIcon: Icon( - Icons.search, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - if (widget.model.categoriesList.length != 0) + // SizedBox( + // width: MediaQuery.of(context).size.width * 0.29, + // ), + // InkWell( + // child: Icon( + // Icons.close, + // size: 24.0, + // ), + // onTap: () { + // Navigator.pop(context); + // }, + // ), + // ], + // ), + // SizedBox( + // height: 10.0, + // ), + // Container( + // height: screenSize.height * 0.070, + // child: InkWell( + // onTap: model.categoryList != null && + // model.categoryList.length > 0 + // ? () { + // ListSelectDialog dialog = + // ListSelectDialog( + // list: model.categoryList, + // attributeName: 'categoryName', + // attributeValueId: 'categoryId', + // okText: TranslationBase.of(context).ok, + // okFunction: (selectedValue) { + // setState(() { + // selectedCategory = selectedValue; + // model.getProcedureCategory( + // categoryName: selectedCategory[ + // 'categoryName'], + // categoryID: selectedCategory[ + // 'categoryId'] <= + // 9 + // ? "0" + + // selectedCategory[ + // 'categoryId'] + // .toString() + // : selectedCategory[ + // 'categoryId'] + // .toString()); + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: (BuildContext context) { + // return dialog; + // }, + // ); + // //model.getProcedureCategory(); + // } + // : null, + // child: TextField( + // decoration: textFieldSelectorDecoration( + // TranslationBase.of(context) + // .procedureCategorise, + // selectedCategory != null + // ? selectedCategory['categoryName'] + // : null, + // true, + // suffixIcon: Icon( + // Icons.search, + // color: Colors.black, + // )), + // enabled: false, + // ), + // ), + // ), + if (procedureName.text.isNotEmpty && + model.procedureList.length != 0) NetworkBaseView( baseViewModel: model, - child: selectedCategory != null - ? selectedCategory['categoryId'] == 02 || - selectedCategory['categoryId'] == 03 - ? EntityListCheckboxSearchWidget( - model: widget.model, - masterList: widget.model - .categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ) - : ProcedureListWidget( - model: widget.model, - masterList: widget.model - .categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ) - : null), + child: + // selectedCategory != null + // ? selectedCategory['categoryId'] == 02 || + // selectedCategory['categoryId'] == 03 + // ? + EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ) + // : ProcedureListWidget( + // model: widget.model, + // masterList: widget.model + // .categoriesList[0].entityList, + // removeHistory: (item) { + // setState(() { + // entityList.remove(item); + // }); + // }, + // addHistory: (history) { + // setState(() { + // entityList.add(history); + // }); + // }, + // addSelectedHistories: () { + // //TODO build your fun herr + // // widget.addSelectedHistories(); + // }, + // isEntityListSelected: (master) => + // isEntityListSelected(master), + // ) + // : null, + ), SizedBox( height: 15.0, ), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 70a5402c..801c730c 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -1,4 +1,3 @@ - import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -227,8 +226,7 @@ class _EntityListCheckboxSearchWidgetState ) : Center( child: Container( - child: AppText( - "There's no procedures for this category", + child: AppText("Sorry , No Match", color: Color(0xFFB9382C)), ), ) From a91d64f10343c8bce76c8555337be0988b94d138 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 23:06:18 +0300 Subject: [PATCH 024/102] samll fix --- lib/screens/patients/profile/patient_profile_screen.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 9cb8a0d4..93f70876 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -80,6 +80,7 @@ class _PatientProfileScreenState extends Statewith SingleT child: Scaffold( appBar: AppBar( backgroundColor: Colors.white, + automaticallyImplyLeading: false, toolbarHeight: 65, elevation: 0, bottom: TabBar( From 48471bbc0747e94e6ea9996140f7ffd3ddd0b460 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 23:07:07 +0300 Subject: [PATCH 025/102] fix small --- .../patients/patient_search/patient_search_screen_new.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 14d65831..5c6b833f 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -296,7 +296,7 @@ class _PatientSearchScreenNewState extends State { patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, searchKey: patientFileInfoController.text, - isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, + isInpatient: selectedPatientType == PatientType.OutPatient?false: true, ), ), ); From 29831e82071524b59397221ef357b47c082eef14 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 23:16:25 +0300 Subject: [PATCH 026/102] return code back --- .../patients/patient_search/patient_search_screen_new.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5c6b833f..14d65831 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -296,7 +296,7 @@ class _PatientSearchScreenNewState extends State { patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, searchKey: patientFileInfoController.text, - isInpatient: selectedPatientType == PatientType.OutPatient?false: true, + isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, ), ), ); From c3ac50a859db60fbf56b24f78c8257aac8de1c7f Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 23:19:25 +0300 Subject: [PATCH 027/102] hot fixes --- .../viewModel/PatientSearchViewModel.dart | 1 + lib/models/patient/patiant_info_model.dart | 4 +- .../patients/PatientsInPatientScreen.dart | 1 + .../patient_search_screen_new.dart | 2 +- .../patient_search/patients_screen_new.dart | 3 +- .../profile/patient_profile_screen.dart | 4 + lib/util/date-utils.dart | 9 ++ lib/widgets/patients/PatientCard.dart | 131 ++++++++++++++---- 8 files changed, 126 insertions(+), 29 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 816918cd..59f8c9c6 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -147,6 +147,7 @@ class PatientSearchViewModel extends BaseViewModel{ Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isFirstTime = true}) async { + await getDoctorProfile(); if (isFirstTime) setState(ViewState.Busy); else diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index a794cf29..cd21f911 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -61,6 +61,7 @@ class PatiantInformtion { int visitTypeId; String startTimes; String dischargeDate; + int status; PatiantInformtion( {this.patientDetails, this.projectId, @@ -120,7 +121,7 @@ class PatiantInformtion { this.nationalityFlagURL, this.patientStatusType, this.visitTypeId, - this.startTimes,this.dischargeDate}); + this.startTimes,this.dischargeDate,this.status}); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( @@ -197,5 +198,6 @@ class PatiantInformtion { visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], startTimes: json['StartTime'] ?? json['StartTime'], dischargeDate: json['DischargeDate'] , + status: json['Status'] , ); } diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index ba8b5f0a..2a3f3839 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -107,6 +107,7 @@ class _PatientInPatientScreenState extends State { patientType: "1", arrivalType: "1", isInpatient: true, + isMyPatient: _activeTab!=0? false:item.doctorId==model.doctorProfile.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { 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 14d65831..c101567a 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -296,7 +296,7 @@ class _PatientSearchScreenNewState extends State { patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, searchKey: patientFileInfoController.text, - isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, + isInpatient: selectedPatientType != PatientType.OutPatient, ), ), ); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 8786bc48..ab1e9594 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -108,7 +108,7 @@ class _PatientsScreenNewState extends State { Container( child: Column( children: [ - if(!widget.isInpatient) + if(!widget.isInpatient && !widget.isSearch) Container( // color: Colors.red, height: screenSize.height * 0.070, @@ -249,6 +249,7 @@ class _PatientsScreenNewState extends State { "7", }); }, + isFromSearch: widget.isSearch, ); }).toList(), ) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 9cb8a0d4..5bfb84db 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -58,6 +58,10 @@ class _PatientProfileScreenState extends Statewith SingleT if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; } + if(isInpatient) + _tabController.index =0; + else + _tabController.index = 1; } @override diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index d380ee93..78c2a3b9 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -290,6 +290,15 @@ class DateUtils { return ""; } + /// get data formatted like 26/4/2020 + /// [dateTime] convert DateTime to data formatted + static String getDayMonthYearDate(DateTime dateTime,{bool isArabic = false}) { + if (dateTime != null) + return dateTime.day.toString()+"/"+ "${dateTime.month}"+ "/" + dateTime.year.toString(); + else + return ""; + } + /// get data formatted like 10:45 PM /// [dateTime] convert DateTime to data formatted static String getHour(DateTime dateTime) { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index f7f39d95..251f7653 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -16,13 +16,16 @@ class PatientCard extends StatelessWidget { final String patientType; final String arrivalType; final bool isInpatient; + final bool isMyPatient; + final bool isFromSearch; + const PatientCard( {Key key, this.patientInfo, this.onTap, this.patientType, this.arrivalType, - this.isInpatient}) + this.isInpatient, this.isMyPatient = false, this.isFromSearch = false}) : super(key: key); @override Widget build(BuildContext context) { @@ -35,9 +38,9 @@ class PatientCard extends StatelessWidget { color: Colors.white, ), child: Stack(children: [ - if (isInpatient) + if (!isInpatient&& !isMyPatient && !isFromSearch) Container( - height: MediaQuery.of(context).size.height * .20, + height: 160, width: 5, decoration: BoxDecoration( borderRadius: BorderRadius.only( @@ -47,6 +50,16 @@ class PatientCard extends StatelessWidget { ? Colors.green[500] : Colors.red[800], )), + if(isMyPatient && !isFromSearch) + Container( + height: 180, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10)), + color: Colors.green[500] + )), Container( padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( @@ -55,47 +68,113 @@ class PatientCard extends StatelessWidget { SizedBox( height: 10, ), - !isInpatient + !(isInpatient && !isFromSearch) ? Padding( padding: EdgeInsets.only(left: 12.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ patientInfo.patientStatusType == 43 - ? AppText( - TranslationBase.of(context).arrivedP, - color: Colors.green, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), + ? Row( + children: [ + AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox(width: 8,), + SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), + SizedBox(width: 8,), + AppText( + patientInfo.status==2? 'Confirmed':'Booked', + color: patientInfo.status==2? Colors.green:Colors.grey , + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + ], + ) + : patientInfo.patientStatusType == 42?Row( + children: [ + AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox(width: 8,), + SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), + SizedBox(width: 8,), + AppText( + patientInfo.status==2? 'Confirmed':'Booked', + color: patientInfo.status==2? Colors.green:Colors.grey , + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + ], + ): !isFromSearch?Row( + children: [ + AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox(width: 8,), + SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), + SizedBox(width: 8,), + AppText( + patientInfo.status==2? 'Confirmed':'Booked', + color: patientInfo.status==2? Colors.green:Colors.grey , + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + ], + ):SizedBox(), this.arrivalType == '1' ? AppText( patientInfo.startTime != null ? patientInfo.startTime : patientInfo.startTimes, fontFamily: 'Poppins', - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null ? AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate( - patientInfo.arrivedOn, - )), + DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,) + )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.arrivedOn,)), fontFamily: 'Poppins', - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w400, ) - : SizedBox() + : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? + AppText( + DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,) + )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + ):SizedBox() ], )) : SizedBox(), + if(isInpatient && isMyPatient && !isFromSearch) + Row( + children: [ + SizedBox(width: 12,), + AppText( + 'My Patient', + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + ], + ), Padding( padding: EdgeInsets.only(left: 12.0), child: Row( @@ -212,7 +291,7 @@ class PatientCard extends StatelessWidget { ), ), ), - if (isInpatient) + //if (isInpatient) Container( child: RichText( text: new TextSpan( @@ -368,7 +447,7 @@ class PatientCard extends StatelessWidget { //) ])) ]), - !isInpatient + !isInpatient && !isFromSearch ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ From 05a3ca73001ecea5d6e3b9c9400a4fec3ce0b5f1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 11:40:27 +0300 Subject: [PATCH 028/102] add doctor profile --- lib/screens/home/home_screen.dart | 2 +- .../patient_search_screen_new.dart | 6 +- .../patient_search/patients_screen_new.dart | 347 +++++++++--------- 3 files changed, 183 insertions(+), 172 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 1435c942..307b635c 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -559,7 +559,7 @@ class _HomeScreenState extends State { isSearch: false, isInpatient: false, patientSearchRequestModel: - PatientSearchRequestModel(from: date, to: date), + PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID), selectedPatientType: PatientType.OutPatient, isSearchWithKeyInfo: false, 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 c101567a..e1a22170 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,7 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/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'; import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class PatientSearchScreenNew extends StatefulWidget { @override @@ -26,9 +28,11 @@ class _PatientSearchScreenNewState extends State { TextEditingController middleNameInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; + AuthViewModel authProvider; @override Widget build(BuildContext context) { + authProvider =Provider.of(context); return BaseView( onModelReady: (model) async {}, builder: (_, model, w) => AppScaffold( @@ -248,7 +252,7 @@ class _PatientSearchScreenNewState extends State { isFormSubmitted = true; }); PatientSearchRequestModel patientSearchRequestModel = - PatientSearchRequestModel(); + 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(); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index ab1e9594..a4236870 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -100,187 +100,194 @@ class _PatientsScreenNewState extends State { title: "Search for ${widget.searchKey}", ), baseViewModel: model, - body: Container( - color: Colors.grey[200], - child: ListView( - scrollDirection: Axis.vertical, - children: [ + body: Column( + children: [ + if(!widget.isInpatient && !widget.isSearch) Container( - child: 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; + // 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, - ), - ), - ), - ), + 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, - ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), - SizedBox( - height: 10.0, - ), - SizedBox( - height: 10.0, + 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), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Expanded( + child: Container( + // color: Colors.grey[200], + child: ListView( + scrollDirection: Axis.vertical, + children: [ Container( - child: model.patientList.isNotEmpty - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: model.filterData - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: - patientType, - arrivalType: - arrivalType, - isInpatient: - widget.isInpatient, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - "1", - "from": widget.patientSearchRequestModel.from, - "to": widget.patientSearchRequestModel.from, - "isSearch": - widget.isSearch, - "isInpatient": - widget.isInpatient, - "arrivalType": - "7", - }); - }, - isFromSearch: widget.isSearch, - ); - }).toList(), - ) - : Center( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - SizedBox( - height: 100, - ), - Image.asset( - 'assets/images/no-data.png'), - Padding( - padding: - const EdgeInsets - .all(8.0), - child: AppText( - TranslationBase.of( - context) - .youDontHaveAnyPatient), - ) - ], + child: Column( + children: [ + + SizedBox( + height: 10.0, ), - )), + Container( + child: model.patientList.isNotEmpty + ? Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: model.filterData + .map((PatiantInformtion + item) { + return PatientCard( + patientInfo: item, + patientType: + patientType, + arrivalType: + arrivalType, + isInpatient: + widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType": + "1", + "from": widget.patientSearchRequestModel.from, + "to": widget.patientSearchRequestModel.from, + "isSearch": + widget.isSearch, + "isInpatient": + widget.isInpatient, + "arrivalType": + "7", + }); + }, + isFromSearch: widget.isSearch, + ); + }).toList(), + ) + : Center( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + SizedBox( + height: 100, + ), + Image.asset( + 'assets/images/no-data.png'), + Padding( + padding: + const EdgeInsets + .all(8.0), + child: AppText( + TranslationBase.of( + context) + .youDontHaveAnyPatient), + ) + ], + ), + )), + ], + ), + ) ], ), - ) - ], - ), + ), + ), + ], ) ), ); From 60eb7adab119ab6bc06b29545be4dcb73584380b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 27 Apr 2021 11:54:25 +0300 Subject: [PATCH 029/102] hot fixes --- lib/config/localized_values.dart | 3 +- .../service/patient-vital-signs-service.dart | 47 ++- .../patient-vital-sign-viewmodel.dart | 2 +- lib/routes.dart | 1 + .../medical-file/medical_file_page.dart | 4 +- .../insurance_approval_screen_patient.dart | 4 +- .../profile/in_patient_profile_screen.dart | 227 +++++++++++++ .../profile/lab_result/labs_home_page.dart | 4 +- .../profile/note/progress_note_screen.dart | 2 +- .../profile/patient_profile_screen.dart | 310 +++++++++++++++++- .../radiology/radiology_home_page.dart | 9 +- .../refer-patient-screen-in-patient.dart | 4 +- .../prescription/prescriptions_page.dart | 3 +- lib/screens/procedures/procedure_screen.dart | 6 +- lib/screens/sick-leave/add-sickleave.dart | 2 + lib/util/translations_delegate_base.dart | 1 + ...ent-profile-header-new-design-app-bar.dart | 51 ++- 17 files changed, 617 insertions(+), 63 deletions(-) create mode 100644 lib/screens/patients/profile/in_patient_profile_screen.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e47a8707..ea99a982 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': 'My InPatients', 'ar': 'المريض الداخلي'}, + 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, @@ -769,7 +770,7 @@ const Map> localizedValues = { 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, 'details': {'en': 'Details', 'ar': 'التفاصيل'}, "liveCare": {"en": "Live Care", "ar": "لايف كير"}, - "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, + "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, "sendSuc": { diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 4dd16859..fe6dcb5b 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -39,25 +39,29 @@ class VitalSignsService extends BaseService { patientVitalSigns = null; hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientId; // patient.patientMRN - // body['AppointmentNo'] = patient.appointmentNo; - // body['EpisodeID'] = patient.episodeNo; + body['PatientID'] = patient.patientId; // patient.patientMRN + body['InOutPatientType'] = 1; body['PatientTypeID'] = 1; body['PatientType'] = 1; body['DeviceTypeID'] = 1; body['isDentalAllowedBackend'] = false; - body['From'] = fromDate; - body['To'] = toDate; + body['ProjectID'] = patient.projectId; + // body['From'] = fromDate; + // body['To'] = toDate; + if (patient.appointmentNo != null && patient.projectId != null) { + body['TransNo'] = patient.appointmentNo; + body['ProjectID'] = patient.projectId; + } await baseAppClient.post( - GET_PATIENT_VITAL_SIGN_DATA, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); - if (response['VitalSignsHistory'] != null) { - response['VitalSignsHistory'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; @@ -67,31 +71,26 @@ class VitalSignsService extends BaseService { ); } - Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { + Future getOutPatientVitalSignHistory(PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; body['PatientTypeID'] = patient.patientType; - // if(isInPatient){ - body['InOutPatientType'] = 0; - // }else { - // body['InOutPatientType'] = 2; - // } + // if(isInPatient){ + body['InOutPatientType'] = 0; + // }else { + // body['InOutPatientType'] = 2; + // } - if (patient.appointmentNo != null && patient.projectId != null) { - body['TransNo'] = patient.appointmentNo; - body['ProjectID'] = patient.projectId; - } await baseAppClient.postPatient( - GET_PATIENT_VITAL_SIGN, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + });} }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index f9cbfc8d..cd02f538 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -56,7 +56,7 @@ class VitalSignsViewModel extends BaseViewModel { if (isInPatient) { await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); } else { - await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to); } diff --git a/lib/routes.dart b/lib/routes.dart index c9a77e70..91c3eaed 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -35,6 +35,7 @@ const String LOGIN = 'login'; const String VERIFICATION_METHODS = 'verification-methods'; const String PATIENTS = 'patients/patients'; const String PATIENTS_PROFILE = 'patients/patients-profile'; +const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile'; const String LAB_RESULT = 'patients/lab_result'; const String MEDICAL_FILE = 'patients/radiology'; const String PROGRESS_NOTE = 'patients/progress-note'; diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index f0ee6445..b7587efb 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -24,14 +24,14 @@ class _MedicalFilePageState extends State { patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", arrivalType), + patient, patientType.toString() ?? "0", arrivalType,isInpatient:isInpatient ,), isShowAppBar: true, appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 2225e289..ab3abbe9 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -33,7 +33,7 @@ class _InsuranceApprovalScreenNewState PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: patient.admissionNo != null ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) @@ -45,7 +45,7 @@ class _InsuranceApprovalScreenNewState builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", patientType), + patient, patientType.toString() ?? "0", patientType,isInpatient: isInpatient,), isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, diff --git a/lib/screens/patients/profile/in_patient_profile_screen.dart b/lib/screens/patients/profile/in_patient_profile_screen.dart new file mode 100644 index 00000000..bce4c725 --- /dev/null +++ b/lib/screens/patients/profile/in_patient_profile_screen.dart @@ -0,0 +1,227 @@ +import 'package:doctor_app_flutter/core/viewModel/patient_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/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import '../../../routes.dart'; + + +class InPatientProfileScreen extends StatefulWidget { + @override + _InPatientProfileScreenState createState() => _InPatientProfileScreenState(); +} + +class _InPatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { + PatiantInformtion patient; + + bool isFromSearch = false; + + bool isInpatient = false; + + bool isDischargedPatient = false; + String patientType; + String arrivalType; + String from; + String to; + + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; + if (routeArgs.containsKey("isSearch")) { + isFromSearch = routeArgs['isSearch']; + } + if (routeArgs.containsKey("isInpatient")) { + isInpatient = routeArgs['isInpatient']; + } + if (routeArgs.containsKey("isDischargedPatient")) { + isDischargedPatient = routeArgs['isDischargedPatient']; + } + + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, patientViewModel, w) => AppScaffold( + baseViewModel: patientViewModel, + appBarTitle: TranslationBase.of(context).patientProfile, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + ), + ), + )); + } +} + +class AvatarWidget extends StatelessWidget { + final Widget avatarIcon; + + AvatarWidget(this.avatarIcon); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(35.0)), + color: Color(0xffCCCCCC), + ), + child: avatarIcon, + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index abfcb282..5677d374 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -44,7 +44,7 @@ class _LabsHomePageState extends State { backgroundColor: Colors.grey[100], isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', patientType), + patient, patient.patientType.toString() ?? '0', patientType,isInpatient: isInpatient,), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -158,7 +158,7 @@ class _LabsHomePageState extends State { .toUpperCase() : !labOrder.isInOutPatient ? TranslationBase.of(context) - .inPatient + .inPatientLabel .toUpperCase() : TranslationBase.of(context) .outpatient diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 443bff8d..d7506402 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -79,7 +79,7 @@ class _ProgressNoteState extends State { backgroundColor: Theme.of(context).scaffoldBackgroundColor, // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType), + patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: true,), body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( error: TranslationBase.of(context).errorNoProgressNote) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 730e8a26..49943159 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -71,9 +71,9 @@ class _PatientProfileScreenState extends Statewith SingleT baseViewModel: patientViewModel, appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), body: SingleChildScrollView( - child: Column( + child: isFromSearch ?Column( children: [ DefaultTabController( length: 2, @@ -165,6 +165,7 @@ class _PatientProfileScreenState extends Statewith SingleT patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, + isInPatient: isInpatient, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), @@ -192,6 +193,7 @@ class _PatientProfileScreenState extends Statewith SingleT patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, + isInPatient: isInpatient, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'patient/Order_Procedures.png'), @@ -201,7 +203,7 @@ class _PatientProfileScreenState extends Statewith SingleT arrivalType: arrivalType, route: MEDICAL_FILE, nameLine1: "Health", - //TranslationBase.of(context).medicalReport, + isInPatient: isInpatient, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), @@ -212,7 +214,7 @@ class _PatientProfileScreenState extends Statewith SingleT isDisable: true, route: MEDICAL_FILE, nameLine1: "Medical", //Health - //TranslationBase.of(context).medicalReport, + isInPatient: isInpatient, nameLine2: "Report", //Report //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), @@ -226,6 +228,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -234,7 +237,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).approvals, icon: 'patient/vital_signs.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -244,7 +247,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: "Summery", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -264,7 +267,7 @@ class _PatientProfileScreenState extends Statewith SingleT crossAxisCount: 3, children: [ PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -276,7 +279,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -287,7 +290,7 @@ class _PatientProfileScreenState extends Statewith SingleT "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -307,7 +310,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).service, icon: 'patient/health_summary.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -316,7 +319,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: "ECG", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -326,7 +329,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -336,7 +339,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -346,7 +349,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -357,7 +360,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -370,7 +373,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -383,6 +386,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -404,6 +408,280 @@ class _PatientProfileScreenState extends Statewith SingleT ), ], + ):isInpatient?GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ):GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + + ], ), ), )); diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 6c709e83..81e0e6cf 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -47,7 +47,7 @@ class _RadiologyHomePageState extends State { backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType), + patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: isInpatient,), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -155,7 +155,7 @@ class _RadiologyHomePageState extends State { .toUpperCase() : !model.radiologyList[index].isInOutPatient ? TranslationBase.of(context) - .inPatient + .inPatientLabel .toUpperCase() : TranslationBase.of(context) .outpatient @@ -172,9 +172,8 @@ class _RadiologyHomePageState extends State { invoiceNO: '${model.radiologyList[index].invoiceNo}', branch: '${model.radiologyList[index].projectName}', clinic: model.radiologyList[index].clinicDescription, - appointmentDate: !isInpatient - ? model.radiologyList[index].orderDate - : model.radiologyList[index].reportDate, + appointmentDate: model.radiologyList[index].orderDate?? + model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index ae3fcee7..197cf6bc 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -48,7 +48,7 @@ class _PatientMakeInPatientReferralScreenState patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; referToList = List(); dynamic sameBranch = { "id": 1, @@ -70,7 +70,7 @@ class _PatientMakeInPatientReferralScreenState appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + patient, patientType, arrivalType,isInpatient: isInpatient,), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 19ce09e4..a1a5b962 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -24,6 +24,7 @@ class PrescriptionsPage extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; + bool isInpatient = routeArgs['isInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => @@ -35,7 +36,7 @@ class PrescriptionsPage extends StatelessWidget { isShowAppBar: true, backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType ?? '0', arrivalType), + patient, patientType ?? '0', arrivalType,isInpatient: isInpatient,), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 2a3a851c..51122999 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -30,17 +30,17 @@ class ProcedureScreen extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => - model.getProcedure(mrn: patient.patientId, patientType: patientType), + model.getProcedure(mrn: patient.patientId, patientType: patientType,), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType), + patient, arrivalType ?? '0', patientType,isInpatient: isInpatient,), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 3b05d8f4..6ee37745 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -21,6 +21,7 @@ class AddSickLeavScreen extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), @@ -32,6 +33,7 @@ class AddSickLeavScreen extends StatelessWidget { patient, routeArgs['patientType'] ?? "0", routeArgs['arrivalType'] ?? "0", + isInpatient: isInpatient, ), body: SingleChildScrollView( child: Column(children: [ diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 3d431f9d..6602722c 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 inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; 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..5faa82a4 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 @@ -17,9 +17,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final String patientType; final String arrivalType; final double height; + final bool isInpatient; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false}); @override Widget build(BuildContext context) { @@ -38,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? 200 : height, + height: height == 0 ? isInpatient? 210:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -254,7 +255,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age??'' + " : ", + text: TranslationBase.of(context).age+ " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: @@ -265,6 +266,50 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), ), ), + if(isInpatient) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: patient.admissionDate == null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: patient.admissionDate == null + ? "" + : "${DateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ]))), + if (patient.admissionDate != null) + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 15, + ), + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], + ), + ], + ) ], ), ), From 4c493d8ea680326f6a58e71d3aab90c6f6aebbab Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 12:16:12 +0300 Subject: [PATCH 030/102] fix issue in patients_screen --- .../viewModel/PatientSearchViewModel.dart | 1 + .../patient_search/patients_screen_new.dart | 117 ++++++------------ 2 files changed, 40 insertions(+), 78 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 59f8c9c6..b670205d 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -124,6 +124,7 @@ class PatientSearchViewModel extends BaseViewModel{ currentModel.firstName = patientSearchRequestModel.firstName; currentModel.lastName = patientSearchRequestModel.lastName; currentModel.middleName = patientSearchRequestModel.middleName; + currentModel.doctorID = patientSearchRequestModel.doctorID; currentModel.from = dateFrom; currentModel.to = dateTo; diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index a4236870..5de98242 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -5,7 +5,6 @@ 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'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -14,6 +13,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; @@ -208,85 +208,46 @@ class _PatientsScreenNewState extends State { ), Expanded( child: Container( - // color: Colors.grey[200], - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - child: Column( - children: [ - - SizedBox( - height: 10.0, - ), - Container( - child: model.patientList.isNotEmpty - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: model.filterData - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: - patientType, - arrivalType: - arrivalType, - isInpatient: - widget.isInpatient, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - "1", - "from": widget.patientSearchRequestModel.from, - "to": widget.patientSearchRequestModel.from, - "isSearch": - widget.isSearch, - "isInpatient": - widget.isInpatient, - "arrivalType": - "7", - }); - }, - isFromSearch: widget.isSearch, - ); - }).toList(), - ) - : Center( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - SizedBox( - height: 100, - ), - Image.asset( - 'assets/images/no-data.png'), - Padding( - padding: - const EdgeInsets - .all(8.0), - child: AppText( - TranslationBase.of( - context) - .youDontHaveAnyPatient), - ) - ], + 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) { + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: patientType, + arrivalType: arrivalType, + 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": widget.isSearch, + "isInpatient": widget.isInpatient, + "arrivalType": "7", + }); + }, + isFromSearch: widget.isSearch, ), - )), - ], - ), - ) - ], - ), + ); + })), ), - ), ], ) ), From 21fd90ea8c1aa1d3d8c433e93cf9dad5fa291e27 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 27 Apr 2021 12:32:01 +0300 Subject: [PATCH 031/102] hot fixes --- .../viewModel/PatientSearchViewModel.dart | 2 +- .../patients/PatientsInPatientScreen.dart | 92 ++++++++++++------- lib/util/dr_app_shared_pref.dart | 3 +- 3 files changed, 64 insertions(+), 33 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 59f8c9c6..9312f255 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -152,7 +152,7 @@ class PatientSearchViewModel extends BaseViewModel{ setState(ViewState.Busy); else setState(ViewState.BusyLocal); - await _inPatientService.getInPatientList(requestModel, isMyInpatient); + await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { error = _inPatientService.error; setState(ViewState.Error); diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 2a3f3839..7d41b3cb 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -101,32 +101,60 @@ class _PatientInPatientScreenState extends State { // const SizedBox( // height: 16, // ), - ...model.filteredInPatientItems.map((item) { - return PatientCard( - patientInfo: item, - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: _activeTab!=0? false:item.doctorId==model.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + ...List.generate(model.filteredInPatientItems.length, (index) { + if(_activeTab == 0) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { - "patient": item, - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - }).toList(), + 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) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + onTap: () { + 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", + }); + }, + ); + else return SizedBox(); + }), + SizedBox(height: 15,) ], ), ), @@ -173,12 +201,14 @@ class _PatientInPatientScreenState extends State { if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - GifLoaderDialogUtils.showMyDialog( - context); - await model.getInPatientList(requestModel, - isMyInpatient: _activeTab == 1, isFirstTime: false); - GifLoaderDialogUtils.hideDialog( - context); + if (_activeTab==0) { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getInPatientList(requestModel, + isMyInpatient: _activeTab == 1, isFirstTime: false); + GifLoaderDialogUtils.hideDialog( + context); + } }, child: Center( child: Container( diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index 2f6f3232..bac296bf 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -92,7 +92,8 @@ class DrAppSharedPreferances { clear() async { final SharedPreferences prefs = await _prefs; - prefs.clear(); + var vvas= await prefs.clear(); + var asd; } remove(String key) async { From 4f6fec07dad85277ec8380a7d907ad5d9140d20e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 27 Apr 2021 12:45:22 +0300 Subject: [PATCH 032/102] vital sign fix bug --- .../profile/vital_sign/vital_sign_details_screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 5ceaedd5..0b41e0a2 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -316,8 +316,8 @@ class VitalSignDetailsScreen extends StatelessWidget { GridView.count( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 6, - mainAxisSpacing: 6, + crossAxisSpacing: 8, + mainAxisSpacing: 12, crossAxisCount: 3, children: [ InkWell( From cf1d4439f2a310fc6abf5b22178d029089972b93 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 12:53:59 +0300 Subject: [PATCH 033/102] fix issue of out SA in case of 3 or 2 project id --- lib/client/base_app_client.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e6e6f9fc..602efa32 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; @@ -6,12 +7,8 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; -import 'dart:io' show Platform; - -import '../UpdatePage.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); @@ -70,6 +67,11 @@ class BaseAppClient { await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } + if (body['ProjectID'] != null && + (body['ProjectID'] == 2 || body['ProjectID'] == 3)) { + body['PatientOutSA'] = true; + } + print("URL : $url"); print("Body : ${json.encode(body)}"); var asd = json.encode(body); @@ -192,6 +194,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)) { + body['PatientOutSA'] = true; + } + print("URL : $url"); print("Body : ${json.encode(body)}"); From dc9f75f0ca55b02f300b1b2b17b5704c164fc338 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 27 Apr 2021 16:35:01 +0300 Subject: [PATCH 034/102] hot fixes --- lib/client/base_app_client.dart | 4 +- .../service/patient-vital-signs-service.dart | 2 + .../viewModel/prescription_view_model.dart | 5 +- lib/core/viewModel/procedure_View_model.dart | 2 +- lib/core/viewModel/sick_leave_view_model.dart | 2 +- lib/models/patient/patiant_info_model.dart | 2 +- .../patients/DischargedPatientPage.dart | 2 +- .../ReferralDischargedPatientDetails.dart | 4 +- .../patient_search_screen_new.dart | 144 +- .../profile/lab_result/LineChartCurved.dart | 2 +- .../profile/patient_profile_screen.dart | 1304 +++++++++-------- .../refer-patient-screen-in-patient.dart | 109 +- .../LineChartCurvedBloodPressure.dart | 7 +- .../vital_sing_chart_blood_pressure.dart | 1 + .../prescription/prescriptions_page.dart | 3 +- .../procedures/add-procedure-form.dart | 10 +- .../medicine/medicine_item_widget.dart | 5 +- lib/widgets/patients/PatientCard.dart | 100 +- .../profile/PatientProfileButton.dart | 4 +- ...ent-profile-header-new-design-app-bar.dart | 4 +- 20 files changed, 936 insertions(+), 780 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e6e6f9fc..c5f667d8 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -145,11 +145,11 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 6.3; + body['VersionID'] = 8.3; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; - body['IPAdress'] = IP_ADDRESS; + body['IPAdress'] = "10.20.10.20"; body['generalid'] = GENERAL_ID; body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index fe6dcb5b..1c07aa48 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -78,6 +78,8 @@ class VitalSignsService extends BaseService { body['PatientTypeID'] = patient.patientType; // if(isInPatient){ body['InOutPatientType'] = 0; + body['isDentalAllowedBackend'] = false; + body['IPAdress'] = "10.20.10.20"; // }else { // body['InOutPatientType'] = 2; // } diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index c266f3c0..c549b2b0 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -59,10 +59,11 @@ class PrescriptionViewModel extends BaseViewModel { getPrescriptionsInPatient(PatiantInformtion patient) async { setState(ViewState.Busy); + error=""; await _prescriptionsService.getPrescriptionInPatient( mrn: patient.patientId, adn: patient.admissionNo); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = "No Prescription Found"; setState(ViewState.Error); } else { _filterList(); @@ -268,7 +269,7 @@ class PrescriptionViewModel extends BaseViewModel { if (patientType == "7") setState(ViewState.ErrorLocal); else - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { _filterList(); await _getPrescriptionsOrders(); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index c68ec510..4ee569ce 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -147,7 +147,7 @@ class ProcedureViewModel extends BaseViewModel { if(patientType=="7") setState(ViewState.ErrorLocal); else - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { _radiologyService.finalRadiologyList.forEach((element) { List finalRadiologyListClinic = diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index f5ddd676..bc80744f 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -62,7 +62,7 @@ class SickLeaveViewModel extends BaseViewModel { await _sickLeaveService.getSickLeavePatient(patientMRN); if (_sickLeaveService.hasError) { error = _sickLeaveService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index cd21f911..2dec82d1 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -174,7 +174,7 @@ class PatiantInformtion { genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"] ?? '', - startTime: json["startTime"], + startTime: json["startTime"]??json['StartTime'], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentType: json['appointmentType'], appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'], diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 0e61702d..793ae8bb 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -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}", + "${DateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index b0ec6105..e16a1d8e 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -195,9 +195,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( - referredPatient.dischargeDate, - "dd MMM,yyyy"), + "${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays+1}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 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 e1a22170..5972ee6f 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -125,78 +125,78 @@ class _PatientSearchScreenNewState extends State { SizedBox( height: 5, ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - InkWell( - child: this.showOther == false - ? AppText( - TranslationBase.of(context) - .searchWithOther, - color: Colors.red, - fontWeight: FontWeight.bold, - ) - : AppText( - TranslationBase.of(context) - .hideOtherCriteria, - color: Colors.red, - fontWeight: FontWeight.bold), - onTap: () { - setState(() { - this.showOther = !this.showOther; - }); - }, - ) - ], - ), - SizedBox( - height: 30, - ), - if (showOther) - Column( - children: [ - AppTextFieldCustom( - hintText: - TranslationBase.of(context).firstName, - controller: firstNameInfoController, - maxLines: 1, - minLines: 1, - hasBorder: true, - onChanged: (_) {}, - // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - hintText: - TranslationBase.of(context).middleName, - controller: middleNameInfoController, - maxLines: 1, - minLines: 1, - onChanged: (_) {}, - hasBorder: true, - // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - hintText: - TranslationBase.of(context).lastName, - controller: lastNameFileInfoController, - maxLines: 1, - minLines: 1, - onChanged: (_) {}, - hasBorder: true, - // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - ), - SizedBox( - height: 10, - ), - ], - ), + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // InkWell( + // child: this.showOther == false + // ? AppText( + // TranslationBase.of(context) + // .searchWithOther, + // color: Colors.red, + // fontWeight: FontWeight.bold, + // ) + // : AppText( + // TranslationBase.of(context) + // .hideOtherCriteria, + // color: Colors.red, + // fontWeight: FontWeight.bold), + // onTap: () { + // setState(() { + // this.showOther = !this.showOther; + // }); + // }, + // ) + // ], + // ), + // SizedBox( + // height: 30, + // ), + // if (showOther) + // Column( + // children: [ + // AppTextFieldCustom( + // hintText: + // TranslationBase.of(context).firstName, + // controller: firstNameInfoController, + // maxLines: 1, + // minLines: 1, + // hasBorder: true, + // onChanged: (_) {}, + // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + // ), + // SizedBox( + // height: 10, + // ), + // AppTextFieldCustom( + // hintText: + // TranslationBase.of(context).middleName, + // controller: middleNameInfoController, + // maxLines: 1, + // minLines: 1, + // onChanged: (_) {}, + // hasBorder: true, + // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + // ), + // SizedBox( + // height: 10, + // ), + // AppTextFieldCustom( + // hintText: + // TranslationBase.of(context).lastName, + // controller: lastNameFileInfoController, + // maxLines: 1, + // minLines: 1, + // onChanged: (_) {}, + // hasBorder: true, + // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + // ), + // SizedBox( + // height: 10, + // ), + // ], + // ), SizedBox( height: MediaQuery.of(context).size.height * 0.12, ), diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index d0e61c10..2734286d 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -160,7 +160,7 @@ class LineChartCurvedState extends State { ), minX: 0, maxX: (widget.labResult.length - 1).toDouble(), - maxY: getMaxY(), + maxY: getMaxY()+2, minY: getMinY(), lineBarsData: getData(), ); diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 49943159..ba51c621 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -1,4 +1,7 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -7,6 +10,10 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.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/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import '../../../routes.dart'; @@ -29,6 +36,8 @@ class _PatientProfileScreenState extends Statewith SingleT String from; String to; TabController _tabController; + int index = 0; + int _activeTab = 0; @override void initState() { _tabController = TabController(length: 2,vsync:this); @@ -59,633 +68,758 @@ class _PatientProfileScreenState extends Statewith SingleT isDischargedPatient = routeArgs['isDischargedPatient']; } if(isInpatient) - _tabController.index =0; + _activeTab = 0; else - _tabController.index = 1; + _activeTab = 1; } @override Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; return BaseView( builder: (_, patientViewModel, w) => AppScaffold( baseViewModel: patientViewModel, appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), + isShowAppBar: false,//TODO fix button location + // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), body: SingleChildScrollView( - child: isFromSearch ?Column( - children: [ - DefaultTabController( - length: 2, - initialIndex: isInpatient ? 0 : 1, - child: SizedBox( - height: MediaQuery.of(context).size.height * 1.0, - width: double.infinity, - child: Scaffold( - appBar: AppBar( - backgroundColor: Colors.white, - automaticallyImplyLeading: false, - toolbarHeight: 65, - elevation: 0, - bottom: TabBar( - controller: _tabController, - indicator: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(10), // Creates border - color: Color(0xffD02126), - ), - indicatorColor: Colors.red[500], - unselectedLabelColor: Color(0xff5A6168), - labelColor: Colors.white, - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.35, - height: MediaQuery.of(context).size.height * 0.06, - child: Center( - child: Text('Inpatient Info'), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.35, - height: MediaQuery.of(context).size.height * 0.06, - child: Center( - child: Text('OutPatient Info'), - ), - ), - ]), - ), - body: Container( - margin: EdgeInsets.only(top: 10), - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, + child: Container( + child: Column( + children: [ + Stack( + children: [ + PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?250:0,), + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 175, + left: 20, + right: 20, + child: Row( children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], + ), + )), + ], + ), + Container( + child: isFromSearch ?Column( + children: [ - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + tabsBar(context,screenSize), + SizedBox(height: 10,), + if(_activeTab==0) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: _activeTab==0, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + if(_activeTab==1) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) PatientProfileButton( isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), - GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( + ], + ), + ), + ], + ):isInpatient? + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient :true, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ): + Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: false, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), - ], - ), ], ), ), - ), + ], ), ), + ], + ), + ), + ), + )); + } - ), - ], - ):isInpatient?GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ):GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), + Widget tabsBar( + BuildContext context, Size screenSize ) { + List _tabs = [ + "Inpatient Info".toUpperCase(), + "Outpatient Info".toUpperCase(), + ]; + + return Container( + 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: _tabs.map((item) { + bool _isActive = _tabs[_activeTab] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeTab = _tabs.indexOf(item); + }); - ], + }, + 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(), + ), + ); } + } class AvatarWidget extends StatelessWidget { @@ -710,3 +844,5 @@ class AvatarWidget extends StatelessWidget { ); } } + + diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 197cf6bc..38182570 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -1,6 +1,9 @@ +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/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'; 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/dr_app_toast_msg.dart'; @@ -11,11 +14,14 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.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:flutter/services.dart'; import 'package:intl/intl.dart'; - +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 PatientMakeInPatientReferralScreen extends StatefulWidget { @override _PatientMakeInPatientReferralScreenState createState() => @@ -41,6 +47,76 @@ class _PatientMakeInPatientReferralScreenState String clinicError; String doctorError; String frequencyError; + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + + @override + void initState() { + requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + initSpeechState().then((value) => {onVoiceText()}); + } + } + }); + super.initState(); + } + + 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(); + _remarksController.text = reconizedWord; + }); + } else { + print(result.finalResult); + } + } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } @override Widget build(BuildContext context) { @@ -387,13 +463,30 @@ class _PatientMakeInPatientReferralScreenState SizedBox( height: 10, ), - AppTextFieldCustom( - hintText: - TranslationBase.of(context).dietTypeRemarks, - controller: _remarksController, - inputType: TextInputType.multiline, - minLines: 4, - maxLines: 6, + Stack( + children: [ + AppTextFieldCustom( + hintText:"Remarks", + controller: _remarksController, + inputType: TextInputType.multiline, + minLines: 4, + maxLines: 6, + ), + Positioned( + top: 0, //MediaQuery.of(context).size.height * 0, + right: 15, + child: IconButton( + icon: Icon( + DoctorApp.speechtotext, + color: Colors.black, + ), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ), + ], ), ], ), diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 3f9b1dd6..1c387c9a 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -10,9 +10,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final List timeSeries1; final List timeSeries2; final int indexes; + final bool isOX; LineChartCurvedBloodPressure( - {this.title, this.timeSeries1, this.indexes, this.timeSeries2}); + {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false}); List xAxixs = List(); List yAxixs = List(); @@ -79,7 +80,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { color: Theme.of(context).primaryColor), ), SizedBox(width: 5,), - AppText(TranslationBase.of(context).systolicLng) + AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng) ], ), SizedBox(width: 15,), @@ -93,7 +94,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { color: Colors.red), ), SizedBox(width: 5,), - AppText(TranslationBase.of(context).diastolicLng,) + AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,) ], ), ], 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..27256525 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 @@ -47,6 +47,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { borderRadius: BorderRadius.circular(12)), child: LineChartCurvedBloodPressure( title: name, + isOX: title2=="SAO2", timeSeries1: timeSeriesData1, timeSeries2: timeSeriesData2, indexes: timeSeriesData1.length ~/ 5.5, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index a1a5b962..be212dc9 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -25,10 +25,11 @@ class PrescriptionsPage extends StatelessWidget { String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; + bool isSelectInpatient = routeArgs['isSelectInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => - patient.admissionNo != null && patient.admissionNo != "0" + isSelectInpatient ? model.getPrescriptionsInPatient(patient) : model.getPrescriptions(patient, patientType: patientType), builder: (_, model, w) => AppScaffold( diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 9a8fe0c5..7cc9818b 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -199,8 +199,11 @@ class _AddSelectedProcedureState extends State { // categoryName: procedureName.text); // }, onClick: () { + if(procedureName.text.isNotEmpty && procedureName.text.length>=3) model.getProcedureCategory( categoryName: procedureName.text); + else + DrAppToastMsg.showErrorToast('At least three Characters'); }, ), ), @@ -209,8 +212,11 @@ class _AddSelectedProcedureState extends State { ), InkWell( onTap: () { - model.getProcedureCategory( - categoryName: procedureName.text); + if(procedureName.text.isNotEmpty && procedureName.text.length>=3) + model.getProcedureCategory( + categoryName: procedureName.text); + else + DrAppToastMsg.showErrorToast('At least three Characters'); }, child: Icon( Icons.search, diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index bd71e477..f4f78c08 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -2,6 +2,8 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import '../shared/app_texts_widget.dart'; @@ -62,7 +64,8 @@ class _MedicineItemWidgetState extends State { padding: EdgeInsets.all(5), child: Align( alignment: Alignment.centerLeft, - child: AppText(widget.label)))) + child: AppText(widget.label)))), + Icon(EvaIcons.eye) ], ), ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 251f7653..f56ad676 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -116,7 +116,7 @@ class PatientCard extends StatelessWidget { fontSize: 12, ), ], - ): !isFromSearch?Row( + ): !isFromSearch && patientInfo.patientStatusType==null ? Row( children: [ AppText( TranslationBase.of(context).notArrived, @@ -129,8 +129,8 @@ class PatientCard extends StatelessWidget { SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), SizedBox(width: 8,), AppText( - patientInfo.status==2? 'Confirmed':'Booked', - color: patientInfo.status==2? Colors.green:Colors.grey , + patientInfo.status==2? 'Booked':'Confirmed', + color: patientInfo.status==2? Colors.grey:Colors.green , fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -154,8 +154,9 @@ class PatientCard extends StatelessWidget { ) : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? AppText( - DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,) - )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), + // + // )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), + " ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${patientInfo.startTime}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, ):SizedBox() @@ -355,96 +356,7 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w700), ], ), - // Container( - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Expanded( - // child: AppText( - // TranslationBase.of(context).noOfDays + - // " : ", - // fontSize: 14, - // ), - // ), - // AppText( - // patientInfo.days, - // color: Colors.white, - // fontSize: 1.5 * SizeConfig.textMultiplier, - // textAlign: TextAlign.center, - // fontWeight: FontWeight.bold, - // ), - // SizedBox( - // height: 0.5, - // ) - // ], - // ), - // margin: EdgeInsets.only( - // top: 8, - // ), - // ), - //if (SERVICES_PATIANT2[int.parse(patientType)] == - // "List_MyOutPatient") - // Container( - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // AppText( - // TranslationBase.of(context) - // .appointmentDate + - // " : ", - // fontSize: 14, - // ), - - // // Container( - // // child: - // patientInfo.appointmentDate != null - // ? AppText( - // DateUtils - // .convertDateFromServerFormat( - // patientInfo.appointmentDate - // .toString(), - // 'yyyy-MM-dd'), - // fontSize: 12, - // fontWeight: FontWeight.bold, - // ) - // : SizedBox(), - // //), - // patientInfo.startTimes != null - // ? - // // - // // Container( - // // // height: 15, - // // // width: 60, - // // padding: EdgeInsets.all(5), - // // decoration: BoxDecoration( - // // borderRadius: - // // BorderRadius.circular(25), - // // color: HexColor("#20A169"), - // // ), - // // child: - // AppText( - // ' ' + patientInfo.startTimes, - // fontSize: 11, - // fontWeight: FontWeight.bold, - // ) - // //) - // : SizedBox(), - // SizedBox( - // width: 3.5, - // ), - // //, - // SizedBox( - // height: 0.5, - // ) - // ], - // ), - // margin: EdgeInsets.only( - // top: 8, - // ), - //) ])) ]), !isInpatient && !isFromSearch diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index a9db021f..66d33fe7 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -21,6 +21,7 @@ class PatientProfileButton extends StatelessWidget { final bool isLoading; final Function onTap; final bool isDischargedPatient; + final bool isSelectInpatient; PatientProfileButton( {Key key, this.patient, @@ -35,7 +36,7 @@ class PatientProfileButton extends StatelessWidget { this.isLoading = false, this.from, this.to, - this.isInPatient = false, this.isDischargedPatient=false, + this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false, }) : super(key: key); @@ -133,6 +134,7 @@ class PatientProfileButton extends StatelessWidget { 'arrivalType': arrivalType, 'isInpatient': isInPatient, 'isDischargedPatient': isDischargedPatient, + 'isSelectInpatient': isSelectInpatient, }); } } 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 5faa82a4..ddbeb379 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 @@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 210:200 : height, + height: height == 0 ? isInpatient? 220:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -60,7 +60,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget " " + Helpers.capitalize(patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 2.2, + fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), From d37051ebe0c7ea75606b70a006b114b65b6cf87c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 16:48:55 +0300 Subject: [PATCH 035/102] fix button --- .../profile/patient_profile_screen.dart | 1177 +++++++++-------- 1 file changed, 592 insertions(+), 585 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index ba51c621..c8411b2c 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -88,13 +88,602 @@ class _PatientProfileScreenState extends Statewith SingleT children: [ Stack( children: [ - PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?250:0,), + Column( + children: [ + PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?250:0,), + Container( + child: isFromSearch ?Column( + children: [ + + tabsBar(context,screenSize), + SizedBox(height: 10,), + if(_activeTab==0) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: _activeTab==0, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + if(_activeTab==1) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + + ], + ), + ), + ], + ):isInpatient? + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient :true, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ): + Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: false, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + + ], + ), + ), + ], + ), + ), + ], + ), + if (patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( onModelReady: (model) async {}, builder: (_, model, w) => Positioned( - top: 175, + top: 210, left: 20, right: 20, child: Row( @@ -173,592 +762,10 @@ class _PatientProfileScreenState extends Statewith SingleT ], ), )), + ], ), - Container( - child: isFromSearch ?Column( - children: [ - - tabsBar(context,screenSize), - SizedBox(height: 10,), - if(_activeTab==0) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: _activeTab==0, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ), - if(_activeTab==1) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - - ], - ), - ), - ], - ):isInpatient? - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient :true, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ): - Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: false, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - - ], - ), - ), - ], - ), - ), ], ), ), From b6d1c698e2abcc978ae738ba1baeebed2ba29031 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 17:05:04 +0300 Subject: [PATCH 036/102] fix --- lib/screens/patients/profile/patient_profile_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index c8411b2c..b2997bc4 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -90,7 +90,7 @@ class _PatientProfileScreenState extends Statewith SingleT children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?250:0,), + PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?265:0,), Container( child: isFromSearch ?Column( children: [ From acb1bdbb37b6543df3c591ff79fae4a211cb9a3c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 17:10:10 +0300 Subject: [PATCH 037/102] fix --- .../profile/patient_profile_screen.dart | 43 ++++++++++++------- ...ent-profile-header-new-design-app-bar.dart | 2 +- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index b2997bc4..2082fefc 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -7,14 +7,13 @@ 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/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; + import '../../../routes.dart'; @@ -90,18 +89,32 @@ class _PatientProfileScreenState extends Statewith SingleT children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?265:0,), - Container( - child: isFromSearch ?Column( - children: [ - - tabsBar(context,screenSize), - SizedBox(height: 10,), - if(_activeTab==0) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + Container( + child: isFromSearch + ? Column( + children: [ + tabsBar(context, screenSize), + SizedBox( + height: 10, + ), + if (_activeTab == 0) + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, @@ -683,7 +696,7 @@ class _PatientProfileScreenState extends Statewith SingleT BaseView( onModelReady: (model) async {}, builder: (_, model, w) => Positioned( - top: 210, + top: 180, left: 20, right: 20, child: Row( 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 ddbeb379..48ebe348 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 @@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 220:200 : height, + height: height == 0 ? isInpatient? 235:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), From 72bf5d233762322faf18ba4d9a02a7c1b57ffd7e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 17:27:22 +0300 Subject: [PATCH 038/102] fix scrolling in patient screen --- .../profile/patient_profile_screen.dart | 1087 +++++++++-------- ...ent-profile-header-new-design-app-bar.dart | 2 +- 2 files changed, 548 insertions(+), 541 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 2082fefc..c5a2fcb1 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -81,40 +81,331 @@ class _PatientProfileScreenState extends Statewith SingleT appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: false,//TODO fix button location // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), - body: SingleChildScrollView( - child: Container( - child: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : 0, - ), - Container( - child: isFromSearch - ? Column( - children: [ - tabsBar(context, screenSize), - SizedBox( - height: 10, + body: Container( + child: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height *0.65, + child: ListView( + children: [ + Container( + child: isFromSearch + ? Column( + children: [ + tabsBar(context, screenSize), + SizedBox( + height: 10, + ), + if (_activeTab == 0) + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: _activeTab==0, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + if(_activeTab==1) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + + ], ), - if (_activeTab == 0) - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, + ), + ], + ):isInpatient? + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, @@ -142,7 +433,6 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), PatientProfileButton( - patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -153,11 +443,11 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/health_summary.png'), PatientProfileButton( patient: patient, + isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: _activeTab==0, - isInPatient: isInpatient, + isSelectInpatient :true, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), @@ -166,12 +456,14 @@ class _PatientProfileScreenState extends Statewith SingleT patientType: patientType, arrivalType: arrivalType, route: PROGRESS_NOTE, + isInPatient: isInpatient, isDischargedPatient: isDischargedPatient, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, + isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, @@ -221,7 +513,6 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), PatientProfileButton( - isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -250,462 +541,221 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/patient_sick_leave.png'), ], ), - ), - if(_activeTab==1) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - - ], - ), - ), - ], - ):isInpatient? - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient :true, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ): - Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, + ): + Column( children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: false, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: false, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + ], + ), + ), ], - ), + ), + ), + ], ), - ], + ), ), - ), - ], - ), + ], + ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", color: patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, @@ -716,71 +766,28 @@ class _PatientProfileScreenState extends Statewith SingleT fontWeight: FontWeight.normal, fontSize: 1.6, icon: Image.asset( - "assets/images/create-episod.png", + "assets/images/modilfy-episode.png", color: Colors.white, height: 30, ), - onPressed: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = model.episodeID; + onPressed: () { + if (patient.patientStatusType == + 43) { Navigator.of(context).pushNamed( - CREATE_EPISODE, + UPDATE_EPISODE, arguments: { 'patient': patient }); } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), + }), + ], + ), + )), - ], - ), + ], + ), - ], - ), + ], ), ), )); 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 48ebe348..f07ad8a4 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 @@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 235:200 : height, + height: height == 0 ? isInpatient? 210:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), From cfe3056f173b338cb1b76c1af189895a00f7137b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 17:50:43 +0300 Subject: [PATCH 039/102] fix scrolling step 2 --- .../profile/patient_profile_screen.dart | 1213 ++++++++--------- 1 file changed, 605 insertions(+), 608 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index c5a2fcb1..6d7a7845 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -81,328 +81,469 @@ class _PatientProfileScreenState extends Statewith SingleT appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: false,//TODO fix button location // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), - body: Container( - child: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : 0, - ), - SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height *0.65, - child: ListView( - children: [ - Container( - child: isFromSearch - ? Column( - children: [ - tabsBar(context, screenSize), - SizedBox( - height: 10, - ), - if (_activeTab == 0) - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( + body: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + Container( + height: MediaQuery.of(context).size.height *0.69, + + child: ListView( + children: [ + Container( + child: isFromSearch + ? Column( + children: [ + tabsBar(context, screenSize), + SizedBox( + height: 10, + ), + if (_activeTab == 0) + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: _activeTab==0, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ), - if(_activeTab==1) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: _activeTab==0, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + if(_activeTab==1) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), - ], - ), - ), - ], - ):isInpatient? - Padding( + ], + ), + ), + ], + ):isInpatient? + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient :true, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ): + Column( + children: [ + Padding( padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), child: GridView.count( shrinkWrap: true, @@ -413,6 +554,7 @@ class _PatientProfileScreenState extends Statewith SingleT crossAxisCount: 3, children: [ PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -421,57 +563,59 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, - isInPatient: true, icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - isInPatient: true, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( + patient: patient, patientType: patientType, arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, + nameLine2: TranslationBase.of(context).service, icon: 'patient/health_summary.png'), PatientProfileButton( - patient: patient, isInPatient: isInpatient, + patient: patient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient :true, + route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( patient: patient, - isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: false, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( patient: patient, patientType: patientType, @@ -481,55 +625,17 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, + nameLine2: TranslationBase.of(context).service, icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, patient: patient, @@ -539,181 +645,115 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + ], ), - ): - Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: false, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - - ], - ), - ), - ], - ), + ), + ], ), - ], - ), - ), + ), + ], ), - ], - ), + ), + ], + ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", color: patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, @@ -724,71 +764,28 @@ class _PatientProfileScreenState extends Statewith SingleT fontWeight: FontWeight.normal, fontSize: 1.6, icon: Image.asset( - "assets/images/create-episod.png", + "assets/images/modilfy-episode.png", color: Colors.white, height: 30, ), - onPressed: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = model.episodeID; + onPressed: () { + if (patient.patientStatusType == + 43) { Navigator.of(context).pushNamed( - CREATE_EPISODE, + UPDATE_EPISODE, arguments: { 'patient': patient }); } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), + }), + ], + ), + )), - ], - ), + ], + ), - ], - ), + ], ), )); } From bfd36b1c77321a2f594c4816f720b27db0e9050b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 19:04:39 +0300 Subject: [PATCH 040/102] fix scrolling step 3 --- .../profile/patient_profile_screen.dart | 1469 ++++++++++++----- 1 file changed, 1019 insertions(+), 450 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 6d7a7845..3c2fab57 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -16,13 +16,13 @@ import 'package:flutter/material.dart'; import '../../../routes.dart'; - class PatientProfileScreen extends StatefulWidget { @override _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { PatiantInformtion patient; bool isFromSearch = false; @@ -39,9 +39,10 @@ class _PatientProfileScreenState extends Statewith SingleT int _activeTab = 0; @override void initState() { - _tabController = TabController(length: 2,vsync:this); + _tabController = TabController(length: 2, vsync: this); super.initState(); } + @override void dispose() { _tabController.dispose(); @@ -52,11 +53,11 @@ class _PatientProfileScreenState extends Statewith SingleT void didChangeDependencies() { super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - patientType = routeArgs['patientType']; - arrivalType = routeArgs['arrivalType']; - from = routeArgs['from']; - to = routeArgs['to']; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; if (routeArgs.containsKey("isSearch")) { isFromSearch = routeArgs['isSearch']; } @@ -66,7 +67,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; } - if(isInpatient) + if (isInpatient) _activeTab = 0; else _activeTab = 1; @@ -78,47 +79,55 @@ class _PatientProfileScreenState extends Statewith SingleT return BaseView( builder: (_, patientViewModel, w) => AppScaffold( baseViewModel: patientViewModel, - appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: false,//TODO fix button location - // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), + appBarTitle: TranslationBase + .of(context) + .patientProfile, + isShowAppBar: false, + //TODO fix button location + // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), body: Column( children: [ Stack( children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : 0, - ), - Container( - height: MediaQuery.of(context).size.height *0.69, + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + if(isFromSearch) + tabsBar(context, screenSize), + Container( + height: isFromSearch ? MediaQuery + .of(context) + .size + .height * 0.60 : MediaQuery + .of(context) + .size + .height * 0.69, + child: ListView( + children: [ + Container( + child: isFromSearch + ? Column( + children: [ - child: ListView( - children: [ - Container( - child: isFromSearch - ? Column( - children: [ - tabsBar(context, screenSize), - SizedBox( - height: 10, - ), - if (_activeTab == 0) - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + if (_activeTab == 0) + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, @@ -126,286 +135,584 @@ class _PatientProfileScreenState extends Statewith SingleT children: [ PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, isInPatient: true, - icon: 'patient/vital_signs.png'), + icon: + 'patient/vital_signs.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: _activeTab==0, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: + _activeTab == 0, + isInPatient: + isInpatient, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + isInPatient: + isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: MEDICAL_FILE, nameLine1: "Health", - isInPatient: isInpatient, + isInPatient: + isInpatient, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, isDisable: true, route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report + nameLine1: + "Medical", + //Health + isInPatient: + isInpatient, + nameLine2: + "Report", + //Report //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, isDisable: true, route: null, nameLine1: "Discharge", nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), ], ), ), - if(_activeTab==1) + if (_activeTab == 1) Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, crossAxisCount: 3, children: [ PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: MEDICAL_FILE, nameLine1: - "Health", //TranslationBase.of(context).medicalReport, + "Health", + //TranslationBase.of(context).medicalReport, nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: + TranslationBase + .of( + context) + .patient, nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), ], ), ), ], - ):isInpatient? - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + ) + : isInpatient + ? Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, @@ -417,69 +724,130 @@ class _PatientProfileScreenState extends Statewith SingleT arrivalType: arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, route: VITAL_SIGN_DETAILS, isInPatient: true, - icon: 'patient/vital_signs.png'), + icon: + 'patient/vital_signs.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient :true, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: true, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: PROGRESS_NOTE, isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), PatientProfileButton( patient: patient, patientType: patientType, @@ -489,36 +857,64 @@ class _PatientProfileScreenState extends Statewith SingleT isInPatient: isInpatient, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, isDisable: true, route: MEDICAL_FILE, - nameLine1: "Medical", //Health + nameLine1: + "Medical", + //Health isInPatient: isInpatient, - nameLine2: "Report", //Report + nameLine2: + "Report", + //Report //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, + route: + REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), PatientProfileButton( isInPatient: isInpatient, patient: patient, @@ -528,271 +924,448 @@ class _PatientProfileScreenState extends Statewith SingleT route: null, nameLine1: "Discharge", nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), ], ), - ): - Column( + ) + : Column( children: [ Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + padding: const EdgeInsets + .symmetric( + vertical: 15.0, + horizontal: 15), child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, crossAxisCount: 3, children: [ PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: MEDICAL_FILE, nameLine1: - "Health", //TranslationBase.of(context).medicalReport, + "Health", + //TranslationBase.of(context).medicalReport, nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: + TranslationBase + .of( + context) + .patient, nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: false, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: + false, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PROCEDURE, + isInPatient: + isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), ], ), ), ], + ), + ), + ], ), ), - ], - ), - ), ], ), - if (patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, + builder: (_, model, w) => + Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase + .of(context) + .createNew}\n${TranslationBase + .of(context) + .episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == + 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = + model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), - + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase + .of(context) + .update}\n${TranslationBase + .of(context) + .episode}", + color: + patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], + ), + )), ], ), - ], ), )); } - - Widget tabsBar( - BuildContext context, Size screenSize ) { + Widget tabsBar(BuildContext context, Size screenSize) { List _tabs = [ "Inpatient Info".toUpperCase(), "Outpatient Info".toUpperCase(), @@ -815,7 +1388,6 @@ class _PatientProfileScreenState extends Statewith SingleT setState(() { _activeTab = _tabs.indexOf(item); }); - }, child: Center( child: Container( @@ -843,7 +1415,6 @@ class _PatientProfileScreenState extends Statewith SingleT ), ); } - } class AvatarWidget extends StatelessWidget { @@ -868,5 +1439,3 @@ class AvatarWidget extends StatelessWidget { ); } } - - From 1dd668ed70cf7ace27f02f0e55fba4f462d50d58 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 28 Apr 2021 00:03:31 +0300 Subject: [PATCH 041/102] hot fixes --- .../service/DischargedPatientService.dart | 2 +- lib/core/service/base/base_service.dart | 12 +- lib/core/service/labs_service.dart | 4 +- lib/core/service/sickleave_service.dart | 20 +- lib/core/viewModel/procedure_View_model.dart | 48 +-- .../patients/DischargedPatientPage.dart | 1 + .../ReferralDischargedPatientDetails.dart | 1 + .../patient_search_screen_new.dart | 83 ++-- .../patient_search/patients_screen_new.dart | 9 +- .../profile/lab_result/labs_home_page.dart | 142 +++---- .../profile/patient_profile_screen.dart | 386 +++--------------- .../assessment/update_assessment_page.dart | 108 ++--- .../objective/update_objective_page.dart | 96 ++--- .../soap_update/plan/update_plan_page.dart | 108 ++--- .../subjective/update_subjective_page.dart | 9 +- lib/util/date-utils.dart | 12 + lib/widgets/patients/PatientCard.dart | 4 +- ...ent-profile-header-new-design-app-bar.dart | 2 +- lib/widgets/shared/app_scaffold_widget.dart | 12 +- 19 files changed, 391 insertions(+), 668 deletions(-) diff --git a/lib/core/service/DischargedPatientService.dart b/lib/core/service/DischargedPatientService.dart index 63d3f0de..2d43afc6 100644 --- a/lib/core/service/DischargedPatientService.dart +++ b/lib/core/service/DischargedPatientService.dart @@ -11,7 +11,7 @@ class DischargedPatientService extends BaseService { Future getDischargedPatient() async { hasError = false; Map body = Map(); - await getDoctorProfile(); + await getDoctorProfile(isGetProfile: true); body['DoctorID'] = doctorProfile.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 42e2cc6d..09ee7c49 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -15,7 +15,17 @@ class BaseService { List patientArrivalList = []; //TODO add the user login model when we need it - Future getDoctorProfile() async { + Future getDoctorProfile({bool isGetProfile = false}) async { + if(isGetProfile) + { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } + } + } if (doctorProfile == null) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { diff --git a/lib/core/service/labs_service.dart b/lib/core/service/labs_service.dart index aba5330e..8af2121f 100644 --- a/lib/core/service/labs_service.dart +++ b/lib/core/service/labs_service.dart @@ -25,7 +25,8 @@ class LabsService extends BaseService { body['isDentalAllowedBackend'] = false; url = GET_Patient_LAB_ORDERS; } - + patientLabOrdersList=[]; + patientLabOrdersList.clear(); await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabOrdersList=[]; @@ -33,6 +34,7 @@ class LabsService extends BaseService { response['ListPLO'].forEach((hospital) { patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); }); + var asd=""; } else { response['List_GetLabOreders'].forEach((hospital) { patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 90785a7b..1bfb8df8 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -17,7 +17,7 @@ class SickLeaveService extends BaseService { List get getReasons => reasonse; List reasonse = []; List get getAllSickLeave => _getAllsickLeave; - List _getAllsickLeave = []; + List _getAllsickLeave = List(); List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; @@ -31,9 +31,8 @@ class SickLeaveService extends BaseService { dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic _sickLeaveResponse; - List get getAllSickLeavePatient => - _getAllsickLeavePatient; - List _getAllsickLeavePatient = []; + + List getAllSickLeavePatient = List(); SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); @@ -98,13 +97,14 @@ class SickLeaveService extends BaseService { Future getSickLeave(patientMRN) async { hasError = false; + getAllSickLeavePatient = []; await baseAppClient.postPatient( GET_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { - Future.value(response); - _getAllsickLeavePatient.clear(); + // Future.value(response); + getAllSickLeavePatient=[]; response['List_SickLeave'].forEach((v) { - _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); + getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -119,13 +119,15 @@ class SickLeaveService extends BaseService { _sickLeavePatientRequestModel = SickLeavePatientRequestModel( patientID: patientMRN, patientTypeID: 2, patientType: 1); hasError = false; + getAllSickLeavePatient =[]; + getAllSickLeavePatient.clear(); await baseAppClient.postPatient( GET_SICK_LEAVE_PATIENT, onSuccess: (dynamic response, int statusCode) { Future.value(response); - _getAllsickLeavePatient.clear(); + getAllSickLeavePatient.clear(); response['List_SickLeave'].forEach((v) { - _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); + getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 4ee569ce..8717c84b 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -43,16 +43,15 @@ class ProcedureViewModel extends BaseViewModel { List get radiologyList => _radiologyService.finalRadiologyList; + List get patientLabOrdersList => _labsService.patientLabOrdersList; + List get labOrdersResultsList => _labsService.labOrdersResultsList; List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); - List get patientLabOrdersList => - filterType == FilterType.Clinic - ? _patientLabOrdersListClinic - : _patientLabOrdersListHospital; + Future getProcedure({int mrn,String patientType}) async { hasError = false; @@ -222,6 +221,8 @@ class ProcedureViewModel extends BaseViewModel { List labResultLists = List(); + + List get labResultListsCoustom { return labResultLists; } @@ -233,45 +234,6 @@ class ProcedureViewModel extends BaseViewModel { error = _labsService.error; setState(ViewState.Error); } else { - _labsService.patientLabOrdersList.forEach((element) { - List patientLabOrdersClinic = - _patientLabOrdersListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); - - if (patientLabOrdersClinic.length != 0) { - _patientLabOrdersListClinic[_patientLabOrdersListClinic - .indexOf(patientLabOrdersClinic[0])] - .patientLabOrdersList - .add(element); - } else { - _patientLabOrdersListClinic.add(PatientLabOrdersList( - filterName: element.clinicDescription, - patientDoctorAppointment: element)); - } - - // doctor list sort via project - List patientLabOrdersHospital = - _patientLabOrdersListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); - - if (patientLabOrdersHospital.length != 0) { - _patientLabOrdersListHospital[_patientLabOrdersListHospital - .indexOf(patientLabOrdersHospital[0])] - .patientLabOrdersList - .add(element); - } else { - _patientLabOrdersListHospital.add(PatientLabOrdersList( - filterName: element.projectName, - patientDoctorAppointment: element)); - } - }); - setState(ViewState.Idle); } } diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 793ae8bb..28f7b834 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -27,6 +27,7 @@ class _DischargedPatientState extends State { onModelReady: (model) => model.getDischargedPatient(), builder: (_, model, w) => AppScaffold( appBarTitle: 'Discharged Patient', + subtitle: "Last Three Months", backgroundColor: Colors.grey[200], isShowAppBar: true, baseViewModel: model, diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index e16a1d8e..0b664d4b 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -75,6 +75,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", + "isDischargedPatient":true, "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); 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 5972ee6f..c17c173a 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -55,46 +55,46 @@ class _PatientSearchScreenNewState extends State { SizedBox( height: 16, ), - AppText( - 'Patient Type', - fontWeight: FontWeight.w600, - ), - Row( - children: [ - Row( - children: [ - Radio( - activeColor: Color(0xFFB9382C), - value: PatientType.inPatient, - groupValue: selectedPatientType, - onChanged: (value) { - setState(() { - selectedPatientType = - PatientType.inPatient; - }); - }, - ), - Text('InPatient'), - ], - ), - Row( - children: [ - Radio( - activeColor: Color(0xFFB9382C), - value: PatientType.OutPatient, - groupValue: selectedPatientType, - onChanged: (value) { - setState(() { - selectedPatientType = - PatientType.OutPatient; - }); - }, - ), - Text('OutPatient'), - ], - ), - ], - ), + // AppText( + // 'Patient Type', + // fontWeight: FontWeight.w600, + // ), + // Row( + // children: [ + // Row( + // children: [ + // Radio( + // activeColor: Color(0xFFB9382C), + // value: PatientType.inPatient, + // groupValue: selectedPatientType, + // onChanged: (value) { + // setState(() { + // selectedPatientType = + // PatientType.inPatient; + // }); + // }, + // ), + // Text('InPatient'), + // ], + // ), + // Row( + // children: [ + // Radio( + // activeColor: Color(0xFFB9382C), + // value: PatientType.OutPatient, + // groupValue: selectedPatientType, + // onChanged: (value) { + // setState(() { + // selectedPatientType = + // PatientType.OutPatient; + // }); + // }, + // ), + // Text('OutPatient'), + // ], + // ), + // ], + // ), SizedBox( height: 10, ), @@ -299,8 +299,9 @@ class _PatientSearchScreenNewState extends State { isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, + isSearchAndOut:true, searchKey: patientFileInfoController.text, - isInpatient: selectedPatientType != PatientType.OutPatient, + 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 5de98242..7074bda9 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -33,6 +33,7 @@ class PatientsScreenNew extends StatefulWidget { final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; + final bool isSearchAndOut; final String searchKey; @@ -46,7 +47,7 @@ class PatientsScreenNew extends StatefulWidget { this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, - this.isInpatient = false, this.searchKey}); + this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); @override _PatientsScreenNewState createState() => _PatientsScreenNewState(); @@ -226,7 +227,8 @@ class _PatientsScreenNewState extends State { patientInfo: model.filterData[index], patientType: patientType, arrivalType: arrivalType, - isInpatient: widget.isInpatient, + isFromSearch:widget.isSearchAndOut, + isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic Navigator.of(context).pushNamed( @@ -241,9 +243,10 @@ class _PatientsScreenNewState extends State { "isSearch": widget.isSearch, "isInpatient": widget.isInpatient, "arrivalType": "7", + "isSearchAndOut": widget.isSearchAndOut, }); }, - isFromSearch: widget.isSearch, + // isFromSearch: widget.isSearch, ), ); })), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 5677d374..290f9569 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -114,87 +114,79 @@ class _LabsHomePageState extends State { ), ...List.generate( model.patientLabOrdersList.length, - (index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .patientLabOrdersList[index].patientLabOrdersList - .map((labOrder) { - return Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(8.0), + (index) => Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: model.patientLabOrdersList[index].isLiveCareAppointment + ? Colors.red[900] + : !model.patientLabOrdersList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), ), - color: Colors.white), - child: Row( - children: [ - Container( - width: 20, - height: 160, - decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) - color: labOrder.isLiveCareAppointment - ? Colors.red[900] - : !labOrder.isInOutPatient - ? Colors.black - : Color(0xffa9a089), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.patientLabOrdersList[index].isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), ), - ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - labOrder.isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !labOrder.isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), - style: TextStyle(color: Colors.white), - ), - )), - ), - Expanded( - child: DoctorCard( - isNoMargin: true, - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, - arrivalType: arrivalType, - patientType: patientType, - ), - ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: model.patientLabOrdersList[index], + patient: patient, + arrivalType: arrivalType, + patientType: patientType, ), - doctorName: labOrder.doctorName, - invoiceNO: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - branch: labOrder.projectName, - clinic: labOrder.clinicDescription, - appointmentDate: labOrder.orderDate, - orderNo: labOrder.orderNo, - isShowTime: false, ), ), - ], + doctorName: model.patientLabOrdersList[index].doctorName, + invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model.patientLabOrdersList[index].doctorImageURL, + branch: model.patientLabOrdersList[index].projectName, + clinic: model.patientLabOrdersList[index].clinicDescription, + appointmentDate: model.patientLabOrdersList[index].orderDate, + orderNo: model.patientLabOrdersList[index].orderNo, + isShowTime: false, + ), ), - ); - }).toList(), + ], + ), ), ), if (model.patientLabOrdersList.isEmpty && diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 3c2fab57..bae49ef9 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -30,6 +30,7 @@ class _PatientProfileScreenState extends State bool isInpatient = false; bool isDischargedPatient = false; + bool isSearchAndOut = false; String patientType; String arrivalType; String from; @@ -66,6 +67,8 @@ class _PatientProfileScreenState extends State } if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; + }if (routeArgs.containsKey("isSearchAndOut")) { + isSearchAndOut = routeArgs['isSearchAndOut']; } if (isInpatient) _activeTab = 0; @@ -101,24 +104,22 @@ class _PatientProfileScreenState extends State ? 210 : 0, ), - if(isFromSearch) - tabsBar(context, screenSize), + Container( - height: isFromSearch ? MediaQuery + height: !isSearchAndOut ? MediaQuery .of(context) .size - .height * 0.60 : MediaQuery + .height * 0.70 : MediaQuery .of(context) .size .height * 0.69, child: ListView( children: [ Container( - child: isFromSearch + child: isSearchAndOut ? Column( children: [ - if (_activeTab == 0) Padding( padding: const EdgeInsets.symmetric( @@ -134,6 +135,8 @@ class _PatientProfileScreenState extends State crossAxisCount: 3, children: [ PatientProfileButton( + isInPatient: + isInpatient, patient: patient, patientType: patientType, @@ -153,17 +156,17 @@ class _PatientProfileScreenState extends State .signs, route: VITAL_SIGN_DETAILS, - isInPatient: true, icon: 'patient/vital_signs.png'), PatientProfileButton( + isInPatient: + isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - isInPatient: true, nameLine1: TranslationBase .of( @@ -195,10 +198,12 @@ class _PatientProfileScreenState extends State TranslationBase .of( context) - .result, + .service, icon: 'patient/health_summary.png'), PatientProfileButton( + isInPatient: + isInpatient, patient: patient, patientType: patientType, @@ -206,15 +211,11 @@ class _PatientProfileScreenState extends State arrivalType, route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: - _activeTab == 0, - isInPatient: - isInpatient, nameLine1: TranslationBase .of( context) - .patient, + .orders, nameLine2: TranslationBase .of( @@ -222,222 +223,6 @@ class _PatientProfileScreenState extends State .prescription, icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1: - TranslationBase - .of( - context) - .progress, - nameLine2: - TranslationBase - .of( - context) - .note, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1: - "Order", - //"Text", - nameLine2: - "Sheet", - //TranslationBase.of(context).orders, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - isInPatient: - isInpatient, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: - isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: - "Medical", - //Health - isInPatient: - isInpatient, - nameLine2: - "Report", - //Report - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: - isDischargedPatient || - isFromSearch, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .approvals, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - ], - ), - ), - if (_activeTab == 1) - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - // if (selectedPatientType != 7) PatientProfileButton( isInPatient: isInpatient, @@ -455,50 +240,6 @@ class _PatientProfileScreenState extends State //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), PatientProfileButton( isInPatient: isInpatient, @@ -516,29 +257,6 @@ class _PatientProfileScreenState extends State nameLine2: "ECG", icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, @@ -560,7 +278,6 @@ class _PatientProfileScreenState extends State .procedures, icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, @@ -583,7 +300,6 @@ class _PatientProfileScreenState extends State .service, icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, @@ -987,24 +703,6 @@ class _PatientProfileScreenState extends State VITAL_SIGN_DETAILS, icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), PatientProfileButton( isInPatient: isInpatient, @@ -1026,7 +724,6 @@ class _PatientProfileScreenState extends State .result, icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( patient: patient, patientType: @@ -1057,15 +754,20 @@ class _PatientProfileScreenState extends State patientType, arrivalType: arrivalType, - route: PATIENT_ECG, + route: + ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase .of( context) - .patient, - nameLine2: "ECG", + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, icon: - 'patient/patient_sick_leave.png'), + 'patient/order_prescription.png'), PatientProfileButton( isInPatient: isInpatient, @@ -1074,33 +776,41 @@ class _PatientProfileScreenState extends State patientType, arrivalType: arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - isSelectInpatient: - false, + route: MEDICAL_FILE, nameLine1: - TranslationBase - .of( - context) - .orders, + "Health", + //TranslationBase.of(context).medicalReport, nameLine2: + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase .of( context) - .prescription, + .patient, + nameLine2: "ECG", icon: - 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + 'patient/patient_sick_leave.png'), PatientProfileButton( + isInPatient: + isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, - route: - ORDER_PROCEDURE, - isInPatient: - isInpatient, + route: ORDER_PROCEDURE, nameLine1: TranslationBase .of( @@ -1113,7 +823,6 @@ class _PatientProfileScreenState extends State .procedures, icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, @@ -1136,7 +845,6 @@ class _PatientProfileScreenState extends State .service, icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, 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..1c3c7e3f 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 @@ -453,7 +453,7 @@ class _UpdateAssessmentPageState extends State { ), ), ), - bottomSheet: Container( + bottomSheet:Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -462,55 +462,67 @@ class _UpdateAssessmentPageState extends State { border: Border.all( color: HexColor('#707070'), width: 0), - ), child: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: TranslationBase - .of(context) - .previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(1); - }, - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.05, - ), - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast( - TranslationBase - .of(context) - .assessmentErrorMsg); - } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - } - }, + ), + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container(child: + FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase + .of(context) + .previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(1); + }, + ) + , + ), + SizedBox(width: 5,), + Expanded( + child: AppButton( + title: TranslationBase + .of(context) + .next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + if (widget.mySelectedAssessmentList.isEmpty) { + Helpers.showErrorToast( + TranslationBase + .of(context) + .assessmentErrorMsg); + } else { + widget.changePageViewIndex(3); + widget.changeLoadingState(true); + } + }, + ), + ), + ], ), ), - ], - ), - ), - ), + ),), + SizedBox( + height: 5, + ), + ], + ),) + ), ); } diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 8fe66db1..8fdfffc2 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -143,7 +143,8 @@ class _UpdateObjectivePageState extends State { ), ), ), - bottomSheet: Container( + bottomSheet: + Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -153,55 +154,56 @@ class _UpdateObjectivePageState extends State { color: HexColor('#707070'), width: 0), ), - height: MediaQuery - .of(context) - .size - .height * 0.1, + height: 80, width: double.infinity, - child: FractionallySizedBox( - widthFactor: 0.9, - child: Row( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.4, - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - onPressed: () { - widget.changePageViewIndex(0); - }, - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width *0.1, - ), - Container( - width: MediaQuery.of(context).size.width *0.4, - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - loading: model.state == ViewState.BusyLocal, - color: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 - ? Colors.red[700] - : HexColor("#A5A5A5"), - fontColor: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"), - disabled: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 - ? false - : true, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container(child: + FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + onPressed: () { + widget.changePageViewIndex(0); + }, + ) + , + ), + SizedBox(width: 5,), + Expanded( + child: AppButton( + title: TranslationBase + .of(context) + .next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitUpdateObjectivePage(model); + }, + ), + ), + ], ), ), - ], - ), - ), - ), + ),), + SizedBox( + height: 5, + ), + ], + ),) + + ), ); } 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..8e7e3f98 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 @@ -236,7 +236,8 @@ class _UpdatePlanPageState extends State { ), ), ), - bottomSheet: Container( + bottomSheet: + Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -246,76 +247,85 @@ class _UpdatePlanPageState extends State { color: HexColor('#707070'), width: 0), ), - width: double.maxFinite, - height: 90, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - margin: EdgeInsets.all(6), - child: Column( - children: [ - Row( + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container(child: + FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( children: [ Expanded( child: AppButton( - title: TranslationBase.of(context).previous, + title: TranslationBase + .of(context) + .previous, color: Colors.grey[300], fontColor: Colors.black, fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, onPressed: () async { - setState(() { - widget.changePageViewIndex(2); - }); + widget.changePageViewIndex(2); }, - ), + ) + , ), SizedBox(width: 5,), Expanded( child: AppButton( - title: isAddProgress? TranslationBase.of(context).next: "Finish", + title: TranslationBase + .of(context) + .next, fontWeight: FontWeight.w600, color: Colors.red[700], loading: model.state == ViewState.BusyLocal, disabled: progressNoteController.text.isEmpty, onPressed: () async { - if (progressNoteController.text.isNotEmpty) { - if (isAddProgress) { - Map profile = - await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); - setState(() { - widget.patientProgressNote.createdByName = - widget.patientProgressNote - .createdByName ?? - doctorProfile.doctorName; - widget.patientProgressNote.editedByName = - doctorProfile.doctorName; - widget.patientProgressNote.createdOn = - DateTime.now().toString(); - widget.patientProgressNote.planNote = - progressNoteController.text; - isAddProgress = !isAddProgress; - }); - submitPlan(model); - } else { - Navigator.of(context).pop(); - } - } else { - Helpers.showErrorToast(TranslationBase.of(context) - .progressNoteErrorMsg); - } - }, + if (progressNoteController.text.isNotEmpty) { + if (isAddProgress) { + Map profile = + await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); + setState(() { + widget.patientProgressNote.createdByName = + widget.patientProgressNote + .createdByName ?? + doctorProfile.doctorName; + widget.patientProgressNote.editedByName = + doctorProfile.doctorName; + widget.patientProgressNote.createdOn = + DateTime.now().toString(); + widget.patientProgressNote.planNote = + progressNoteController.text; + isAddProgress = !isAddProgress; + }); + submitPlan(model); + } else { + Navigator.of(context).pop(); + } + } else { + Helpers.showErrorToast(TranslationBase.of(context) + .progressNoteErrorMsg); + } + }, ), ), ], ), - - ], + ), + ),), + SizedBox( + height: 5, ), - ), - ), - ), + ], + ),) + ), ); } diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 19999880..b0db0414 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -323,18 +323,15 @@ class _UpdateSubjectivePageState extends State { color: HexColor('#707070'), width: 0), ), - height: MediaQuery - .of(context) - .size - .height * 0.1, + height: 80, width: double.infinity, - child: Column( children: [ SizedBox( height: 10, ), - Container(child: FractionallySizedBox( + Container(child: + FractionallySizedBox( widthFactor: .80, child: Center( child: AppButton( diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 78c2a3b9..cd92f71b 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -361,6 +361,18 @@ class DateUtils { return DateFormat('hh:mm a').format(dateTime); } + static String getTimeHHMMA2 (DateTime dateTime){ + return DateFormat('hh:mm').format(dateTime); + } + + static String getStartTime(String dateTime){ + String time=dateTime; + + if(dateTime.length>7) + time = dateTime.substring(0,5); + return time; + } + static String getTimeFormated(DateTime dateTime) { print(dateTime); if (dateTime != null) diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index f56ad676..fd60b21d 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -148,7 +148,7 @@ class PatientCard extends StatelessWidget { : patientInfo.arrivedOn != null ? AppText( DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,) - )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.arrivedOn,)), + )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, ) @@ -156,7 +156,7 @@ class PatientCard extends StatelessWidget { AppText( // // )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), - " ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${patientInfo.startTime}", + " ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, ):SizedBox() 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 f07ad8a4..0ba5c8f2 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 @@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 210:200 : height, + height: height == 0 ? isInpatient? 215:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 017b7b39..e957b5d4 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -19,6 +19,7 @@ class AppScaffold extends StatelessWidget { final Widget bottomSheet; final Color backgroundColor; final Widget appBar; + final String subtitle; final bool isHomeIcon; AppScaffold( {this.appBarTitle = '', @@ -29,7 +30,7 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar}); + this.appBar, this.subtitle}); @override Widget build(BuildContext context) { @@ -51,7 +52,14 @@ class AppScaffold extends StatelessWidget { color: Colors.black87, fontSize: 16.8, )), - title: Text(appBarTitle.toUpperCase()), + title: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(appBarTitle.toUpperCase()), + if(subtitle!=null) + Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), + ], + ), leading: Builder(builder: (BuildContext context) { return IconButton( icon: Icon(Icons.arrow_back_ios), From 9c68f23647f3bbc2cf8cb73077689fa4046c2892 Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Wed, 28 Apr 2021 11:15:31 +0300 Subject: [PATCH 042/102] updates & fixes --- android/app/build.gradle | 2 +- android/app/google-services.json | 23 ++-- android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 4 +- .../ui/VideoCallActivity.java | 2 +- .../doctor_app_flutter/MainActivity.kt | 101 ------------------ android/app/src/profile/AndroidManifest.xml | 2 +- android/google-services.json | 16 +-- ios/Flutter/AppFrameworkInfo.plist | 40 +++---- ios/Podfile.lock | 2 +- ios/Runner.xcodeproj/project.pbxproj | 18 ++-- ios/Runner/Info.plist | 36 ++++--- pubspec.yaml | 2 +- 13 files changed, 79 insertions(+), 171 deletions(-) delete mode 100644 android/app/src/main/kotlin/com/example/doctor_app_flutter/MainActivity.kt diff --git a/android/app/build.gradle b/android/app/build.gradle index af0821ee..fd6c7720 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -38,7 +38,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.doctor_app_flutter" + applicationId "com.hmg.hmgDr" minSdkVersion 18 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() diff --git a/android/app/google-services.json b/android/app/google-services.json index 27e5dfb1..db548786 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,41 +1,34 @@ { "project_info": { - "project_number": "1097451043303", - "project_id": "doctor-app-35ddc", - "storage_bucket": "doctor-app-35ddc.appspot.com" + "project_number": "157373154094", + "project_id": "hmg-doctor-app-1553688619744", + "storage_bucket": "hmg-doctor-app-1553688619744.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:1097451043303:android:f82ecce9562ecaad866542", + "mobilesdk_app_id": "1:157373154094:android:daeea3a4e1f4462a1bf0bf", "android_client_info": { - "package_name": "com.example.doctor_app_flutter" + "package_name": "com.hmg.hmgDr" } }, "oauth_client": [ { - "client_id": "1097451043303-u7bl21167fq5b7u06cqpq621psv9s3qh.apps.googleusercontent.com", + "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyChu44P8Dp8jtRqnoDR2mdjqKgSKQq-FPY" + "current_key": "AIzaSyDX8RPwu00MyrpqC-T2zXtrUQvTQGRv1mM" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "1097451043303-u7bl21167fq5b7u06cqpq621psv9s3qh.apps.googleusercontent.com", + "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_type": 3 - }, - { - "client_id": "1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.hmg.doctorApp" - } } ] } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 631e9b28..317d0290 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.hmg.hmgDr"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index fdd8f424..57a59745 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.hmg.hmgDr"> diff --git a/android/google-services.json b/android/google-services.json index 3c00f05c..db548786 100644 --- a/android/google-services.json +++ b/android/google-services.json @@ -1,33 +1,33 @@ { "project_info": { - "project_number": "1008895414777", - "project_id": "doctorapp-9f172", - "storage_bucket": "doctorapp-9f172.appspot.com" + "project_number": "157373154094", + "project_id": "hmg-doctor-app-1553688619744", + "storage_bucket": "hmg-doctor-app-1553688619744.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28", + "mobilesdk_app_id": "1:157373154094:android:daeea3a4e1f4462a1bf0bf", "android_client_info": { - "package_name": "com.example.doctor_app_flutter" + "package_name": "com.hmg.hmgDr" } }, "oauth_client": [ { - "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw" + "current_key": "AIzaSyDX8RPwu00MyrpqC-T2zXtrUQvTQGRv1mM" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_type": 3 } ] diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 6b4c0f78..25fb7fb6 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -2,25 +2,25 @@ - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 8.0 + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 9.0 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 878a1850..a365fcf4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f35ae084..9d448f00 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -375,7 +375,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -383,12 +383,14 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.hmg.doctorApp; + MARKETING_VERSION = 1.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -508,7 +510,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -516,12 +518,14 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.hmg.doctorApp; + MARKETING_VERSION = 1.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -537,7 +541,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -545,12 +549,14 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.hmg.doctorApp; + MARKETING_VERSION = 1.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 645c587b..acabe064 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + HMG Doctor CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -15,15 +17,25 @@ CFBundlePackageType APPL CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion - $(FLUTTER_BUILD_NUMBER) + $(CURRENT_PROJECT_VERSION) + FirebaseAppDelegateProxyEnabled + LSRequiresIPhoneOS + NSSpeechRecognitionUsageDescription + This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. + NSAppleMusicUsageDescription + This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. + NSCalendarsUsageDescription + This app requires calendar access to set reminders for Virtual & Normal Appointments. NSCameraUsageDescription - Camera permission is required for barcode scanning. + App requires access to camera incase you are interested to attach images to your Qr Code. + NSContactsUsageDescription + This app requires contacts access to show incoming virtual consultation request. NSFaceIDUsageDescription We are using it for authentication @@ -31,6 +43,14 @@ ${PRODUCT_NAME} requires access to use voice command + NSLocationWhenInUseUsageDescription + This App requires access to your location to show the nearest hospitals from your location. + NSMicrophoneUsageDescription + This app requires microphone access to enable virtual consultation between patient & doctor + NSMotionUsageDescription + This app requires motion detection access to function properly. + NSPhotoLibraryUsageDescription + Need to upload image UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -50,15 +70,5 @@ UIViewControllerBasedStatusBarAppearance - - NSCameraUsageDescription - App requires access to camera incase you are interested to attach images to your Qr Code. - NSPhotoLibraryUsageDescription - Need to upload image - - NSMicrophoneUsageDescription - ${PRODUCT_NAME} always Microphone use - FirebaseAppDelegateProxyEnabled - diff --git a/pubspec.yaml b/pubspec.yaml index 347b7a62..9472f598 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 +version: 1.2.1+1 environment: sdk: ">=2.8.0 <3.0.0" From 30bc9b4beafa57347d62861b0bd272608556ce55 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 28 Apr 2021 21:40:59 +0300 Subject: [PATCH 043/102] fix issue --- lib/screens/home/home_screen.dart | 10 +- .../out_patient/out_patient_screen.dart | 251 ++++++++++++++++++ .../patient_search_screen_new.dart | 8 + .../profile/patient_profile_screen.dart | 2 +- .../update_Chief_complaints.dart | 6 +- lib/widgets/shared/errors/error_message.dart | 30 ++- ..._key_checkbox_search_allergies_widget.dart | 4 +- 7 files changed, 284 insertions(+), 27 deletions(-) create mode 100644 lib/screens/patients/out_patient/out_patient_screen.dart diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 307b635c..d3d2c827 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -18,6 +18,7 @@ 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_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; @@ -555,14 +556,9 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => - PatientsScreenNew( - isSearch: false, - isInpatient: false, + OutPatientsScreen( patientSearchRequestModel: - PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID), - selectedPatientType: - PatientType.OutPatient, - isSearchWithKeyInfo: false, + PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID) ), )); }, diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart new file mode 100644 index 00000000..8a4a7b3d --- /dev/null +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -0,0 +1,251 @@ +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 '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'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class OutPatientsScreen extends StatefulWidget { + final patientSearchForm; + final selectedType; + final isAppbar; + final arrivalType; + final isView; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; + final bool isSearchWithKeyInfo; + final bool isSearch; + final bool isInpatient; + 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}); + + @override + _OutPatientsScreenState createState() => _OutPatientsScreenState(); +} + +class _OutPatientsScreenState extends State { + int clinicId; + AuthViewModel authProvider; + + List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; + + int _activeLocation = 0; + String patientType; + String patientTypeTitle; + var selectedFilter = 1; + String arrivalType; + ProjectViewModel projectsProvider; + var isView; + final _controller = TextEditingController(); + + PatientModel patient; + + + @override + Widget build(BuildContext context) { + authProvider = Provider.of(context); + _locations = [ + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; + final screenSize = MediaQuery.of(context).size; + + + return BaseView( + onModelReady: (model) async { + await model.getOutPatient(widget.patientSearchRequestModel); + }, + builder: (_, model, w) => AppScaffold( + appBarTitle: "Search Patient", + 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: _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(), + ), + ), + + 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), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), + 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) { + 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, + ), + ); + })), + ), + ], + ) + ), + ); + } +} 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 c17c173a..5270511d 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -1,3 +1,4 @@ +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 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -107,8 +109,14 @@ class _PatientSearchScreenNewState extends State { isTextFieldHasSuffix: false, maxLines: 1, minLines: 1, + inputType:TextInputType.number, hasBorder: true, controller: patientFileInfoController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + onChanged: (_){}, validationError: (isFormSubmitted && ( patientFileInfoController .text.isEmpty && diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index bae49ef9..9e3d5140 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -109,7 +109,7 @@ class _PatientProfileScreenState extends State height: !isSearchAndOut ? MediaQuery .of(context) .size - .height * 0.70 : MediaQuery + .height * 0.65 : MediaQuery .of(context) .size .height * 0.69, diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 10f9c2a6..216fbd53 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -40,7 +40,7 @@ class UpdateChiefComplaints extends StatelessWidget { maxLines: 25, minLines: 7, hasBorder: true, - validationError:complaintsController.text.isEmpty && complaintsControllerError !=''?complaintsControllerError:null , + validationError:complaintsControllerError !=''?complaintsControllerError:null , ), SizedBox( @@ -55,7 +55,7 @@ class UpdateChiefComplaints extends StatelessWidget { maxLines: 25, minLines: 7, hasBorder: true, - validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + validationError:illnessControllerError !=''?illnessControllerError:null , ), SizedBox( height: 10, @@ -74,7 +74,7 @@ class UpdateChiefComplaints extends StatelessWidget { maxLines: 25, minLines: 7, hasBorder: true, - validationError:medicationController.text.isEmpty && medicationControllerError !=''?medicationControllerError:null , + validationError:medicationControllerError !=''?medicationControllerError:null , ), SizedBox( diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 53c41d2b..21e04e6c 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -12,22 +12,24 @@ class ErrorMessage extends StatelessWidget { @override Widget build(BuildContext context) { - return Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 100,), - Image.asset('assets/images/no-data.png'), - Center( - child: Center( - child: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30), - child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)), + return SingleChildScrollView( + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100,), + Image.asset('assets/images/no-data.png'), + Center( + child: Center( + child: Padding( + padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30), + child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)), + ), ), - ), - ) + ) - ], + ], + ), ), ); } diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 31115b11..e91236e8 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -76,8 +76,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: Column( children: [ AppTextFieldCustom( - height: - MediaQuery.of(context).size.height * 0.070, + // height: + // MediaQuery.of(context).size.height * 0.070, hintText: TranslationBase.of(context).selectAllergy, isTextFieldHasSuffix: true, From 8e9687c2ed275878f8681b9d0328cf5e4d54cca4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 28 Apr 2021 21:49:49 +0300 Subject: [PATCH 044/102] fix issue on add examination --- .../objective/add_examination_page.dart | 66 ++++++++++++------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index c77e9a49..d98e17be 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -102,36 +102,56 @@ class _AddExaminationPageState extends State { setState(() { widget.mySelectedExamination .add(selectedExamination); - }); - }, + }); + }, + ), + ], + ), ), ], ), ), + ), + ], + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: + "${TranslationBase.of(context).addExamination}", + padding: 10, + color: Color(0xFF359846), + onPressed: () { + widget.addSelectedExamination(); + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), ], ), ), - ), - Container( - padding: EdgeInsets.all(16), - color: Colors.white, - child: AppButton( - title:"${TranslationBase.of(context).addExamination}", - color: HexColor("#359846"), - fontColor: Colors.white, - vPadding: 12, - radius: 12, - fontWeight: FontWeight.w600, - fontSize: SizeConfig.textMultiplier * 2.5, - onPressed: () { - widget.addSelectedExamination(); - }, - ), - ) - ], - ), - ), - ); + )); } isServiceSelected(MasterKeyModel masterKey) { From 0244334bb532787f09ab0e1d0a5759eafa66914a Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Thu, 29 Apr 2021 10:50:20 +0300 Subject: [PATCH 045/102] Update on store --- .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 101 ++++++++++++++++++ ios/Runner.xcodeproj/project.pbxproj | 12 +-- ios/Runner/Info.plist | 11 +- lib/client/base_app_client.dart | 2 +- lib/config/config.dart | 2 +- .../patient-doctor-referral-service.dart | 2 +- lib/core/viewModel/hospital_view_model.dart | 2 +- ...t_list_stp_referral_frequency_request.dart | 2 +- .../patient/insurance_aprovals_request.dart | 2 +- .../vital_sign/vital_sign_req_model.dart | 2 +- .../pharmacies_items_request_model.dart | 2 +- .../doctor/patient_arrival_screen.dart | 2 +- .../patients/patient_search_screen.dart | 2 +- pubspec.yaml | 2 +- 14 files changed, 121 insertions(+), 25 deletions(-) create mode 100644 android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt new file mode 100644 index 00000000..aed21dd3 --- /dev/null +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -0,0 +1,101 @@ +package com.hmg.hmgDr + +import android.app.Activity +import android.content.Intent +import androidx.annotation.NonNull +import com.example.doctor_app_flutter.Model.GetSessionStatusModel +import com.example.doctor_app_flutter.Model.SessionStatusModel +import com.example.doctor_app_flutter.ui.VideoCallActivity +import com.google.gson.GsonBuilder +import io.flutter.embedding.android.FlutterFragmentActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugins.GeneratedPluginRegistrant + +class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler { + + private val CHANNEL = "Dr.cloudSolution/videoCall" + private var result: MethodChannel.Result? = null + private var call: MethodCall? = null + private val LAUNCH_VIDEO: Int = 1 + + + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine) + + MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler(this) + } + + + override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { + + this.result = result + this.call = call + + if (call.method == "openVideoCall") { + val apiKey = call.argument("kApiKey") + val sessionId = call.argument("kSessionId") + val token = call.argument("kToken") + val appLang = call.argument("appLang") + val baseUrl = call.argument("baseUrl") + + // Session Status model + val VC_ID = call.argument("VC_ID") + val tokenID = call.argument("TokenID") + val generalId = call.argument("generalId") + val doctorId = call.argument("DoctorId") + + val sessionStatusModel = GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId) + + + openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel) + + } else { + result.notImplemented() + } + } + + private fun openVideoCall(apiKey: String?, sessionId: String?, token: String?, appLang: String?, baseUrl: String?, sessionStatusModel: GetSessionStatusModel) { + // val videoCallActivity = VideoCallActivity() + + val intent = Intent(this, VideoCallActivity::class.java) + intent.putExtra("apiKey", apiKey) + intent.putExtra("sessionId", sessionId) + intent.putExtra("token", token) + intent.putExtra("appLang", appLang) + intent.putExtra("baseUrl", baseUrl) + intent.putExtra("sessionStatusModel", sessionStatusModel) + startActivityForResult(intent, LAUNCH_VIDEO) + + } + + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + var asd = ""; + if (requestCode == LAUNCH_VIDEO) { + if (resultCode == Activity.RESULT_OK) { + val result : SessionStatusModel? = data?.getParcelableExtra("sessionStatusNotRespond") + val callResponse : HashMap = HashMap() + + val sessionStatus : HashMap = HashMap() + val gson = GsonBuilder().serializeNulls().create() + + callResponse["callResponse"] = "CallNotRespond" + val jsonRes = gson.toJson(result) + callResponse["sessionStatus"] = jsonRes + + this.result?.success(callResponse) + } + if (resultCode == Activity.RESULT_CANCELED) { + val callResponse : HashMap = HashMap() + callResponse["callResponse"] = "CallEnd" + + result?.success(callResponse) + } + } + } + + +} diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 9d448f00..f0784432 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -375,7 +375,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -389,7 +389,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -510,7 +510,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -524,7 +524,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -541,7 +541,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -555,7 +555,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index acabe064..2314a2c8 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -26,10 +26,8 @@ LSRequiresIPhoneOS - NSSpeechRecognitionUsageDescription - This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. NSAppleMusicUsageDescription - This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. + ${PRODUCT_NAME} requires access to use voice command NSCalendarsUsageDescription This app requires calendar access to set reminders for Virtual & Normal Appointments. NSCameraUsageDescription @@ -38,11 +36,6 @@ This app requires contacts access to show incoming virtual consultation request. NSFaceIDUsageDescription We are using it for authentication - - NSAppleMusicUsageDescription - ${PRODUCT_NAME} requires access to use voice command - - NSLocationWhenInUseUsageDescription This App requires access to your location to show the nearest hospitals from your location. NSMicrophoneUsageDescription @@ -51,6 +44,8 @@ This app requires motion detection access to function properly. NSPhotoLibraryUsageDescription Need to upload image + NSSpeechRecognitionUsageDescription + This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e92a921c..177b95ee 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -147,7 +147,7 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 8.3; + body['VersionID'] = 5.8; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; diff --git a/lib/config/config.dart b/lib/config/config.dart index 07151d1d..9596a029 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -336,7 +336,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 = 5.8; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 76f9f18a..680adada 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -29,7 +29,7 @@ class PatientReferralService extends LookupService { "LanguageID": 1, "stamp": "2020-02-26T13:51:44.111Z", "IPAdress": "11.11.11.11", - "VersionID": 5.5, + "VersionID": 5.8, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", diff --git a/lib/core/viewModel/hospital_view_model.dart b/lib/core/viewModel/hospital_view_model.dart index dbb5e4fb..a49b85e5 100644 --- a/lib/core/viewModel/hospital_view_model.dart +++ b/lib/core/viewModel/hospital_view_model.dart @@ -13,7 +13,7 @@ class HospitalViewModel with ChangeNotifier { "LanguageID": 1, "stamp": "2020-02-26T13:51:44.111Z", "IPAdress": "11.11.11.11", - "VersionID": 5.5, + "VersionID": 5.8, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index f524aa37..7f466deb 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -37,7 +37,7 @@ class STPReferralFrequencyRequest { {this.languageID = 2, this.stamp = "2020-06-03T11:18:19.986Z", this.iPAdress = "11.11.11.11", - this.versionID = 5.5, + this.versionID = 5.8, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index 63e7926a..2d3ac663 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -45,7 +45,7 @@ class InsuranceAprovalsRequest { this.languageID = 2, this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', - this.versionID = 5.5, + this.versionID = 5.8, this.tokenID , this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index 61e3fcf2..2cfd24c2 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -31,7 +31,7 @@ class VitalSignReqModel { this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=5.5, + this.versionID=5.8, this.channel=9, this.sessionID='E2bsEeYEJo', this.isLoginForDoctorApp=true, diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index 8d6b9b46..4f2e947a 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -24,7 +24,7 @@ class PharmaciesItemsRequestModel { {this.pHRItemName, this.pageIndex = 0, this.pageSize = 20, - this.versionID = 5.5, + this.versionID = 5.8, this.channel = 3, this.languageID = 2, this.iPAdress = "10.20.10.20", diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 4580e5c8..e4f933e7 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -31,7 +31,7 @@ class _PatientArrivalScreen extends State LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 5.5, + VersionID: 5.8, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index db7a2e21..88b8547b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -62,7 +62,7 @@ class _PatientSearchScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 5.5, + VersionID: 5.8, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/pubspec.yaml b/pubspec.yaml index 9472f598..58dd50be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.1+1 +version: 1.2.2+2 environment: sdk: ">=2.8.0 <3.0.0" From 7c2889c5d22c435ca0199a2dcb89df9b2adb397d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 11:47:30 +0300 Subject: [PATCH 046/102] fix height issue --- lib/screens/patients/profile/patient_profile_screen.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 9e3d5140..31be0812 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -102,11 +102,14 @@ class _PatientProfileScreenState extends State height: (patient.patientStatusType != null && patient.patientStatusType == 43) ? 210 - : 0, + : isDischargedPatient?240:0, ), Container( - height: !isSearchAndOut ? MediaQuery + height: !isSearchAndOut ? isDischargedPatient?MediaQuery + .of(context) + .size + .height * 0.64 : MediaQuery .of(context) .size .height * 0.65 : MediaQuery From 3d6b55681a20fadda4c6b4ebe2ac851b7ab6cb89 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 29 Apr 2021 14:00:02 +0300 Subject: [PATCH 047/102] fix arabic and font style --- lib/config/localized_values.dart | 2 + .../patient-admission-request-service.dart | 2 +- .../patient-vital-sign-viewmodel.dart | 6 +- .../lab_result_chart_and_detials.dart | 3 +- .../profile/patient_profile_screen.dart | 2 +- .../vital_sign/vital_sign_details_screen.dart | 201 +----------------- .../profile/vital_sign/vital_sign_item.dart | 5 +- .../vital_sing_chart_and_detials.dart | 2 +- .../vital_sing_chart_blood_pressure.dart | 2 +- lib/util/translations_delegate_base.dart | 2 + .../profile/PatientProfileButton.dart | 8 +- .../shared/app_expandable_notifier.dart | 3 +- .../shared/buttons/app_buttons_widget.dart | 123 +++++------ .../shared/buttons/button_bottom_sheet.dart | 53 ++++- 14 files changed, 141 insertions(+), 273 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea99a982..c46fb2c3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -870,4 +870,6 @@ const Map> localizedValues = { }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, + "severe": {"en": "Severe", "ar": "الشدة"}, + "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, }; diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart index bdbf125e..c97f8426 100644 --- a/lib/core/service/patient-admission-request-service.dart +++ b/lib/core/service/patient-admission-request-service.dart @@ -163,7 +163,7 @@ class AdmissionRequestService extends LookupService { hasError = false; Map body = Map(); - body['patientMRN'] = patientMrn; + body['PatientMRN'] = patientMrn; await baseAppClient.post( GET_DIET_TYPES, diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index cd02f538..59b13fe8 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -23,7 +23,7 @@ class VitalSignsViewModel extends BaseViewModel { String hartRat = "0"; String respirationBeatPerMinute = "0"; String bloodPressure = "0 / 0"; - String oxygenation = "0 - 0"; + String oxygenation = "0"; String painScore = "-"; String painLocation = "-"; String painCharacter = "-"; @@ -93,11 +93,11 @@ class VitalSignsViewModel extends BaseViewModel { bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } - if (oxygenation == "0 - 0" || + if (oxygenation == "0" || 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/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index b6699b22..6026c9e9 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -45,7 +46,7 @@ class LabResultChartAndDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Graph Details", + TranslationBase.of(context).graphDetails, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index bae49ef9..eafcd0d6 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -431,7 +431,7 @@ class _PatientProfileScreenState extends State NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, + childAspectRatio: 1 / 1.01, crossAxisCount: 3, children: [ PatientProfileButton( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 0b41e0a2..a6f36784 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -57,15 +57,15 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ AppText( "${patient.firstName ?? patient.patientDetails.firstName}'s", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( TranslationBase.of(context).vitalSign, - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -90,7 +90,7 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ AppText( "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w700, ), @@ -544,8 +544,8 @@ class VitalSignDetailsScreen extends StatelessWidget { .oxygenation, imagePath: "${assetBasePath}oxg.png", - lastVal: mode.oxygenation, - unit: "%", + lastVal: "${mode.oxygenation}%", + unit: "", ), ), InkWell( @@ -576,198 +576,11 @@ class VitalSignDetailsScreen extends StatelessWidget { imagePath: "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: "", + unit: TranslationBase.of(context).severe, ), ), ], ), - /*RoundedContainer( - width: MediaQuery.of(context).size.width / 2, - margin: EdgeInsets.symmetric( - horizontal: 0.0, vertical: 16), - child: Container( - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(top: 8), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Expanded( - child: Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).painScale}", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painScore}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "Location", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painLocation}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "Character", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painCharacter}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "Duration", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painDuration}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).painManagement, - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.isPainDone}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).frequency, - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painFrequency}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - ), - ), - Container( - child: Image.asset( - "${assetBasePath}painScale.png", - width: 40, - height: 40, - )) - ], - ), - ), - Container( - child: Column( - children: [ - Align( - alignment: - Alignment.topRight, - child: Icon( - EvaIcons.eye, - ), - ), - Align( - alignment: - Alignment.topLeft, - child: Container( - margin: EdgeInsets.only( - left: 5, right: 5), - child: AppText( - "${TranslationBase.of(context).painScale}", - fontFamily: 'Poppins', - fontSize: SizeConfig - .textMultiplier * - 1.3, - fontWeight: - FontWeight.bold, - ), - ), - ), - ], - ), - ), - ], - ), - ), - ),*/ ], ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index fbea0452..20d5b439 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -52,6 +52,7 @@ class VitalSignItem extends StatelessWidget { fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.4, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), margin: 0, ), Expanded( @@ -62,7 +63,7 @@ class VitalSignItem extends StatelessWidget { fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.2, fontWeight: FontWeight.w700, - color: Color(0xFFB8382C), + color: Color(0xFFD02127), margin: 0, ), ], @@ -98,7 +99,7 @@ class VitalSignItem extends StatelessWidget { margin: EdgeInsets.only(left: 5, right: 5), child: AppText( "$des", - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.3, fontWeight: FontWeight.bold, ), 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..2d4abec8 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 @@ -58,7 +58,7 @@ class VitalSingChartAndDetials extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Graph Details", + TranslationBase.of(context).graphDetails, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, 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 27256525..0ac2f18b 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 @@ -63,7 +63,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Graph Details", + TranslationBase.of(context).graphDetails, fontSize: SizeConfig.textMultiplier * 2.3, fontWeight: FontWeight.bold, fontFamily: 'Poppins', diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6602722c..56c2f710 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1247,6 +1247,8 @@ class TranslationBase { String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get severe => localizedValues["severe"][locale.languageCode]; + String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 66d33fe7..9a027e36 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -1,9 +1,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PatientProfileButton extends StatelessWidget { final String nameLine1; @@ -42,6 +44,8 @@ class PatientProfileButton extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + return new Container( margin: new EdgeInsets.symmetric(horizontal: 4.0), padding: EdgeInsets.fromLTRB(10, 10, 10, 5), @@ -63,11 +67,11 @@ class PatientProfileButton extends StatelessWidget { url + icon, width: 50, height: 50, - )) + ),) ], )), Container( - alignment: Alignment.topLeft, + alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart index 5e934167..76a7f57e 100644 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ b/lib/widgets/shared/app_expandable_notifier.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; @@ -30,7 +31,7 @@ class AppExpandableNotifier extends StatelessWidget { header: Padding( padding: EdgeInsets.all(10), child: Text( - "See Graph Details", + "${TranslationBase.of(context).graphDetails}", style: TextStyle(fontWeight: FontWeight.bold), )), collapsed: Text(''), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index eab11a57..e63acba2 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -48,71 +48,74 @@ class AppButton extends StatefulWidget { class _AppButtonState extends State { @override Widget build(BuildContext context) { - return IgnorePointer( - ignoring: widget.loading ||widget.disabled, - child: RawMaterialButton( - fillColor: widget.disabled - ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), - splashColor: widget.color, - child: Padding( - padding: (widget.hPadding > 0 || widget.vPadding > 0) - ? EdgeInsets.symmetric( - vertical: widget.vPadding, horizontal: widget.hPadding) - : EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, - //right: SizeConfig.widthMultiplier * widget.padding, - //left: SizeConfig.widthMultiplier * widget.padding - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (widget.icon != null) - Container(width: 25, height: 25, child: widget.icon), - if (widget.iconData != null) - Icon( - widget.iconData, - color: Colors.white, - ), - if (widget.icon != null || widget.iconData != null) - SizedBox( - width: 5.0, - ), - widget.loading - ? Padding( - padding: EdgeInsets.all(2.6), - child: SizedBox( - height: 19.0, - width: 19.0, - child: CircularProgressIndicator( - backgroundColor: Colors.white, - valueColor: AlwaysStoppedAnimation( - Colors.grey[300], + return Container( + height: MediaQuery.of(context).size.height * 0.075, + child: IgnorePointer( + ignoring: widget.loading ||widget.disabled, + child: RawMaterialButton( + fillColor: widget.disabled + ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), + splashColor: widget.color, + child: Padding( + padding: (widget.hPadding > 0 || widget.vPadding > 0) + ? EdgeInsets.symmetric( + vertical: widget.vPadding, horizontal: widget.hPadding) + : EdgeInsets.only( + top: widget.padding, + bottom: widget.padding, + //right: SizeConfig.widthMultiplier * widget.padding, + //left: SizeConfig.widthMultiplier * widget.padding + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.icon != null) + Container(width: 25, height: 25, child: widget.icon), + if (widget.iconData != null) + Icon( + widget.iconData, + color: Colors.white, + ), + if (widget.icon != null || widget.iconData != null) + SizedBox( + width: 5.0, + ), + widget.loading + ? Padding( + padding: EdgeInsets.all(2.6), + child: SizedBox( + height: 19.0, + width: 19.0, + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[300], + ), ), ), + ) + : Container( + child: AppText( + widget.title, + color: widget.fontColor, + fontSize: SizeConfig.textMultiplier * widget.fontSize, + fontWeight: widget.fontWeight, + ), ), - ) - : Container( - child: AppText( - widget.title, - color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize, - fontWeight: widget.fontWeight, - ), - ), - ], + ], + ), ), + onPressed: widget.disabled ? (){} : widget.onPressed, + shape: RoundedRectangleBorder( + side: BorderSide( + color: + widget.hasBorder ? widget.borderColor : widget.disabled + ? Colors.grey : widget.color ?? Color(0xFFB8382C), + width: 0.8, + ), + borderRadius: BorderRadius.all(Radius.circular(widget.radius))), ), - onPressed: widget.disabled ? (){} : widget.onPressed, - shape: RoundedRectangleBorder( - side: BorderSide( - color: - widget.hasBorder ? widget.borderColor : widget.disabled - ? Colors.grey : widget.color ?? Color(0xFFB8382C), - width: 0.8, - ), - borderRadius: BorderRadius.all(Radius.circular(widget.radius))), ), ); } diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 224907d9..9db662d2 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -4,20 +4,61 @@ import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { - final double height; - final String buttonTitle; - final Function onPressed; + final GestureTapCallback onPressed; + final String title; + final IconData iconData; + final Widget icon; + final Color color; + final double fontSize; + final double padding; + final Color fontColor; + final bool loading; + final bool disabled; + final FontWeight fontWeight; + final bool hasBorder; + final Color borderColor; + final double radius; + final double vPadding; + final double hPadding; - ButtonBottomSheet({@required this.height, @required this.buttonTitle, @required this.onPressed}); + ButtonBottomSheet({@required this.onPressed, + this.title, + this.iconData, + this.icon, + this.color, + this.fontSize = 2, + this.padding = 13, + this.loading = false, + this.disabled = false, + this.fontColor = Colors.white, + this.fontWeight = FontWeight.normal, + this.vPadding = 0, + this.hPadding = 0, + this.radius = 8.0, + this.hasBorder = false, + this.borderColor,}); @override Widget build(BuildContext context) { return Container( - height: height ?? null, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: AppButton( - title: buttonTitle, + title: title, onPressed: onPressed, + fontWeight: fontWeight, + color: color, + fontSize: fontSize, + padding: padding, + disabled: disabled, + radius: radius, + hasBorder: hasBorder, + fontColor: fontColor, + icon: icon, + iconData: iconData, + hPadding: hPadding, + vPadding: vPadding, + borderColor: borderColor, + loading: loading, ), ); } From 68f405cb21761f2be99e6b85dbc1d4c7a66c17e8 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 29 Apr 2021 15:01:44 +0300 Subject: [PATCH 048/102] design fixes --- lib/config/localized_values.dart | 2 +- .../admission-request-first-screen.dart | 19 ++++-- .../admission-request-third-screen.dart | 10 +-- .../admission-request_second-screen.dart | 14 ++-- .../profile/patient_profile_screen.dart | 4 +- .../text_fields/app-textfield-custom.dart | 65 +++++++++++-------- pubspec.lock | 2 +- 7 files changed, 64 insertions(+), 52 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c46fb2c3..ebeabbd1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -447,7 +447,7 @@ const Map> localizedValues = { 'en': "Is Sick Leave Required", 'ar': 'هل الإجازة المرضية مطلوبة' }, - 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'}, + 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'المريض حامل'}, 'treatmentLine': { 'en': "Main line of treatment", 'ar': 'الخط الرئيسي للعلاج' diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index dd93be70..d23397da 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -44,6 +44,7 @@ class _AdmissionRequestThirdScreenState String clinicError; String doctorError; String sickLeaveCommentError; + String dietTypeError; String medicalHistoryError; String surgicalHistoryError; @@ -78,8 +79,6 @@ class _AdmissionRequestThirdScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // PatientProfileHeaderNewDesign( - // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( @@ -87,15 +86,15 @@ class _AdmissionRequestThirdScreenState children: [ AppText( "${TranslationBase.of(context).admission}", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( - "${TranslationBase.of(context).request}", - fontFamily: 'Poppins', + TranslationBase.of(context).request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -109,7 +108,7 @@ class _AdmissionRequestThirdScreenState AppText( TranslationBase.of(context) .specialityAndDoctorDetail, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), @@ -278,6 +277,7 @@ class _AdmissionRequestThirdScreenState height: screenSize.height * 0.075, hintText: TranslationBase.of(context).dietType, isTextFieldHasSuffix: true, + validationError: dietTypeError, dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : null, @@ -426,6 +426,11 @@ class _AdmissionRequestThirdScreenState }else { sickLeaveCommentError = null; } + if(_selectedDietType == null){ + dietTypeError = TranslationBase.of(context).fieldRequired; + }else { + dietTypeError = null; + } if(_postMedicalHistoryController.text == ""){ medicalHistoryError = TranslationBase.of(context).fieldRequired; }else { diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index 71a29a1e..120b6adf 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -76,15 +76,15 @@ class _AdmissionRequestThirdScreenState children: [ AppText( "${TranslationBase.of(context).admission}", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( - "${TranslationBase.of(context).request}", - fontFamily: 'Poppins', + TranslationBase.of(context).request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -96,7 +96,7 @@ class _AdmissionRequestThirdScreenState children: [ AppText( TranslationBase.of(context).diagnosisDetail, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), 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..90131c03 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 @@ -91,8 +91,6 @@ class _AdmissionRequestSecondScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // PatientProfileHeaderNewDesign( - // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( @@ -100,15 +98,15 @@ class _AdmissionRequestSecondScreenState children: [ AppText( "${TranslationBase.of(context).admission}", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( - "${TranslationBase.of(context).request}", - fontFamily: 'Poppins', + TranslationBase.of(context).request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -122,7 +120,7 @@ class _AdmissionRequestSecondScreenState AppText( TranslationBase.of(context) .postPlansEstimatedCost, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), @@ -170,7 +168,7 @@ class _AdmissionRequestSecondScreenState ), AppText( TranslationBase.of(context).otherInformation, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 826b0eea..b160f48c 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -134,7 +134,7 @@ class _PatientProfileScreenState extends State NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, + childAspectRatio: 1 / 1.01, crossAxisCount: 3, children: [ PatientProfileButton( @@ -679,7 +679,7 @@ class _PatientProfileScreenState extends State NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, + childAspectRatio: 1 / 1.01, crossAxisCount: 3, children: [ PatientProfileButton( diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 88b95936..12eaaa7c 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -1,8 +1,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_field_error.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:provider/provider.dart'; import '../app_texts_widget.dart'; @@ -50,10 +52,12 @@ class AppTextFieldCustom extends StatefulWidget { class _AppTextFieldCustomState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Column( children: [ Container( - height: widget.height != 0 ? widget.height + 8 : null, + height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null, decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), @@ -72,7 +76,7 @@ class _AppTextFieldCustomState extends State { child: Container( padding: widget.dropDownText == null ? EdgeInsets.symmetric(vertical: 0) - : EdgeInsets.symmetric(vertical: 8), + : EdgeInsets.symmetric(vertical: 0), // 8.0 child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, @@ -82,40 +86,45 @@ class _AppTextFieldCustomState extends State { widget.dropDownText != null) AppText( widget.hintText, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.4, fontWeight: FontWeight.w700, ), widget.dropDownText == null - ? TextField( - textAlign: TextAlign.left, - decoration: - TextFieldsUtils.textFieldSelectorDecoration( - widget.hintText, null, true), - style: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.7, - fontFamily: 'Poppins', - color: Colors.grey.shade800, - ), - controller: widget.controller, - keyboardType: widget.inputType, - enabled: widget.enabled, - minLines: widget.minLines, - maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null - ? widget.inputFormatters - : [], - onChanged: (value) { - if (widget.onChanged != null) { - widget.onChanged(value); + ? Container( + height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null, + child: TextField( + textAlign: projectViewModel.isArabic + ? TextAlign.right + : TextAlign.left, + decoration: + TextFieldsUtils.textFieldSelectorDecoration( + widget.hintText, null, true), + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.7, + fontFamily: 'Poppins', + color: Color(0xFF575757), + ), + controller: widget.controller, + keyboardType: widget.inputType, + enabled: widget.enabled, + minLines: widget.minLines, + maxLines: widget.maxLines, + inputFormatters: widget.inputFormatters != null + ? widget.inputFormatters + : [], + onChanged: (value) { setState(() {}); - } - }, - ) + if (widget.onChanged != null) { + widget.onChanged(value); + } + }, + ), + ) : AppText( widget.dropDownText, fontFamily: 'Poppins', - color: Colors.grey.shade800, + color: Color(0xFF575757), fontSize: SizeConfig.textMultiplier * 1.7, ), ], diff --git a/pubspec.lock b/pubspec.lock index d338a618..9d52ce65 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: From 0f8820fa443a892638da9dd1e0c53525b700f207 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 15:08:16 +0300 Subject: [PATCH 049/102] fix profile screen and start the first step from filter page --- lib/core/enum/filter_type.dart | 4 + .../viewModel/PatientSearchViewModel.dart | 16 +- lib/routes.dart | 2 +- .../out_patient/filter_date_page.dart | 308 +++++ .../out_patient/out_patient_screen.dart | 49 +- .../profile/patient_profile_screen.dart | 1152 ----------------- .../patient_profile_screen.dart | 319 +++++ .../profile_gird_for_InPatient.dart | 275 ++++ .../profile_gird_for_other.dart | 309 +++++ .../profile_gird_for_search.dart | 164 +++ .../profile/patient-page-header-widget.dart | 2 +- .../text_fields/app_text_form_field.dart | 1 + 12 files changed, 1423 insertions(+), 1178 deletions(-) create mode 100644 lib/screens/patients/out_patient/filter_date_page.dart delete mode 100644 lib/screens/patients/profile/patient_profile_screen.dart create mode 100644 lib/screens/patients/profile/profile_screen/patient_profile_screen.dart create mode 100644 lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart create mode 100644 lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart create mode 100644 lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart diff --git a/lib/core/enum/filter_type.dart b/lib/core/enum/filter_type.dart index 4591e023..bfa781f9 100644 --- a/lib/core/enum/filter_type.dart +++ b/lib/core/enum/filter_type.dart @@ -1,2 +1,6 @@ enum FilterType { Clinic, Hospital } +enum OutPatientFilterType { Previous, Today, NextWeek } + + + diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index a714cef9..40074370 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -88,14 +88,14 @@ class PatientSearchViewModel extends BaseViewModel{ bool isSearchWithKeyInfo })async { String dateTo; String dateFrom; - if (item == 'Tomorrow') { + if (item == 'Previous') { dateTo = DateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), + DateTime.now().day-1), 'yyyy-MM-dd'); dateFrom = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), + DateTime(DateTime.now().year, DateTime.now().month-3, + DateTime.now().day), 'yyyy-MM-dd'); } else if (item == 'Next Week') { @@ -127,13 +127,7 @@ class PatientSearchViewModel extends BaseViewModel{ currentModel.doctorID = patientSearchRequestModel.doctorID; currentModel.from = dateFrom; currentModel.to = dateTo; - - - if(isSearchWithKeyInfo) { - await getPatientFileInformation(currentModel); - } else { - await getOutPatient(currentModel, isLocalBusy: true); - } + await getOutPatient(currentModel, isLocalBusy: true); filterData = _outPatientService.patientList; } diff --git a/lib/routes.dart b/lib/routes.dart index 91c3eaed..97f842f6 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -18,7 +18,7 @@ import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import './screens/auth/login_screen.dart'; import './screens/auth/verification_methods_screen.dart'; import './screens/patients/patients_screen.dart'; -import './screens/patients/profile/patient_profile_screen.dart'; +import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import 'landing_page.dart'; import 'screens/patients/profile/admission-request/admission-request-first-screen.dart'; diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart new file mode 100644 index 00000000..73632fdd --- /dev/null +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -0,0 +1,308 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/model/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'; +import 'package:doctor_app_flutter/util/helpers.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:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class FilterDatePage extends StatefulWidget { + final OutPatientFilterType outPatientFilterType; + final PatientSearchViewModel patientSearchViewModel; + + const FilterDatePage( + {Key key, this.outPatientFilterType, this.patientSearchViewModel}) + : super(key: key); + + @override + _FilterDatePageState createState() => _FilterDatePageState(); +} + +class _FilterDatePageState extends State { + DateTime selectedFromDate; + DateTime selectedToDate; + + @override + Widget build(BuildContext context) { + var screenSize; + return AppScaffold( + isShowAppBar: false, + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Container( + height: MediaQuery + .of(context) + .size + .height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( + title: (OutPatientFilterType.Previous == + widget.outPatientFilterType) + ? " Filter Previous Out Patient" + : "Filter Nextweek Out Patient", + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + color: Colors.white, + child: InkWell( + onTap: () => + selectDate( + context, firstDate: getFirstDate( + widget.outPatientFilterType), + lastDate: getLastDate( + widget.outPatientFilterType)), + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase + .of( + context) + .fromDate, + selectedFromDate != null + ? "${DateUtils + .convertStringToDateFormat( + selectedFromDate.toString(), + "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox(height: 10,), + Container( + color: Colors.white, + child: InkWell( + onTap: () => + selectDate( + context, isFromDate: false, + firstDate: getFirstDate( + widget.outPatientFilterType), + lastDate: getLastDate( + widget.outPatientFilterType)), + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase + .of( + context) + .toDate, + selectedToDate != null + ? "${DateUtils + .convertStringToDateFormat( + selectedToDate.toString(), + "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery + .of(context) + .size + .height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: + TranslationBase + .of(context) + .search, + padding: 10, + color: Color(0xFF359846), + onPressed: () { + if (selectedFromDate == null || + selectedToDate == null) { + Helpers.showErrorToast( + "Please Select All The date Fields "); + } else { + String dateTo = DateUtils.convertDateToFormat( + selectedToDate, + 'yyyy-MM-dd'); + String dateFrom = DateUtils.convertDateToFormat( + selectedFromDate, + 'yyyy-MM-dd'); + + PatientSearchRequestModel currentModel = PatientSearchRequestModel(); + currentModel.to = dateTo; + currentModel.from= dateFrom; + widget.patientSearchViewModel.getOutPatient( + currentModel, isLocalBusy: true); + Navigator.of(context).pop(); + } + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ) + ); + } + + selectDate(BuildContext context, + {bool isFromDate = true, DateTime firstDate, lastDate}) async { + Helpers.hideKeyboard(context); + DateTime selectedDate = isFromDate + ? this.selectedFromDate ?? firstDate + : this.selectedToDate ?? lastDate; + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: firstDate, + lastDate: lastDate, + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null) { + if (isFromDate) { + setState(() { + this.selectedFromDate = picked; + }); + } else { + setState(() { + this.selectedToDate = picked; + }); + } + } + } + + getFirstDate(OutPatientFilterType outPatientFilterType) { + if (outPatientFilterType == OutPatientFilterType.Previous) { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month - 3, DateTime + .now() + .day); + } else { + return DateTime( + 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)); + } else { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month, DateTime + .now() + .day + 7); + } + } + + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + 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, + ), + labelText: selectedText != null ? '$hintText\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + ); + } +} diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 8a4a7b3d..f99f791b 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,4 +1,5 @@ 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 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; @@ -18,9 +19,12 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'filter_date_page.dart'; + // ignore: must_be_immutable class OutPatientsScreen extends StatefulWidget { final patientSearchForm; @@ -57,9 +61,9 @@ class _OutPatientsScreenState extends State { int clinicId; AuthViewModel authProvider; - List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; + List _times = []; //['All', 'Today', 'Tomorrow', 'Next Week']; - int _activeLocation = 0; + int _activeLocation = 1; String patientType; String patientTypeTitle; var selectedFilter = 1; @@ -70,21 +74,30 @@ class _OutPatientsScreenState extends State { PatientModel patient; + OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; @override Widget build(BuildContext context) { authProvider = Provider.of(context); - _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, + _times = [ + 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 { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -108,8 +121,8 @@ class _OutPatientsScreenState extends State { child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item + children: _times.map((item) { + bool _isActive = _times[_activeLocation] == item ? true : false; @@ -117,7 +130,8 @@ class _OutPatientsScreenState extends State { child: InkWell( onTap: () async { setState(() { - _activeLocation = _locations.indexOf(item); + _activeLocation = _times.indexOf(item); + outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==0?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; }); GifLoaderDialogUtils.showMyDialog(context); await model.getPatientBasedOnDate(item: item, @@ -181,17 +195,26 @@ class _OutPatientsScreenState extends State { AppTextFormField( // focusNode: focusProject, controller: _controller, - borderColor: Colors.white, + borderColor: Colors.white + , prefix: IconButton( icon: Icon( - DoctorApp.filter_1, + _activeLocation == 1 + ? DoctorApp.filter_1 + : FontAwesomeIcons.slidersH, color: Colors.black, ), iconSize: 20, padding: EdgeInsets.only( bottom: 30), + onPressed: _activeLocation == 1 ? null : () { + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => + FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); + }, ), + onChanged: (String str) { model.searchData(str); }), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart deleted file mode 100644 index 31be0812..00000000 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ /dev/null @@ -1,1152 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.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/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; -import 'package:flutter/material.dart'; - -import '../../../routes.dart'; - -class PatientProfileScreen extends StatefulWidget { - @override - _PatientProfileScreenState createState() => _PatientProfileScreenState(); -} - -class _PatientProfileScreenState extends State - with SingleTickerProviderStateMixin { - PatiantInformtion patient; - - bool isFromSearch = false; - - bool isInpatient = false; - - bool isDischargedPatient = false; - bool isSearchAndOut = false; - String patientType; - String arrivalType; - String from; - String to; - TabController _tabController; - int index = 0; - int _activeTab = 0; - @override - void initState() { - _tabController = TabController(length: 2, vsync: this); - super.initState(); - } - - @override - void dispose() { - _tabController.dispose(); - super.dispose(); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - patientType = routeArgs['patientType']; - arrivalType = routeArgs['arrivalType']; - from = routeArgs['from']; - to = routeArgs['to']; - if (routeArgs.containsKey("isSearch")) { - isFromSearch = routeArgs['isSearch']; - } - if (routeArgs.containsKey("isInpatient")) { - isInpatient = routeArgs['isInpatient']; - } - if (routeArgs.containsKey("isDischargedPatient")) { - isDischargedPatient = routeArgs['isDischargedPatient']; - }if (routeArgs.containsKey("isSearchAndOut")) { - isSearchAndOut = routeArgs['isSearchAndOut']; - } - if (isInpatient) - _activeTab = 0; - else - _activeTab = 1; - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - builder: (_, patientViewModel, w) => AppScaffold( - baseViewModel: patientViewModel, - appBarTitle: TranslationBase - .of(context) - .patientProfile, - isShowAppBar: false, - //TODO fix button location - // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), - body: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient?240:0, - ), - - Container( - height: !isSearchAndOut ? isDischargedPatient?MediaQuery - .of(context) - .size - .height * 0.64 : MediaQuery - .of(context) - .size - .height * 0.65 : MediaQuery - .of(context) - .size - .height * 0.69, - child: ListView( - children: [ - Container( - child: isSearchAndOut - ? Column( - children: [ - - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .admission, - nameLine2: - TranslationBase - .of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], - ), - ), - ], - ) - : isInpatient - ? Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - isSelectInpatient: true, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: - isDischargedPatient, - nameLine1: - TranslationBase - .of( - context) - .progress, - nameLine2: - TranslationBase - .of( - context) - .note, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1: - "Order", - //"Text", - nameLine2: - "Sheet", - //TranslationBase.of(context).orders, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: - "Medical", - //Health - isInPatient: isInpatient, - nameLine2: - "Report", - //Report - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: - isDischargedPatient || - isFromSearch, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .approvals, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - ], - ), - ) - : Column( - children: [ - Padding( - padding: const EdgeInsets - .symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .admission, - nameLine2: - TranslationBase - .of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], - ), - ), - ], - ), - ), - ], - ), - ), - ], - ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => - Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase - .of(context) - .createNew}\n${TranslationBase - .of(context) - .episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == - 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = - model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase - .of(context) - .update}\n${TranslationBase - .of(context) - .episode}", - color: - patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), - ], - ), - ], - ), - )); - } - - Widget tabsBar(BuildContext context, Size screenSize) { - List _tabs = [ - "Inpatient Info".toUpperCase(), - "Outpatient Info".toUpperCase(), - ]; - - return Container( - 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: _tabs.map((item) { - bool _isActive = _tabs[_activeTab] == item ? true : false; - - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeTab = _tabs.indexOf(item); - }); - }, - 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(), - ), - ); - } -} - -class AvatarWidget extends StatelessWidget { - final Widget avatarIcon; - - AvatarWidget(this.avatarIcon); - - @override - Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(35.0)), - color: Color(0xffCCCCCC), - ), - child: avatarIcon, - ); - } -} diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart new file mode 100644 index 00000000..44641b4b --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -0,0 +1,319 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +class PatientProfileScreen extends StatefulWidget { + @override + _PatientProfileScreenState createState() => _PatientProfileScreenState(); +} + +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { + PatiantInformtion patient; + + bool isFromSearch = false; + + bool isInpatient = false; + + bool isDischargedPatient = false; + bool isSearchAndOut = false; + String patientType; + String arrivalType; + String from; + String to; + TabController _tabController; + int index = 0; + int _activeTab = 0; + @override + void initState() { + _tabController = TabController(length: 2, vsync: this); + super.initState(); + } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; + if (routeArgs.containsKey("isSearch")) { + isFromSearch = routeArgs['isSearch']; + } + if (routeArgs.containsKey("isInpatient")) { + isInpatient = routeArgs['isInpatient']; + } + if (routeArgs.containsKey("isDischargedPatient")) { + isDischargedPatient = routeArgs['isDischargedPatient']; + } + if (routeArgs.containsKey("isSearchAndOut")) { + isSearchAndOut = routeArgs['isSearchAndOut']; + } + if (isInpatient) + _activeTab = 0; + else + _activeTab = 1; + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + builder: (_, patientViewModel, w) => AppScaffold( + baseViewModel: patientViewModel, + appBarTitle: TranslationBase.of(context).patientProfile, + isShowAppBar: false, + body: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + ), + Container( + height: !isSearchAndOut + ? isDischargedPatient + ? MediaQuery.of(context).size.height * 0.64 + : MediaQuery.of(context).size.height * 0.65 + : MediaQuery.of(context).size.height * 0.69, + child: ListView( + children: [ + Container( + child: isSearchAndOut + ? ProfileGridForSearch( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + ) + : isInpatient + ? ProfileGridForInPatient( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + isDischargedPatient: + isDischargedPatient, + isFromSearch: isFromSearch, + ) + : ProfileGridForOther( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + ), + ), + ], + ), + ), + ], + ), + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == + 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = + model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: + patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], + ), + )), + ], + ), + ], + ), + )); + } + + Widget tabsBar(BuildContext context, Size screenSize) { + List _tabs = [ + "Inpatient Info".toUpperCase(), + "Outpatient Info".toUpperCase(), + ]; + + return Container( + 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: _tabs.map((item) { + bool _isActive = _tabs[_activeTab] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeTab = _tabs.indexOf(item); + }); + }, + 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(), + ), + ); + } +} + +class AvatarWidget extends StatelessWidget { + final Widget avatarIcon; + + AvatarWidget(this.avatarIcon); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(35.0)), + color: Color(0xffCCCCCC), + ), + child: avatarIcon, + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart new file mode 100644 index 00000000..457fe04e --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -0,0 +1,275 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +// ignore: must_be_immutable +class ProfileGridForInPatient extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + final bool isDischargedPatient; + final bool isFromSearch; + String from; + String to; + + ProfileGridForInPatient( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, this.from,this.to, this.isDischargedPatient, this.isFromSearch}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: true, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", + nameLine2: + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: + "Medical", + //Health + isInPatient: isInpatient, + nameLine2: + "Report", + //Report + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: + REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart new file mode 100644 index 00000000..5b7112d6 --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -0,0 +1,309 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +// ignore: must_be_immutable +class ProfileGridForOther extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + String from; + String to; + + ProfileGridForOther( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, this.from,this.to}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Padding( + padding: const EdgeInsets + .symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + from: from, + to: to, + nameLine1: + TranslationBase.of( + context) + .vital, + nameLine2: + TranslationBase.of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: LAB_RESULT, + nameLine1: + TranslationBase.of( + context) + .lab, + nameLine2: + TranslationBase.of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase.of( + context) + .radiology, + nameLine2: + TranslationBase.of( + context) + .service, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + nameLine1: + TranslationBase.of( + context) + .orders, + nameLine2: + TranslationBase.of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: PATIENT_ECG, + nameLine1: + TranslationBase.of( + context) + .patient, + nameLine2: "ECG", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PROCEDURE, + nameLine1: + TranslationBase.of( + context) + .orders, + nameLine2: + TranslationBase.of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase.of( + context) + .insurance, + nameLine2: + TranslationBase.of( + context) + .service, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase.of( + context) + .patientSick, + nameLine2: + TranslationBase.of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase.of( + context) + .patient, + nameLine2: + TranslationBase.of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase.of( + context) + .referral, + nameLine2: + TranslationBase.of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase.of( + context) + .admission, + nameLine2: + TranslationBase.of( + context) + .request, + icon: + 'patient/admission_req.png'), + ], + ), + ), + ], + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart new file mode 100644 index 00000000..ed3c4dfd --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -0,0 +1,164 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +class ProfileGridForSearch extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + String from; + String to; + + ProfileGridForSearch( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, this.from,this.to}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + ], + ), + ), + ], + ); + } +} diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index b9312289..49ad8f4e 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index 8fed3cd8..cf5f0abf 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -48,6 +48,7 @@ class AppTextFormField extends FormField { }, textInputAction: textInputAction, onFieldSubmitted: onFieldSubmitted, + decoration: InputDecoration( hintText: hintText, suffixIcon: prefix, From f0457f4e99a69a543eb55d4c237eb5cc6b51bcbc Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 16:28:48 +0300 Subject: [PATCH 050/102] finish filter page --- .../viewModel/PatientSearchViewModel.dart | 8 +- .../out_patient/filter_date_page.dart | 15 +- .../profile/patient_profile_screen.dart | 1153 ----------------- 3 files changed, 13 insertions(+), 1163 deletions(-) delete mode 100644 lib/screens/patients/profile/patient_profile_screen.dart diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 40074370..9ef94647 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -2,14 +2,9 @@ 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/service/patient/out_patient_service.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 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/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'; @@ -61,7 +56,6 @@ class PatientSearchViewModel extends BaseViewModel{ } else { setState(ViewState.Error); } - setState(ViewState.Error); } else { filterData = _outPatientService.patientList; setState(ViewState.Idle); diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 73632fdd..034f6136 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -1,4 +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/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'; @@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/util/helpers.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/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -161,7 +163,7 @@ class _FilterDatePageState extends State { .search, padding: 10, color: Color(0xFF359846), - onPressed: () { + onPressed: () async { if (selectedFromDate == null || selectedToDate == null) { Helpers.showErrorToast( @@ -177,9 +179,16 @@ class _FilterDatePageState extends State { PatientSearchRequestModel currentModel = PatientSearchRequestModel(); currentModel.to = dateTo; currentModel.from= dateFrom; - widget.patientSearchViewModel.getOutPatient( + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientSearchViewModel.getOutPatient( currentModel, isLocalBusy: true); - Navigator.of(context).pop(); + GifLoaderDialogUtils.hideDialog(context); + if(widget.patientSearchViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientSearchViewModel.error); + }else { + Navigator.of(context).pop(); + } + } }, ), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart deleted file mode 100644 index 24f6448b..00000000 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ /dev/null @@ -1,1153 +0,0 @@ - -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.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/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; -import 'package:flutter/material.dart'; - -import '../../../routes.dart'; - -class PatientProfileScreen extends StatefulWidget { - @override - _PatientProfileScreenState createState() => _PatientProfileScreenState(); -} - -class _PatientProfileScreenState extends State - with SingleTickerProviderStateMixin { - PatiantInformtion patient; - - bool isFromSearch = false; - - bool isInpatient = false; - - bool isDischargedPatient = false; - bool isSearchAndOut = false; - String patientType; - String arrivalType; - String from; - String to; - TabController _tabController; - int index = 0; - int _activeTab = 0; - @override - void initState() { - _tabController = TabController(length: 2, vsync: this); - super.initState(); - } - - @override - void dispose() { - _tabController.dispose(); - super.dispose(); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - patientType = routeArgs['patientType']; - arrivalType = routeArgs['arrivalType']; - from = routeArgs['from']; - to = routeArgs['to']; - if (routeArgs.containsKey("isSearch")) { - isFromSearch = routeArgs['isSearch']; - } - if (routeArgs.containsKey("isInpatient")) { - isInpatient = routeArgs['isInpatient']; - } - if (routeArgs.containsKey("isDischargedPatient")) { - isDischargedPatient = routeArgs['isDischargedPatient']; - }if (routeArgs.containsKey("isSearchAndOut")) { - isSearchAndOut = routeArgs['isSearchAndOut']; - } - if (isInpatient) - _activeTab = 0; - else - _activeTab = 1; - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - builder: (_, patientViewModel, w) => AppScaffold( - baseViewModel: patientViewModel, - appBarTitle: TranslationBase - .of(context) - .patientProfile, - isShowAppBar: false, - //TODO fix button location - // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), - body: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient?240:0, - ), - - Container( - height: !isSearchAndOut ? isDischargedPatient?MediaQuery - .of(context) - .size - .height * 0.64 : MediaQuery - .of(context) - .size - .height * 0.65 : MediaQuery - .of(context) - .size - .height * 0.69, - child: ListView( - children: [ - Container( - child: isSearchAndOut - ? Column( - children: [ - - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.01, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .admission, - nameLine2: - TranslationBase - .of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], - ), - ), - ], - ) - : isInpatient - ? Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.01, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - isSelectInpatient: true, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: - isDischargedPatient, - nameLine1: - TranslationBase - .of( - context) - .progress, - nameLine2: - TranslationBase - .of( - context) - .note, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1: - "Order", - //"Text", - nameLine2: - "Sheet", - //TranslationBase.of(context).orders, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: - "Medical", - //Health - isInPatient: isInpatient, - nameLine2: - "Report", - //Report - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: - isDischargedPatient || - isFromSearch, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .approvals, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - ], - ), - ) - : Column( - children: [ - Padding( - padding: const EdgeInsets - .symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.01, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .admission, - nameLine2: - TranslationBase - .of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], - ), - ), - ], - ), - ), - ], - ), - ), - ], - ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => - Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase - .of(context) - .createNew}\n${TranslationBase - .of(context) - .episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == - 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = - model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase - .of(context) - .update}\n${TranslationBase - .of(context) - .episode}", - color: - patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), - ], - ), - ], - ), - )); - } - - Widget tabsBar(BuildContext context, Size screenSize) { - List _tabs = [ - "Inpatient Info".toUpperCase(), - "Outpatient Info".toUpperCase(), - ]; - - return Container( - 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: _tabs.map((item) { - bool _isActive = _tabs[_activeTab] == item ? true : false; - - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeTab = _tabs.indexOf(item); - }); - }, - 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(), - ), - ); - } -} - -class AvatarWidget extends StatelessWidget { - final Widget avatarIcon; - - AvatarWidget(this.avatarIcon); - - @override - Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(35.0)), - color: Color(0xffCCCCCC), - ), - child: avatarIcon, - ); - } -} \ No newline at end of file From c86a3dabdab82e5328c46e2ab467628e4481eae5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 29 Apr 2021 16:32:25 +0300 Subject: [PATCH 051/102] page translation --- lib/config/localized_values.dart | 82 +++++++++++++- .../medical-file/medical_file_details.dart | 29 +++-- .../medical-file/medical_file_page.dart | 13 ++- .../insurance_approval_screen_patient.dart | 22 ++-- .../patients/insurance_approvals_details.dart | 104 +++++++++++++----- .../profile/lab_result/labs_home_page.dart | 69 +++++++----- .../radiology/radiology_home_page.dart | 69 +++++++----- .../prescription/add_prescription_form.dart | 36 ++++-- .../prescription_item_in_patient_page.dart | 14 +-- .../prescription/prescriptions_page.dart | 32 +++--- .../procedures/add-procedure-form.dart | 30 +++-- lib/screens/procedures/add_lab_orders.dart | 10 +- .../procedures/add_radiology_order.dart | 9 +- lib/screens/procedures/procedure_screen.dart | 33 ++++-- lib/util/translations_delegate_base.dart | 59 +++++++++- lib/widgets/shared/doctor_card_insurance.dart | 6 +- 16 files changed, 447 insertions(+), 170 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea99a982..c494dbe0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -384,10 +384,7 @@ const Map> localizedValues = { 'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'}, 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, - 'yourBodyMassIndex': { - 'en': "Body Mass Index is", - 'ar': 'مؤشر كتلة الجسم هو' - }, + 'yourBodyMassIndex': {'en': "Body Mass Index is", 'ar': 'مؤشر كتلة الجسم هو'}, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, 'bmiOverWeight': {'en': "OverWeight", 'ar': 'فوق الوزن'}, @@ -870,4 +867,81 @@ const Map> localizedValues = { }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, + "pleaseEnterProcedure": { + "en": "Please Enter Procedure", + "ar": "الرجاء إدخال الإجراء " + }, + "fillTheMandatoryProcedureDetails": { + "en": "Fill The Mandatory Procedure Details", + "ar": "املأ تفاصيل الإجراء الإلزامي" + }, + "atLeastThreeCharacters": { + "en": "At least three Characters", + "ar": "ثلاثة أحرف على الأقل " + }, + "searchProcedureHere": { + "en": "Search Procedure here...", + "ar": "إجراء البحث هنا ... " + }, + "noInsuranceApprovalFound": { + "en": "No Insurance Approval Found", + "ar": "لم يتم العثور على موافقة التأمين" + }, + "procedure": {"en": "Procedure", "ar": "عملية"}, + "stopDate": {"en": "Stop Date", "ar": "تاريخ التوقف"}, + "processed": {"en": "processed", "ar": "معالجتها"}, + "direction": {"en": "Direction", "ar": "إشراف"}, + "refill": {"en": "Refill", "ar": "اعادة تعبئه"}, + "medicationHasBeenAdded": { + "en": "Medication has been added", + "ar": "تمت إضافة الدواء" + }, + "newPrescriptionOrder": { + "en": "New Prescription Order", + "ar": "طلب وصفة طبية جديد " + }, + "pleaseFillAllFields": { + "en": "Please Fill All Fields", + "ar": "لو سمحت أملأ كل الحقول" + }, + "narcoticMedicineCanOnlyBePrescribedFromVida": { + "en": "Narcotic medicine can only be prescribed from VIDA", + "ar": "لا يمكن وصف الأدوية المخدرة إلا من VIDA " + }, + "only5DigitsAllowedForStrength": { + "en": "Only 5 Digits allowed for strength", + "ar": "يسمح فقط بـ 5 أرقام للقوة" + }, + "unit": {"en": "Unit", "ar": "وحدة"}, + "boxQuantity": {"en": "Box Quantity", "ar": "كمية الصندوق "}, + "orderTestOr": {"en": "Order Test or", "ar": "اطلب اختبار أو"}, + "applyForRadiologyOrder": { + "en": "Apply for Radiology Order", + "ar": "التقدم بطلب للحصول على طلب الأشعة " + }, + "applyForNewLabOrder": { + "en": "Apply for New Lab Order", + "ar": "تقدم بطلب جديد للمختبر الأشعة" + }, + "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب معمل"}, + "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشغة"}, + "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"}, + "orderDate": {"en": "Order Date", "ar": "تاريخ الطلب"}, + "examType": {"en": "Exam Type", "ar": "نوع الفحص"}, + "health": {"en": "Health", "ar": "التقرير"}, + "summary": {"en": "Summary", "ar": "الصحي"}, + "applyForNewPrescriptionsOrder": { + "en": "Apply for New Prescriptions Order", + "ar": "التقدم بطلب للحصول على وصفات طبية جديدة " + }, + "noPrescriptionsFound": { + "en": "No Prescriptions Found", + "ar": "لم يتم العثور على وصفات طبية" + }, + "noMedicalFileFound": { + "en": "No Medical File Found", + "ar": "لم يتم العثور على ملف طبي" + }, + "insurance22": {"en": "Insurance", "ar": "موافقات"}, + "approvals22": {"en": "Approvals", "ar": "التامين"}, }; diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 828210e0..1c06fd0c 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -378,7 +378,10 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Condition: ', + TranslationBase.of( + context) + .condition + + ": ", fontSize: 12.5, ), Expanded( @@ -435,7 +438,10 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Type: ', + TranslationBase.of( + context) + .type + + ": ", fontSize: 15.5, ), Expanded( @@ -617,7 +623,10 @@ class _MedicalFileDetailsState extends State { Column( children: [ AppText( - 'Order Date: ', + TranslationBase.of( + context) + .orderDate + + ": ", ), AppText( DateUtils.getDateFormatted( @@ -807,9 +816,10 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - AppText( - 'Exam Type: ', - ), + AppText(TranslationBase.of( + context) + .examType + + ": "), AppText( model .medicalFileList[ @@ -854,9 +864,10 @@ class _MedicalFileDetailsState extends State { ), Row( children: [ - AppText( - 'Abnormal: ', - ), + AppText(TranslationBase.of( + context) + .abnormal + + ": "), AppText( model .medicalFileList[ diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index b7587efb..b2590296 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -31,7 +31,11 @@ class _MedicalFilePageState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", arrivalType,isInpatient:isInpatient ,), + patient, + patientType.toString() ?? "0", + arrivalType, + isInpatient: isInpatient, + ), isShowAppBar: true, appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( @@ -51,7 +55,7 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Health', + TranslationBase.of(context).health, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -61,7 +65,7 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Summary', + TranslationBase.of(context).summary, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -193,7 +197,8 @@ class _MedicalFilePageState extends State { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Medical File Found'), + child: AppText(TranslationBase.of(context) + .noMedicalFileFound), ) ], ), diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index ab3abbe9..2e4645ae 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -45,7 +45,11 @@ class _InsuranceApprovalScreenNewState builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", patientType,isInpatient: isInpatient,), + patient, + patientType.toString() ?? "0", + patientType, + isInpatient: isInpatient, + ), isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, @@ -67,7 +71,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -77,7 +81,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -141,7 +145,8 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Insurance Approval Found'), + child: AppText(TranslationBase.of(context) + .noInsuranceApprovalFound), ), SizedBox( height: 150.0, @@ -168,7 +173,8 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context) + .insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -178,7 +184,8 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context) + .approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -238,7 +245,8 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Insurance Approval Found'), + child: AppText(TranslationBase.of(context) + .noInsuranceApprovalFound), ) ], ), diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 931f4051..e6284be7 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -4,6 +4,7 @@ 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/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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'; @@ -67,7 +68,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -77,7 +78,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -121,7 +122,9 @@ class _InsuranceApprovalsDetailsState extends State { .approvalStatusDescption != null ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "Approved" + "Approved" || + "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127) : Color(0xffD02127), @@ -192,7 +195,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Clinic: ', + TranslationBase.of( + context) + .clinic + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -210,7 +216,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approval No: ', + TranslationBase.of( + context) + .approvalNo + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -244,7 +253,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Company Name :', + TranslationBase.of( + context) + .companyName + + ": ", color: Colors.grey[500], ), AppText('Sample') @@ -253,7 +265,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Receipt on: ', + TranslationBase.of( + context) + .receiptOn + + ": ", color: Colors.grey[500], ), Expanded( @@ -269,7 +284,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Exp on: ', + TranslationBase.of( + context) + .expiryDate + + ": ", color: Colors.grey[500], ), AppText( @@ -300,19 +318,22 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - 'Procedure', + TranslationBase.of(context) + .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Status', + TranslationBase.of(context) + .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Usage Status', + TranslationBase.of(context) + .usageStatus, fontWeight: FontWeight.w700, ), ) @@ -424,7 +445,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -434,7 +455,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -548,7 +569,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Clinic: ', + TranslationBase.of( + context) + .clinic + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -566,7 +590,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approval No: ', + TranslationBase.of( + context) + .approvalNo + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -583,7 +610,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Unused Count:', + TranslationBase.of( + context) + .unusedCount + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -600,7 +630,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Company Name :', + TranslationBase.of( + context) + .companyName + + ": ", color: Colors.grey[500], ), AppText('Sample') @@ -609,7 +642,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Receipt on: ', + TranslationBase.of( + context) + .receiptOn + + ": ", color: Colors.grey[500], ), Expanded( @@ -625,16 +661,23 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Exp on: ', + TranslationBase.of( + context) + .expiryDate + + ": ", color: Colors.grey[500], ), - if(model.insuranceApproval[indexInsurance].expiryDate!=null) - AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), + if (model + .insuranceApproval[ + indexInsurance] + .expiryDate != + null) + AppText( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), ], ), ], @@ -657,19 +700,22 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - 'Procedure', + TranslationBase.of(context) + .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Status', + TranslationBase.of(context) + .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Usage Status', + TranslationBase.of(context) + .usageStatus, fontWeight: FontWeight.w700, ), ) diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 290f9569..c77e33d9 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -44,7 +44,11 @@ class _LabsHomePageState extends State { backgroundColor: Colors.grey[100], isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', patientType,isInpatient: isInpatient,), + patient, + patient.patientType.toString() ?? '0', + patientType, + isInpatient: isInpatient, + ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -63,13 +67,13 @@ class _LabsHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Lab', + TranslationBase.of(context).lab, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -84,13 +88,13 @@ class _LabsHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Lab', + TranslationBase.of(context).lab, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -110,7 +114,7 @@ class _LabsHomePageState extends State { )), ); }, - label: 'Apply for New Lab Order', + label: TranslationBase.of(context).applyForNewLabOrder, ), ...List.generate( model.patientLabOrdersList.length, @@ -132,11 +136,13 @@ class _LabsHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.patientLabOrdersList[index].isLiveCareAppointment + color: model.patientLabOrdersList[index] + .isLiveCareAppointment ? Colors.red[900] - : !model.patientLabOrdersList[index].isInOutPatient - ? Colors.black - : Color(0xffa9a089), + : !model.patientLabOrdersList[index] + .isInOutPatient + ? Colors.black + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: Radius.circular(8), bottomLeft: Radius.circular(8), @@ -146,17 +152,19 @@ class _LabsHomePageState extends State { quarterTurns: 3, child: Center( child: Text( - model.patientLabOrdersList[index].isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.patientLabOrdersList[index].isInOutPatient + model.patientLabOrdersList[index] + .isLiveCareAppointment ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + .liveCare + .toUpperCase() + : !model.patientLabOrdersList[index] + .isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -168,19 +176,26 @@ class _LabsHomePageState extends State { context, FadePage( page: LaboratoryResultPage( - patientLabOrders: model.patientLabOrdersList[index], + patientLabOrders: + model.patientLabOrdersList[index], patient: patient, arrivalType: arrivalType, patientType: patientType, ), ), ), - doctorName: model.patientLabOrdersList[index].doctorName, - invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model.patientLabOrdersList[index].doctorImageURL, - branch: model.patientLabOrdersList[index].projectName, - clinic: model.patientLabOrdersList[index].clinicDescription, - appointmentDate: model.patientLabOrdersList[index].orderDate, + doctorName: + model.patientLabOrdersList[index].doctorName, + invoiceNO: + ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model + .patientLabOrdersList[index].doctorImageURL, + branch: + model.patientLabOrdersList[index].projectName, + clinic: model + .patientLabOrdersList[index].clinicDescription, + appointmentDate: + model.patientLabOrdersList[index].orderDate, orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 81e0e6cf..294a8854 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -47,7 +47,11 @@ class _RadiologyHomePageState extends State { backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: isInpatient,), + patient, + patient.patientType.toString() ?? '0', + arrivalType, + isInpatient: isInpatient, + ), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -65,13 +69,13 @@ class _RadiologyHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Radiology', + TranslationBase.of(context).radiology, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -86,13 +90,13 @@ class _RadiologyHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Radiology', + TranslationBase.of(context).radiology, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -112,7 +116,7 @@ class _RadiologyHomePageState extends State { )), ); }, - label: 'Apply for Radiology Order', + label: TranslationBase.of(context).applyForRadiologyOrder, ), ...List.generate( model.radiologyList.length, @@ -134,32 +138,34 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index].isLiveCareAppodynamicment + color: model.radiologyList[index] + .isLiveCareAppodynamicment ? Colors.red[900] : !model.radiologyList[index].isInOutPatient - ? Colors.black - : Color(0xffa9a089), + ? Colors.black + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: Radius.circular(8), bottomLeft: Radius.circular(8), - ), ), child: RotatedBox( quarterTurns: 3, child: Center( child: Text( - model.radiologyList[index].isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index].isInOutPatient + model.radiologyList[index] + .isLiveCareAppodynamicment ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + .liveCare + .toUpperCase() + : !model.radiologyList[index] + .isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -167,19 +173,26 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: model.radiologyList[index].doctorName, - profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: '${model.radiologyList[index].invoiceNo}', - branch: '${model.radiologyList[index].projectName}', - clinic: model.radiologyList[index].clinicDescription, - appointmentDate: model.radiologyList[index].orderDate?? - model.radiologyList[index].reportDate, + doctorName: + model.radiologyList[index].doctorName, + profileUrl: + model.radiologyList[index].doctorImageURL, + invoiceNO: + '${model.radiologyList[index].invoiceNo}', + branch: + '${model.radiologyList[index].projectName}', + clinic: model + .radiologyList[index].clinicDescription, + appointmentDate: + model.radiologyList[index].orderDate ?? + model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, FadePage( page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], + finalRadiology: + model.radiologyList[index], patient: patient, ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index c99bb063..baebe130 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -7,6 +7,7 @@ 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/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'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -25,6 +26,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_fiel import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { @@ -188,6 +190,7 @@ class _PrescriptionFormWidgetState extends State { Widget build(BuildContext context) { ListSelectDialog drugDialog; final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); // final routeArgs = ModalRoute.of(context).settings.arguments as Map; // patient = routeArgs['patient']; @@ -258,7 +261,8 @@ class _PrescriptionFormWidgetState extends State { MainAxisAlignment.spaceBetween, children: [ AppText( - 'New Prescription Order', + TranslationBase.of(context) + .newPrescriptionOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -284,7 +288,6 @@ class _PrescriptionFormWidgetState extends State { child: Column( //mainAxisAlignment: MainAxisAlignment.end, children: [ - FractionallySizedBox( widthFactor: 0.9, child: Container( @@ -407,7 +410,8 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ AppText( - 'Order Type', + TranslationBase.of(context) + .orderType, fontWeight: FontWeight.w600, ), Radio( @@ -460,7 +464,10 @@ class _PrescriptionFormWidgetState extends State { if (strengthChar >= 5) { DrAppToastMsg .showErrorToast( - "Only 5 Digits allowed for strength"); + TranslationBase.of( + context) + .only5DigitsAllowedForStrength, + ); } }, onSubmit: (_) { @@ -554,7 +561,9 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - 'UNIT', + TranslationBase.of( + context) + .unit, units != null ? units[ 'description'] @@ -1066,9 +1075,14 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - "Box Quantity", + TranslationBase.of( + context) + .boxQuantity, box != null - ? "Box Quantity: " + + ? TranslationBase.of( + context) + .boxQuantity + + ": " + model .boxQuintity .toString() @@ -1124,14 +1138,18 @@ class _PrescriptionFormWidgetState extends State { selectedDate == null || units == null) { DrAppToastMsg.showErrorToast( - "Please Fill All Fields"); + TranslationBase.of( + context) + .pleaseFillAllFields); return; } if (_selectedMedication .isNarcotic == true) { DrAppToastMsg.showErrorToast( - "Narcotic medicine can only be prescribed from VIDA"); + TranslationBase.of( + context) + .narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); return; } diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index af0f66e5..b29a2169 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -271,7 +271,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Direction', + TranslationBase.of(context).direction, color: Colors.grey, ), Expanded( @@ -286,7 +286,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Route', + TranslationBase.of(context).route, color: Colors.grey, ), AppText(" " + @@ -301,7 +301,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Refill', + TranslationBase.of(context).refill, color: Colors.grey, ), Expanded( @@ -316,7 +316,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Start Date ', + TranslationBase.of(context).startDate, color: Colors.grey, ), Expanded( @@ -332,7 +332,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Stop Date', + TranslationBase.of(context).stopDate, color: Colors.grey, ), Expanded( @@ -377,7 +377,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Status', + TranslationBase.of(context).status, color: Colors.grey, ), AppText(" " + @@ -392,7 +392,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Processed', + TranslationBase.of(context).processed, color: Colors.grey, ), AppText(" " + diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index be212dc9..19620dda 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.da import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.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'; @@ -28,16 +29,19 @@ class PrescriptionsPage extends StatelessWidget { bool isSelectInpatient = routeArgs['isSelectInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => - isSelectInpatient - ? model.getPrescriptionsInPatient(patient) - : model.getPrescriptions(patient, patientType: patientType), + onModelReady: (model) => isSelectInpatient + ? model.getPrescriptionsInPatient(patient) + : model.getPrescriptions(patient, patientType: patientType), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType ?? '0', arrivalType,isInpatient: isInpatient,), + patient, + patientType ?? '0', + arrivalType, + isInpatient: isInpatient, + ), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, @@ -55,13 +59,13 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order', + TranslationBase.of(context).orders, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Prescriptions', + TranslationBase.of(context).prescriptions, bold: true, fontSize: 22, ), @@ -76,13 +80,13 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order', + TranslationBase.of(context).orders, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Prescriptions', + TranslationBase.of(context).prescriptions, bold: true, fontSize: 22, ), @@ -96,7 +100,8 @@ class PrescriptionsPage extends StatelessWidget { addPrescriptionForm(context, model, patient, model.prescriptionList); }, - label: 'Apply for New Prescriptions Order', + label: TranslationBase.of(context) + .applyForNewPrescriptionsOrder, ), ...List.generate( model.prescriptionsList.length, @@ -140,7 +145,8 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Prescriptions Found'), + child: AppText(TranslationBase.of(context) + .noPrescriptionsFound), ) ], ), @@ -209,8 +215,8 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - 'No Prescriptions Found In Patentiss'), + child: AppText(TranslationBase.of(context) + .noPrescriptionsFound), ) ], ), diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 7cc9818b..df748922 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -165,7 +165,8 @@ class _AddSelectedProcedureState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - 'Please Enter Procedure', + TranslationBase.of(context) + .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -187,7 +188,8 @@ class _AddSelectedProcedureState extends State { Container( width: MediaQuery.of(context).size.width * 0.85, child: AppTextFieldCustom( - hintText: 'Search Procedure here...', + hintText: TranslationBase.of(context) + .searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, @@ -199,11 +201,15 @@ class _AddSelectedProcedureState extends State { // categoryName: procedureName.text); // }, onClick: () { - if(procedureName.text.isNotEmpty && procedureName.text.length>=3) - model.getProcedureCategory( - categoryName: procedureName.text); + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + categoryName: procedureName.text); else - DrAppToastMsg.showErrorToast('At least three Characters'); + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); }, ), ), @@ -212,11 +218,15 @@ class _AddSelectedProcedureState extends State { ), InkWell( onTap: () { - if(procedureName.text.isNotEmpty && procedureName.text.length>=3) + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) model.getProcedureCategory( categoryName: procedureName.text); else - DrAppToastMsg.showErrorToast('At least three Characters'); + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); }, child: Icon( Icons.search, @@ -419,7 +429,9 @@ class _AddSelectedProcedureState extends State { onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); return; } diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index b7bc2835..4a20dbaa 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -9,6 +9,7 @@ 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/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/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -160,7 +161,7 @@ class _AddSelectedLabOrderState extends State { Row( children: [ AppText( - 'New Lab Order', + TranslationBase.of(context).applyForNewLabOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -218,7 +219,8 @@ class _AddSelectedLabOrderState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: "Add Lab Order", //TranslationBase.of(context) + title: TranslationBase.of(context) + .addLabOrder, //TranslationBase.of(context) fontWeight: FontWeight.w700, //.addSelectedProcedures, color: Color(0xff359846), @@ -227,7 +229,9 @@ class _AddSelectedLabOrderState extends State { onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); return; } diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 4c1c8468..3f19e7f9 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -9,6 +9,7 @@ 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/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/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -161,7 +162,7 @@ class _AddSelectedRadiologyOrderState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - 'New Radiology Order', + TranslationBase.of(context).newRadiologyOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -216,15 +217,15 @@ class _AddSelectedRadiologyOrderState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: 'Add Radiology Order', + title: TranslationBase.of(context).addRadiologyOrder, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { //print(entityList.toString()); onPressed: if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); + DrAppToastMsg.showErrorToast(TranslationBase.of(context) + .fillTheMandatoryProcedureDetails); return; } diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 51122999..7e18055d 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -8,11 +8,11 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.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/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 'ProcedureCard.dart'; class ProcedureScreen extends StatelessWidget { @@ -32,15 +32,21 @@ class ProcedureScreen extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: (model) => - model.getProcedure(mrn: patient.patientId, patientType: patientType,), + onModelReady: (model) => model.getProcedure( + mrn: patient.patientId, + patientType: patientType, + ), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType,isInpatient: isInpatient,), + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + ), body: SingleChildScrollView( child: Container( child: Column( @@ -57,13 +63,13 @@ class ProcedureScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order Test or', + TranslationBase.of(context).orderTestOr, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Procedure', + TranslationBase.of(context).procedure, bold: true, fontSize: 22, ), @@ -78,13 +84,13 @@ class ProcedureScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order Test or', + TranslationBase.of(context).orderTestOr, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Procedure', + TranslationBase.of(context).procedure, bold: true, fontSize: 22, ), @@ -135,7 +141,7 @@ class ProcedureScreen extends StatelessWidget { height: 10, ), AppText( - 'Add More Procedure', + TranslationBase.of(context).addMoreProcedure, color: Colors.grey[600], fontWeight: FontWeight.w600, ) @@ -183,8 +189,9 @@ class ProcedureScreen extends StatelessWidget { doctorName: doctorNameP, ), ), - if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) - + if (model.state == ViewState.ErrorLocal || + (model.procedureList.isNotEmpty && + model.procedureList[0].entityList.isEmpty)) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -195,7 +202,9 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(22.0), - child: AppText(model.procedureList.isEmpty ? model.error: 'No Procedure Found '), + child: AppText(model.procedureList.isEmpty + ? model.error + : 'No Procedure Found '), ) ], ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6602722c..c86ba9e3 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -100,9 +100,11 @@ class TranslationBase { String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + String get inPatientLabel => + localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => + localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; @@ -1176,7 +1178,8 @@ class TranslationBase { localizedValues['SpecialResult'][locale.languageCode]; String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode]; String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; @@ -1247,6 +1250,56 @@ class TranslationBase { String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get pleaseEnterProcedure => + localizedValues["pleaseEnterProcedure"][locale.languageCode]; + String get fillTheMandatoryProcedureDetails => + localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; + String get atLeastThreeCharacters => + localizedValues["atLeastThreeCharacters"][locale.languageCode]; + String get searchProcedureHere => + localizedValues["searchProcedureHere"][locale.languageCode]; + String get noInsuranceApprovalFound => + localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + String get procedure => localizedValues["procedure"][locale.languageCode]; + String get stopDate => localizedValues["stopDate"][locale.languageCode]; + String get processed => localizedValues["processed"][locale.languageCode]; + String get direction => localizedValues["direction"][locale.languageCode]; + String get refill => localizedValues["refill"][locale.languageCode]; + String get medicationHasBeenAdded => + localizedValues["medicationHasBeenAdded"][locale.languageCode]; + String get newPrescriptionOrder => + localizedValues["newPrescriptionOrder"][locale.languageCode]; + String get pleaseFillAllFields => + localizedValues["pleaseFillAllFields"][locale.languageCode]; + String get narcoticMedicineCanOnlyBePrescribedFromVida => + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] + [locale.languageCode]; + String get only5DigitsAllowedForStrength => + localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + String get unit => localizedValues["unit"][locale.languageCode]; + String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; + String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; + String get applyForRadiologyOrder => + localizedValues["applyForRadiologyOrder"][locale.languageCode]; + String get applyForNewLabOrder => + localizedValues["applyForNewLabOrder"][locale.languageCode]; + String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; + String get addRadiologyOrder => + localizedValues["addRadiologyOrder"][locale.languageCode]; + String get newRadiologyOrder => + localizedValues["newRadiologyOrder"][locale.languageCode]; + String get orderDate => localizedValues["orderDate"][locale.languageCode]; + String get examType => localizedValues["examType"][locale.languageCode]; + String get health => localizedValues["health"][locale.languageCode]; + String get summary => localizedValues["summary"][locale.languageCode]; + String get applyForNewPrescriptionsOrder => + localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + String get noPrescriptionsFound => + localizedValues["noPrescriptionsFound"][locale.languageCode]; + String get noMedicalFileFound => + localizedValues["noMedicalFileFound"][locale.languageCode]; + String get insurance22 => localizedValues["insurance22"][locale.languageCode]; + String get approvals22 => localizedValues["approvals22"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index a163ef24..2b0aae7c 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -59,7 +59,8 @@ class DoctorCardInsurance extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: approvalStatus == "Approved" + color: approvalStatus == "Approved" || + approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), @@ -79,7 +80,8 @@ class DoctorCardInsurance extends StatelessWidget { children: [ AppText( "$approvalStatus", - color: approvalStatus == "Approved" + color: approvalStatus == "Approved" || + approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), From 51e9df740144d091d25e4a8af7f1785649db389a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 29 Apr 2021 16:36:49 +0300 Subject: [PATCH 052/102] page translation --- lib/config/localized_values.dart | 5 +---- lib/util/translations_delegate_base.dart | 12 ++++++++---- pubspec.lock | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index dbce6d1a..d5999b21 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -384,10 +384,7 @@ const Map> localizedValues = { 'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'}, 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, - 'yourBodyMassIndex': { - 'en': "Body Mass Index is", - 'ar': 'مؤشر كتلة الجسم هو' - }, + 'yourBodyMassIndex': {'en': "Body Mass Index is", 'ar': 'مؤشر كتلة الجسم هو'}, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, 'bmiOverWeight': {'en': "OverWeight", 'ar': 'فوق الوزن'}, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 67764fc4..cc6513d0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -100,9 +100,11 @@ class TranslationBase { String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + String get inPatientLabel => + localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => + localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; @@ -1176,7 +1178,8 @@ class TranslationBase { localizedValues['SpecialResult'][locale.languageCode]; String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode]; String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; @@ -1298,7 +1301,8 @@ class TranslationBase { String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => + localizedValues["graphDetails"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/pubspec.lock b/pubspec.lock index 9d52ce65..e9386145 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive 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-nullsafety.2" sticky_headers: dependency: "direct main" description: @@ -1091,5 +1091,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From fe581ae7ce8675133413210185a14928d751bc42 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 16:38:30 +0300 Subject: [PATCH 053/102] remove button height --- lib/widgets/shared/buttons/app_buttons_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index e63acba2..66aaac09 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -49,7 +49,7 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( - height: MediaQuery.of(context).size.height * 0.075, + // height: 60,//MediaQuery.of(context).size.height * 0.075, child: IgnorePointer( ignoring: widget.loading ||widget.disabled, child: RawMaterialButton( From ed3449bcf4e5d05f5d4780d36ccbf1db2c739a89 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 29 Apr 2021 16:43:31 +0300 Subject: [PATCH 054/102] fix the doctor card in lab result and radiology --- ios/Podfile.lock | 2 +- .../profile/lab_result/labs_home_page.dart | 10 ++++-- .../radiology/radiology_home_page.dart | 7 ++-- lib/widgets/patients/PatientCard.dart | 34 ------------------- 4 files changed, 13 insertions(+), 40 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a365fcf4..878a1850 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.1 diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 290f9569..dfba4578 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_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/screens/patients/profile/lab_result/laboratory_result_page.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class LabsHomePage extends StatefulWidget { @override @@ -37,6 +39,7 @@ class _LabsHomePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( @@ -131,15 +134,16 @@ class _LabsHomePageState extends State { width: 20, height: 160, decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) color: model.patientLabOrdersList[index].isLiveCareAppointment ? Colors.red[900] : !model.patientLabOrdersList[index].isInOutPatient ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8), + topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), + bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), + topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), + bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) ), ), child: RotatedBox( diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 81e0e6cf..d96a908a 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -39,6 +39,7 @@ class _RadiologyHomePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), @@ -140,8 +141,10 @@ class _RadiologyHomePageState extends State { ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8), + topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), + bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), + topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), + bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) ), ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index fd60b21d..aa6f114f 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -398,39 +398,5 @@ class PatientCard extends StatelessWidget { ])); } - convertDateFormat2(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } - - isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); - } - - myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); - } } From 7337dc4f879439e3ee4f0102abd9af3d8df3a38e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:16:11 +0300 Subject: [PATCH 055/102] date picker --- lib/core/viewModel/PatientSearchViewModel.dart | 16 ++++++++++++---- .../patients/out_patient/filter_date_page.dart | 9 ++++++--- .../patients/out_patient/out_patient_screen.dart | 4 ++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 9ef94647..7fbd7d1f 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -16,6 +16,9 @@ class PatientSearchViewModel extends BaseViewModel{ List filterData = []; + DateTime selectedFromDate; + DateTime selectedToDate; + searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { @@ -83,14 +86,19 @@ class PatientSearchViewModel extends BaseViewModel{ 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( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day-1), + selectedToDate, 'yyyy-MM-dd'); dateFrom = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month-3, - DateTime.now().day), + selectedFromDate, 'yyyy-MM-dd'); + + } else if (item == 'Next Week') { diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 034f6136..a8f7904d 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -16,6 +16,7 @@ class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; + const FilterDatePage( {Key key, this.outPatientFilterType, this.patientSearchViewModel}) : super(key: key); @@ -30,6 +31,8 @@ class _FilterDatePageState extends State { @override Widget build(BuildContext context) { + DateTime selectedFromDate = widget.patientSearchViewModel.selectedFromDate; + DateTime selectedToDate= widget.patientSearchViewModel.selectedToDate; var screenSize; return AppScaffold( isShowAppBar: false, @@ -235,9 +238,9 @@ class _FilterDatePageState extends State { return DateTime( DateTime .now() - .year, DateTime + .year -20, DateTime .now() - .month - 3, DateTime + .month, DateTime .now() .day); } else { @@ -257,7 +260,7 @@ class _FilterDatePageState extends State { return DateTime( DateTime .now() - .year, DateTime + .year +20, DateTime .now() .month, (DateTime .now() diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index f99f791b..953e7722 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -199,7 +199,7 @@ class _OutPatientsScreenState extends State { , prefix: IconButton( icon: Icon( - _activeLocation == 1 + _activeLocation !=0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, color: Colors.black, @@ -208,7 +208,7 @@ class _OutPatientsScreenState extends State { padding: EdgeInsets.only( bottom: 30), - onPressed: _activeLocation == 1 ? null : () { + onPressed: _activeLocation !=0 ? null : () { Navigator.push(context, MaterialPageRoute( builder: (BuildContext context) => FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); From 4d87c6fb7571d2d92a7ac1b290c2bb137ec82ff0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:24:31 +0300 Subject: [PATCH 056/102] date fix --- .../out_patient/filter_date_page.dart | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index a8f7904d..541a70eb 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -26,13 +26,15 @@ class FilterDatePage extends StatefulWidget { } class _FilterDatePageState extends State { - DateTime selectedFromDate; - DateTime selectedToDate; + @override + void initState() { + // TODO: implement initState + super.initState(); + } @override Widget build(BuildContext context) { - DateTime selectedFromDate = widget.patientSearchViewModel.selectedFromDate; - DateTime selectedToDate= widget.patientSearchViewModel.selectedToDate; + var screenSize; return AppScaffold( isShowAppBar: false, @@ -80,10 +82,10 @@ class _FilterDatePageState extends State { .of( context) .fromDate, - selectedFromDate != null + widget.patientSearchViewModel.selectedFromDate != null ? "${DateUtils .convertStringToDateFormat( - selectedFromDate.toString(), + widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -113,10 +115,10 @@ class _FilterDatePageState extends State { .of( context) .toDate, - selectedToDate != null + widget.patientSearchViewModel.selectedToDate != null ? "${DateUtils .convertStringToDateFormat( - selectedToDate.toString(), + widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -167,16 +169,16 @@ class _FilterDatePageState extends State { padding: 10, color: Color(0xFF359846), onPressed: () async { - if (selectedFromDate == null || - selectedToDate == null) { + if (widget.patientSearchViewModel.selectedFromDate == null || + widget.patientSearchViewModel.selectedToDate == null) { Helpers.showErrorToast( "Please Select All The date Fields "); } else { String dateTo = DateUtils.convertDateToFormat( - selectedToDate, + widget.patientSearchViewModel.selectedToDate, 'yyyy-MM-dd'); String dateFrom = DateUtils.convertDateToFormat( - selectedFromDate, + widget.patientSearchViewModel.selectedFromDate, 'yyyy-MM-dd'); PatientSearchRequestModel currentModel = PatientSearchRequestModel(); @@ -211,8 +213,8 @@ class _FilterDatePageState extends State { {bool isFromDate = true, DateTime firstDate, lastDate}) async { Helpers.hideKeyboard(context); DateTime selectedDate = isFromDate - ? this.selectedFromDate ?? firstDate - : this.selectedToDate ?? lastDate; + ? this.widget.patientSearchViewModel.selectedFromDate ?? firstDate + : this.widget.patientSearchViewModel.selectedToDate ?? lastDate; final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, @@ -223,11 +225,11 @@ class _FilterDatePageState extends State { if (picked != null) { if (isFromDate) { setState(() { - this.selectedFromDate = picked; + this.widget.patientSearchViewModel.selectedFromDate = picked; }); } else { setState(() { - this.selectedToDate = picked; + this.widget.patientSearchViewModel.selectedToDate = picked; }); } } From f4020af4f82d62b3c4ed1b1975375cc1902de92c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:32:15 +0300 Subject: [PATCH 057/102] date fix --- lib/screens/patients/out_patient/filter_date_page.dart | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 541a70eb..e95cb425 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -259,14 +259,8 @@ class _FilterDatePageState extends State { getLastDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime( - DateTime - .now() - .year +20, DateTime - .now() - .month, (DateTime - .now() - .day - 1)); + return DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day-1); } else { return DateTime( DateTime From 01bd55366a489eae25d2d03eded616e15f855482 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:44:28 +0300 Subject: [PATCH 058/102] date difference --- .../out_patient/filter_date_page.dart | 54 ++++++++++++------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index e95cb425..f4577008 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -169,31 +169,45 @@ class _FilterDatePageState extends State { padding: 10, color: Color(0xFF359846), onPressed: () async { - if (widget.patientSearchViewModel.selectedFromDate == null || - widget.patientSearchViewModel.selectedToDate == null) { + if (widget.patientSearchViewModel.selectedFromDate == + null || + widget.patientSearchViewModel.selectedToDate == + null) { Helpers.showErrorToast( "Please Select All The date Fields "); } else { - String dateTo = DateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedToDate, - 'yyyy-MM-dd'); - String dateFrom = DateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedFromDate, - 'yyyy-MM-dd'); + Duration difference = widget + .patientSearchViewModel.selectedToDate + .difference( + widget.patientSearchViewModel.selectedFromDate); + if (difference.inDays > 30) { + Helpers.showErrorToast( + "The difference between from date and end date must be less"); + } else { + String dateTo = DateUtils.convertDateToFormat( + widget.patientSearchViewModel.selectedToDate, + 'yyyy-MM-dd'); + String dateFrom = DateUtils.convertDateToFormat( + widget.patientSearchViewModel.selectedFromDate, + 'yyyy-MM-dd'); - PatientSearchRequestModel currentModel = PatientSearchRequestModel(); - currentModel.to = dateTo; - currentModel.from= dateFrom; - GifLoaderDialogUtils.showMyDialog(context); - await widget.patientSearchViewModel.getOutPatient( - currentModel, isLocalBusy: true); - GifLoaderDialogUtils.hideDialog(context); - if(widget.patientSearchViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientSearchViewModel.error); - }else { - Navigator.of(context).pop(); - } + PatientSearchRequestModel currentModel = + PatientSearchRequestModel(); + currentModel.to = dateTo; + currentModel.from = dateFrom; + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientSearchViewModel + .getOutPatient(currentModel, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + if (widget.patientSearchViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientSearchViewModel.error); + } else { + Navigator.of(context).pop(); + } + } } }, ), From eebaf01570765b52602a00673743f51f4f7a437a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:54:09 +0300 Subject: [PATCH 059/102] fix diff msg --- lib/screens/patients/out_patient/filter_date_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index f4577008..193c1ec2 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -180,9 +180,9 @@ class _FilterDatePageState extends State { .patientSearchViewModel.selectedToDate .difference( widget.patientSearchViewModel.selectedFromDate); - if (difference.inDays > 30) { + if (difference.inDays > 90) { Helpers.showErrorToast( - "The difference between from date and end date must be less"); + "The difference between from date and end date must be less than 3 months"); } else { String dateTo = DateUtils.convertDateToFormat( widget.patientSearchViewModel.selectedToDate, From 27a3dd1eb485701a3e4823ce5bdd2dad4ac34ac2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Fri, 30 Apr 2021 13:23:59 +0300 Subject: [PATCH 060/102] fix the filter page --- lib/client/base_app_client.dart | 2 +- .../viewModel/PatientSearchViewModel.dart | 3 +- lib/core/viewModel/base_view_model.dart | 14 +- .../out_patient/filter_date_page.dart | 5 + .../out_patient/out_patient_screen.dart | 10 +- .../patient_profile_screen.dart | 2 + ...ent-profile-header-new-design-app-bar.dart | 13 +- ..._key_checkbox_search_allergies_widget.dart | 597 +++++++++--------- 8 files changed, 338 insertions(+), 308 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 177b95ee..83dfad00 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -71,7 +71,7 @@ class BaseAppClient { (body['ProjectID'] == 2 || body['ProjectID'] == 3)) { body['PatientOutSA'] = true; } - + body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; print("URL : $url"); print("Body : ${json.encode(body)}"); var asd = json.encode(body); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 7fbd7d1f..8192b1a8 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -49,7 +49,8 @@ class PatientSearchViewModel extends BaseViewModel{ } else { setState(ViewState.Busy); } - + await getDoctorProfile(isGetProfile: true); + patientSearchRequestModel.doctorID = doctorProfile.doctorID; await _outPatientService.getOutPatient( patientSearchRequestModel); if (_outPatientService.hasError) { diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index d8591660..43e83c9b 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -22,7 +22,17 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } - Future getDoctorProfile() async { + Future getDoctorProfile({bool isGetProfile = false}) async { + if(isGetProfile) + { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } + } + } if (doctorProfile == null) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { @@ -35,5 +45,5 @@ class BaseViewModel extends ChangeNotifier { } else { return doctorProfile; } - } +} } diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 193c1ec2..e4f28ac7 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -240,6 +240,11 @@ class _FilterDatePageState extends State { if (isFromDate) { setState(() { this.widget.patientSearchViewModel.selectedFromDate = picked; + var date = picked.add(Duration(days: 30)); + if(date.isBefore(lastDate)){ + this.widget.patientSearchViewModel.selectedToDate = date; + }else + this.widget.patientSearchViewModel.selectedToDate = lastDate; }); } else { setState(() { diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 953e7722..4d0ce94a 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -132,7 +132,10 @@ class _OutPatientsScreenState extends State { 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, @@ -222,6 +225,7 @@ class _OutPatientsScreenState extends State { SizedBox( height: 10.0, ), + Expanded( child: Container( child: model.filterData.isEmpty @@ -236,7 +240,9 @@ class _OutPatientsScreenState extends State { shrinkWrap: true, itemCount: model.filterData.length, itemBuilder: (BuildContext ctxt, int index) { - return Padding( + 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], @@ -264,6 +270,8 @@ class _OutPatientsScreenState extends State { // isFromSearch: widget.isSearch, ), ); + else + return SizedBox(); })), ), ], diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 44641b4b..aa2b5276 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -94,6 +94,7 @@ class _PatientProfileScreenState extends State Column( children: [ PatientProfileHeaderNewDesignAppBar( + patient, arrivalType ?? '0', patientType, @@ -104,6 +105,7 @@ class _PatientProfileScreenState extends State : isDischargedPatient ? 240 : 0, + isDischargedPatient:isDischargedPatient ), Container( height: !isSearchAndOut 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 0ba5c8f2..3d7638c2 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 @@ -18,9 +18,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final String arrivalType; final double height; final bool isInpatient; + final bool isDischargedPatient; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false}); @override Widget build(BuildContext context) { @@ -302,10 +303,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget "${TranslationBase.of(context).numOfDays}: ", fontSize: 15, ), + if(isDischargedPatient) AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 15, - fontWeight: FontWeight.w700), + fontWeight: FontWeight.w700) + else + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), ], ), ], diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index e91236e8..7a1fc3f5 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -62,119 +62,91 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - child: Expanded( - child: Column( - children: [ - Expanded( - child: Container( - height: MediaQuery.of(context).size.height * 0.70, - child: Center( - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - children: [ - AppTextFieldCustom( - // height: - // MediaQuery.of(context).size.height * 0.070, - hintText: - TranslationBase.of(context).selectAllergy, - isTextFieldHasSuffix: true, - hasBorder: false, - // controller: filteredSearchController, - onChanged: (value) { - filterSearchResults(value); - }, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - )), - ), - DividerWithSpacesAround(), - SizedBox( - height: 10, - ), - Expanded( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Container( - height: - MediaQuery.of(context).size.height * 0.60, - child: ListView.builder( - itemCount: items.length, - itemBuilder: (context, index) { - bool isSelected = widget - .isServiceSelected(items[index]); - MySelectedAllergy mySelectedAllergy; - if (isSelected) { - mySelectedAllergy = - widget.getServiceSelectedAllergy( - items[index]); - } - TextEditingController remarkController = - TextEditingController( - text: isSelected - ? mySelectedAllergy.remark - : null); - TextEditingController severityController = - TextEditingController( - text: isSelected - ? mySelectedAllergy - .selectedAllergySeverity != - null - ? projectViewModel - .isArabic - ? mySelectedAllergy - .selectedAllergySeverity - .nameAr - : mySelectedAllergy - .selectedAllergySeverity - .nameEn - : null - : null); - return HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Checkbox( - value: widget - .isServiceSelected( - items[index]), - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - setState(() { - if (widget - .isServiceSelected( - items[index])) { - widget.removeAllergy( - items[index]); - } else { - MySelectedAllergy - mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: - items[ - index], - selectedAllergySeverity: - _selectedAllergySeverity, - remark: null, - isChecked: - true, - isExpanded: - true); - widget.addAllergy( - mySelectedAllergy); - } - }); - }), - InkWell( - onTap: () { + child: Column( + children: [ + Expanded( + child: Container( + height: MediaQuery.of(context).size.height * 0.70, + child: Center( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + AppTextFieldCustom( + // height: + // MediaQuery.of(context).size.height * 0.070, + hintText: + TranslationBase.of(context).selectAllergy, + isTextFieldHasSuffix: true, + hasBorder: false, + // controller: filteredSearchController, + onChanged: (value) { + filterSearchResults(value); + }, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + )), + ), + DividerWithSpacesAround(), + SizedBox( + height: 10, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Container( + height: + MediaQuery.of(context).size.height * 0.60, + child: ListView.builder( + itemCount: items.length, + itemBuilder: (context, index) { + bool isSelected = widget + .isServiceSelected(items[index]); + MySelectedAllergy mySelectedAllergy; + if (isSelected) { + mySelectedAllergy = + widget.getServiceSelectedAllergy( + items[index]); + } + TextEditingController remarkController = + TextEditingController( + text: isSelected + ? mySelectedAllergy.remark + : null); + TextEditingController severityController = + TextEditingController( + text: isSelected + ? mySelectedAllergy + .selectedAllergySeverity != + null + ? projectViewModel + .isArabic + ? mySelectedAllergy + .selectedAllergySeverity + .nameAr + : mySelectedAllergy + .selectedAllergySeverity + .nameEn + : null + : null); + return HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Checkbox( + value: widget + .isServiceSelected( + items[index]), + activeColor: + Colors.red[800], + onChanged: (bool newValue) { setState(() { if (widget .isServiceSelected( @@ -182,9 +154,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState widget.removeAllergy( items[index]); } else { - // TODO add Allergy - - MySelectedAllergy mySelectedAllergy = + MySelectedAllergy + mySelectedAllergy = new MySelectedAllergy( selectedAllergy: items[ @@ -192,208 +163,234 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState selectedAllergySeverity: _selectedAllergySeverity, remark: null, - isChecked: true, + isChecked: + true, isExpanded: true); widget.addAllergy( mySelectedAllergy); } }); - }, - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Container( - child: AppText( - projectViewModel - .isArabic - ? items[index] - .nameAr != - "" - ? items[index] - .nameAr - : items[index] - .nameEn - : items[index] - .nameEn, - color: - Color(0xFF575757), - fontSize: 16, - fontWeight: - FontWeight.w600, - ), - width: - MediaQuery.of(context) - .size - .width * - 0.55, - ), - ), - ), - ], - ), - InkWell( + }), + InkWell( onTap: () { - if (mySelectedAllergy != - null) { - setState(() { - mySelectedAllergy - .isExpanded = - mySelectedAllergy - .isExpanded - ? false - : true; - }); - } + setState(() { + if (widget + .isServiceSelected( + items[index])) { + widget.removeAllergy( + items[index]); + } else { + + MySelectedAllergy mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[ + index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: + true); + widget.addAllergy( + mySelectedAllergy); + } + }); }, - child: Icon((mySelectedAllergy != - null - ? mySelectedAllergy - .isExpanded - : false) - ? EvaIcons - .arrowIosUpwardOutline - : EvaIcons - .arrowIosDownwardOutline)) - ], - ), - bodyWidget: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Center( - child: Column( - children: [ - AppTextFieldCustom( - onClick: widget.model - .allergySeverityList != - null - ? () { - MasterKeyDailog - dialog = - MasterKeyDailog( - list: widget.model - .allergySeverityList, - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - mySelectedAllergy - .selectedAllergySeverity = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, - isTextFieldHasSuffix: true, - hintText: - TranslationBase.of( - context) - .selectSeverity, - enabled: false, - maxLines: 2, - minLines: 2, - controller: - severityController, - ), - SizedBox( - height: 5, - ), - if (isSubmitted && - mySelectedAllergy != - null && - mySelectedAllergy - .selectedAllergySeverity == - null) - Row( - children: [ - CustomValidationError(), - ], - mainAxisAlignment: - MainAxisAlignment - .start, + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Container( + child: AppText( + projectViewModel + .isArabic + ? items[index] + .nameAr != + "" + ? items[index] + .nameAr + : items[index] + .nameEn + : items[index] + .nameEn, + color: + Color(0xFF575757), + fontSize: 16, + fontWeight: + FontWeight.w600, ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only( - left: 0, - right: 0, - top: 15), - child: NewTextFields( - hintText: - TranslationBase.of( - context) - .remarks, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: - FontWeight.w600, - maxLines: 25, - minLines: 3, - initialValue: isSelected - ? mySelectedAllergy - .remark - : '', - // controller: remarkControlle - - onChanged: (value) { - if (isSelected) { - mySelectedAllergy - .remark = value; - } - }, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, + width: + MediaQuery.of(context) + .size + .width * + 0.55, ), - ], + ), ), + ], + ), + InkWell( + onTap: () { + if (mySelectedAllergy != + null) { + setState(() { + mySelectedAllergy + .isExpanded = + mySelectedAllergy + .isExpanded + ? false + : true; + }); + } + }, + child: Icon((mySelectedAllergy != + null + ? mySelectedAllergy + .isExpanded + : false) + ? EvaIcons + .arrowIosUpwardOutline + : EvaIcons + .arrowIosDownwardOutline)) + ], + ), + bodyWidget: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: Column( + children: [ + AppTextFieldCustom( + onClick: widget.model + .allergySeverityList != + null + ? () { + MasterKeyDailog + dialog = + MasterKeyDailog( + list: widget.model + .allergySeverityList, + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + mySelectedAllergy + .selectedAllergySeverity = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: + (BuildContext + context) { + return dialog; + }, + ); + } + : null, + isTextFieldHasSuffix: true, + hintText: + TranslationBase.of( + context) + .selectSeverity, + enabled: false, + maxLines: 2, + minLines: 2, + controller: + severityController, + ), + SizedBox( + height: 5, + ), + if (isSubmitted && + mySelectedAllergy != + null && + mySelectedAllergy + .selectedAllergySeverity == + null) + Row( + children: [ + CustomValidationError(), + ], + mainAxisAlignment: + MainAxisAlignment + .start, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, + right: 0, + top: 15), + child: NewTextFields( + hintText: + TranslationBase.of( + context) + .remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: + FontWeight.w600, + maxLines: 25, + minLines: 3, + initialValue: isSelected + ? mySelectedAllergy + .remark + : '', + // controller: remarkControlle + + onChanged: (value) { + if (isSelected) { + mySelectedAllergy + .remark = value; + } + }, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + ], ), ), ), - isExpand: mySelectedAllergy != null - ? mySelectedAllergy.isExpanded - : false, - ); - }, - ), + ), + isExpand: mySelectedAllergy != null + ? mySelectedAllergy.isExpanded + : false, + ); + }, ), ), ), - ], - ))), - ), - ), - SizedBox( - height: 10, + ), + ], + ))), ), - ], - ), + ), + SizedBox( + height: 10, + ), + ], ), ); } From 2978aeecb24b8f9085a399f4618aedefe1a1a05b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Fri, 30 Apr 2021 13:44:27 +0300 Subject: [PATCH 061/102] fix the tab bar --- .../referral/patient_referral_screen.dart | 88 +++++++++++++++---- 1 file changed, 69 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 1206c9c3..6b7f448b 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -1,9 +1,11 @@ import 'dart:ui'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -14,13 +16,22 @@ class PatientReferralScreen extends StatefulWidget { _PatientReferralScreen createState() => _PatientReferralScreen(); } -class _PatientReferralScreen extends State - with SingleTickerProviderStateMixin { +class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { + TabController _tabController; + int index=0; + @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(_handleTabSelection); + } + + _handleTabSelection() { + setState(() { + index = _tabController.index; + }); } @override @@ -29,7 +40,7 @@ class _PatientReferralScreen extends State _tabController.dispose(); } - @override + @override Widget build(BuildContext context) { return AppScaffold( @@ -39,12 +50,10 @@ class _PatientReferralScreen extends State extendBodyBehindAppBar: true, // backgroundColor: Colors.white, appBar: PreferredSize( - preferredSize: Size.fromHeight(60.0), + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Center( child: Container( - height: 60.0, - // margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 1, // 0.92, + height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -54,30 +63,71 @@ class _PatientReferralScreen extends State color: Colors.white), child: Center( child: TabBar( - isScrollable: true, + isScrollable: false, controller: _tabController, - indicatorColor: Colors.red[800], - indicatorWeight: 5.0, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.30, + width: MediaQuery.of(context).size.width * 0.50, + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( - child: - AppText(TranslationBase.of(context).referral), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + index == 0 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), + index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + TranslationBase.of(context).myReferredPatient, + fontSize: SizeConfig.textMultiplier * 1.8, + color: index == 0 ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), ), ), Container( - width: MediaQuery.of(context).size.width * 0.30, + width: MediaQuery.of(context).size.width * 0.50, + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( - child: AppText( - TranslationBase.of(context).myReferredPatient), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + index == 1 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), + index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + TranslationBase.of(context).referral, + fontSize: SizeConfig.textMultiplier * 1.8, + color: index == 1 ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), ), ), + ], ), ), @@ -91,8 +141,8 @@ class _PatientReferralScreen extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - MyReferralInPatientScreen(), ReferredPatientScreen(), + MyReferralInPatientScreen(), // MyReferredPatient(), ], ), From d5d57e7997be8a67d007c07c9b943d49270294ac Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 13:20:28 +0300 Subject: [PATCH 062/102] fix new design issue --- ios/Podfile.lock | 2 +- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 2 +- lib/landing_page.dart | 2 +- lib/screens/doctor/doctor_reply_screen.dart | 2 +- .../out_patient/out_patient_screen.dart | 42 +++++++++++++++---- .../assessment/add_assessment_details.dart | 1 + .../update_Chief_complaints.dart | 42 ++++++++++++------- lib/widgets/shared/app_drawer_widget.dart | 4 -- lib/widgets/shared/drawer_item_widget.dart | 4 -- 10 files changed, 67 insertions(+), 36 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 878a1850..2f4607e0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/config/config.dart b/lib/config/config.dart index 9596a029..07151d1d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -336,7 +336,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.8; +const VERSION_ID = 5.9; 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 d5999b21..c2d77da5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -847,7 +847,7 @@ const Map> localizedValues = { "en": "Apply Reschedule Leave", "ar": "التقدم بطلب أو إعادة جدولة الإجازة" }, - "myQRCode": {"en": "My QR Code", "ar": "My QR Code"}, + "myQRCode": {"en": "My QR Code", "ar": " كود QR "}, "patientIDMobilenational": { "en": "Patient ID, National ID, Mobile Number", "ar": "هوية المريض ، الهوية الوطنية ، رقم الهاتف المحمول" diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 99e1694f..13d4e92b 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -90,7 +90,7 @@ class _LandingPageState extends State { case 2: return TranslationBase.of(context).qr; case 3: - return TranslationBase.of(context).replay; + return TranslationBase.of(context).replay2; } } } diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index f522561f..dcbe9667 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -34,7 +34,7 @@ class DoctorReplyScreen extends StatelessWidget { }, child: AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: "ghgh",//TranslationBase.of(context).replay2, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem) diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 4d0ce94a..e2e6e94c 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -109,7 +109,7 @@ class _OutPatientsScreenState extends State { baseViewModel: model, body: Column( children: [ - Container( + Container( // color: Colors.red, height: screenSize.height * 0.070, decoration: TextFieldsUtils @@ -155,11 +155,40 @@ class _OutPatientsScreenState extends State { borderRadius: 4, borderWidth: 0), child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, + 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 ?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(), + ], ), ), ), @@ -169,7 +198,6 @@ class _OutPatientsScreenState extends State { }).toList(), ), ), - SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 87015bbb..47d639ad 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -351,6 +351,7 @@ class _AddAssessmentDetailsState extends State { hintText: TranslationBase.of(context).remarks, maxLines: 18, minLines: 5, + inputType: TextInputType.multiline, controller: remarkController, onChanged: (value) { widget.mySelectedAssessment.remark = diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 216fbd53..0e5e6ec1 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -40,22 +40,28 @@ class UpdateChiefComplaints extends StatelessWidget { maxLines: 25, minLines: 7, hasBorder: true, - validationError:complaintsControllerError !=''?complaintsControllerError:null , - + inputType: TextInputType.multiline, + validationError: complaintsControllerError != '' + ? complaintsControllerError + : null, ), SizedBox( height: 20, ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .historyOfPresentIllness, - controller: illnessController, - maxLines: 25, - minLines: 7, + hintText: TranslationBase + .of(context) + .historyOfPresentIllness, + controller: illnessController, + inputType: TextInputType.multiline, + + maxLines: 25, + minLines: 7, hasBorder: true, - validationError:illnessControllerError !=''?illnessControllerError:null , + validationError: illnessControllerError != '' + ? illnessControllerError + : null, ), SizedBox( height: 10, @@ -67,14 +73,18 @@ class UpdateChiefComplaints extends StatelessWidget { height: 10, ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .currentMedications, - controller: medicationController, + hintText: TranslationBase + .of(context) + .currentMedications, + controller: medicationController, maxLines: 25, - minLines: 7, - hasBorder: true, - validationError:medicationControllerError !=''?medicationControllerError:null , + minLines: 7, + hasBorder: true, + inputType: TextInputType.multiline, + + validationError: medicationControllerError != '' + ? medicationControllerError + : null, ), SizedBox( diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 8509bc95..ebb49e6f 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -16,9 +16,6 @@ import 'app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); -// OWNER : Ibrahim albitar -// DATE : 06-04-2020 -// DESCRIPTION : Custom App Drawer for app. class AppDrawer extends StatefulWidget { @override @@ -26,7 +23,6 @@ class AppDrawer extends StatefulWidget { } class _AppDrawerState extends State { - bool _isInit = true; Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 6b8e8d48..2b8ce40d 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -5,10 +5,6 @@ import 'package:flutter/material.dart'; import '../shared/app_texts_widget.dart'; -// OWNER : Ibrahim albitar -// DATE : 08-04-2020 -// DESCRIPTION : Custom Drawer item for app. - class DrawerItem extends StatefulWidget { final String title; final String subTitle; From 0b473f630f447d590c422803db6ca30bf85ee7d4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 15:14:05 +0300 Subject: [PATCH 063/102] translate progress_note_screen --- lib/config/localized_values.dart | 18 +- .../profile/note/progress_note_screen.dart | 340 +++++++++++------- .../patients/profile/note/update_note.dart | 30 +- lib/util/translations_delegate_base.dart | 22 ++ 4 files changed, 261 insertions(+), 149 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c2d77da5..53981e90 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -654,8 +654,8 @@ const Map> localizedValues = { }, 'progressNoteSOAP': {'en': "Progress Note", 'ar': "ملاحظة التقدم"}, 'addProgressNote': {'en': "Add Progress Note", 'ar': "أضف ملاحظة التقدم"}, - 'createdBy': {'en': "Created By :", 'ar': "أضيفت : "}, - 'editedBy': {'en': "Edited By :", 'ar': "عدلت : "}, + 'createdBy': {'en': "Created By :", 'ar': "أضيفت من قبل : "}, + 'editedBy': {'en': "Edited By :", 'ar': "عدلت من قبل : "}, 'currentMedications': {'en': "Current Medications", 'ar': "الأدوية الحالية"}, 'noItem': { 'en': "No items exists in this list", @@ -783,7 +783,7 @@ const Map> localizedValues = { "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, - 'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"}, + 'fileNumber': {'en': "File Number: ", 'ar': "رقم الملف : "}, 'searchPatient-name': { 'en': 'Search Name, Medical File, Phone Number', 'ar': "اسم البحث ، الملف الطبي ، رقم الهاتف" @@ -946,4 +946,16 @@ const Map> localizedValues = { "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, + "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف ورقة طلب جديدة"}, + "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة تقدم جديدة"}, + "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, + "noteCanceled": {"en": "Canceled", "ar": "ألغيت"}, + "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, + 'noteVerify': {'en': 'Verify', 'ar': 'تحقق'}, + 'noteConfirm': {'en': 'Confirm', 'ar': 'تاكيد'}, + 'noteAdd': {'en': 'Add ', 'ar': 'اضف '}, + 'noteUpdateْْ': {'en': 'Update ', 'ar': 'تحديت'}, + 'orderSheet': {'en': 'Order Sheet', 'ar': 'ورقة الطلب'}, + + }; diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index d7506402..173115f9 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -2,6 +2,7 @@ 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/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_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/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -42,9 +43,10 @@ class _ProgressNoteState extends State { var _isInit = true; bool isDischargedPatient = false; AuthViewModel authProvider; + ProjectViewModel projectViewModel; - - getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { + getProgressNoteList(BuildContext context, PatientViewModel model, + {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); @@ -59,7 +61,10 @@ class _ProgressNoteState extends State { tokenID: token, patientTypeID: patient.patientType, languageID: 2); - model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { + model + .getPatientProgressNote(progressNoteRequest.toJson(), + isLocalBusy: isLocalBusy) + .then((c) { notesList = model.patientProgressNoteList; }); } @@ -67,97 +72,124 @@ class _ProgressNoteState extends State { @override Widget build(BuildContext context) { authProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute + .of(context) + .settings + .arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; - if(routeArgs.containsKey('isDischargedPatient')) - isDischargedPatient = routeArgs['isDischargedPatient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => getProgressNoteList(context, model), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - // appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: true,), - body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) - : Container( - color: Colors.grey[200], + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + patient.patientType.toString() ?? '0', + arrivalType, + isInpatient: true, + ), + body: model.patientProgressNoteList == null || + model.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase + .of(context) + .errorNoProgressNote) + : Container( + color: Colors.grey[200], child: Column( - children: [ - if(!isDischargedPatient) - AddNewOrder( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - )), - ); - },label: widget.visitType ==3?'Add a New Order Sheet':'Create a New Progress Note',), - Expanded( - child: Container( - - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index] - .status == - 1 && - authProvider.doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy - ? Color(0xFFCC9B14):model - .patientProgressNoteList[ - index] - .status == - 4?Colors.red.shade700 - : model - .patientProgressNoteList[ - index] - .status == - 2?Colors.green[600]:Color(0xFFCC9B14), - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model - .patientProgressNoteList[ - index] - .status == - 1 && - authProvider - .doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy) - AppText( - 'Pending', - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), + children: [ + if (!isDischargedPatient) + AddNewOrder( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + )), + ); + }, + label: widget.visitType == 3 + ? TranslationBase + .of(context) + .addNewOrderSheet + : TranslationBase + .of(context) + .addProgressNote, + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index] + .status == + 1 && + authProvider.doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index] + .status == + 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index] + .status == + 2 + ? Colors.green[600] + : Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (model + .patientProgressNoteList[ + index] + .status == + 1 && + authProvider + .doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy) + AppText( + TranslationBase + .of(context) + .notePending, + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), if (model .patientProgressNoteList[ index] .status == 4) AppText( - 'Canceled', + TranslationBase + .of(context) + .noteCanceled, fontWeight: FontWeight.bold, color: Colors.red.shade700, fontSize: 12, @@ -168,7 +200,9 @@ class _ProgressNoteState extends State { .status == 2) AppText( - 'Verified', + TranslationBase + .of(context) + .noteVerified, fontWeight: FontWeight.bold, color: Colors.green[600], fontSize: 12, @@ -229,7 +263,10 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - 'Update', + TranslationBase + .of( + context) + .update, fontSize: 10, color: Colors.white, ), @@ -309,7 +346,10 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - 'Verify', + TranslationBase + .of( + context) + .noteVerify, fontSize: 10, color: Colors.white, ), @@ -325,22 +365,26 @@ class _ProgressNoteState extends State { onTap: () async { showMyDialog( context: context, - actionName: "cancel", + actionName: + TranslationBase + .of( + context) + .cancel, confirmFun: () async { GifLoaderDialogUtils .showMyDialog( context, ); UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( + reqModel = + UpdateNoteReqModel( admissionNo: int .parse(patient - .admissionNo), + .admissionNo), cancelledNote: true, lineItemNo: model .patientProgressNoteList[ - index] + index] .lineItemNo, createdBy: model .patientProgressNoteList[ @@ -398,7 +442,6 @@ class _ProgressNoteState extends State { padding: EdgeInsets.all(6), ), ), - SizedBox( width: 10, ) @@ -428,7 +471,10 @@ class _ProgressNoteState extends State { .start, children: [ AppText( - 'Created By: ', + TranslationBase + .of( + context) + .createdBy, fontSize: 10, ), Expanded( @@ -452,26 +498,34 @@ class _ProgressNoteState extends State { children: [ AppText( model + .patientProgressNoteList[ + index] + .createdOn != + null + ? DateUtils + .getDayMonthYearDateFormatted( + DateUtils + .getDateTimeFromServerFormat( + model .patientProgressNoteList[ - index] - .createdOn != - null - ? DateUtils.getDayMonthYearDateFormatted( - DateUtils.getDateTimeFromServerFormat( - model - .patientProgressNoteList[ - index] - .createdOn)) + index] + .createdOn), + isArabic: + projectViewModel + .isArabic) : DateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), fontWeight: FontWeight.w600, fontSize: 14, ), AppText( model - .patientProgressNoteList[ - index] + .patientProgressNoteList[ + index] .createdOn != null ? DateUtils.getHour(DateUtils @@ -508,21 +562,21 @@ class _ProgressNoteState extends State { ), ), ]) - ], - ), - SizedBox( - height: 20, - ), - ], - ), + ], + ), + SizedBox( + height: 20, + ), + ], ), - ); - }), - ), + ), + ); + }), ), - ], + ), + ], ), - ), + ), ), ); } @@ -541,38 +595,49 @@ class _ProgressNoteState extends State { isShowAppBar: false, body: Container( color: Colors.white, - child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ // SizedBox(height: 20,), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ AppText( - "Confirm", fontWeight: FontWeight.w600, + TranslationBase + .of(context) + .noteConfirm, + fontWeight: FontWeight.w600, color: Colors.black, - fontSize: 16,), + fontSize: 16, + ), ], ), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), DividerWithSpacesAround(), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), Container( padding: EdgeInsets.all(20), color: Colors.white, child: AppText( - 'Are you sure you want $actionName this order?', + projectViewModel.isArabic?"هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟":'Are you sure you want $actionName this order?', fontSize: 15, textAlign: TextAlign.center, ), ), - SizedBox(height: 8,), + SizedBox( + height: 8, + ), DividerWithSpacesAround(), FractionallySizedBox( widthFactor: 0.75, @@ -581,22 +646,29 @@ class _ProgressNoteState extends State { children: [ FlatButton( child: AppText( - "Cancel", fontWeight: FontWeight.w600, + TranslationBase + .of(context) + .cancel, + fontWeight: FontWeight.w600, color: Colors.black, - fontSize: 16,),//Text("Cancel"), + fontSize: 16, + ), //Text("Cancel"), onPressed: () { Navigator.of(context).pop(); }), FlatButton( child: AppText( - "Confirm", fontWeight: FontWeight.w600, + TranslationBase + .of(context) + .noteConfirm, + fontWeight: FontWeight.w600, color: Colors.red.shade700, - fontSize: 16,), //Text("Confirm", ), + fontSize: 16, + ), //Text("Confirm", ), onPressed: () async { - await confirmFun(); + await confirmFun(); Navigator.of(context).pop(); }) - ], ), ) @@ -608,8 +680,4 @@ class _ProgressNoteState extends State { ), )); } - - - - } diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 207e56a6..673a6e2b 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -7,6 +7,7 @@ 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/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_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/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -22,6 +23,7 @@ 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; @@ -51,6 +53,8 @@ class _UpdateNoteOrderState extends State { stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); + ProjectViewModel projectViewModel; + TextEditingController progressNoteController = TextEditingController(); setSelectedType(int val) { @@ -74,6 +78,8 @@ class _UpdateNoteOrderState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + if (widget.note != null) { progressNoteController.text = widget.note.notes; } @@ -91,8 +97,10 @@ class _UpdateNoteOrderState extends State { children: [ BottomSheetTitle( title: widget.visitType == 3 - ? (widget.isUpdate ? 'Update' : 'Add') + ' Order Sheet' - : (widget.isUpdate ? 'Update' : 'Add') + ' Progress Note', + ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, ), SizedBox( height: 10.0, @@ -106,10 +114,10 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: widget.visitType == 3 - ? (widget.isUpdate ? 'Update' : 'Add') + - ' Order Sheet' - : (widget.isUpdate ? 'Update' : 'Add') + - ' Progress Note', + ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -124,8 +132,8 @@ class _UpdateNoteOrderState extends State { : null, ), Positioned( - top: 0, //MediaQuery.of(context).size.height * 0, - right: 15, + top: -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic? MediaQuery.of(context).size.width * 0.75 : 15, child: IconButton( icon: Icon( DoctorApp.speechtotext, @@ -155,8 +163,10 @@ class _UpdateNoteOrderState extends State { children: [ AppButton( title: widget.visitType == 3 - ? (widget.isUpdate ? 'Update' : 'Add') + ' Order Sheet' - : (widget.isUpdate ? 'Update' : 'Add') + ' Progress Note', + ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index cc6513d0..0519d99e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1303,6 +1303,28 @@ class TranslationBase { String get severe => localizedValues["severe"][locale.languageCode]; String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get addNewOrderSheet => + localizedValues["addNewOrderSheet"][locale.languageCode]; + String get addNewProgressNote => + localizedValues["addNewProgressNote"][locale.languageCode]; + String get notePending => + localizedValues["notePending"][locale.languageCode]; + String get noteCanceled => + localizedValues["noteCanceled"][locale.languageCode]; + String get noteVerified => + localizedValues["noteVerified"][locale.languageCode]; + String get noteVerify => + localizedValues["noteVerify"][locale.languageCode]; + String get noteConfirm => + localizedValues["noteConfirm"][locale.languageCode]; + String get noteAdd => + localizedValues["noteAdd"][locale.languageCode]; + + String get noteUpdate => + localizedValues["noteUpdate"][locale.languageCode]; + + String get orderSheet => + localizedValues["orderSheet"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From c24bb604d45187166682a038e062c2a53f249de2 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 2 May 2021 16:53:33 +0300 Subject: [PATCH 064/102] DashBoard design fix --- lib/client/base_app_client.dart | 2 +- lib/config/config.dart | 5 +- lib/screens/home/home_page_card.dart | 4 +- lib/screens/home/home_screen.dart | 311 +++++++++++------- .../prescription/add_prescription_form.dart | 17 +- lib/widgets/auth/verfiy_account.dart | 2 +- 6 files changed, 217 insertions(+), 124 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 83dfad00..07a19747 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -147,7 +147,7 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 5.8; + body['VersionID'] = 5.9; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; diff --git a/lib/config/config.dart b/lib/config/config.dart index 9596a029..b21ee8ed 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -280,7 +280,8 @@ const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; -const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; +const GET_MY_OUT_PATIENT = + "Services/DoctorApplication.svc/REST/GetMyOutPatient"; var selectedPatientType = 1; @@ -336,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.8; +const VERSION_ID = 5.9; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 216a8c3f..ffe56fd0 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -28,7 +28,7 @@ class HomePageCard extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: width != null ? width : MediaQuery.of(context).size.width * 0.29, + width: width != null ? width : MediaQuery.of(context).size.width * 0.28, height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait @@ -41,7 +41,7 @@ class HomePageCard extends StatelessWidget { ? color : HexColor('#050705').withOpacity(opacity) : Colors.white, - borderRadius: BorderRadius.circular(15.0), + borderRadius: BorderRadius.circular(17.0), border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index d3d2c827..36f86c85 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -222,7 +222,7 @@ class _HomeScreenState extends State { return DropdownMenuItem( child: AppText( item.clinicName, - textAlign: TextAlign.right, + textAlign: TextAlign.left, ), value: item.clinicID, ); @@ -470,7 +470,7 @@ class _HomeScreenState extends State { scrollDirection: Axis.horizontal, children: [ HomePageCard( - color: Colors.red[800], + color: Color(0xffD02127), margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: @@ -481,10 +481,25 @@ class _HomeScreenState extends State { Padding( padding: EdgeInsets.only( top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.inpatient, - size: 32, - color: Colors.white, + 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), @@ -528,10 +543,26 @@ class _HomeScreenState extends State { Padding( padding: EdgeInsets.only( top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.arrival_patients, - size: 35, - color: Colors.black, + 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), @@ -546,25 +577,30 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { - - String date = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day ), - 'yyyy-MM-dd'); + String date = + DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, + DateTime.now().month, + DateTime.now().day), + 'yyyy-MM-dd'); Navigator.push( context, MaterialPageRoute( - builder: (context) => - OutPatientsScreen( - patientSearchRequestModel: - PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID) - ), + builder: (context) => OutPatientsScreen( + patientSearchRequestModel: + PatientSearchRequestModel( + from: date, + to: date, + doctorID: authProvider + .doctorProfile + .doctorID)), )); }, ), HomePageCard( - color: Colors.black, + color: Color(0xff2B353E), margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: @@ -575,10 +611,26 @@ class _HomeScreenState extends State { Padding( padding: EdgeInsets.only( top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.referral_1, - size: 35, - color: Colors.white, + 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), @@ -603,86 +655,86 @@ class _HomeScreenState extends State { ); }, ), + // HomePageCard( + // color: Colors.red[800], + // margin: EdgeInsets.all(5), + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.center, + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Padding( + // padding: EdgeInsets.only( + // top: 10, left: 10, right: 0), + // child: Icon( + // DoctorApp.discharge_patients, + // size: 35, + // color: Colors.white, + // )), + // Container( + // padding: EdgeInsets.all(10), + // child: AppText( + // 'Discharged Patients', + // color: Colors.white, + // textAlign: TextAlign.start, + // fontSize: 15, + // )) + // ], + // ), + // hasBorder: false, + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // DischargedPatient(), + // // MyReferredPatient(), + // ), + // ); + // }, + // ), + // 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: Icon( + // DoctorApp.referral_discharge, + // size: 35, + // color: Colors.black, + // )), + // Container( + // padding: EdgeInsets.all(10), + // child: AppText( + // 'Referral Discharged', + // color: Colors.black, + // textAlign: TextAlign.start, + // fontSize: 15, + // )) + // ], + // ), + // hasBorder: false, + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // ReferralDischargedPatientPage(), + // // MyReferredPatient(), + // ), + // ); + // }, + // ), HomePageCard( - color: Colors.red[800], - margin: EdgeInsets.all(5), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.discharge_patients, - size: 35, - color: Colors.white, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - 'Discharged Patients', - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 15, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - DischargedPatient(), - // MyReferredPatient(), - ), - ); - }, - ), - 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: Icon( - DoctorApp.referral_discharge, - size: 35, - color: Colors.black, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - 'Referral Discharged', - color: Colors.black, - textAlign: TextAlign.start, - fontSize: 15, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - ReferralDischargedPatientPage(), - // MyReferredPatient(), - ), - ); - }, - ), - HomePageCard( - color: Colors.black, + color: Color(0xffD02127), margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: @@ -693,10 +745,25 @@ class _HomeScreenState extends State { Padding( padding: EdgeInsets.only( top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.search, - size: 32, - color: Colors.white, + 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), @@ -720,7 +787,7 @@ class _HomeScreenState extends State { }, ), HomePageCard( - color: Colors.red[800], + color: Color(0xffC9C9C9), margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: @@ -731,17 +798,33 @@ class _HomeScreenState extends State { Padding( padding: EdgeInsets.only( top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.search_medicines, - size: 32, - color: Colors.white, + 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: Colors.white, + color: Color(0xff2B353E), textAlign: TextAlign.start, fontSize: 13, )) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index baebe130..07bf9d81 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -564,10 +564,17 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .unit, - units != null - ? units[ + model.itemMedicineListUnit + .length == + 1 + ? model.itemMedicineListUnit[ + 0][ 'description'] - : null, + : units != + null + ? units[ + 'description'] + : null, true), enabled: false), ), @@ -1368,7 +1375,9 @@ class _PrescriptionFormWidgetState extends State { // .toList() // .join(' '), dose: strengthController.text, - doseUnit: units['parameterCode'].toString(), + doseUnit: model.itemMedicineListUnit.length == 1 + ? model.itemMedicineListUnit[0]['parameterCode'] + : units['parameterCode'].toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), model: widget.model, diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 535efcf5..1574d3d4 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -93,7 +93,7 @@ class _VerifyAccountState extends State { return Form( key: verifyAccountForm, child: Container( - width: SizeConfig.realScreenWidth * 0.90, + width: SizeConfig.realScreenWidth * 0.95, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ From 989774a0b3c2031a73845a116260fddcc1b78cea Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 2 May 2021 17:12:24 +0300 Subject: [PATCH 065/102] Fix patient card and add the discharged in Patient referral page --- lib/client/base_app_client.dart | 2 +- lib/config/config.dart | 2 +- .../patients/DischargedPatientPage.dart | 32 ++-- .../referral/patient_referral_screen.dart | 35 ++++- lib/widgets/patients/PatientCard.dart | 147 +++++++++--------- .../shared/buttons/app_buttons_widget.dart | 2 +- lib/widgets/shared/card_with_bg_widget.dart | 20 +-- 7 files changed, 128 insertions(+), 112 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 83dfad00..faef1fca 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -147,7 +147,7 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 5.8; + body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; diff --git a/lib/config/config.dart b/lib/config/config.dart index 9596a029..07151d1d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -336,7 +336,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.8; +const VERSION_ID = 5.9; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 28f7b834..23270afc 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -26,10 +26,10 @@ class _DischargedPatientState extends State { return BaseView( onModelReady: (model) => model.getDischargedPatient(), builder: (_, model, w) => AppScaffold( - appBarTitle: 'Discharged Patient', - subtitle: "Last Three Months", + //appBarTitle: 'Discharged Patient', + //subtitle: "Last Three Months", backgroundColor: Colors.grey[200], - isShowAppBar: true, + isShowAppBar: false, baseViewModel: model, body: model.myDischargedPatient.isEmpty?Center( child: Column( @@ -53,17 +53,12 @@ class _DischargedPatientState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 12,), + SizedBox(height: 65,), Container( width: double.maxFinite, height: 75, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: Color(0xffCCCCCC), - ), + borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: Color(0xffCCCCCC),), color: Colors.white), child: Column( crossAxisAlignment: @@ -88,19 +83,17 @@ class _DischargedPatientState extends State { color: Colors.black, ), iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), + padding: EdgeInsets.only(bottom: 30), ), onChanged: (String str) { model.searchData(str); }), ])), SizedBox(height: 5,), - Expanded( - child: ListView.builder( - itemCount: model.filterData.length, - itemBuilder: (context,index)=>InkWell( + Expanded(child: SingleChildScrollView( + child: Column( + children: [ + ...List.generate(model.filterData.length, (index) => InkWell( onTap: () { Navigator.of(context) .pushNamed( @@ -324,8 +317,9 @@ class _DischargedPatientState extends State { ), ), )), - ), - + ], + ), + )) ], ), ), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 6b7f448b..de106524 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils. import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../DischargedPatientPage.dart'; import 'my-referral-inpatient-screen.dart'; class PatientReferralScreen extends StatefulWidget { @@ -24,7 +25,7 @@ class _PatientReferralScreen extends State with SingleTic @override void initState() { super.initState(); - _tabController = TabController(length: 2, vsync: this); + _tabController = TabController(length: 3, vsync: this); _tabController.addListener(_handleTabSelection); } @@ -74,7 +75,7 @@ class _PatientReferralScreen extends State with SingleTic unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.50, + width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), Color(0xFFCCCCCC), @@ -101,7 +102,7 @@ class _PatientReferralScreen extends State with SingleTic ), ), Container( - width: MediaQuery.of(context).size.width * 0.50, + width: MediaQuery.of(context).size.width * 0.34, height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), Color(0xFFCCCCCC), @@ -127,6 +128,33 @@ class _PatientReferralScreen extends State with SingleTic ), ), ), + Container( + width: MediaQuery.of(context).size.width * 0.33, + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + index == 2 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), + index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + 'Discharged', + fontSize: SizeConfig.textMultiplier * 1.8, + color: index == 2 ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), ], ), @@ -143,6 +171,7 @@ class _PatientReferralScreen extends State with SingleTic children: [ ReferredPatientScreen(), MyReferralInPatientScreen(), + DischargedPatient() // MyReferredPatient(), ], ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index aa6f114f..e02ebb5b 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/util/date-utils.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/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; @@ -32,36 +33,22 @@ class PatientCard extends StatelessWidget { return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 0, top: 0), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), + borderRadius: BorderRadius.circular(10), color: Colors.white, ), - child: Stack(children: [ - if (!isInpatient&& !isMyPatient && !isFromSearch) - Container( - height: 160, - width: 5, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10)), - color: patientInfo.patientStatusType == 43 - ? Colors.green[500] - : Colors.red[800], - )), - if(isMyPatient && !isFromSearch) - Container( - height: 180, - width: 5, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10)), - color: Colors.green[500] - )), - Container( - padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), + child: CardWithBgWidget( + padding: 0, + marginLeft: (!isMyPatient && isInpatient)?0:10, + marginSymmetric:isFromSearch ? 10 : 0.0, + hasBorder: false, + bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43 + ? Colors.green[500] + :isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white, + widget: Container( + color: Colors.white, + // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( child: Column( children: [ @@ -82,7 +69,7 @@ class PatientCard extends StatelessWidget { color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: 10, ), SizedBox(width: 8,), SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), @@ -92,7 +79,7 @@ class PatientCard extends StatelessWidget { color: patientInfo.status==2? Colors.green:Colors.grey , fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: 10, ), ], ) @@ -103,7 +90,7 @@ class PatientCard extends StatelessWidget { color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: 10, ), SizedBox(width: 8,), SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), @@ -113,7 +100,7 @@ class PatientCard extends StatelessWidget { color: patientInfo.status==2? Colors.green:Colors.grey , fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: 10, ), ], ): !isFromSearch && patientInfo.patientStatusType==null ? Row( @@ -151,14 +138,15 @@ class PatientCard extends StatelessWidget { )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, + fontSize: 15, ) : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? AppText( - // - // )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), - " ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}", + + "${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, + fontSize: 15, ):SizedBox() ], )) @@ -181,29 +169,31 @@ class PatientCard extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row(children: [ - Container( - width: 170, - child: AppText( - (Helpers.capitalize(patientInfo.firstName) + - " " + - Helpers.capitalize(patientInfo.lastName)), - fontSize: 16, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, + Expanded( + child: Row(children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + (Helpers.capitalize(patientInfo.firstName) + + " " + + Helpers.capitalize(patientInfo.lastName)), + fontSize: 16, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), ), - ), - patientInfo.gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), + if (patientInfo.gender == 1) + Icon( + DoctorApp.male_2, + color: Colors.blue, + ) else Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), Row( children: [ AppText( @@ -280,14 +270,14 @@ class PatientCard extends StatelessWidget { text: TranslationBase.of(context) .fileNumber, style: TextStyle( - fontSize: 14, + fontSize: 12, fontFamily: 'Poppins')), new TextSpan( text: patientInfo.patientId.toString(), style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: 15)), + fontSize: 13)), ], ), ), @@ -306,13 +296,13 @@ class PatientCard extends StatelessWidget { text: TranslationBase.of(context).age + " : ", - style: TextStyle(fontSize: 14)), + style: TextStyle(fontSize: 12)), new TextSpan( text: "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, - fontSize: 15)), + fontSize: 13)), ], ), ), @@ -334,28 +324,35 @@ class PatientCard extends StatelessWidget { : TranslationBase.of(context) .admissionDate + " : ", - style: TextStyle(fontSize: 14)), + style: TextStyle(fontSize: 12)), new TextSpan( text: patientInfo.admissionDate == null ? "" : "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, - fontSize: 15)), + fontSize: 13)), ]))), if (patientInfo.admissionDate != null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 15, - ), - AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700), - ], - ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of(context).numOfDays + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 13)), + ]))), ])) ]), @@ -395,7 +392,7 @@ class PatientCard extends StatelessWidget { ), onTap: onTap, )), - ])); + )); } diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index 66aaac09..ed3e6e98 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -49,7 +49,7 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( - // height: 60,//MediaQuery.of(context).size.height * 0.075, + // height: MediaQuery.of(context).size.height * 0.075, child: IgnorePointer( ignoring: widget.loading ||widget.disabled, child: RawMaterialButton( diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 3b65bba5..deeff358 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -3,27 +3,23 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -/* - *@author: Mohammad Aljammal - *@Date:27/4/2020 - *@param: Widget - *@return: - *@desc: Card With Bg Widget - */ class CardWithBgWidget extends StatelessWidget { final Widget widget; final Color bgColor; final bool hasBorder; + final double padding; + final double marginLeft; + final double marginSymmetric; CardWithBgWidget( - {@required this.widget, this.bgColor, this.hasBorder = true}); + {@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0}); @override Widget build(BuildContext context) { ProjectViewModel projectProvider = Provider.of(context); return Container( - margin: EdgeInsets.symmetric(vertical: 10.0), + margin: EdgeInsets.symmetric(vertical: marginSymmetric), // width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -61,15 +57,15 @@ class CardWithBgWidget extends StatelessWidget { borderRadius: BorderRadius.only( topLeft: Radius.circular(10), bottomLeft: Radius.circular(10),),), - width: 10, + width: 7, ), bottom: 1, top: 1, left: 1, ), Container( - padding: EdgeInsets.all(15.0), - margin: EdgeInsets.only(left: 10), + padding: EdgeInsets.all(padding), + margin: EdgeInsets.only(left: marginLeft), child: widget) ], ), From 7bc897bf39eb90b62b0731ec5ab7b71716f60157 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 17:13:02 +0300 Subject: [PATCH 066/102] fix profile issue --- lib/client/base_app_client.dart | 2 +- lib/config/localized_values.dart | 15 ++++++---- lib/routes.dart | 6 ++-- ...ile_page.dart => health_summary_page.dart} | 6 ++-- .../profile/in_patient_profile_screen.dart | 4 +-- .../profile_gird_for_InPatient.dart | 30 ++++++++----------- .../profile_gird_for_other.dart | 8 ++--- .../profile_gird_for_search.dart | 8 ++--- lib/screens/sick-leave/add-sickleave.dart | 8 +++-- lib/util/translations_delegate_base.dart | 10 +++++++ .../profile/PatientProfileButton.dart | 4 +-- .../profile/profile_medical_info_widget.dart | 2 +- ...rofile_medical_info_widget_in_patient.dart | 4 +-- .../profile_medical_info_widget_search.dart | 6 ++-- 14 files changed, 61 insertions(+), 52 deletions(-) rename lib/screens/medical-file/{medical_file_page.dart => health_summary_page.dart} (98%) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 83dfad00..faef1fca 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -147,7 +147,7 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 5.8; + body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 53981e90..9aba36b8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -276,8 +276,8 @@ const Map> localizedValues = { 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, "sick-leaves": {"en": "Patient Sick Leave", "ar": "الاجازات المرضية"}, - "patient-sick": {"en": "Patient Sick", "ar": "المرضية"}, - "leave": {"en": "Leave", "ar": "غادر"}, + "patient-sick": {"en": "Patient Sick", "ar": "مرضية"}, + "leave": {"en": "Leave", "ar": "مغادره"}, "submit": {"en": "Submit", "ar": "ارسال"}, "doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"}, "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, @@ -819,7 +819,7 @@ const Map> localizedValues = { "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, - "sick_leave": {"en": "Sick Leave", "ar": "أجازة مرضية"}, + "sick_leave": {"en": "Sick Leave", "ar": "إجازة مرضية"}, "addSickLeaveRequest": { "en": "Add Sick Leave Request", "ar": "إضافة طلب إجازة مرضية" @@ -928,8 +928,8 @@ const Map> localizedValues = { "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"}, "orderDate": {"en": "Order Date", "ar": "تاريخ الطلب"}, "examType": {"en": "Exam Type", "ar": "نوع الفحص"}, - "health": {"en": "Health", "ar": "التقرير"}, - "summary": {"en": "Summary", "ar": "الصحي"}, + "health": {"en": "Health", "ar": "الصحي"}, + "summary": {"en": "Summary", "ar": "التقرير"}, "applyForNewPrescriptionsOrder": { "en": "Apply for New Prescriptions Order", "ar": "التقدم بطلب للحصول على وصفات طبية جديدة " @@ -956,6 +956,11 @@ const Map> localizedValues = { 'noteAdd': {'en': 'Add ', 'ar': 'اضف '}, 'noteUpdateْْ': {'en': 'Update ', 'ar': 'تحديت'}, 'orderSheet': {'en': 'Order Sheet', 'ar': 'ورقة الطلب'}, + 'order': {'en': 'Order', 'ar': 'الطلب'}, + 'sheet': {'en': 'Sheet', 'ar': 'ورقة'}, + 'medical': {'en': 'Medical', 'ar': 'الطبي'}, + 'report': {'en': 'Report', 'ar': 'التقرير'}, + 'discharge': {'en': 'Discharge', 'ar': 'discharge'}, }; diff --git a/lib/routes.dart b/lib/routes.dart index 97f842f6..44613100 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/root_page.dart'; -import 'package:doctor_app_flutter/screens/medical-file/medical_file_page.dart'; +import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart'; @@ -37,7 +37,7 @@ const String PATIENTS = 'patients/patients'; const String PATIENTS_PROFILE = 'patients/patients-profile'; const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile'; const String LAB_RESULT = 'patients/lab_result'; -const String MEDICAL_FILE = 'patients/radiology'; +const String HEALTH_SUMMARY = 'patients/health-summary'; const String PROGRESS_NOTE = 'patients/progress-note'; const String ORDER_NOTE = 'patients/order-note'; @@ -70,7 +70,7 @@ var routes = { VERIFICATION_METHODS: (_) => VerificationMethodsScreen(), PATIENTS_PROFILE: (_) => PatientProfileScreen(), LAB_RESULT: (_) => LabsHomePage(), - MEDICAL_FILE: (_) => MedicalFilePage(), + HEALTH_SUMMARY: (_) => HealthSummaryPage(), PROGRESS_NOTE: (_) => ProgressNoteScreen(visitType: 5,), ORDER_NOTE: (_) => ProgressNoteScreen(visitType: 3,), REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/health_summary_page.dart similarity index 98% rename from lib/screens/medical-file/medical_file_page.dart rename to lib/screens/medical-file/health_summary_page.dart index b2590296..3096e775 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -11,12 +11,12 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; -class MedicalFilePage extends StatefulWidget { +class HealthSummaryPage extends StatefulWidget { @override - _MedicalFilePageState createState() => _MedicalFilePageState(); + _HealthSummaryPageState createState() => _HealthSummaryPageState(); } -class _MedicalFilePageState extends State { +class _HealthSummaryPageState extends State { PatiantInformtion patient; @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/in_patient_profile_screen.dart b/lib/screens/patients/profile/in_patient_profile_screen.dart index bce4c725..8b1c3b7e 100644 --- a/lib/screens/patients/profile/in_patient_profile_screen.dart +++ b/lib/screens/patients/profile/in_patient_profile_screen.dart @@ -141,7 +141,7 @@ class _InPatientProfileScreenState extends Statewith Sin patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summary", @@ -152,7 +152,7 @@ class _InPatientProfileScreenState extends Statewith Sin patientType: patientType, arrivalType: arrivalType, isDisable: true, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Medical", //Health //TranslationBase.of(context).medicalReport, nameLine2: "Report", //Report diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 457fe04e..59b3dd2f 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -146,12 +146,9 @@ class ProfileGridForInPatient extends StatelessWidget { route: ORDER_NOTE, isDischargedPatient: isDischargedPatient, - nameLine1: - "Order", - //"Text", + nameLine1:TranslationBase.of(context).order, nameLine2: - "Sheet", - //TranslationBase.of(context).orders, + TranslationBase.of(context).sheet, icon: 'patient/Progress_notes.png'), PatientProfileButton( @@ -176,11 +173,11 @@ class ProfileGridForInPatient extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", + route: HEALTH_SUMMARY, + nameLine1: TranslationBase.of(context).health, + nameLine2: TranslationBase.of(context).summary, isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), PatientProfileButton( @@ -188,15 +185,12 @@ class ProfileGridForInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, isDisable: true, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: - "Medical", - //Health - isInPatient: isInpatient, + TranslationBase.of(context).medical, nameLine2: - "Report", - //Report - //TranslationBase.of(context).summaryReport, + TranslationBase.of(context).report, + isInPatient: isInpatient, icon: 'patient/health_summary.png'), PatientProfileButton( @@ -246,8 +240,8 @@ class ProfileGridForInPatient extends StatelessWidget { arrivalType: arrivalType, isDisable: true, route: null, - nameLine1: "Discharge", - nameLine2: "Summery", + nameLine1: TranslationBase.of(context).discharge, + nameLine2: TranslationBase.of(context).report, icon: 'patient/patient_sick_leave.png'), PatientProfileButton( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 5b7112d6..66894e11 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -131,11 +131,9 @@ class ProfileGridForOther extends StatelessWidget { patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, + route: HEALTH_SUMMARY, + nameLine1: TranslationBase.of(context).health, + nameLine2: TranslationBase.of(context).summary, icon: 'patient/health_summary.png'), PatientProfileButton( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index ed3c4dfd..2d3679cf 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -80,11 +80,9 @@ class ProfileGridForSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, + route: HEALTH_SUMMARY, + nameLine1: TranslationBase.of(context).health, + nameLine2: TranslationBase.of(context).summary, icon: 'patient/health_summary.png'), PatientProfileButton( isInPatient: isInpatient, diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 6ee37745..a961c078 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/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'; @@ -14,11 +15,15 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart' import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; +// ignore: must_be_immutable class AddSickLeavScreen extends StatelessWidget { PatiantInformtion patient; @override Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; @@ -37,8 +42,6 @@ class AddSickLeavScreen extends StatelessWidget { ), body: SingleChildScrollView( child: Column(children: [ - // PatientProfileHeaderNewDesign( - // patient, routeArgs['patientType'], routeArgs['arrivalType']), patient.patientStatusType == 43 ? Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -48,6 +51,7 @@ class AddSickLeavScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(!projectsProvider.isArabic) AppText( TranslationBase.of(context).patient, fontWeight: FontWeight.bold, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 0519d99e..8bf49397 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1325,6 +1325,16 @@ class TranslationBase { String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; + String get order => + localizedValues["order"][locale.languageCode]; + String get sheet => + localizedValues["sheet"][locale.languageCode]; + String get medical => + localizedValues["medical"][locale.languageCode]; + String get report => + localizedValues["report"][locale.languageCode]; + String get discharge => + localizedValues["discharge"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 9a027e36..f7c60623 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -77,7 +77,7 @@ class PatientProfileButton extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - this.nameLine1, + !projectsProvider.isArabic?this.nameLine1: nameLine2, color: Colors.black, /*Color(0xFFB9382C),*/ fontWeight: FontWeight.w600, @@ -85,7 +85,7 @@ class PatientProfileButton extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 1.5, ), AppText( - this.nameLine2, + !projectsProvider.isArabic? this.nameLine2:nameLine1, color: Colors.black, fontWeight: FontWeight.w600, textAlign: TextAlign.left, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index a469138c..c5417d85 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -52,7 +52,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health" ,//TranslationBase.of(context).medicalReport, nameLine2: "Summary",//TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index eea3bfbb..17feaf0a 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -113,7 +113,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summary", @@ -125,7 +125,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, isDisable: true, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Medical", //Health //TranslationBase.of(context).medicalReport, nameLine2: "Report", //Report diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index c03367bc..ac33eb82 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -173,7 +173,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summary", @@ -185,7 +185,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, isDisable: true, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Medical", //Health //TranslationBase.of(context).medicalReport, nameLine2: "Report", //Report @@ -256,7 +256,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: From 6153c81aa42715cca24aa7ce514e478ae032f7f0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 17:14:58 +0300 Subject: [PATCH 067/102] small fix --- lib/screens/doctor/doctor_reply_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index dcbe9667..f522561f 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -34,7 +34,7 @@ class DoctorReplyScreen extends StatelessWidget { }, child: AppScaffold( baseViewModel: model, - appBarTitle: "ghgh",//TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem) From b43b7cafccfaef849c2b710abcb0ad87d723489a Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 2 May 2021 17:26:19 +0300 Subject: [PATCH 068/102] working on in-patient screen design --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 1 + lib/core/service/patientInPatientService.dart | 8 +- .../viewModel/PatientSearchViewModel.dart | 120 ++++----- .../patients/DischargedPatientPage.dart | 10 +- lib/screens/patients/InPatientPage.dart | 164 ++++++++++++ .../patients/PatientsInPatientScreen.dart | 251 +++++++----------- .../profile_gird_for_InPatient.dart | 2 +- lib/util/translations_delegate_base.dart | 4 +- .../profile/PatientProfileButton.dart | 6 +- pubspec.lock | 8 +- 11 files changed, 352 insertions(+), 224 deletions(-) create mode 100644 lib/screens/patients/InPatientPage.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 9596a029..62625b40 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -336,7 +336,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.8; +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 d5999b21..b975f6d9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -946,4 +946,5 @@ const Map> localizedValues = { "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, + "discharged": {"en": "Discharged", "ar": "المصرف"}, }; diff --git a/lib/core/service/patientInPatientService.dart b/lib/core/service/patientInPatientService.dart index 3e0ba4a4..6ec77514 100644 --- a/lib/core/service/patientInPatientService.dart +++ b/lib/core/service/patientInPatientService.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class PatientInPatientService extends BaseService { List inPatientList = List(); + List myInPatientList = List(); Future getInPatientList( PatientSearchRequestModel requestModel, bool isMyInpatient) async { @@ -21,9 +22,14 @@ class PatientInPatientService extends BaseService { GET_PATIENT_IN_PATIENT_LIST, onSuccess: (dynamic response, int statusCode) { inPatientList.clear(); + myInPatientList.clear(); response['List_MyInPatient'].forEach((v) { - inPatientList.add(PatiantInformtion.fromJson(v)); + PatiantInformtion patient = PatiantInformtion.fromJson(v); + inPatientList.add(patient); + if(patient.doctorId == doctorProfile.doctorID){ + myInPatientList.add(patient); + } }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 8192b1a8..edf9142a 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -9,7 +9,7 @@ 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,76 +113,78 @@ 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(); + List get inPatientList => _inPatientService.inPatientList; - PatientInPatientService _inPatientService = - locator(); + List get myIinPatientList => + _inPatientService.myInPatientList; - List get _inPatientList => _inPatientService.inPatientList; List filteredInPatientItems = List(); Future getInPatientList(PatientSearchRequestModel requestModel, - {bool isMyInpatient = false, bool isFirstTime = true}) async { - await getDoctorProfile(); - if (isFirstTime) + {bool isMyInpatient = false}) async { + await getDoctorProfile(); setState(ViewState.Busy); - else - setState(ViewState.BusyLocal); - await _inPatientService.getInPatientList(requestModel, false); + + if (inPatientList.length == 0) + await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { error = _inPatientService.error; setState(ViewState.Error); } else { filteredInPatientItems.clear(); - if (_inPatientList.length > 0) - filteredInPatientItems.addAll(_inPatientList); + if (inPatientList.length > 0) + filteredInPatientItems.addAll(inPatientList); setState(ViewState.Idle); } } + void clearPatientList(){ + _inPatientService.inPatientList = []; + _inPatientService.myInPatientList = []; + } + void filterSearchResults(String query) { var strExist = query.length > 0 ? true : false; if (strExist) { filteredInPatientItems = []; - for (var i = 0; i < _inPatientList.length; i++) { - String firstName = _inPatientList[i].firstName.toUpperCase(); - String lastName = _inPatientList[i].lastName.toUpperCase(); - String mobile = _inPatientList[i].mobileNumber.toUpperCase(); - String patientID = _inPatientList[i].patientId.toString(); + for (var i = 0; i < inPatientList.length; i++) { + String firstName = inPatientList[i].firstName.toUpperCase(); + String lastName = inPatientList[i].lastName.toUpperCase(); + String mobile = inPatientList[i].mobileNumber.toUpperCase(); + String patientID = inPatientList[i].patientId.toString(); if (firstName.contains(query.toUpperCase()) || lastName.contains(query.toUpperCase()) || mobile.contains(query) || patientID.contains(query)) { - filteredInPatientItems.add(_inPatientList[i]); + filteredInPatientItems.add(inPatientList[i]); } } 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/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 28f7b834..8e183ca8 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -29,12 +29,15 @@ class _DischargedPatientState extends State { appBarTitle: 'Discharged Patient', subtitle: "Last Three Months", backgroundColor: Colors.grey[200], - isShowAppBar: true, + isShowAppBar: false, baseViewModel: model, - body: model.myDischargedPatient.isEmpty?Center( + body: model.myDischargedPatient.isEmpty? Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), SizedBox( height: 100, ), @@ -53,6 +56,9 @@ class _DischargedPatientState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), SizedBox(height: 12,), Container( width: double.maxFinite, diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart new file mode 100644 index 00000000..e26a5d9a --- /dev/null +++ b/lib/screens/patients/InPatientPage.dart @@ -0,0 +1,164 @@ +import 'package:doctor_app_flutter/core/model/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'; +import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; + +import '../../routes.dart'; + +class InPatientPage extends StatefulWidget { + + final bool isMyInPatient; + + InPatientPage(this.isMyInPatient); + + @override + _InPatientPageState createState() => _InPatientPageState(); +} + +class _InPatientPageState extends State { + TextEditingController _searchController = TextEditingController(); + PatientSearchRequestModel requestModel = PatientSearchRequestModel(); + + @override + void dispose() { + _searchController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getInPatientList(requestModel), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + Container( + margin: EdgeInsets.all(16.0), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).searchPatientName, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), + controller: _searchController, + onChanged: (value) { + model.filterSearchResults(value); + }), + ), + model.filteredInPatientItems.length > 0 + ? Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...List.generate( + model.filteredInPatientItems.length, (index) { + if (!widget.isMyInPatient) + return PatientCard( + patientInfo: + model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, + onTap: () { + 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", + }); + }, + ); + else if (model.filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID && + widget.isMyInPatient) + return PatientCard( + patientInfo: + model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, + onTap: () { + 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", + }); + }, + ); + else + return SizedBox(); + }), + SizedBox( + height: 15, + ) + ], + ), + ), + ), + ) + : Expanded( + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: + TranslationBase.of(context).noDataAvailable)), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 7d41b3cb..cdd8b357 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -15,22 +15,36 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils. import 'package:flutter/material.dart'; import '../../routes.dart'; +import 'DischargedPatientPage.dart'; +import 'InPatientPage.dart'; class PatientInPatientScreen extends StatefulWidget { @override _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); } -class _PatientInPatientScreenState extends State { - PatientSearchRequestModel requestModel = PatientSearchRequestModel(); +class _PatientInPatientScreenState extends State with SingleTickerProviderStateMixin{ + + TabController _tabController; int _activeTab = 0; - TextEditingController _searchController = TextEditingController(); + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + _tabController.addListener(_handleTabSelection); + } @override void dispose() { - _searchController.dispose(); super.dispose(); + _tabController.dispose(); + } + + _handleTabSelection() { + setState(() { + _activeTab = _tabController.index; + }); } @override @@ -38,7 +52,7 @@ class _PatientInPatientScreenState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getInPatientList(requestModel), + onModelReady: (model) => model.clearPatientList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, @@ -71,168 +85,107 @@ class _PatientInPatientScreenState extends State { ]), ), ), - tabsBar(context, screenSize, model), - Container( - margin: EdgeInsets.all(16.0), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchPatientName, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - ), - onPressed: () {}, - ), - controller: _searchController, - onChanged: (value) { - model.filterSearchResults(value); - }), - ), - model.filteredInPatientItems.length > 0 - ? Expanded( - child: Container( - margin: EdgeInsets.symmetric(horizontal: 16.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // const SizedBox( - // height: 16, - // ), - ...List.generate(model.filteredInPatientItems.length, (index) { - if(_activeTab == 0) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, - onTap: () { - 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", - }); - }, - ); - else if(model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID && _activeTab==1) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, - onTap: () { - 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", - }); - }, - ); - else return SizedBox(); - }), - SizedBox(height: 15,) - ], + Expanded( + child: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.5), //width: 0.7 ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll.toUpperCase(), counter: model.inPatientList.length), + tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient.toUpperCase(), counter: model.myIinPatientList.length), + tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged.toUpperCase()), + ], ), ), - ) - : Expanded( - child: SingleChildScrollView( - child: Container( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable)), ), ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + InPatientPage(false), + InPatientPage(true), + DischargedPatient(), + ], + ), + ), + ], + ), + ), + ), ], ), ), ); } - Widget tabsBar( - BuildContext context, Size screenSize, PatientSearchViewModel model) { - List _tabs = [ - TranslationBase.of(context).inPatientAll.toUpperCase(), - TranslationBase.of(context).inPatient.toUpperCase(), - ]; - - return Container( - 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: _tabs.map((item) { - bool _isActive = _tabs[_activeTab] == item ? true : false; + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}){ - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeTab = _tabs.indexOf(item); - }); - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } - if (_activeTab==0) { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getInPatientList(requestModel, - isMyInpatient: _activeTab == 1, isFirstTime: false); - 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( + return 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: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.8, + color: isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + if (counter != -1) + Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive + ? Colors.white + : Color(0xFFD02127), + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : Color(0xFFD02127), fontWeight: FontWeight.w700, ), ), ), ), - ), - ); - }).toList(), + ], + ), ), ); } diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 457fe04e..51aa78d4 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -39,7 +39,7 @@ class ProfileGridForInPatient extends StatelessWidget { NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, + childAspectRatio: 1 / 1.02, crossAxisCount: 3, children: [ PatientProfileButton( diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index cc6513d0..6413865b 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1301,8 +1301,8 @@ class TranslationBase { String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => - localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get discharged => localizedValues["discharged"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 9a027e36..7907cac1 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -47,8 +47,8 @@ class PatientProfileButton extends StatelessWidget { ProjectViewModel projectsProvider = Provider.of(context); return new Container( - margin: new EdgeInsets.symmetric(horizontal: 4.0), - padding: EdgeInsets.fromLTRB(10, 10, 10, 5), + margin: EdgeInsets.symmetric(horizontal: 0.0), + padding: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: isDisable ? null @@ -72,7 +72,7 @@ class PatientProfileButton extends StatelessWidget { )), Container( alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, - padding: EdgeInsets.all(5), + padding: EdgeInsets.symmetric(horizontal: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/pubspec.lock b/pubspec.lock index e9386145..9d52ce65 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: @@ -608,7 +608,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: @@ -900,7 +900,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: @@ -1091,5 +1091,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 c6ac82981332272b2ff0c8b792a5b8e2d8194210 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 2 May 2021 17:38:57 +0300 Subject: [PATCH 069/102] hot fixes in PatientReferralScreen --- lib/screens/home/home_screen.dart | 78 ------------------- .../patients/DischargedPatientPage.dart | 13 ++-- .../ReferralDischargedPatientPage.dart | 2 +- .../referral/patient_referral_screen.dart | 4 +- 4 files changed, 10 insertions(+), 87 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 36f86c85..e95f1d1e 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -655,84 +655,6 @@ class _HomeScreenState extends State { ); }, ), - // HomePageCard( - // color: Colors.red[800], - // margin: EdgeInsets.all(5), - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.center, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Padding( - // padding: EdgeInsets.only( - // top: 10, left: 10, right: 0), - // child: Icon( - // DoctorApp.discharge_patients, - // size: 35, - // color: Colors.white, - // )), - // Container( - // padding: EdgeInsets.all(10), - // child: AppText( - // 'Discharged Patients', - // color: Colors.white, - // textAlign: TextAlign.start, - // fontSize: 15, - // )) - // ], - // ), - // hasBorder: false, - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // DischargedPatient(), - // // MyReferredPatient(), - // ), - // ); - // }, - // ), - // 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: Icon( - // DoctorApp.referral_discharge, - // size: 35, - // color: Colors.black, - // )), - // Container( - // padding: EdgeInsets.all(10), - // child: AppText( - // 'Referral Discharged', - // color: Colors.black, - // textAlign: TextAlign.start, - // fontSize: 15, - // )) - // ], - // ), - // hasBorder: false, - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // ReferralDischargedPatientPage(), - // // MyReferredPatient(), - // ), - // ); - // }, - // ), HomePageCard( color: Color(0xffD02127), margin: EdgeInsets.all(5), diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 0d0682dc..e4138305 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -103,10 +103,10 @@ class _DischargedPatientState extends State { }), ])), SizedBox(height: 5,), - Expanded( - child: ListView.builder( - itemCount: model.filterData.length, - itemBuilder: (context,index)=>InkWell( + Expanded(child: SingleChildScrollView( + child: Column( + children: [ + ...List.generate(model.filterData.length, (index) => InkWell( onTap: () { Navigator.of(context) .pushNamed( @@ -330,8 +330,9 @@ class _DischargedPatientState extends State { ), ), )), - ), - + ], + ), + )) ], ), ), diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 6da969d1..b9860af8 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -25,7 +25,7 @@ class _ReferralDischargedPatientPageState extends State AppScaffold( appBarTitle: 'Referral Discharged ', backgroundColor: Colors.grey[200], - isShowAppBar: true, + isShowAppBar: false, baseViewModel: model, body: model.myDischargeReferralPatient.isEmpty?Center( child: Column( diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index de106524..c5aaed7a 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils. import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../../DischargedPatientPage.dart'; +import '../../ReferralDischargedPatientPage.dart'; import 'my-referral-inpatient-screen.dart'; class PatientReferralScreen extends StatefulWidget { @@ -171,7 +171,7 @@ class _PatientReferralScreen extends State with SingleTic children: [ ReferredPatientScreen(), MyReferralInPatientScreen(), - DischargedPatient() + ReferralDischargedPatientPage() // MyReferredPatient(), ], ), From eb74002cf05cf12532960dcc7c50736749717d3b Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 2 May 2021 17:45:49 +0300 Subject: [PATCH 070/102] hot fix --- lib/config/localized_values.dart | 4 ++-- lib/screens/patients/PatientsInPatientScreen.dart | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d9c6e936..183b2a0f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,9 +47,9 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'}, + 'inPatient': {'en': 'My Patients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, - 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'}, + 'inPatientAll': {'en': 'All Patients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index cdd8b357..1a12c414 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -110,9 +110,9 @@ class _PatientInPatientScreenState extends State with Si labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ - tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll.toUpperCase(), counter: model.inPatientList.length), - tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient.toUpperCase(), counter: model.myIinPatientList.length), - tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged.toUpperCase()), + tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), + tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient, counter: model.myIinPatientList.length), + tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), ], ), ), @@ -158,7 +158,7 @@ class _PatientInPatientScreenState extends State with Si children: [ AppText( title, - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier * 1.6, color: isActive ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), From 8e4d9d96929a63caaf311dcc1e64fd528c0325af Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 21:16:25 +0300 Subject: [PATCH 071/102] hot fix --- lib/core/viewModel/PatientSearchViewModel.dart | 1 + lib/screens/patients/out_patient/out_patient_screen.dart | 3 ++- lib/widgets/shared/text_fields/app-textfield-custom.dart | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 8192b1a8..36d51248 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -86,6 +86,7 @@ class PatientSearchViewModel extends BaseViewModel{ bool isSearchWithKeyInfo })async { String dateTo; String dateFrom; + // TODO Fix this in Arabic if (item == 'Previous') { selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month-1, diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index e2e6e94c..f9e4bfd7 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,6 +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/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; @@ -164,7 +165,7 @@ class _OutPatientsScreenState extends State { color: _isActive ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), - _isActive&&_activeLocation!=0 ?Container( + _isActive&&_activeLocation!=0&&model.state == ViewState.Idle ?Container( padding: EdgeInsets.all(2), margin: EdgeInsets.symmetric(horizontal: 5), decoration: diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 12eaaa7c..da92f574 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -37,7 +37,7 @@ class AppTextFieldCustom extends StatefulWidget { this.suffixIcon, this.dropDownColor, this.enabled = true, - this.inputType = TextInputType.text, + this.inputType, this.minLines = 1, this.maxLines = 1, this.inputFormatters, @@ -106,7 +106,7 @@ class _AppTextFieldCustomState extends State { color: Color(0xFF575757), ), controller: widget.controller, - keyboardType: widget.inputType, + keyboardType: widget.inputType?? (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline), enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, From 6fba03ed690137493111d7de5069f1ed6708c985 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 3 May 2021 11:58:50 +0300 Subject: [PATCH 072/102] design fixes --- .../viewModel/PatientSearchViewModel.dart | 13 +- lib/screens/patients/InPatientPage.dart | 190 +++++----- .../patients/PatientsInPatientScreen.dart | 13 +- .../PatientProfileCardModel.dart | 25 ++ .../profile_gird_for_InPatient.dart | 349 ++++++------------ .../profile/PatientProfileButton.dart | 78 ++-- pubspec.lock | 7 + pubspec.yaml | 1 + 8 files changed, 302 insertions(+), 374 deletions(-) create mode 100644 lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index edf9142a..3c8d7180 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -151,13 +151,20 @@ class PatientSearchViewModel extends BaseViewModel { error = _inPatientService.error; setState(ViewState.Error); } else { - filteredInPatientItems.clear(); - if (inPatientList.length > 0) - filteredInPatientItems.addAll(inPatientList); + // setDefaultInPatientList(); setState(ViewState.Idle); } } + Future setDefaultInPatientList() async { + setState(ViewState.BusyLocal); + await getDoctorProfile(); + filteredInPatientItems.clear(); + if (inPatientList.length > 0) + filteredInPatientItems.addAll(inPatientList); + setState(ViewState.Idle); + } + void clearPatientList(){ _inPatientService.inPatientList = []; _inPatientService.myInPatientList = []; diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index e26a5d9a..1b42d305 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -1,17 +1,16 @@ -import 'package:doctor_app_flutter/core/model/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'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import '../../routes.dart'; class InPatientPage extends StatefulWidget { - final bool isMyInPatient; InPatientPage(this.isMyInPatient); @@ -22,7 +21,6 @@ class InPatientPage extends StatefulWidget { class _InPatientPageState extends State { TextEditingController _searchController = TextEditingController(); - PatientSearchRequestModel requestModel = PatientSearchRequestModel(); @override void dispose() { @@ -33,7 +31,9 @@ class _InPatientPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getInPatientList(requestModel), + onModelReady: (model) async { + await model.setDefaultInPatientList(); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, @@ -62,100 +62,100 @@ class _InPatientPageState extends State { ), model.filteredInPatientItems.length > 0 ? Expanded( - child: Container( - margin: EdgeInsets.symmetric(horizontal: 16.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...List.generate( - model.filteredInPatientItems.length, (index) { - if (!widget.isMyInPatient) - return PatientCard( - patientInfo: - model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: model - .filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = - FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...List.generate( + model.filteredInPatientItems.length, (index) { + if (!widget.isMyInPatient) + return PatientCard( + patientInfo: + model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, + onTap: () { + 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", - }); - }, - ); - else if (model.filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID && - widget.isMyInPatient) - return PatientCard( - patientInfo: - model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: model - .filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID, - onTap: () { - 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", + }); + }, + ); + else if (model.filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID && + widget.isMyInPatient) + return PatientCard( + patientInfo: + model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, + onTap: () { + 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", - }); - }, - ); - else - return SizedBox(); - }), - SizedBox( - height: 15, - ) - ], - ), - ), - ), - ) + 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(); + }), + 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)), + ), + ), ], ), ), diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 1a12c414..6f2bafd9 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -1,20 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/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'; -import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; -import '../../routes.dart'; import 'DischargedPatientPage.dart'; import 'InPatientPage.dart'; @@ -50,9 +43,13 @@ class _PatientInPatientScreenState extends State with Si @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + PatientSearchRequestModel requestModel = PatientSearchRequestModel(); return BaseView( - onModelReady: (model) => model.clearPatientList(), + onModelReady: (model) async { + model.clearPatientList(); + model.getInPatientList(requestModel); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart new file mode 100644 index 00000000..3b566d81 --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -0,0 +1,25 @@ +class PatientProfileCardModel { + final String nameLine1; + final String nameLine2; + final dynamic route; + final String icon; + final bool isInPatient; + final bool isDisable; + final bool isLoading; + final Function onTap; + final bool isDischargedPatient; + final bool isSelectInpatient; + + PatientProfileCardModel( + this.nameLine1, + this.nameLine2, + this.route, + this.icon, { + this.isInPatient = false, + this.isDisable = false, + this.isLoading = false, + this.onTap, + this.isDischargedPatient = false, + this.isSelectInpatient = false, + }); +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index e137730c..1df7d236 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; @@ -17,252 +19,135 @@ class ProfileGridForInPatient extends StatelessWidget { String from; String to; - ProfileGridForInPatient( + ProfileGridForInPatient( {Key key, this.patient, this.patientType, this.arrivalType, this.height, - this.isInpatient, this.from,this.to, this.isDischargedPatient, this.isFromSearch}) + this.isInpatient, + this.from, + this.to, + this.isDischargedPatient, + this.isFromSearch}) : super(key: key); @override Widget build(BuildContext context) { + final List cardsList = [ + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).result, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).progress, + TranslationBase.of(context).note, + PROGRESS_NOTE, + 'patient/Progress_notes.png', + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).order, + TranslationBase.of(context).sheet, + ORDER_NOTE, + 'patient/Progress_notes.png', + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).medical, + TranslationBase.of(context).report, + HEALTH_SUMMARY, + 'patient/health_summary.png', + isInPatient: isInpatient, + isDisable: true), + PatientProfileCardModel( + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, + REFER_IN_PATIENT_TO_DOCTOR, + 'patient/refer_patient.png', + isInPatient: isInpatient, + isDisable: isDischargedPatient || isFromSearch, + ), + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).approvals, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).discharge, + TranslationBase.of(context).report, + null, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + isDisable: true), + PatientProfileCardModel( + TranslationBase.of(context).patientSick, + TranslationBase.of(context).leave, + ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), + ]; + return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: StaggeredGridView.countBuilder( shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.02, crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - isSelectInpatient: true, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: - isDischargedPatient, - nameLine1: - TranslationBase - .of( - context) - .progress, - nameLine2: - TranslationBase - .of( - context) - .note, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1:TranslationBase.of(context).order, - nameLine2: - TranslationBase.of(context).sheet, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: TranslationBase.of(context).health, - nameLine2: TranslationBase.of(context).summary, - isInPatient: isInpatient, - - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: HEALTH_SUMMARY, - nameLine1: - TranslationBase.of(context).medical, - nameLine2: - TranslationBase.of(context).report, - isInPatient: isInpatient, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: - isDischargedPatient || - isFromSearch, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .approvals, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: TranslationBase.of(context).discharge, - nameLine2: TranslationBase.of(context).report, - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - ], + itemCount: cardsList.length, + staggeredTileBuilder: (int index) => StaggeredTile.fit(1), + itemBuilder: (BuildContext context, int index) => PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: cardsList[index].nameLine1, + nameLine2: cardsList[index].nameLine2, + route: cardsList[index].route, + icon: cardsList[index].icon, + isInPatient: cardsList[index].isInPatient, + isDischargedPatient: cardsList[index].isDischargedPatient, + isDisable: cardsList[index].isDisable, + onTap: cardsList[index].onTap, + isLoading: cardsList[index].isLoading, + ), ), ); } diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index b2df6218..0c2fd2f9 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -24,31 +24,33 @@ class PatientProfileButton extends StatelessWidget { final Function onTap; final bool isDischargedPatient; final bool isSelectInpatient; - PatientProfileButton( - {Key key, - this.patient, - this.patientType, - this.arrivalType, - this.nameLine1, - this.nameLine2, - this.icon, - this.route, - this.isDisable = false, - this.onTap, - this.isLoading = false, - this.from, - this.to, - this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false, - }) - : super(key: key); + + PatientProfileButton({ + Key key, + this.patient, + this.patientType, + this.arrivalType, + this.nameLine1, + this.nameLine2, + this.icon, + this.route, + this.isDisable = false, + this.onTap, + this.isLoading = false, + this.from, + this.to, + this.isInPatient = false, + this.isDischargedPatient = false, + this.isSelectInpatient = false, + }) : super(key: key); @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - return new Container( - margin: EdgeInsets.symmetric(horizontal: 0.0), - padding: EdgeInsets.symmetric(horizontal: 4), + return Container( + margin: EdgeInsets.symmetric(horizontal: 0.0), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), child: InkWell( onTap: isDisable ? null @@ -59,25 +61,30 @@ class PatientProfileButton extends StatelessWidget { }, child: Column(children: [ Container( + padding: EdgeInsets.fromLTRB(8, 0, 8, 8), child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - child: new Image.asset( - url + icon, - width: 50, - height: 50, - ),) - ], - )), + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: new Image.asset( + url + icon, + width: 30, + height: 30, + fit: BoxFit.contain, + ), + ) + ], + )), Container( - alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, padding: EdgeInsets.symmetric(horizontal: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - !projectsProvider.isArabic?this.nameLine1: nameLine2, + !projectsProvider.isArabic ? this.nameLine1 : nameLine2, color: Colors.black, /*Color(0xFFB9382C),*/ fontWeight: FontWeight.w600, @@ -85,7 +92,7 @@ class PatientProfileButton extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 1.5, ), AppText( - !projectsProvider.isArabic? this.nameLine2:nameLine1, + !projectsProvider.isArabic ? this.nameLine2 : nameLine1, color: Colors.black, fontWeight: FontWeight.w600, textAlign: TextAlign.left, @@ -118,8 +125,7 @@ class PatientProfileButton extends StatelessWidget { } void navigator(BuildContext context, route) { - if(route == null) - return; + if (route == null) return; if (from == null) { from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); @@ -127,7 +133,7 @@ class PatientProfileButton extends StatelessWidget { if (to == null) { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - if(arrivalType == null){ + if (arrivalType == null) { arrivalType = "0"; } Navigator.of(context).pushNamed(route, arguments: { diff --git a/pubspec.lock b/pubspec.lock index 9d52ce65..ee31002d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: diff --git a/pubspec.yaml b/pubspec.yaml index 58dd50be..b4532e42 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,6 +41,7 @@ dependencies: eva_icons_flutter: ^2.0.0 font_awesome_flutter: ^8.11.0 dropdown_search: ^0.4.8 + flutter_staggered_grid_view: ^0.3.2 expandable: ^4.1.4 From 7559ab31c0e3182ccd0d802a25f981ddc98fe96a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 3 May 2021 12:45:15 +0300 Subject: [PATCH 073/102] fix out patient + fix steper in arabic --- .../viewModel/PatientSearchViewModel.dart | 8 +-- .../out_patient/out_patient_screen.dart | 2 +- .../shared_soap_widgets/SOAP_step_header.dart | 1 - .../shared_soap_widgets/steps_widget.dart | 52 ++++++++++++------- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 36d51248..5b5a99a3 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,3 +1,4 @@ +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 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; @@ -83,11 +84,10 @@ class PatientSearchViewModel extends BaseViewModel{ getPatientBasedOnDate ( {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, - bool isSearchWithKeyInfo })async { + bool isSearchWithKeyInfo,OutPatientFilterType outPatientFilterType })async { String dateTo; String dateFrom; - // TODO Fix this in Arabic - if (item == 'Previous') { + if (OutPatientFilterType.Previous == outPatientFilterType) { selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month-1, DateTime.now().day); @@ -101,7 +101,7 @@ class PatientSearchViewModel extends BaseViewModel{ 'yyyy-MM-dd'); - } else if (item == 'Next Week') { + } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = DateUtils.convertDateToFormat( diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index f9e4bfd7..3052c77d 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -142,7 +142,7 @@ class _OutPatientsScreenState extends State { selectedPatientType: widget.selectedPatientType, patientSearchRequestModel: widget .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); GifLoaderDialogUtils.hideDialog(context); }, child: Center( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index da1abd28..85614b6d 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -33,7 +33,6 @@ class SOAPStepHeader extends StatelessWidget { child: StepsWidget( index: currentIndex, changeCurrentTab: changePageViewIndex, - height: 100, ), ), SizedBox( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart index 059674a8..c5c2e8ca 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart @@ -20,23 +20,26 @@ class StepsWidget extends StatelessWidget { ? Stack( children: [ Container( - height: height == 0 ? 150 : height, + height: height == 0 ? 100 : height, width: MediaQuery.of(context).size.width * 0.9, color: Colors.transparent, ), Positioned( top: 30 - , - child: Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.9, - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, - ), + , + child: Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * 0.9, + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, ), - )), + ), + ),), Positioned( top: 10, left: 0, @@ -260,17 +263,26 @@ class StepsWidget extends StatelessWidget { : Stack( children: [ Container( - height: height == 0 ? 150 : height, - width: MediaQuery.of(context).size.width, + height: height == 0 ? 100 : height, + width: MediaQuery.of(context).size.width * 0.9, color: Colors.transparent, + ), + Positioned( + top: 30 + , child: Center( - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, + child: Container( + width: MediaQuery + .of(context) + .size + .width * 0.9, + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), ), - ), - ), + ),), Positioned( top: 10, right: 0, @@ -303,7 +315,7 @@ class StepsWidget extends StatelessWidget { color: Colors.white, )), ), - SizedBox(height: 5), + SizedBox(height: 3), Column( children: [ AppText( From c3c4b662711df3c8660b460c7ba8b75e431798a6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 3 May 2021 13:18:55 +0300 Subject: [PATCH 074/102] refactor search file name --- lib/routes.dart | 2 - lib/screens/home/home_screen.dart | 7 +- .../search_medicine_patient_screen.dart | 112 -- .../out_patient/out_patient_screen.dart | 4 +- ...header.dart => patient_search_header.dart} | 4 +- ...dart => patient_search_result_screen.dart} | 105 +- ...en_new.dart => patient_search_screen.dart} | 123 +- .../patients/patient_search_screen.dart | 641 ----------- lib/screens/patients/patients_screen.dart | 1005 ----------------- 9 files changed, 26 insertions(+), 1977 deletions(-) delete mode 100644 lib/screens/medicine/search_medicine_patient_screen.dart rename lib/screens/patients/patient_search/{header.dart => patient_search_header.dart} (88%) rename lib/screens/patients/patient_search/{patients_screen_new.dart => patient_search_result_screen.dart} (64%) rename lib/screens/patients/patient_search/{patient_search_screen_new.dart => patient_search_screen.dart} (56%) delete mode 100644 lib/screens/patients/patient_search_screen.dart delete mode 100644 lib/screens/patients/patients_screen.dart diff --git a/lib/routes.dart b/lib/routes.dart index 44613100..2684cd82 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -17,7 +17,6 @@ import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import './screens/auth/login_screen.dart'; import './screens/auth/verification_methods_screen.dart'; -import './screens/patients/patients_screen.dart'; import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import 'landing_page.dart'; @@ -66,7 +65,6 @@ var routes = { ROOT: (_) => RootPage(), HOME: (_) => LandingPage(), LOGIN: (_) => Loginsreen(), - PATIENTS: (_) => PatientsScreen(), VERIFICATION_METHODS: (_) => VerificationMethodsScreen(), PATIENTS_PROFILE: (_) => PatientProfileScreen(), LAB_RESULT: (_) => LabsHomePage(), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 36f86c85..f6f1d85b 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -19,9 +19,8 @@ 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_new.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search_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'; @@ -782,7 +781,7 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => - PatientSearchScreenNew(), + PatientSearchScreen(), )); }, ), diff --git a/lib/screens/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart deleted file mode 100644 index d80c065b..00000000 --- a/lib/screens/medicine/search_medicine_patient_screen.dart +++ /dev/null @@ -1,112 +0,0 @@ -import 'dart:ui'; - -import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class SearchMedicinePatientScreen extends StatefulWidget { - @override - _SearchMedicinePatientScreen createState() => _SearchMedicinePatientScreen(); -} - -class _SearchMedicinePatientScreen extends State - with SingleTickerProviderStateMixin { - TabController _tabController; - var activeIndex = 0; - @override - void initState() { - super.initState(); - _tabController = TabController(length: 2, vsync: this); - } - - @override - void dispose() { - super.dispose(); - _tabController.dispose(); - } - - @override - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).searchmedicinepatient, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.92, // 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 - ), - color: Colors.white), - child: TabBar( - isScrollable: true, - onTap: (index) { - setState(() { - activeIndex = index; - }); - }, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 30.0, right: 30.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: Center( - child: AppText( - TranslationBase.of(context).searchPatient, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 14, - ), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: Center( - child: AppText( - TranslationBase.of(context).searchMedicine, - fontWeight: FontWeight.bold, - fontSize: 14, - color: Colors.black), - ), - ), - ], - ), - ), - ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - PatientSearchScreen(), - MedicineSearchScreen() - ], - ), - ) - ], - ), - )); - } -} diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 3052c77d..8d1d2eb8 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -10,7 +10,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -103,7 +103,7 @@ class _OutPatientsScreenState extends State { builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", isShowAppBar: true, - appBar: HeaderInSearch( + appBar: PatientSearchHeader( title: "My Out patient", ), diff --git a/lib/screens/patients/patient_search/header.dart b/lib/screens/patients/patient_search/patient_search_header.dart similarity index 88% rename from lib/screens/patients/patient_search/header.dart rename to lib/screens/patients/patient_search/patient_search_header.dart index 0fbcdf1a..b9afab7d 100644 --- a/lib/screens/patients/patient_search/header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -2,10 +2,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class HeaderInSearch extends StatelessWidget with PreferredSizeWidget { +class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { final String title; - const HeaderInSearch({Key key, this.title}) : super(key: key); + const PatientSearchHeader({Key key, this.title}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart similarity index 64% rename from lib/screens/patients/patient_search/patients_screen_new.dart rename to lib/screens/patients/patient_search/patient_search_result_screen.dart index 7074bda9..0f536fcd 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -8,26 +8,19 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable -class PatientsScreenNew extends StatefulWidget { - final patientSearchForm; - final selectedType; - final isAppbar; - final arrivalType; - final isView; +class PatientsSearchResultScreen extends StatefulWidget { final PatientType selectedPatientType; final PatientSearchRequestModel patientSearchRequestModel; final bool isSearchWithKeyInfo; @@ -37,29 +30,27 @@ class PatientsScreenNew extends StatefulWidget { final String searchKey; - PatientsScreenNew( - {this.patientSearchForm, - this.selectedType, - this.isAppbar = true, - this.arrivalType, - this.isView, + PatientsSearchResultScreen( + { this.selectedPatientType, 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(); + _PatientsSearchResultScreenState createState() => + _PatientsSearchResultScreenState(); } -class _PatientsScreenNewState extends State { +class _PatientsSearchResultScreenState + extends State { int clinicId; AuthViewModel authProvider; - List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; - int _activeLocation = 0; String patientType; String patientTypeTitle; var selectedFilter = 1; @@ -74,14 +65,6 @@ class _PatientsScreenNewState extends State { @override Widget build(BuildContext context) { authProvider = Provider.of(context); - _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, - ]; - final screenSize = MediaQuery.of(context).size; - - return BaseView( onModelReady: (model) async { if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { @@ -95,72 +78,12 @@ class _PatientsScreenNewState extends State { 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}", - ), + appBar: PatientSearchHeader( + 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(), - ), - ), - SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen.dart similarity index 56% rename from lib/screens/patients/patient_search/patient_search_screen_new.dart rename to lib/screens/patients/patient_search/patient_search_screen.dart index 5270511d..dc6d3587 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -4,11 +4,10 @@ import 'package:doctor_app_flutter/core/model/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'; -import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_result_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -17,12 +16,12 @@ import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -class PatientSearchScreenNew extends StatefulWidget { +class PatientSearchScreen extends StatefulWidget { @override - _PatientSearchScreenNewState createState() => _PatientSearchScreenNewState(); + _PatientSearchScreenState createState() => _PatientSearchScreenState(); } -class _PatientSearchScreenNewState extends State { +class _PatientSearchScreenState extends State { bool showOther = false; bool isFormSubmitted = false; TextEditingController patientFileInfoController = TextEditingController(); @@ -57,46 +56,6 @@ class _PatientSearchScreenNewState extends State { SizedBox( height: 16, ), - // AppText( - // 'Patient Type', - // fontWeight: FontWeight.w600, - // ), - // Row( - // children: [ - // Row( - // children: [ - // Radio( - // activeColor: Color(0xFFB9382C), - // value: PatientType.inPatient, - // groupValue: selectedPatientType, - // onChanged: (value) { - // setState(() { - // selectedPatientType = - // PatientType.inPatient; - // }); - // }, - // ), - // Text('InPatient'), - // ], - // ), - // Row( - // children: [ - // Radio( - // activeColor: Color(0xFFB9382C), - // value: PatientType.OutPatient, - // groupValue: selectedPatientType, - // onChanged: (value) { - // setState(() { - // selectedPatientType = - // PatientType.OutPatient; - // }); - // }, - // ), - // Text('OutPatient'), - // ], - // ), - // ], - // ), SizedBox( height: 10, ), @@ -133,78 +92,6 @@ class _PatientSearchScreenNewState extends State { SizedBox( height: 5, ), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // InkWell( - // child: this.showOther == false - // ? AppText( - // TranslationBase.of(context) - // .searchWithOther, - // color: Colors.red, - // fontWeight: FontWeight.bold, - // ) - // : AppText( - // TranslationBase.of(context) - // .hideOtherCriteria, - // color: Colors.red, - // fontWeight: FontWeight.bold), - // onTap: () { - // setState(() { - // this.showOther = !this.showOther; - // }); - // }, - // ) - // ], - // ), - // SizedBox( - // height: 30, - // ), - // if (showOther) - // Column( - // children: [ - // AppTextFieldCustom( - // hintText: - // TranslationBase.of(context).firstName, - // controller: firstNameInfoController, - // maxLines: 1, - // minLines: 1, - // hasBorder: true, - // onChanged: (_) {}, - // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - // ), - // SizedBox( - // height: 10, - // ), - // AppTextFieldCustom( - // hintText: - // TranslationBase.of(context).middleName, - // controller: middleNameInfoController, - // maxLines: 1, - // minLines: 1, - // onChanged: (_) {}, - // hasBorder: true, - // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - // ), - // SizedBox( - // height: 10, - // ), - // AppTextFieldCustom( - // hintText: - // TranslationBase.of(context).lastName, - // controller: lastNameFileInfoController, - // maxLines: 1, - // minLines: 1, - // onChanged: (_) {}, - // hasBorder: true, - // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - // ), - // SizedBox( - // height: 10, - // ), - // ], - // ), SizedBox( height: MediaQuery.of(context).size.height * 0.12, ), @@ -301,7 +188,7 @@ class _PatientSearchScreenNewState extends State { Navigator.push( context, MaterialPageRoute( - builder: (BuildContext context) => PatientsScreenNew( + builder: (BuildContext context) => PatientsSearchResultScreen( selectedPatientType: selectedPatientType, patientSearchRequestModel: patientSearchRequestModel, isSearchWithKeyInfo: diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart deleted file mode 100644 index 88b8547b..00000000 --- a/lib/screens/patients/patient_search_screen.dart +++ /dev/null @@ -1,641 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:provider/provider.dart'; - -import '../../config/config.dart'; -import '../../config/size_config.dart'; -import '../../lookups/patient_lookup.dart'; -import '../../widgets/patients/dynamic_elements.dart'; -import '../../widgets/shared/app_scaffold_widget.dart'; -import '../../widgets/shared/app_texts_widget.dart'; -import '../../widgets/shared/buttons/app_buttons_widget.dart'; -import '../../widgets/shared/rounded_container_widget.dart'; -import '../../widgets/shared/text_fields/app_text_form_field.dart'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); -Helpers helpers = Helpers(); - -// OWNER : Ibrahim albitar -// DATE : 19-04-2020 -// DESCRIPTION : Patient Search Screen. - -class PatientSearchScreen extends StatefulWidget { - @override - _PatientSearchScreenState createState() => _PatientSearchScreenState(); -} - -class _PatientSearchScreenState extends State { - String _selectedType = '1'; - String _selectedLocation = '1'; - String error = ''; - ProjectViewModel projectsProvider; - String itemText = ''; - String itemText2 = ''; - final GlobalKey _formKey = GlobalKey(); - bool _autoValidate = false; - bool onlyArrived = true; - bool isView = false; - bool isFormSubmitted = false; - - FocusNode _nodeText1 = FocusNode(); - FocusNode _nodeText2 = FocusNode(); - FocusNode _nodeText3 = FocusNode(); - - var _patientSearchFormValues = PatientModel( - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - MobileNo: '0', - PatientID: 0, - From: "0", - To: "0", - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 5.8, - Channel: 9, - TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - IdentificationNo: '0', - PatientOutSA: false); - - void _validateInputs() async { - setState(() { - isFormSubmitted = true; - }); - - try { - if (_formKey.currentState.validate()) { - _formKey.currentState.save(); - - if ((_patientSearchFormValues.From == "0" || - _patientSearchFormValues.To == "0") && - _selectedType == "7" || - ((_patientSearchFormValues.From == "0" || - _patientSearchFormValues.To == "0") && - _selectedType == "6")) { - // Helpers.showErrorToast("Please Choose The Dates"); - } else { - setState(() { - isFormSubmitted = false; - }); - Navigator.of(context).pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": _selectedType, - "isSearch": true, - "isView": isView - }); - } - } else { - setState(() { - _autoValidate = true; - }); - } - } catch (err) { - error = err.toString(); - } - } - - handelCatchErrorCase(err) { - //isLoading = false; - //isError = true; - error = Helpers.generateContactAdminMsg(err); - //notifyListeners(); - throw err; - } - - @override - Widget build(BuildContext context) { - projectsProvider = Provider.of(context); - return GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( - appBarTitle: TranslationBase.of(context).searchPatient, - isShowAppBar: true, - body: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RoundedContainer( - showBorder: false, - child: Column( - children: [ - Column( - children: [ - // Container( - // child: Icon( - // DoctorApp.search_patient_1, - // size: 100, - // color: Colors.black, - // ), - // margin: EdgeInsets.only(top: 10), - // ), - // Padding( - // padding: const EdgeInsets.only(top: 12.0), - // child: AppText( - // TranslationBase.of(context) - // .searchPatientImageCaptionTitle - // .toUpperCase(), - // fontWeight: FontWeight.bold, - // fontSize: SizeConfig.heightMultiplier * 2.5, - // ), - // ), - // Padding( - // padding: const EdgeInsets.only(top: 5.0), - // child: AppText( - // TranslationBase.of(context) - // .searchPatientImageCaptionBody, - // fontSize: SizeConfig.heightMultiplier * 2, - // ), - // ) - ], - ), - Container( - padding: EdgeInsets.all(15), - width: SizeConfig.screenWidth * 1, - child: Form( - key: _formKey, - autovalidate: _autoValidate, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 15, - ), - if (_selectedType != '7') - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .patpatientIDMobilenationalientID, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - if (value != null && value != '') { - if (value.length == 10 && - (value[0] == '2' || - value[0] == '1')) { - _patientSearchFormValues - .IdentificationNo = value; - _patientSearchFormValues.Searchtype = 2; - _patientSearchFormValues.setPatientID = - 0; - } else if ((value.length == 10 || - value.length == 9) && - ((value[0] == '0' && - value[1] == '5') || - value[0] == '5')) { - _patientSearchFormValues.MobileNo = - value; - _patientSearchFormValues.Searchtype = 0; - } else { - _patientSearchFormValues.setPatientID = - int.parse(value); - _patientSearchFormValues.Searchtype = 1; - } - } - - // else{ - - // } - - // value == null || value == '' - // ? _patientSearchFormValues.setPatientID = - // 0 - // : _patientSearchFormValues.setPatientID = - // int.parse(value); - - // if (value != null && - // value.toString().trim().isEmpty) { - // _patientSearchFormValues.setPatientID = 0; - // } - }, - ), - ), - SizedBox( - height: 10, - ), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // InkWell( - // child: this.isView == false - // ? AppText( - // TranslationBase.of(context) - // .searchWithOther, - // color: Colors.red, - // fontWeight: FontWeight.bold, - // ) - // : AppText( - // TranslationBase.of(context) - // .hideOtherCriteria, - // color: Colors.red, - // fontWeight: FontWeight.bold), - // onTap: () { - // setState(() { - // this.isView = !this.isView; - // }); - // }, - // ) - // ], - // ), - isView == true - ? Column(children: [ - SizedBox( - height: 10, - ), - Container( - height: 65.0, - decoration: ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 1.0, - style: BorderStyle.solid, - color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - ), - ), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * - 0.9, - bottom: SizeConfig.widthMultiplier * - 0.9, - right: - SizeConfig.widthMultiplier * 3, - left: - SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: _selectedType, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return PATIENT_TYPE_Des.map( - (item) { - return Row( - mainAxisSize: - MainAxisSize.max, - children: [ - !projectsProvider - .isArabic - ? AppText( - item['text'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ) - : AppText( - item['text_ar'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (String newValue) => - { - setState(() { - _selectedType = newValue; - selectedPatientType = - int.parse( - _selectedType); - }) - }, - items: PATIENT_TYPE_Des.map( - (item) { - !projectsProvider.isArabic - ? itemText = item['text'] - : itemText = - item['text_ar']; - return DropdownMenuItem( - child: Text( - itemText, - textAlign: TextAlign.end, - ), - value: item['val'], - ); - }).toList(), - )), - ), - ], - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .firstName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setFirstName = "0" - : _patientSearchFormValues - .setFirstName = value; - - if (value != null && - value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues - .setFirstName = "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - if (_selectedType != '7') - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .phoneNumber, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientMobileNumber = - "0" - : _patientSearchFormValues - .setPatientMobileNumber = - value; - - if (value != null && - value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues - .setPatientMobileNumber = "0"; - } - }, - ), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .middleName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setMiddleName = "0" - : _patientSearchFormValues - .setMiddleName = value; - if (value != null && - value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues - .setMiddleName = "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .lastName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setLastName = "0" - : _patientSearchFormValues - .setLastName = value; - if (value != null && - value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues - .setLastName = "0"; - } - }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .patientID, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText2, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientID = 0 - : _patientSearchFormValues - .setPatientID = - int.parse(value); - if (value != null && - value - .trim() - .toString() - .isEmpty) { - _patientSearchFormValues - .setPatientID = 0; - } - }), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .patientFile, - borderColor: Colors.white, - textInputType: TextInputType.number, - focusNode: _nodeText3, - inputFormatter: ONLY_NUMBERS, - onSaved: (value) {}, - ), - ), - (!(_selectedType == '2' || - _selectedType == '4')) - ? DynamicElements( - _patientSearchFormValues, - isFormSubmitted) - : SizedBox( - height: 0, - ), - SizedBox( - height: 10, - ), - Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), - height: 25, - width: 25, - child: Checkbox( - value: onlyArrived, - checkColor: HexColor("#2A930A"), - activeColor: Colors.white, - onChanged: (bool newValue) { - setState(() { - onlyArrived = newValue; - }); - }), - ), - SizedBox( - width: 12, - ), - AppText( - TranslationBase.of(context) - .onlyArrivedPatient, - fontSize: - SizeConfig.textMultiplier * - 2), - ])), - SizedBox( - height: 10, - ), - ]) - : SizedBox( - height: 0, - ), - ], - ), - ), - ), - ], - ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).search, - color: Colors.red[800], - onPressed: () { - _validateInputs(); - }, - ), - ], - ), - ), - ], - ), - ]), - ), - ); - } -} diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart deleted file mode 100644 index 586d0238..00000000 --- a/lib/screens/patients/patients_screen.dart +++ /dev/null @@ -1,1005 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_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/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; -import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; -import 'package:provider/provider.dart'; - -import '../../config/size_config.dart'; -import '../../widgets/shared/app_scaffold_widget.dart'; - -class PatientsScreen extends StatefulWidget { - final patientSearchForm; - final selectedType; - final isAppbar; - final arrivalType; - final isView; - PatientsScreen( - {this.patientSearchForm, - this.selectedType, - this.isAppbar = true, - this.arrivalType, - this.isView}); - @override - _PatientsScreenState createState() => _PatientsScreenState(); -} - -class _PatientsScreenState extends State { - List lItems; - - List parsed; - - List date; - List unFilterDate; - - int clinicId; - AuthViewModel authProvider; - - Color sideColor = Colors.black; - List responseModelList; - List responseModelList2; - final String url = "assets/images/"; - final String avatarMale = "user_male.svg"; //'working_male.svg';//'user.svg'; - final String avatarFemale = 'user_female.svg'; - final String assetName = 'assets/image.svg'; - - List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; - - int _activeLocation = 0; - bool isInpatient = false; - bool _isInit = true; - String patientType; - bool isSearch = false; - String patientTypeTitle; - var _isLoading = true; - var selectedFilter = 1; - bool _isError = false; - String error = ""; - String arrivalType; - ProjectViewModel projectsProvider; - var isView; - final _controller = TextEditingController(); - - PatientModel patient; - var _patientSearchFormValues = PatientModel( - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 5.5, - Channel: 9, - TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - PatientOutSA: false); - searchData(String str) { - this.responseModelList = this.responseModelList2; - var strExist = str.length > 0 ? true : false; - if (strExist) { - List filterData = []; - - for (var i = 0; i < responseModelList2.length; i++) { - String firstName = responseModelList[i].firstName.toUpperCase(); - String lastName = responseModelList[i].lastName.toUpperCase(); - String mobile = responseModelList[i].mobileNumber.toUpperCase(); - String patientID = responseModelList[i].patientId.toString(); - - if (firstName.contains(str.toUpperCase()) || - lastName.contains(str.toUpperCase()) || - mobile.contains(str) || - patientID.contains(str)) { - filterData.add(responseModelList[i]); - } - } - - setState(() { - this.responseModelList = filterData; - }); - } else { - setState(() { - this.responseModelList = this.responseModelList2; - }); - } - } - - convertDate(String str) { - String timeConvert; - const start = "/Date("; - - const end = "+0300)"; - - final startIndex = str.indexOf(start); - - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - - String newDateformat = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0') + - " " + - "-" + - " " + - date.hour.toString().padLeft(2, '0') + - ":" + - date.minute.toString().toString().padLeft(2, '0'); - - return newDateformat.toString(); - } - - convertDateFormat(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } - - filterBooking(String str) { - this.responseModelList = this.responseModelList2; - - var strExist = str.length > 0 ? true : false; - if (true) { - List filterDate = []; - String patiantAppointment = ""; - for (var i = 0; i < responseModelList2.length; i++) { - try { - if (responseModelList[i].appointmentDate == "") { - patiantAppointment = responseModelList[i].arrivedOn; - } else { - patiantAppointment = - convertDateFormat(responseModelList[i].appointmentDate); - } - if (patiantAppointment != null) { - String dateAppointment = checkDate(patiantAppointment); - - if (dateAppointment.contains(str) || str == 'All') { - filterDate.add(responseModelList[i]); - } - } - } catch (e) { - print(e); - } - } - - setState(() { - this.responseModelList = filterDate; - }); - } else { - setState(() { - this.responseModelList = this.responseModelList2; - }); - } - } - - String checkDate(String dateString) { - DateTime checkedTime = DateTime.parse(dateString); - DateTime currentTime = DateTime.now(); - - if ((currentTime.year == checkedTime.year) && - (currentTime.month == checkedTime.month) && - (currentTime.day == checkedTime.day)) { - return TranslationBase.of(context).today; - } else if ((currentTime.year == checkedTime.year) && - (currentTime.month == checkedTime.month)) { - if ((currentTime.day - checkedTime.day) == 1) { - return TranslationBase.of(context).yesterday; - } else if ((currentTime.day - checkedTime.day) == -1) { - return TranslationBase.of(context).tomorrow; - } - - if ((currentTime.day - checkedTime.day) <= -2) { - return TranslationBase.of(context).nextWeek; - } else { - return TranslationBase.of(context).all; - } - } - return TranslationBase.of(context).all; - } - - @override - Widget build(BuildContext context) { - authProvider = Provider.of(context); - _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, - ]; - //TranslationBase.of(context).all, - projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - - patient = widget.patientSearchForm != null - ? widget.patientSearchForm - : routeArgs['patientSearchForm']; - - patientType = widget.selectedType != null - ? widget.selectedType - : routeArgs['selectedType']; - arrivalType = widget.arrivalType != null - ? widget.arrivalType - : routeArgs['arrivalType']; - if (routeArgs != null && routeArgs.containsKey("isSearch")) { - isSearch = routeArgs['isSearch']; - } - if (routeArgs != null && routeArgs.containsKey("isSearch")) { - isView = routeArgs['isView']; - //patient.Searchtype = 1; - } - if (routeArgs != null && routeArgs.containsKey('activeFilter')) { - _activeLocation = routeArgs['activeFilter']; - } - if (routeArgs != null && routeArgs.containsKey('isInpatient')) { - isInpatient = routeArgs['isInpatient']; - } - - if (!projectsProvider.isArabic) - patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; - else - patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)]; - - return BaseView( - onModelReady: (model) { - // TODO : change all the logic here to make it work with the model and remove future - int val2 = int.parse(patientType); - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; - if (val2 == 7) { - getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( - from: patient.From, - to: patient.To, - pageIndex: 0, - pageSize: 0, - patientMRN: patient.getPatientID); - } - - model - .getPatientList( - val2 == 7 - ? getPatientArrivalListRequestModel.toJson() - : patient, - patientType, - isView: isView) - .then((res) { - setState(() { - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } else { - if (isView == false && val2 == 1) { - lItems = res['GetPatientFileInformation_PRMList'] - .where((i) => - i['PatientTypeDescription'] == 'Permanent File') - .toList(); - } else { - lItems = res[SERVICES_PATIANT2[val2]]; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - if (val2 == 7) { - responseModelList.sort((a, b) { - if (b.startTime != null && b.startTime != null) { - try { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - } on Exception catch (_) { - print('never reached'); - var adate = a.startTime; //a.startTime; - var bdate = b.startTime; - return adate.compareTo(bdate); - } - } else { - var adate = convertDateFormat(a.appointmentDate); - var bdate = convertDateFormat(b.appointmentDate); - return bdate.compareTo(adate); - } - }); - } - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = model.error ?? - res['ErrorEndUserMessage'] ?? - res['ErrorMessage']; - } - - _isLoading = false; - }); - }).catchError((error) { - setState(() { - _isError = true; - _isLoading = false; - this.error = error.toString(); - }); - }); - }, - builder: (_, model, w) => AppScaffold( - appBarTitle: isSearch? "Search Patient": patientTypeTitle, - isShowAppBar: widget.isAppbar, - isLoading: _isLoading, - body: _isLoading - ? Container() - : _isError - ? DrAppEmbeddedError(error: error) - : lItems == null || lItems.length == 0 - ? Column( - children: [ - Column(children: [ - // 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), - // ), - // onChanged: (String str) { - // this.searchData(str); - // }), - // ])), - - // Container( - // width: SizeConfig.screenWidth * 0.9, - // height: SizeConfig.screenHeight * 0.08, - // child: TextField( - // controller: _controller, - // onChanged: (String str) { - // this.searchData(str); - // }, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context) - // .searchPatientName), - // ), - // ), - SizedBox( - height: 10.0, - ), - if (int.parse(patientType) == 7) - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(10)), - child: ClinicList( - clinicId: clinicId, - onClinicChange: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - }, - )), - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height * - 0.03), - // child: _locationBar(context) - child: - SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" - ? _locationBar(context, model) - : Container(), - ) - ]), - Container( - margin: EdgeInsets.only( - top: MediaQuery.of(context).size.height * 0.10), - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .youDontHaveAnyPatient), - ) - ], - ), - ), - ), - ], - ) - : Container( - color: Colors.grey[200], - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - child: lItems == null - ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Center( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 0, 0, 0, 0), //250 - child: - DrAppCircularProgressIndeicator(), - )), - ), - ], - ) - : 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), - ), - onChanged: (String str) { - this.searchData(str); - }), - ])), - // Container( - // width: SizeConfig.screenWidth * 0.9, - // height: - // SizeConfig.screenHeight * 0.08, - // child: TextField( - // controller: _controller, - // onChanged: (String str) { - // this.searchData(str); - // }, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context) - // .searchPatientName), - // ), - // ), - SizedBox( - height: 10.0, - ), - // if (int.parse(patientType) == 7) - // Container( - // padding: EdgeInsets.all(5), - // decoration: BoxDecoration( - // color: Colors.white, - // border: Border.all( - // color: Colors.grey), - // borderRadius: - // BorderRadius.circular(10)), - // child: ClinicList( - // clinicId: clinicId, - // onClinicChange: (newValue) { - // clinicId = newValue; - // changeClinic( - // newValue, context, model); - // }, - // )), - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context) - .size - .height * - 0.03), - // child: _locationBar(context) - child: SERVICES_PATIANT2[ - int.parse(patientType)] == - "List_MyOutPatient" - ? _locationBar(context, model) - : Container(), - ), - SizedBox( - height: 10.0, - ), - Container( - child: (responseModelList.length > - 0) - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: responseModelList - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: - patientType, - arrivalType: - arrivalType, - isInpatient: - isInpatient, - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - patientType, - "from": patient - .getFrom, - "to": patient - .getTo, - "isSearch": - isSearch, - "isInpatient": - isInpatient, - "arrivalType": - arrivalType, - "isInpatient": - isInpatient - }); - }, - ); - }).toList(), - ) - : Center( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - SizedBox( - height: 100, - ), - Image.asset( - 'assets/images/no-data.png'), - Padding( - padding: - const EdgeInsets - .all(8.0), - child: AppText( - TranslationBase.of( - context) - .youDontHaveAnyPatient), - ) - ], - ), - )), - ], - ), - ) - ], - ), - ), - ), - ); - } - - changeClinic(clinicId, BuildContext context, model) async { - GifLoaderDialogUtils.showMyDialog(context); - 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(), allowChangeProfile: false) - .then((profileList) async { - print(profileList['DoctorProfileList'][0]); - int val2 = int.parse(patientType); - - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel = - GetPatientArrivalListRequestModel( - from: patient.From, - to: patient.To, - clinicID: profileList['DoctorProfileList'][0]['ClinicID'], - doctorID: - profileList['DoctorProfileList'][0]['DoctorID'].toString(), - patientMRN: patient.getPatientID, - pageIndex: 0, - pageSize: 0); - - model - .getPatientList( - getPatientArrivalListRequestModel.toJson(), patientType) - .then((res) { - setState(() { - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList.sort((a, b) { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - }); - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = model.error ?? - res['ErrorEndUserMessage'] ?? - res['ErrorMessage']; - } - - _isLoading = false; - }); - GifLoaderDialogUtils.hideDialog(context); - }).catchError((error) { - Helpers.showErrorToast(error.toString()); - GifLoaderDialogUtils.hideDialog(context); - }); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - Helpers.showErrorToast(err); - }); - } - - Widget _locationBar(BuildContext _context, model) { - return Container( - height: MediaQuery.of(context).size.height * 0.0619, - width: SizeConfig.screenWidth * 0.94, - decoration: BoxDecoration( - color: Color(0Xffffffff), - borderRadius: BorderRadius.circular(12.5), - // border: Border.all( - // width: 0.5, - // ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.058, - width: SizeConfig.screenWidth * 0.2334, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(12.5), - topRight: Radius.circular(12.5), - topLeft: Radius.circular(9.5), - bottomLeft: Radius.circular(9.5)), - color: _isActive ? HexColor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - - fontWeight: FontWeight.normal, - ), - ), - )), - ), - onTap: () { - //filterBooking(item.toString()); - - setState(() { - _activeLocation = _locations.indexOf(item); - }); - filterPatient(item.toString(), model); - }), - _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, - ) - : Container() - ]); - }).toList(), - ), - ); - } - - filterPatient(item, model) { - if (item == 'Tomorrow') { - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - } else if (item == 'Next Week') { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 6), - 'yyyy-MM-dd'); - } else { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); - } - searchPatient(model); - // Navigator.of(context).pop(); - // Navigator.of(context).pushNamed(PATIENTS, arguments: { - // "patientSearchForm": _patientSearchFormValues, - // "selectedType": "7", - // "arrivalType": "1", - // "activeFilter": _activeLocation - // }); - } - - searchPatient(model) { - GifLoaderDialogUtils.showMyDialog(context); - int val2 = int.parse(patientType); - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; - if (val2 == 0) { - patient = PatientModel( - From: _patientSearchFormValues.From, - To: _patientSearchFormValues.To, - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - ); - } - - model - .getPatientList( - val2 == 7 ? getPatientArrivalListRequestModel.toJson() : patient, - patientType, - isView: isView) - .then((res) { - setState(() { - GifLoaderDialogUtils.hideDialog(context); - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } else { - if (isView == false && val2 == 1) { - lItems = res['GetPatientFileInformation_PRMList'] - .where((i) => i['PatientTypeDescription'] == 'Permanent File') - .toList(); - } else { - lItems = res[SERVICES_PATIANT2[val2]]; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - if (val2 == 7) { - responseModelList.sort((a, b) { - if (b.startTime != null && b.startTime != null) { - try { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - } on Exception catch (_) { - print('never reached'); - var adate = a.startTime; //a.startTime; - var bdate = b.startTime; - return adate.compareTo(bdate); - } - } else { - var adate = convertDateFormat(a.appointmentDate); - var bdate = convertDateFormat(b.appointmentDate); - return bdate.compareTo(adate); - } - }); - } - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = - model.error ?? res['ErrorEndUserMessage'] ?? res['ErrorMessage']; - } - - _isLoading = false; - }); - }).catchError((error) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { - _isError = true; - _isLoading = false; - this.error = error.toString(); - }); - }); - } -} From 1bcc643fb94d071137894f29ea8c1e7678eda29f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 3 May 2021 14:06:01 +0300 Subject: [PATCH 075/102] SMS Popup design fix --- lib/widgets/otp/sms-popup.dart | 44 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index 6c28b488..fca0d689 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -69,15 +69,15 @@ class SMSOTP { } return Container( color: Colors.white, - height: SizeConfig.realScreenHeight * 0.5, - width: SizeConfig.realScreenWidth * 0.8, + height: MediaQuery.of(context).size.height * 0.50, + width: MediaQuery.of(context).size.width * 0.84, child: Center( child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.all(10), + padding: EdgeInsets.all(12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -249,23 +249,27 @@ class SMSOTP { )), ), ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).validationMessage + ' ', - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - displayTime, - color: Colors.red, - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: 14, - ) - ]) + Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).validationMessage + + ' ', + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + displayTime, + color: Colors.red, + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: 14, + ) + ]), + ) ], ))), ); From 802bd83ddd00c2a3fe32f05e5d57cea18898d418 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 3 May 2021 14:48:37 +0300 Subject: [PATCH 076/102] design-changes --- lib/config/localized_values.dart | 14 +- lib/screens/home/home_page_card.dart | 14 +- lib/screens/home/home_screen.dart | 9 - .../ReferralDischargedPatientDetails.dart | 2 +- .../profile/UCAF/UCAF-input-screen.dart | 10 +- .../profile_gird_for_other.dart | 376 +++++------------- .../profile_gird_for_search.dart | 222 +++++------ .../referral/patient_referral_screen.dart | 2 +- .../referral_patient_detail_in-paint.dart | 2 +- .../referral/referred-patient-screen.dart | 2 +- .../referred_patient_detail_in-paint.dart | 4 +- lib/util/translations_delegate_base.dart | 5 +- .../profile/PatientProfileButton.dart | 13 +- 13 files changed, 238 insertions(+), 437 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 183b2a0f..d8427557 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -756,12 +756,12 @@ const Map> localizedValues = { 'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض" }, 'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"}, - 'otherStatistic': {'en': "Other Statistics", 'ar': "دیگر شماریات"}, - 'ptientsreferral': {'en': "Patient's Referrals", 'ar': "مریض کا حوالہ"}, - 'arrivalpatient': {'en': "Arrival Patients", 'ar': "مریضوں کی آمد"}, + 'otherStatistic': {'en': "Other Statistics", 'ar': "إحصائيات أخرى"}, + 'ptientsreferral': {'en': "Patient's Referrals", 'ar': "إحالات المريض"}, + 'arrivalpatient': {'en': "Arrival Patients", 'ar': "المرضى القادمون"}, 'searchmedicinepatient': { 'en': "Search patient or Medicines", - 'ar': "مریض یا دوائیں تلاش کریں" + 'ar': "ابحث عن المريض أو الأدوية" }, 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, @@ -859,7 +859,7 @@ const Map> localizedValues = { "numOfDays": {"en": "Number of Days", "ar": "عدد الأيام"}, "replayBefore": {"en": "Replay Before", "ar": "رد قبل"}, "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, - "refClinic": {"en": "Ref Clinic", "ar": "Ref Clinic"}, + "refClinic": {"en": "Ref Clinic", "ar": "العيادة المرجعية"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, "didntCatch": { "en": "Didn't catch that. Try Speaking again", @@ -961,5 +961,7 @@ const Map> localizedValues = { 'medical': {'en': 'Medical', 'ar': 'الطبي'}, 'report': {'en': 'Report', 'ar': 'التقرير'}, 'discharge': {'en': 'Discharge', 'ar': 'discharge'}, - "discharged": {"en": "Discharged", "ar": "المصرف"}, + "discharged": {"en": "Discharged", "ar": "المفرغين"}, + "none": {"en": "None", "ar": "لا شيء"}, + "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"}, }; diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index ffe56fd0..2f85ff89 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -8,8 +8,6 @@ class HomePageCard extends StatelessWidget { @required this.child, this.onTap, Key key, - this.width, - this.height, this.color, this.opacity = 0.4, this.margin}) @@ -18,8 +16,6 @@ class HomePageCard extends StatelessWidget { final String imageName; final Widget child; final Function onTap; - final double width; - final double height; final Color color; final double opacity; final EdgeInsets margin; @@ -28,12 +24,10 @@ class HomePageCard extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: width != null ? width : MediaQuery.of(context).size.width * 0.28, - height: height != null - ? height - : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.18 - : MediaQuery.of(context).size.height * 0.36, + width: 100, + height: MediaQuery.of(context).orientation == Orientation.portrait + ? 130 + : 250, margin: this.margin, decoration: BoxDecoration( color: !hasBorder diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index e95f1d1e..a6e4e258 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -520,15 +520,6 @@ class _HomeScreenState extends State { page: PatientInPatientScreen(), ), ); - // getRequestHeader(true); - // Navigator.of(context) - // .pushNamed(PATIENTS, arguments: { - // "patientSearchForm": - // _patientSearchFormValues, - // "selectedType": "1", - // "arrivalType": "1", - // "isInpatient": true - // }); }, ), HomePageCard( diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index 0b664d4b..b1829126 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -509,7 +509,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - "Dr ${referredPatient.referringDoctorName}", + "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.5 * diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 137b4ed5..5c16d063 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -325,7 +325,7 @@ class _UCAFInputScreenState extends State { ), AppTextFieldCustom( hintText: TranslationBase.of(context).other, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, ), SizedBox( @@ -333,7 +333,7 @@ class _UCAFInputScreenState extends State { ), AppTextFieldCustom( hintText: TranslationBase.of(context).how, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, ), SizedBox( @@ -345,7 +345,7 @@ class _UCAFInputScreenState extends State { child: AppTextFieldCustom( hintText: TranslationBase.of(context).when, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, ), ), @@ -356,7 +356,7 @@ class _UCAFInputScreenState extends State { child: AppTextFieldCustom( hintText: TranslationBase.of(context).where, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, ), ), @@ -369,7 +369,7 @@ class _UCAFInputScreenState extends State { height: screenSize.height * 0.1, hintText: TranslationBase.of(context) .specifyPossibleLineManagement, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, minLines: 4, maxLines: 6, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 66894e11..86ccd6d1 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; @@ -15,290 +17,128 @@ class ProfileGridForOther extends StatelessWidget { String from; String to; - ProfileGridForOther( + ProfileGridForOther( {Key key, this.patient, this.patientType, this.arrivalType, this.height, - this.isInpatient, this.from,this.to}) + this.isInpatient, + this.from, + this.to}) : super(key: key); @override Widget build(BuildContext context) { + final List cardsList = [ + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).service, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, + "ECG", + PATIENT_ECG, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).service, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patientSick, + TranslationBase.of(context).leave, + ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).ucaf, + PATIENT_UCAF_REQUEST, + 'patient/ucaf.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, + REFER_PATIENT_TO_DOCTOR, + 'patient/refer_patient.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).admission, + TranslationBase.of(context).request, + PATIENT_ADMISSION_REQUEST, + 'patient/admission_req.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + ]; + return Column( children: [ Padding( - padding: const EdgeInsets - .symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: StaggeredGridView.countBuilder( shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase.of( - context) - .vital, - nameLine2: - TranslationBase.of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase.of( - context) - .lab, - nameLine2: - TranslationBase.of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase.of( - context) - .radiology, - nameLine2: - TranslationBase.of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase.of( - context) - .orders, - nameLine2: - TranslationBase.of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: HEALTH_SUMMARY, - nameLine1: TranslationBase.of(context).health, - nameLine2: TranslationBase.of(context).summary, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase.of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PROCEDURE, - nameLine1: - TranslationBase.of( - context) - .orders, - nameLine2: - TranslationBase.of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase.of( - context) - .insurance, - nameLine2: - TranslationBase.of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase.of( - context) - .patientSick, - nameLine2: - TranslationBase.of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase.of( - context) - .patient, - nameLine2: - TranslationBase.of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase.of( - context) - .referral, - nameLine2: - TranslationBase.of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase.of( - context) - .admission, - nameLine2: - TranslationBase.of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], + itemCount: cardsList.length, + staggeredTileBuilder: (int index) => StaggeredTile.fit(1), + itemBuilder: (BuildContext context, int index) => PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: cardsList[index].nameLine1, + nameLine2: cardsList[index].nameLine2, + route: cardsList[index].route, + icon: cardsList[index].icon, + isInPatient: cardsList[index].isInPatient, + isDischargedPatient: cardsList[index].isDischargedPatient, + isDisable: cardsList[index].isDisable, + onTap: cardsList[index].onTap, + isLoading: cardsList[index].isLoading, + ), ), ), ], diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index 2d3679cf..9c9f7d36 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; @@ -25,135 +27,115 @@ class ProfileGridForSearch extends StatelessWidget { @override Widget build(BuildContext context) { + final List cardsList = [ + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).service, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, + "ECG", + PATIENT_ECG, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).service, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patientSick, + TranslationBase.of(context).leave, + ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).ucaf, + PATIENT_UCAF_REQUEST, + 'patient/ucaf.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, + REFER_PATIENT_TO_DOCTOR, + 'patient/refer_patient.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).admission, + TranslationBase.of(context).request, + PATIENT_ADMISSION_REQUEST, + 'patient/admission_req.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + ]; + return Column( children: [ Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), - child: GridView.count( + child: StaggeredGridView.countBuilder( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: TranslationBase.of(context).health, - nameLine2: TranslationBase.of(context).summary, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - ], + itemCount: cardsList.length, + staggeredTileBuilder: (int index) => StaggeredTile.fit(1), + itemBuilder: (BuildContext context, int index) => PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: cardsList[index].nameLine1, + nameLine2: cardsList[index].nameLine2, + route: cardsList[index].route, + icon: cardsList[index].icon, + isInPatient: cardsList[index].isInPatient, + isDischargedPatient: cardsList[index].isDischargedPatient, + isDisable: cardsList[index].isDisable, + onTap: cardsList[index].onTap, + isLoading: cardsList[index].isLoading, + ), ), ), ], diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index c5aaed7a..de1d5958 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -146,7 +146,7 @@ class _PatientReferralScreen extends State with SingleTic borderWidth: 0), child: Center( child: AppText( - 'Discharged', + TranslationBase.of(context).discharged, fontSize: SizeConfig.textMultiplier * 1.8, color: index == 2 ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, 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..aff9091e 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 @@ -403,7 +403,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - "Dr ${referredPatient.referringDoctorName}", + "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.5 * diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 23bbb2b9..4b06b6b9 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -103,7 +103,7 @@ class ReferredPatientScreen extends StatelessWidget { .getReferredPatientItem(index) .doctorImageURL, referralDoctorName: - "Dr. ${model.getReferredPatientItem(index).referralDoctorName}", + "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", clinicDescription: model .getReferredPatientItem(index) .referralClinicDescription, 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 a9ca6c27..a37803dd 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 @@ -407,7 +407,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - "Dr ${referredPatient.referralDoctorName}", + "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.5 * @@ -517,7 +517,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { referredPatient .referredDoctorRemarks.isNotEmpty ? referredPatient.referredDoctorRemarks - : " Not Replied yet", + : TranslationBase.of(context).notRepliedYet, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index f42437c2..f972f14f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1333,8 +1333,9 @@ class TranslationBase { localizedValues["medical"][locale.languageCode]; String get report => localizedValues["report"][locale.languageCode]; - String get discharge => - localizedValues["discharge"][locale.languageCode]; + String get discharge => localizedValues["discharge"][locale.languageCode]; + String get none => localizedValues["none"][locale.languageCode]; + String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 0c2fd2f9..dc1a9910 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -85,15 +85,14 @@ class PatientProfileButton extends StatelessWidget { children: [ AppText( !projectsProvider.isArabic ? this.nameLine1 : nameLine2, - color: Colors.black, - /*Color(0xFFB9382C),*/ + color: Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.5, ), AppText( !projectsProvider.isArabic ? this.nameLine2 : nameLine1, - color: Colors.black, + color: Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.5, @@ -112,14 +111,6 @@ class PatientProfileButton extends StatelessWidget { color: Color(0xffBBBBBB), width: 1, )), - /*boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - spreadRadius: 5, - blurRadius: 7, - offset: Offset(0, 3), // changes position of shadow - ), - ],*/ ), ); } From 4eba6d9f5a0b606c2046f70949a282de3afa82f6 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 3 May 2021 17:12:49 +0300 Subject: [PATCH 077/102] 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 5a421847163ddaa7e23bffbdc4e7cbc9cf0816d4 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 3 May 2021 21:04:06 +0300 Subject: [PATCH 078/102] voice commad updated --- lib/config/localized_values.dart | 11 +- .../patients/profile/note/update_note.dart | 213 ++++++++++-------- .../referral/AddReplayOnReferralPatient.dart | 84 ++++--- .../refer-patient-screen-in-patient.dart | 167 ++++++++------ lib/util/translations_delegate_base.dart | 41 ++-- 5 files changed, 299 insertions(+), 217 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d8427557..a5398db9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -946,8 +946,14 @@ const Map> localizedValues = { "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, - "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف ورقة طلب جديدة"}, - "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة تقدم جديدة"}, + "addNewOrderSheet": { + "en": "Add a New Order Sheet", + "ar": "أضف ورقة طلب جديدة" + }, + "addNewProgressNote": { + "en": "Add a New Progress Note", + "ar": "أضف ملاحظة تقدم جديدة" + }, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, "noteCanceled": {"en": "Canceled", "ar": "ألغيت"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, @@ -964,4 +970,5 @@ const Map> localizedValues = { "discharged": {"en": "Discharged", "ar": "المفرغين"}, "none": {"en": "None", "ar": "لا شيء"}, "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"}, + "clearText": {"en": "Clear Text", "ar": "نص واضح"}, }; diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 673a6e2b..b2e36d8f 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -97,10 +97,14 @@ class _UpdateNoteOrderState extends State { children: [ BottomSheetTitle( title: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, ), SizedBox( height: 10.0, @@ -114,10 +118,18 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).progressNote, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -132,19 +144,23 @@ class _UpdateNoteOrderState extends State { : null, ), Positioned( - top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic? MediaQuery.of(context).size.width * 0.75 : 15, - child: IconButton( - icon: Icon( - DoctorApp.speechtotext, - color: Colors.black, - ), - onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); - }, - ), - ) + 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()}); + }, + ), + ], + )) ], ), ], @@ -161,77 +177,98 @@ class _UpdateNoteOrderState extends State { child: Wrap( alignment: WrapAlignment.center, children: [ - AppButton( - title: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, - color: Color(0xff359846), - // disabled: progressNoteController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - if (progressNoteController.text.trim().isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); - - if (widget.isUpdate) { - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), - cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, - notes: progressNoteController.text, - verifiedNote: false, - patientTypeID: widget.patient.patientType, - patientOutSA: false, - ); - await widget.patientModel - .updatePatientProgressNote(reqModel); - } else { - CreateNoteModel reqModel = CreateNoteModel( - admissionNo: int.parse(widget.patient.admissionNo), - createdBy: doctorProfile.doctorID, - visitType: widget.visitType, - patientID: widget.patient.patientId, - nursingRemarks: ' ', - patientTypeID: widget.patient.patientType, - patientOutSA: false, - notes: progressNoteController.text); + progressNoteController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), + child: Expanded( + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + )), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, + color: Color(0xff359846), + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.trim().isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - await widget.patientModel - .createPatientProgressNote(reqModel); - } + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); - if (widget.patientModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientModel.error); - } else { - ProgressNoteRequest progressNoteRequest = - ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note + if (widget.isUpdate) { + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(widget.patient.admissionNo), + cancelledNote: false, + lineItemNo: widget.note.lineItemNo, + createdBy: widget.note.createdBy, + notes: progressNoteController.text, + verifiedNote: false, + patientTypeID: widget.patient.patientType, + patientOutSA: false, + ); + await widget.patientModel + .updatePatientProgressNote(reqModel); + } else { + CreateNoteModel reqModel = CreateNoteModel( admissionNo: int.parse(widget.patient.admissionNo), - projectID: widget.patient.projectId, + createdBy: doctorProfile.doctorID, + visitType: widget.visitType, + patientID: widget.patient.patientId, + nursingRemarks: ' ', patientTypeID: widget.patient.patientType, - languageID: 2); - await widget.patientModel - .getPatientProgressNote(progressNoteRequest.toJson()); - } - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - Navigator.of(context).pop(); - } else { - Helpers.showErrorToast("You cant add only spaces"); - } - }), + patientOutSA: false, + notes: progressNoteController.text); + + await widget.patientModel + .createPatientProgressNote(reqModel); + } + + if (widget.patientModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientModel.error); + } else { + ProgressNoteRequest progressNoteRequest = + ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: + int.parse(widget.patient.admissionNo), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote( + progressNoteRequest.toJson()); + } + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); + Navigator.of(context).pop(); + } else { + Helpers.showErrorToast("You cant add only spaces"); + } + })), ], ), ), @@ -278,7 +315,7 @@ class _UpdateNoteOrderState extends State { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - progressNoteController.text = reconizedWord; + progressNoteController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index fd5ec6bb..06f426d1 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.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,12 +82,13 @@ 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( DoctorApp.speechtotext, color: Colors.black, + size: 35, ), onPressed: () { onVoiceText(); @@ -112,32 +111,53 @@ class _AddReplayOnReferralPatientState extends State child: Wrap( alignment: WrapAlignment.center, children: [ - AppButton( - title: 'Submit Replay', - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - 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); - } else { - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast("Your Replay Added Successfully"); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - }else { - Helpers.showErrorToast("You can't add empty replay"); - setState(() { - isSubmitted = false; - }); - } - }), + progressNoteController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), + child: Expanded( + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + )), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: 'Submit Replay', + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + 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); + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Your Replay Added Successfully"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + } else { + Helpers.showErrorToast("You can't add empty replay"); + setState(() { + isSubmitted = false; + }); + } + })), ], ), ), @@ -179,7 +199,7 @@ class _AddReplayOnReferralPatientState extends State if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); - progressNoteController.text = reconizedWord; + progressNoteController.text += reconizedWord + '\n'; }); } } diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 38182570..cc491cf2 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -22,6 +22,7 @@ import 'package:intl/intl.dart'; 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 PatientMakeInPatientReferralScreen extends StatefulWidget { @override _PatientMakeInPatientReferralScreenState createState() => @@ -104,7 +105,7 @@ class _PatientMakeInPatientReferralScreenState setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - _remarksController.text = reconizedWord; + _remarksController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); @@ -140,13 +141,17 @@ class _PatientMakeInPatientReferralScreenState final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getReferralFrequencyList(), + onModelReady: (model) => model.getReferralFrequencyList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType,isInpatient: isInpatient,), + patient, + patientType, + arrivalType, + isInpatient: isInpatient, + ), body: SingleChildScrollView( child: Container( child: Column( @@ -466,19 +471,21 @@ class _PatientMakeInPatientReferralScreenState Stack( children: [ AppTextFieldCustom( - hintText:"Remarks", + hintText: "Remarks", controller: _remarksController, inputType: TextInputType.multiline, minLines: 4, maxLines: 6, ), Positioned( - top: 0, //MediaQuery.of(context).size.height * 0, + top: + 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( DoctorApp.speechtotext, color: Colors.black, + size: 35, ), onPressed: () { initSpeechState() @@ -493,73 +500,91 @@ class _PatientMakeInPatientReferralScreenState ) ], ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).refer, - fontWeight: FontWeight.w700, - color: Color(0XFF359846), - onPressed: () async{ - setState(() { - if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; - } else { - branchError = null; - } - if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; - } else { - hospitalError = null; - } - if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; - } else { - clinicError = null; - } - if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; - } else { - doctorError = null; - } - if (_selectedFrequency == null) { - frequencyError = - TranslationBase.of(context).fieldRequired; - } else { - frequencyError = null; - } - }); - if (_selectedFrequency == null || - _selectedBranch == null || - _selectedClinic == null || - _selectedDoctor == null || - _remarksController.text == null || - _extController.text == null) return;{ - - await model.makeInPatientReferral( - patient: patient, - projectID: _selectedBranch['facilityId'], - clinicID: _selectedClinic['ClinicID'], - doctorID: _selectedDoctor['DoctorID'], - frequencyCode: _selectedFrequency['ParameterCode'], - ext: _extController.text, - remarks: _remarksController.text, - priority: _activePriority, - referralDate: appointmentDate - ); - if(model.state == ViewState.ErrorLocal) - DrAppToastMsg.showErrorToast(model.error); - else{ - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); - Navigator.pop(context); - } - + Column( + children: [ + _remarksController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), + child: Expanded( + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + _remarksController.text = ''; + }); + }, + ))), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).refer, + fontWeight: FontWeight.w700, + color: Color(0XFF359846), + onPressed: () async { + setState(() { + if (_referTo == null) { + branchError = + TranslationBase.of(context).fieldRequired; + } else { + branchError = null; + } + if (_selectedBranch == null) { + hospitalError = + TranslationBase.of(context).fieldRequired; + } else { + hospitalError = null; + } + if (_selectedClinic == null) { + clinicError = + TranslationBase.of(context).fieldRequired; + } else { + clinicError = null; + } + if (_selectedDoctor == null) { + doctorError = + TranslationBase.of(context).fieldRequired; + } else { + doctorError = null; + } + if (_selectedFrequency == null) { + frequencyError = + TranslationBase.of(context).fieldRequired; + } else { + frequencyError = null; + } + }); + if (_selectedFrequency == null || + _selectedBranch == null || + _selectedClinic == null || + _selectedDoctor == null || + _remarksController.text == null || + _extController.text == null) return; + { + await model.makeInPatientReferral( + patient: patient, + projectID: _selectedBranch['facilityId'], + clinicID: _selectedClinic['ClinicID'], + doctorID: _selectedDoctor['DoctorID'], + frequencyCode: + _selectedFrequency['ParameterCode'], + ext: _extController.text, + remarks: _remarksController.text, + priority: _activePriority, + referralDate: appointmentDate); + if (model.state == ViewState.ErrorLocal) + DrAppToastMsg.showErrorToast(model.error); + else { + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context) + .referralSuccessMsg); + Navigator.pop(context); + } } - }, - ), + }, + ), + ) + ], ) ], ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index f972f14f..ba69e104 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1301,41 +1301,34 @@ class TranslationBase { String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => + localizedValues["graphDetails"][locale.languageCode]; String get discharged => localizedValues["discharged"][locale.languageCode]; String get addNewOrderSheet => localizedValues["addNewOrderSheet"][locale.languageCode]; String get addNewProgressNote => localizedValues["addNewProgressNote"][locale.languageCode]; - String get notePending => - localizedValues["notePending"][locale.languageCode]; + String get notePending => localizedValues["notePending"][locale.languageCode]; String get noteCanceled => localizedValues["noteCanceled"][locale.languageCode]; String get noteVerified => localizedValues["noteVerified"][locale.languageCode]; - String get noteVerify => - localizedValues["noteVerify"][locale.languageCode]; - String get noteConfirm => - localizedValues["noteConfirm"][locale.languageCode]; - String get noteAdd => - localizedValues["noteAdd"][locale.languageCode]; - - String get noteUpdate => - localizedValues["noteUpdate"][locale.languageCode]; - - String get orderSheet => - localizedValues["orderSheet"][locale.languageCode]; - String get order => - localizedValues["order"][locale.languageCode]; - String get sheet => - localizedValues["sheet"][locale.languageCode]; - String get medical => - localizedValues["medical"][locale.languageCode]; - String get report => - localizedValues["report"][locale.languageCode]; + String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; + String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; + String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; + + String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; + + String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; + String get order => localizedValues["order"][locale.languageCode]; + String get sheet => localizedValues["sheet"][locale.languageCode]; + String get medical => localizedValues["medical"][locale.languageCode]; + String get report => localizedValues["report"][locale.languageCode]; String get discharge => localizedValues["discharge"][locale.languageCode]; String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; + String get notRepliedYet => + localizedValues["notRepliedYet"][locale.languageCode]; + String get clearText => localizedValues["clearText"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From f84bc6da9d4c7057c6b2837da53c70d4db9b96b8 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 4 May 2021 10:31:11 +0300 Subject: [PATCH 079/102] voice command uodated --- lib/screens/patients/profile/note/update_note.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index b2e36d8f..8997dd07 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -181,15 +181,14 @@ class _UpdateNoteOrderState extends State { ? SizedBox() : Container( margin: EdgeInsets.all(5), - child: Expanded( - child: AppButton( + child: AppButton( title: TranslationBase.of(context).clearText, onPressed: () { setState(() { progressNoteController.text = ''; }); }, - )), + ), ), Container( margin: EdgeInsets.all(5), From 81d518e7252c5e7b9aa7a347c019607cc96c5528 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 4 May 2021 11:45:49 +0300 Subject: [PATCH 080/102] hot fix --- lib/config/localized_values.dart | 4 ++-- lib/screens/patients/PatientsInPatientScreen.dart | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a5398db9..5d2b2de8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,9 +47,9 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'My Patients', 'ar': 'مرضاي'}, + 'inPatient': {'en': 'My InPatients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, - 'inPatientAll': {'en': 'All Patients', 'ar': 'كل المرضى'}, + 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 6f2bafd9..75b65847 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -76,7 +76,6 @@ class _PatientInPatientScreenState extends State with Si fontSize: SizeConfig.textMultiplier * 2.8, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), - fontFamily: 'Poppins', ), ), ]), @@ -155,7 +154,7 @@ class _PatientInPatientScreenState extends State with Si children: [ AppText( title, - fontSize: SizeConfig.textMultiplier * 1.6, + fontSize: SizeConfig.textMultiplier * 1.5, color: isActive ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), From 583edfed89e57cf969dcfbd47d5695488fa1d43a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 4 May 2021 11:54:54 +0300 Subject: [PATCH 081/102] fix out patient number --- lib/screens/patients/out_patient/out_patient_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 8d1d2eb8..c8d197de 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -132,7 +132,7 @@ class _OutPatientsScreenState extends State { onTap: () async { setState(() { _activeLocation = _times.indexOf(item); - outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==0?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; + outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==1?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; _controller.text=""; }); model.searchData(""); From 302294afada420888f4b926d2448e07de956bc81 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 4 May 2021 12:12:06 +0300 Subject: [PATCH 082/102] session issue fix --- lib/util/helpers.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 13b7b2ae..3e410c86 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,6 +1,7 @@ import 'package:connectivity/connectivity.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/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -16,6 +17,7 @@ import '../util/dr_app_toast_msg.dart'; import 'dr_app_shared_pref.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + class Helpers { static int cupertinoPickerIndex = 0; @@ -82,7 +84,6 @@ class Helpers { style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), ); }).toList(), - itemExtent: 25, looping: false, onSelectedItemChanged: (int index) { @@ -100,6 +101,7 @@ class Helpers { DrAppToastMsg.showErrorToast(localMsg); } + static Future checkConnection() async { ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); @@ -144,8 +146,13 @@ class Helpers { String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); sharedPref.setString(APP_Language, lang); - Navigator.pushAndRemoveUntil(AppGlobal.CONTEX, FadePage(page: Loginsreen(),), (r) => false); - + ProjectViewModel().isLogin = false; + Navigator.pushAndRemoveUntil( + AppGlobal.CONTEX, + FadePage( + page: Loginsreen(), + ), + (r) => false); } navigateToUpdatePage(String message, String androidLink, iosLink) { @@ -158,7 +165,7 @@ class Helpers { iosLink: iosLink, ), ), - (r) => false); + (r) => false); } static String parseHtmlString(String htmlString) { From c4a6d9ad6f4bafd5ffb24dde83cb330d927d2fbb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 4 May 2021 12:58:18 +0300 Subject: [PATCH 083/102] prescription changes --- .../prescription/add_prescription_form.dart | 28 +++++++++++++++---- pubspec.lock | 8 +++--- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 07bf9d81..09d9f29e 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -641,8 +641,14 @@ class _PrescriptionFormWidgetState extends State { context) .route, route != null - ? route[ - 'description'] + ? model.itemMedicineListRoute + .length == + 1 + ? model.itemMedicineListRoute[ + 0][ + 'description'] + : route[ + 'description'] : null, true), enabled: false, @@ -726,8 +732,14 @@ class _PrescriptionFormWidgetState extends State { context) .frequency, frequency != null - ? frequency[ - 'description'] + ? model.itemMedicineList + .length == + 1 + ? model.itemMedicineList[ + 0][ + 'description'] + : frequency[ + 'description'] : null, true), enabled: false, @@ -1382,8 +1394,12 @@ class _PrescriptionFormWidgetState extends State { doseTimeIn: doseTime['id'].toString(), model: widget.model, duration: duration['id'].toString(), - frequency: frequency['parameterCode'].toString(), - route: route['parameterCode'].toString(), + frequency: model.itemMedicineList.length == 1 + ? model.itemMedicineList[0]['parameterCode'] + : frequency['parameterCode'].toString(), + route: model.itemMedicineListRoute.length == 1 + ? model.itemMedicineListRoute[0]['parameterCode'] + : route['parameterCode'].toString(), drugId: _selectedMedication.itemId.toString(), strength: strengthController.text, indication: indicationController.text, diff --git a/pubspec.lock b/pubspec.lock index ee31002d..1a572a0a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -573,7 +573,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -615,7 +615,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -907,7 +907,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" 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" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From f07208586da07d66344df4e2a07c81d3dfc0625e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 4 May 2021 16:38:52 +0300 Subject: [PATCH 084/102] Add Prescription changes --- .../prescription/add_prescription_form.dart | 144 +++++++++++------- 1 file changed, 91 insertions(+), 53 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 09d9f29e..71cdd1e4 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -438,7 +438,7 @@ class _PrescriptionFormWidgetState extends State { width: MediaQuery.of(context) .size .width * - 0.550, + 0.450, child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter( @@ -513,7 +513,7 @@ class _PrescriptionFormWidgetState extends State { width: MediaQuery.of(context) .size .width * - 0.350, + 0.450, child: InkWell( onTap: model.itemMedicineListUnit != @@ -561,14 +561,13 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of( - context) - .unit, + 'Select', model.itemMedicineListUnit .length == 1 - ? model.itemMedicineListUnit[ - 0][ + ? units = model + .itemMedicineListUnit[0] + [ 'description'] : units != null @@ -640,16 +639,16 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .route, - route != null - ? model.itemMedicineListRoute - .length == - 1 - ? model.itemMedicineListRoute[ - 0][ - 'description'] - : route[ + model.itemMedicineListRoute + .length == + 1 + ? model.itemMedicineListRoute[ + 0] + ['description'] + : route != null + ? route[ 'description'] - : null, + : null, true), enabled: false, ), @@ -731,16 +730,16 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .frequency, - frequency != null - ? model.itemMedicineList - .length == - 1 - ? model.itemMedicineList[ - 0][ - 'description'] - : frequency[ + model.itemMedicineList + .length == + 1 + ? model.itemMedicineList[ + 0] + ['description'] + : frequency != null + ? frequency[ 'description'] - : null, + : null, true), enabled: false, ), @@ -1150,12 +1149,13 @@ class _PrescriptionFormWidgetState extends State { formKey.currentState.save(); // Navigator.pop(context); // openDrugToDrug(); - if (route == null || - frequency == null || + if (frequency == null || + strengthController + .text == + null || doseTime == null || duration == null || - selectedDate == null || - units == null) { + selectedDate == null) { DrAppToastMsg.showErrorToast( TranslationBase.of( context) @@ -1218,27 +1218,48 @@ class _PrescriptionFormWidgetState extends State { // // .trim()) // // .toList() // // .join(' '), - // dose: - // strengthController - // .text, - // doseUnit: units[ - // 'parameterCode'] - // .toString(), - // patient: - // widget.patient, + // dose: strengthController + // .text, + // doseUnit: model + // .itemMedicineListUnit + // .length == + // 1 + // ? model + // .itemMedicineListUnit[ + // 0][ + // 'parameterCode'] + // .toString() + // : units['parameterCode'] + // .toString(), + // patient: widget.patient, // doseTimeIn: // doseTime['id'] // .toString(), // model: widget.model, - // duration: - // duration['id'] - // .toString(), - // frequency: frequency[ - // 'parameterCode'] - // .toString(), - // route: route[ - // 'parameterCode'] + // duration: duration['id'] // .toString(), + // frequency: model + // .itemMedicineList + // .length == + // 1 + // ? model + // .itemMedicineList[ + // 0][ + // 'parameterCode'] + // .toString() + // : frequency[ + // 'parameterCode'] + // .toString(), + // route: model.itemMedicineListRoute + // .length == + // 1 + // ? model + // .itemMedicineListRoute[ + // 0][ + // 'parameterCode'] + // .toString() + // : route['parameterCode'] + // .toString(), // drugId: // _selectedMedication // .itemId @@ -1252,8 +1273,7 @@ class _PrescriptionFormWidgetState extends State { // instruction: // instructionController // .text, - // doseTime: - // selectedDate, + // doseTime: selectedDate, // ); } } @@ -1362,7 +1382,7 @@ class _PrescriptionFormWidgetState extends State { children: [ DrugToDrug( widget.patient, - getPriscriptionforDrug(widget.prescriptionList), + getPriscriptionforDrug(widget.prescriptionList, model), model.patientAssessmentList), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), @@ -1447,7 +1467,17 @@ class _PrescriptionFormWidgetState extends State { }); } - getPriscriptionforDrug(List prescriptionList) { + // selectedValue(itemMdeicationList,key){ + // // String selected = ""; + // // units[key]=itemMdeicationList.length==1? itemMdeicationList[0][key]:units[key].toString(); + // // + // // selected = units[key]; + // // + // // return selected; + // // } + + getPriscriptionforDrug( + List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { prescriptionList[0].entityList.forEach((element) { @@ -1471,11 +1501,19 @@ class _PrescriptionFormWidgetState extends State { 'DrugId': _selectedMedication.mediSpanGPICode, 'DrugName': _selectedMedication.description, 'Dose': strengthController.text, - 'DoseType': units['parameterCode'].toString(), - 'Unit': units['description'], - 'FrequencyType': frequency['parameterCode'].toString(), + 'DoseType': model.itemMedicineListUnit.length == 1 + ? model.itemMedicineListUnit[0]['parameterCode'].toString() + : units['parameterCode'].toString(), + 'Unit': model.itemMedicineListUnit.length == 1 + ? model.itemMedicineListUnit[0]['description'] + : units['description'], + 'FrequencyType': model.itemMedicineList.length == 1 + ? model.itemMedicineList[0]['parameterCode'] + : frequency['parameterCode'].toString(), 'Duration': duration['id'].toString(), - 'RouteID': route['parameterCode'].toString(), + 'RouteID': model.itemMedicineListRoute.length == 1 + ? model.itemMedicineListRoute[0]['parameterCode'].toString() + : route['parameterCode'].toString(), 'IsScreen': true }); } From bf86fcc168ab83544da9eea587d6b36e73f72684 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 4 May 2021 17:35:44 +0300 Subject: [PATCH 085/102] fix in note and AddReplayOnReferralPatient --- ios/Podfile.lock | 2 +- lib/client/base_app_client.dart | 3 +-- lib/config/localized_values.dart | 2 +- .../service/DischargedPatientService.dart | 2 +- lib/screens/home/home_page_card.dart | 2 +- .../patients/profile/note/update_note.dart | 9 ++++---- .../referral/AddReplayOnReferralPatient.dart | 22 +++++++++---------- 7 files changed, 20 insertions(+), 22 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 2f4607e0..878a1850 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0.rc.1 +COCOAPODS: 1.10.1 diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index faef1fca..d6a72ab6 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -88,7 +88,6 @@ class BaseAppClient { onFailure(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); - if (parsed['ErrorType'] == 4) { helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); @@ -99,7 +98,7 @@ class BaseAppClient { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { await Helpers.logout(); - Helpers.showErrorToast('Your session expired Please login agian'); + Helpers.showErrorToast('Your session expired Please login again'); } if (isAllowAny) { onFailure(getError(parsed), statusCode); diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5d2b2de8..77186b0b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,7 +47,7 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'My InPatients', 'ar': 'مرضاي'}, + 'inPatient': {'en': 'My\n InPatients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, diff --git a/lib/core/service/DischargedPatientService.dart b/lib/core/service/DischargedPatientService.dart index 2d43afc6..9b54f308 100644 --- a/lib/core/service/DischargedPatientService.dart +++ b/lib/core/service/DischargedPatientService.dart @@ -44,7 +44,7 @@ class DischargedPatientService extends BaseService { Future gtMyDischargeReferralPatient() async { hasError = false; Map body = Map(); - await getDoctorProfile(); + await getDoctorProfile(isGetProfile: true); body['DoctorID'] = doctorProfile.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 2f85ff89..fef7dd5b 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 ? 130 : 250, diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 8997dd07..3fde4262 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -173,13 +173,12 @@ class _UpdateNoteOrderState extends State { ), ), bottomSheet: Container( + height: progressNoteController.text.isNotEmpty? 130:70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, + child: Column( children: [ - progressNoteController.text.isEmpty - ? SizedBox() - : Container( + if(progressNoteController.text.isNotEmpty) + Container( margin: EdgeInsets.all(5), child: AppButton( title: TranslationBase.of(context).clearText, diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 06f426d1..0626e3e8 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -22,7 +22,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; - //TODO Jammal + const AddReplayOnReferralPatient( {Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) : super(key: key); @@ -38,7 +38,7 @@ class _AddReplayOnReferralPatientState stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - TextEditingController progressNoteController = TextEditingController(); + TextEditingController replayOnReferralController = TextEditingController(); @override void initState() { requestPermissions(); @@ -71,12 +71,12 @@ class _AddReplayOnReferralPatientState children: [ AppTextFieldCustom( hintText: 'Replay your responses here', - controller: progressNoteController, + controller: replayOnReferralController, maxLines: 35, minLines: 25, hasBorder: true, validationError: - progressNoteController.text.isEmpty && + replayOnReferralController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, @@ -107,11 +107,11 @@ class _AddReplayOnReferralPatientState ), ), bottomSheet: Container( + height: replayOnReferralController.text.isNotEmpty? 130:70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, + child: Column( children: [ - progressNoteController.text.isEmpty + replayOnReferralController.text.isEmpty ? SizedBox() : Container( margin: EdgeInsets.all(5), @@ -120,7 +120,7 @@ class _AddReplayOnReferralPatientState title: TranslationBase.of(context).clearText, onPressed: () { setState(() { - progressNoteController.text = ''; + replayOnReferralController.text = ''; }); }, )), @@ -135,10 +135,10 @@ class _AddReplayOnReferralPatientState setState(() { isSubmitted = true; }); - if (progressNoteController.text.isNotEmpty) { + if (replayOnReferralController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); await widget.patientReferralViewModel.replay( - progressNoteController.text.trim(), + replayOnReferralController.text.trim(), widget.myReferralInPatientModel); if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { @@ -199,7 +199,7 @@ class _AddReplayOnReferralPatientState if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); - progressNoteController.text += reconizedWord + '\n'; + replayOnReferralController.text += reconizedWord + '\n'; }); } } From a82a3fa38db82ab94ac6c2da623a413ae384f42b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 4 May 2021 17:50:55 +0300 Subject: [PATCH 086/102] add prescription changes --- 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 71cdd1e4..d372e548 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1152,7 +1152,7 @@ class _PrescriptionFormWidgetState extends State { if (frequency == null || strengthController .text == - null || + "" || doseTime == null || duration == null || selectedDate == null) { From 16519d0ccfaa9106284010279e28d6102f566e27 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 4 May 2021 18:20:30 +0300 Subject: [PATCH 087/102] hot fix --- lib/config/localized_values.dart | 2 +- lib/screens/home/home_screen.dart | 3 +-- lib/screens/patients/PatientsInPatientScreen.dart | 2 +- .../profile/patient-profile-header-new-design-app-bar.dart | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 77186b0b..d09d33f4 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,7 +47,7 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'My\n InPatients', 'ar': 'مرضاي'}, + 'inPatient': {'en': '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 76dba1cf..79ceddbf 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -503,8 +503,7 @@ class _HomeScreenState extends State { Container( padding: EdgeInsets.all(10), child: AppText( - 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 75b65847..e6c28a51 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -107,7 +107,7 @@ class _PatientInPatientScreenState extends State with Si unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), - tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient, counter: model.myIinPatientList.length), + tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), ], ), 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 3d7638c2..d5c43892 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 @@ -303,7 +303,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget "${TranslationBase.of(context).numOfDays}: ", fontSize: 15, ), - if(isDischargedPatient) + if(isDischargedPatient && patient.dischargeDate!=null) AppText( "${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 15, From eb0fda35551460638b380158717e723981a6081d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 5 May 2021 12:17:21 +0300 Subject: [PATCH 088/102] hot fix --- .../prescription/add_prescription_form.dart | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index d372e548..fd7c09cf 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -385,8 +385,7 @@ class _PrescriptionFormWidgetState extends State { true; visbiltySearch = false; _selectedMedication = - model.allMedicationList[ - index]; + model.allMedicationList[index]; uom = _selectedMedication .uom; }, @@ -406,6 +405,8 @@ class _PrescriptionFormWidgetState extends State { child: Container( child: Column( children: [ + + AppText(_selectedMedication?.description??"",bold: true,), Container( child: Row( children: [ @@ -435,10 +436,7 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.450, + width: MediaQuery.of(context).size.width * 0.35, child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter( @@ -447,9 +445,7 @@ class _PrescriptionFormWidgetState extends State { // .digitsOnly ], hintText: - TranslationBase.of( - context) - .strength, + TranslationBase.of(context).strength, controller: strengthController, keyboardType: TextInputType @@ -560,20 +556,11 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: - textFieldSelectorDecoration( - 'Select', - model.itemMedicineListUnit - .length == - 1 - ? units = model - .itemMedicineListUnit[0] - [ - 'description'] - : units != - null - ? units[ - 'description'] - : null, + textFieldSelectorDecoration('Select', + + model.itemMedicineListUnit.length == 1 + ? units = model.itemMedicineListUnit[0]['description'] + : units != null ? units['description'].toString() : null, true), enabled: false), ), From 086ca517d20293690381725712c85a5452b22d1a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 5 May 2021 12:24:30 +0300 Subject: [PATCH 089/102] Add Medical Report Page --- .../profile/medical_report/MedicalReportPage.dart | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/screens/patients/profile/medical_report/MedicalReportPage.dart diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart new file mode 100644 index 00000000..f31c754e --- /dev/null +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -0,0 +1,8 @@ +import 'package:flutter/cupertino.dart'; + +class MedicalReportPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container(); + } +} From e16d91a1b8ef29e0829a47028127d0ca211488bf Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 12:49:26 +0300 Subject: [PATCH 090/102] add prescription form changes --- .../prescription/add_prescription_form.dart | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index fd7c09cf..27a9c53f 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -385,7 +385,8 @@ class _PrescriptionFormWidgetState extends State { true; visbiltySearch = false; _selectedMedication = - model.allMedicationList[index]; + model.allMedicationList[ + index]; uom = _selectedMedication .uom; }, @@ -405,8 +406,11 @@ class _PrescriptionFormWidgetState extends State { child: Container( child: Column( children: [ - - AppText(_selectedMedication?.description??"",bold: true,), + AppText( + _selectedMedication?.description ?? + "", + bold: true, + ), Container( child: Row( children: [ @@ -431,12 +435,15 @@ class _PrescriptionFormWidgetState extends State { SizedBox( height: spaceBetweenTextFileds), Container( - height: screenSize.height * 0.070, + height: screenSize.height * 0.076, width: double.infinity, child: Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.35, + width: MediaQuery.of(context) + .size + .width * + 0.35, child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter( @@ -445,7 +452,12 @@ class _PrescriptionFormWidgetState extends State { // .digitsOnly ], hintText: - TranslationBase.of(context).strength, + TranslationBase.of( + context) + .strength, + fontWeight: FontWeight.w500, + fontSize: 14.0, + borderWidth: 0.2, controller: strengthController, keyboardType: TextInputType @@ -509,7 +521,7 @@ class _PrescriptionFormWidgetState extends State { width: MediaQuery.of(context) .size .width * - 0.450, + 0.560, child: InkWell( onTap: model.itemMedicineListUnit != @@ -556,11 +568,20 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: - textFieldSelectorDecoration('Select', - - model.itemMedicineListUnit.length == 1 - ? units = model.itemMedicineListUnit[0]['description'] - : units != null ? units['description'].toString() : null, + textFieldSelectorDecoration( + 'Select', + model.itemMedicineListUnit + .length == + 1 + ? units = model + .itemMedicineListUnit[0] + [ + 'description'] + : units != + null + ? units['description'] + .toString() + : null, true), enabled: false), ), From c17d3d63e02af511bd857b50dcc3f3389ba4913e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 13:36:35 +0300 Subject: [PATCH 091/102] 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 27a9c53f..22e91415 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -435,7 +435,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox( height: spaceBetweenTextFileds), Container( - height: screenSize.height * 0.076, + height: screenSize.height * 0.062, width: double.infinity, child: Row( children: [ From ca11da36b3a4bc3da4c813a10413959163e2a241 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 14:17:59 +0300 Subject: [PATCH 092/102] hot fix --- lib/screens/prescription/add_prescription_form.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 22e91415..9fcd20cc 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -435,7 +435,11 @@ class _PrescriptionFormWidgetState extends State { SizedBox( height: spaceBetweenTextFileds), Container( - height: screenSize.height * 0.062, + //height: screenSize.height * 0.062, + height: MediaQuery.of(context) + .size + .height * + 0.06, width: double.infinity, child: Row( children: [ From 498e65180b1d937e7215981bc6e1ced1338b302f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 14:59:33 +0300 Subject: [PATCH 093/102] 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 ed8da38bc9dde5aa30d749c52b599c0a598f5409 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 15:04:41 +0300 Subject: [PATCH 094/102] hot fix --- lib/screens/prescription/add_prescription_form.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 9fcd20cc..91536aeb 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -444,6 +444,10 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( + height: MediaQuery.of(context) + .size + .height * + 0.06, width: MediaQuery.of(context) .size .width * @@ -521,6 +525,10 @@ class _PrescriptionFormWidgetState extends State { width: 10.0, ), Container( + height: MediaQuery.of(context) + .size + .height * + 0.06, color: Colors.white, width: MediaQuery.of(context) .size From 68e9470273e259894246c3c2007c167fb9ac8e55 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 16:06:02 +0300 Subject: [PATCH 095/102] hot fix --- lib/config/config.dart | 2 +- .../prescription/add_prescription_form.dart | 86 ++++++++++--------- .../text_fields/app-textfield-custom.dart | 29 ++++--- 3 files changed, 64 insertions(+), 53 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/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 91536aeb..b9951f8e 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -439,20 +440,20 @@ class _PrescriptionFormWidgetState extends State { height: MediaQuery.of(context) .size .height * - 0.06, + 0.075, width: double.infinity, child: Row( children: [ Container( - height: MediaQuery.of(context) - .size - .height * - 0.06, + // height: MediaQuery.of(context) + // .size + // .height * + // 0.02, width: MediaQuery.of(context) .size .width * 0.35, - child: TextFields( + child: AppTextFieldCustom( inputFormatters: [ LengthLimitingTextInputFormatter( 5), @@ -463,15 +464,16 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .strength, - fontWeight: FontWeight.w500, - fontSize: 14.0, - borderWidth: 0.2, + // fontWeight: FontWeight.w500, + // fontSize: 14.0, + // borderWidth: 0.2, + controller: strengthController, - keyboardType: TextInputType - .numberWithOptions( - decimal: true, - ), + // keyboardType: TextInputType + // .numberWithOptions( + // decimal: true, + // ), onChanged: (String value) { setState(() { strengthChar = @@ -486,30 +488,30 @@ class _PrescriptionFormWidgetState extends State { ); } }, - onSubmit: (_) { - 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; - } - }, + // 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 > @@ -522,13 +524,13 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox( - width: 10.0, + width: 5.0, ), Container( - height: MediaQuery.of(context) - .size - .height * - 0.06, + // height: MediaQuery.of(context) + // .size + // .height * + // 0.06, color: Colors.white, width: MediaQuery.of(context) .size diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index da92f574..e00ffc7b 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -57,7 +57,9 @@ class _AppTextFieldCustomState extends State { return Column( children: [ Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null, + height: widget.height != 0 && widget.maxLines == 1 + ? widget.height + 8 + : null, decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), @@ -92,13 +94,16 @@ class _AppTextFieldCustomState extends State { ), widget.dropDownText == null ? Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null, - child: TextField( + height: + widget.height != 0 && widget.maxLines == 1 + ? widget.height - 22 + : null, + child: TextField( textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left, - decoration: - TextFieldsUtils.textFieldSelectorDecoration( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( widget.hintText, null, true), style: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, @@ -106,13 +111,17 @@ class _AppTextFieldCustomState extends State { color: Color(0xFF575757), ), controller: widget.controller, - keyboardType: widget.inputType?? (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline), + keyboardType: widget.inputType ?? + (widget.maxLines == 1 + ? TextInputType.text + : TextInputType.multiline), enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null - ? widget.inputFormatters - : [], + inputFormatters: + widget.inputFormatters != null + ? widget.inputFormatters + : [], onChanged: (value) { setState(() {}); if (widget.onChanged != null) { @@ -120,7 +129,7 @@ class _AppTextFieldCustomState extends State { } }, ), - ) + ) : AppText( widget.dropDownText, fontFamily: 'Poppins', From d2814f610e480679eeb6e796cbb6e5a30e24c0af Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 16:28:46 +0300 Subject: [PATCH 096/102] hot fix --- lib/screens/prescription/add_prescription_form.dart | 4 +++- lib/widgets/shared/text_fields/app-textfield-custom.dart | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index b9951f8e..cfb6263b 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -440,7 +440,7 @@ class _PrescriptionFormWidgetState extends State { height: MediaQuery.of(context) .size .height * - 0.075, + 0.0749, width: double.infinity, child: Row( children: [ @@ -454,6 +454,7 @@ class _PrescriptionFormWidgetState extends State { .width * 0.35, child: AppTextFieldCustom( + isPrscription: true, inputFormatters: [ LengthLimitingTextInputFormatter( 5), @@ -464,6 +465,7 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .strength, + // fontWeight: FontWeight.w500, // fontSize: 14.0, // borderWidth: 0.2, diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index e00ffc7b..ded2568d 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -25,6 +25,7 @@ class AppTextFieldCustom extends StatefulWidget { final List inputFormatters; final Function(String) onChanged; final String validationError; + final bool isPrscription; AppTextFieldCustom({ this.height = 0, @@ -43,6 +44,7 @@ class AppTextFieldCustom extends StatefulWidget { this.inputFormatters, this.onChanged, this.validationError, + this.isPrscription = false, }); @override @@ -89,7 +91,9 @@ class _AppTextFieldCustomState extends State { AppText( widget.hintText, color: Color(0xFF2E303A), - fontSize: SizeConfig.textMultiplier * 1.4, + fontSize: widget.isPrscription == false + ? SizeConfig.textMultiplier * 1.3 + : 0, fontWeight: FontWeight.w700, ), widget.dropDownText == null From 6107f88c16df45085c0d4ad5003752ed011cd6a5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 6 May 2021 13:37:30 +0300 Subject: [PATCH 097/102] 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 098/102] 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 099/102] 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 100/102] 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 101/102] 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 292bc2a97fc0ee0b1f176fb79e83f3712f9ee4a3 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 6 May 2021 15:20:31 +0300 Subject: [PATCH 102/102] 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';