From e530646c28bf22881f84257e0afb7ec226f17b15 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Aug 2023 14:25:31 +0300 Subject: [PATCH] VidaPlus changes for radiology --- lib/config/config.dart | 4 +- .../hospitals/VidaPlusProjectListModel.dart | 15 ++ .../service/hospitals/hospitals_service.dart | 8 + .../radiology/radiology_service.dart | 6 +- .../viewModel/authentication_view_model.dart | 6 +- lib/core/viewModel/project_view_model.dart | 27 ++- lib/core/viewModel/radiology_view_model.dart | 4 +- lib/screens/auth/login_screen.dart | 225 ++++++++---------- .../patient_profile_screen.dart | 4 + .../profile_gird_for_other.dart | 118 ++------- .../radiology/radiology_details_page.dart | 11 +- .../radiology/radiology_home_page.dart | 13 +- lib/utils/utils.dart | 55 ++--- .../app_bar/patient-profile-app-bar.dart | 206 ++++++---------- 14 files changed, 293 insertions(+), 409 deletions(-) create mode 100644 lib/core/model/hospitals/VidaPlusProjectListModel.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 7be1e61f..b589e661 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -8,11 +8,11 @@ const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; // const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL -// const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL +const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; diff --git a/lib/core/model/hospitals/VidaPlusProjectListModel.dart b/lib/core/model/hospitals/VidaPlusProjectListModel.dart new file mode 100644 index 00000000..e56b82db --- /dev/null +++ b/lib/core/model/hospitals/VidaPlusProjectListModel.dart @@ -0,0 +1,15 @@ +class VidaPlusProjectListModel { + int projectID; + + VidaPlusProjectListModel({this.projectID}); + + VidaPlusProjectListModel.fromJson(Map json) { + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index 96267d01..09e5a365 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -1,10 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { List hospitals = List(); + List vidaPlusProjectListModel = List(); Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; @@ -15,6 +17,12 @@ class HospitalsService extends BaseService { response['ProjectInfo'].forEach((hospital) { hospitals.add(GetHospitalsResponseModel.fromJson(hospital)); }); + vidaPlusProjectListModel.clear(); + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 10eb9a49..22765c6d 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -10,11 +10,11 @@ class RadiologyService extends BaseService { String url = ''; bool isRadiologyVIDAPlus = false; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient}) async { hasError = false; final Map body = new Map(); - body['InvoiceNo'] = invoiceNo; - body['InvoiceNo_VP'] = invoiceNo; + body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; + body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 52cdb1f7..aec315c8 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; +import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/authentication_service.dart'; @@ -52,6 +53,8 @@ class AuthenticationViewModel extends BaseViewModel { CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; + List get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel; + NewLoginInformationModel loggedUser; GetIMEIDetailsModel user; @@ -238,7 +241,8 @@ class AuthenticationViewModel extends BaseViewModel { /// add token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); + await sharedPref.setString( + DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 7e0c2468..9be8774a 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -6,6 +6,7 @@ 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/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:flutter/cupertino.dart'; @@ -32,12 +33,14 @@ class ProjectViewModel with ChangeNotifier { bool get isArabic => _isArabic; StreamSubscription subscription; + List _vidaPlusProjectListModel = List(); + + List get vidaPlusProjectList => _vidaPlusProjectListModel; + ProjectViewModel() { loadSharedPrefLanguage(); - subscription = Connectivity() - .onConnectivityChanged - .listen((ConnectivityResult result) { + subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { switch (result) { case ConnectivityResult.wifi: isInternetConnection = true; @@ -53,6 +56,11 @@ class ProjectViewModel with ChangeNotifier { }); } + setVidaPlusProjectList(List vidaPlusProjectListModelInput) { + _vidaPlusProjectListModel = vidaPlusProjectListModelInput; + notifyListeners(); + } + void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_Language); _appLocale = Locale(currentLanguage ?? 'en'); @@ -95,12 +103,18 @@ class ProjectViewModel with ChangeNotifier { try { dynamic localRes; - await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, onSuccess: (dynamic response, int statusCode) { doctorClinicsList = []; response['List_DoctorsClinic'].forEach((v) { doctorClinicsList.add(new ClinicModel.fromJson(v)); }); + _vidaPlusProjectListModel.clear(); + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + _vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + }); + setVidaPlusProjectList(_vidaPlusProjectListModel); + } localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -122,7 +136,6 @@ class ProjectViewModel with ChangeNotifier { projectID: doctorProfile.projectID, ); - await Provider.of(AppGlobal.CONTEX, listen: false) - .getDoctorProfileBasedOnClinic(clinicModel); + await Provider.of(AppGlobal.CONTEX, listen: false).getDoctorProfileBasedOnClinic(clinicModel); } } diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index 57cccce5..e49af610 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -53,9 +53,9 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 0527742a..c1ce9c3c 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -32,10 +33,12 @@ class _LoginScreenState extends State { FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: false, backgroundColor: HexColor('#F8F8F8'), @@ -44,142 +47,106 @@ class _LoginScreenState extends State { Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), alignment: Alignment.topLeft, - child: Column( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( + //TODO Use App Text rather than text + Container( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - //TODO Use App Text rather than text - Container( - child: Column( + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - ], + SizedBox( + height: 30, ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Text( - TranslationBase.of(context).welcomeTo, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase.of(context) - .drSulaimanAlHabib, - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontSize: SizeConfig.isMobile - ? 24 - : SizeConfig.realScreenWidth * - 0.029, - fontFamily: 'Poppins'), - ), - Text( - "Doctor App", - style: TextStyle( - fontSize: SizeConfig.isMobile - ? 16 - : SizeConfig.realScreenWidth * - 0.030, - fontWeight: FontWeight.w600, - color: Color(0xFFD02127)), - ), - ]), ], - )), - SizedBox( - height: 40, ), - Form( - key: loginFormKey, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: SizeConfig.realScreenWidth * 0.90, - height: SizeConfig.realScreenHeight * 0.65, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - buildSizedBox(), - AppTextFieldCustom( - hintText: - TranslationBase.of(context).enterId, - hasBorder: true, - controller: userIdController, - onChanged: (value) { - if (value != null) - setState(() { - authenticationViewModel.userInfo - .userID = value.trim(); - }); - }, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context) - .enterPassword, - hasBorder: true, - isSecure: true, - controller: passwordController, - onChanged: (value) { - if (value != null) - setState(() { - authenticationViewModel.userInfo - .password = value.trim(); - }); - // if(allowCallApi) { - this.getProjects( - authenticationViewModel - .userInfo.userID); - // setState(() { - // allowCallApi = false; - // }); - // } - }, - onClick: () {}, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context) - .selectYourProject, - hasBorder: true, - controller: projectIdController, - isTextFieldHasSuffix: true, - enabled: false, - onClick: () { - Utils.showCupertinoPicker( - context, - projectsList, - 'facilityName', - onSelectProject, - authenticationViewModel); - }, - ), - buildSizedBox() - ]), - ), - ], + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 10, + ), + Text( + TranslationBase.of(context).welcomeTo, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, fontFamily: 'Poppins'), + ), + Text( + TranslationBase.of(context).drSulaimanAlHabib, + style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, fontFamily: 'Poppins'), ), - ) + Text( + "Doctor App", + style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)), + ), + ]), ], + )), + SizedBox( + height: 40, + ), + Form( + key: loginFormKey, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: SizeConfig.realScreenWidth * 0.90, + height: SizeConfig.realScreenHeight * 0.65, + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterId, + hasBorder: true, + controller: userIdController, + onChanged: (value) { + if (value != null) + setState(() { + authenticationViewModel.userInfo.userID = value.trim(); + }); + }, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterPassword, + hasBorder: true, + isSecure: true, + controller: passwordController, + onChanged: (value) { + if (value != null) + setState(() { + authenticationViewModel.userInfo.password = value.trim(); + }); + // if(allowCallApi) { + this.getProjects(authenticationViewModel.userInfo.userID); + // setState(() { + // allowCallApi = false; + // }); + // } + }, + onClick: () {}, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).selectYourProject, + hasBorder: true, + controller: projectIdController, + isTextFieldHasSuffix: true, + enabled: false, + onClick: () { + Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel); + }, + ), + buildSizedBox() + ]), + ), + ], + ), ) - ])) + ], + ) + ])) ]), ), bottomSheet: Container( @@ -195,8 +162,7 @@ class _LoginScreenState extends State { title: TranslationBase.of(context).login, color: AppGlobal.appRedColor, fontWeight: FontWeight.w600, - disabled: authenticationViewModel.userInfo.userID == null || - authenticationViewModel.userInfo.password == null, + disabled: authenticationViewModel.userInfo.userID == null || authenticationViewModel.userInfo.password == null, onPressed: () { login(context); }, @@ -246,8 +212,7 @@ class _LoginScreenState extends State { onSelectProject(index) { setState(() { - authenticationViewModel.userInfo.projectID = - projectsList[index].facilityId; + authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; projectIdController.text = projectsList[index].facilityName; }); @@ -264,8 +229,8 @@ class _LoginScreenState extends State { if (authenticationViewModel.state == ViewState.Idle) { projectsList = authenticationViewModel.hospitals; setState(() { - authenticationViewModel.userInfo.projectID = - projectsList[0].facilityId; + projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList); + authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; projectIdController.text = projectsList[0].facilityName; }); } 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 64f28ba9..bde71637 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; @@ -25,6 +26,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import 'package:quiver/async.dart'; import '../../../../locator.dart'; @@ -137,6 +139,7 @@ class _PatientProfileScreenState extends State with Single @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); @@ -199,6 +202,7 @@ class _PatientProfileScreenState extends State with Single isFromLiveCare: isFromLiveCare, from: from, to: to, + projectViewModel: projectViewModel, ), ), SizedBox( 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 1084f7f2..f9ea94a0 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,6 +1,8 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; @@ -16,122 +18,50 @@ class ProfileGridForOther extends StatelessWidget { final bool isFromLiveCare; String from; String to; + ProjectViewModel projectViewModel; - ProfileGridForOther( - {Key key, - this.patient, - this.patientType, - this.arrivalType, - this.height, - this.isInpatient, - this.from, - this.to, - this.isFromLiveCare}) - : super(key: key); + ProfileGridForOther({Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to, this.isFromLiveCare, this.projectViewModel}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, - 'assets/images/svgs/profile_screen/vital signs.svg', + PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'assets/images/svgs/profile_screen/lab results.svg', + PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).special, - ALL_SPECIAL_LAB_RESULT, - 'assets/images/svgs/profile_screen/lab results.svg', - isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).service, - RADIOLOGY_PATIENT, - 'assets/images/svgs/profile_screen/health summary.svg', - isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', - ORDER_PRESCRIPTION_OLD, - 'assets/images/svgs/profile_screen/order prescription.svg', - isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, - 'assets/images/svgs/profile_screen/health summary.svg', + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", - PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', + PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'assets/images/svgs/profile_screen/Order Procedures.svg', + PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, - PATIENT_INSURANCE_APPROVALS_NEW, - 'assets/images/svgs/profile_screen/insurance approval.svg', + PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, - ADD_SICKLEAVE, - 'assets/images/svgs/profile_screen/patient sick leave.svg', + PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, - PATIENT_UCAF_REQUEST, - 'assets/images/svgs/profile_screen/UCAF.svg', - isInPatient: isInpatient, - isDisable: isFromLiveCare - ? patient.appointmentNo == null - : patient.patientStatusType != 43 || - patient.appointmentNo == null), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', + isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null), + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, - isDisable: isFromLiveCare - ? patient.appointmentNo == null - : patient.patientStatusType != 43 || - patient.appointmentNo == null, + isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null, ), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, - PATIENT_ADMISSION_REQUEST, - 'assets/images/svgs/profile_screen/admission req.svg', + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, - isDisable: isFromLiveCare - ? patient.appointmentNo == null - : patient.patientStatusType != 43 || - patient.appointmentNo == null), + isDisable: + Utils.isVidaPlusProject(projectViewModel, patient.projectId) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null), ]; return Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index ae5abefc..a71bc59d 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,15 +1,18 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../../../locator.dart'; @@ -26,9 +29,15 @@ class RadiologyDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getRadImageURL( - patient: patient, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), + patient: patient, + projectId: finalRadiology.projectID, + lineItem: finalRadiology.invoiceLineItemNo, + invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID), + ), builder: (_, model, widget) => AppScaffold( appBar: PatientProfileAppBar( patient, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 0f64185c..cc419e06 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -143,7 +143,10 @@ class _RadiologyHomePageState extends State { isNoMargin: true, doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName), profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}', + invoiceNO: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID) + ? '${model.radiologyList[index].invoiceNo_VP}' + : '${model.radiologyList[index].invoiceNo}', + // model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}', branch: '${model.radiologyList[index].projectName}', clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription), appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, @@ -152,7 +155,13 @@ class _RadiologyHomePageState extends State { context, FadePage( page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], patient: patient, isInpatient: isInpatient, isVidaPlus: model.radiologyList[index].isRecordFromVidaPlus), + finalRadiology: model.radiologyList[index], + patient: patient, + isInpatient: isInpatient, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID) + // false + // model.radiologyList[index].isRecordFromVidaPlus + ), ), ); }, diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 48213619..9907a032 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -25,8 +26,7 @@ class Utils { get currentLanguage => null; - static showConfirmationDialog( - BuildContext context, String message, Function okFunction) { + static showConfirmationDialog(BuildContext context, String message, Function okFunction) { return showDialog( context: context, barrierDismissible: false, // user must tap button! @@ -63,8 +63,7 @@ class Utils { }); } - static showCupertinoPicker(context, List items, - decKey, onSelectFun, AuthenticationViewModel model) { + static showCupertinoPicker(context, List items, decKey, onSelectFun, AuthenticationViewModel model) { showModalBottomSheet( isDismissible: false, context: context, @@ -82,8 +81,7 @@ class Utils { mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( - child: Text(TranslationBase.of(context).cancel, - style: textStyle(context)), + child: Text(TranslationBase.of(context).cancel, style: textStyle(context)), onPressed: () { Navigator.pop(context); }, @@ -101,27 +99,19 @@ class Utils { ], ), ), - Container( - height: SizeConfig.realScreenHeight * 0.3, - color: Color(0xfff7f7f7), - child: buildPickerItems( - context, items, decKey, onSelectFun, model)) + Container(height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model)) ], ), ); }); } + static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); - static TextStyle textStyle(context) => - TextStyle(color: Theme.of(context).primaryColor); - - static buildPickerItems(context, List items, - decKey, onSelectFun, model) { + static buildPickerItems(context, List items, decKey, onSelectFun, model) { return CupertinoPicker( magnification: 1.5, - scrollController: - FixedExtentScrollController(initialItem: cupertinoPickerIndex), + scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), children: items.map((item) { return Text( '${item.facilityName}', @@ -147,10 +137,8 @@ class Utils { } static Future checkConnection() async { - ConnectivityResult connectivityResult = - await (Connectivity().checkConnectivity()); - if ((connectivityResult == ConnectivityResult.mobile) || - (connectivityResult == ConnectivityResult.wifi)) { + ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); + if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) { return true; } else { return false; @@ -163,8 +151,7 @@ class Utils { listOfHours.forEach((element) { WorkingHours workingHours = WorkingHours(); - var from = element.substring( - element.indexOf('m ') + 2, element.indexOf('To') - 1); + var from = element.substring(element.indexOf('m ') + 2, element.indexOf('To') - 1); workingHours.from = from.trim(); var to = element.substring(element.indexOf('To') + 2); workingHours.to = to.trim(); @@ -232,9 +219,7 @@ class Utils { return parsedString; } - static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon, Color dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -264,9 +249,7 @@ class Utils { ); } - static BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor, - {double borderWidth = -1}) { + static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -326,8 +309,6 @@ class Utils { return kpi; } - - static String convertToTitleCase(String text) { if (text == null) { return null; @@ -354,4 +335,14 @@ class Utils { // Join/Merge all words back to one String return capitalizedWords.join(' '); } + + static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) { + bool isVidaPlus = false; + projectViewModel.vidaPlusProjectList.forEach((element) { + if (element.projectID == projectID) { + isVidaPlus = true; + } + }); + return isVidaPlus; + } } diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart index c27c9dd7..19578c2b 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart @@ -73,17 +73,14 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { right: 5, bottom: 5, ), - decoration: BoxDecoration( - color: Colors.white, - border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))), + decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))), child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + padding: EdgeInsets.only(left: 10, right: 10, bottom: 0), margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50), child: Column( children: [ Container( - padding: EdgeInsets.only( - left: SizeConfig.isHeightVeryShort ? 0 : 12.0), + padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0), child: Row(children: [ IconButton( icon: Icon(Icons.arrow_back_ios), @@ -96,11 +93,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Expanded( child: AppText( patient.firstName != null - ? (Utils.capitalize(patient.firstName) + - " " + - Utils.capitalize(patient.lastName)) - : Utils.capitalize(patient.fullName ?? - patient.patientDetails.fullName), + ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName)) + : Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -133,15 +127,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), Row(children: [ Padding( - padding: EdgeInsets.only( - left: SizeConfig.isHeightVeryShort ? 0 : 12.0), + padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0), child: Container( width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -164,29 +155,18 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { color: AppGlobal.appGreenColor, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ) : AppText( TranslationBase.of(context).notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), patient.startTime != null - ? AppText( - patient.startTime != null - ? patient.startTime - : '', - fontWeight: FontWeight.w700, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, - color: Color(0xFF2E303A)) + ? AppText(patient.startTime != null ? patient.startTime : '', + fontWeight: FontWeight.w700, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A)) : SizedBox() ], )) @@ -199,9 +179,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { children: [ AppText( TranslationBase.of(context).fileNumber, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF575757), fontWeight: FontWeight.w600, ), @@ -210,9 +188,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), AppText( patient.patientId.toString(), - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, isCopyable: true, @@ -222,14 +198,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Row( children: [ AppText( - patient.nationalityName ?? - patient.nationality ?? - patient.nationalityId ?? - '', + patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), patient.nationalityFlagURL != null ? ClipRRect( @@ -238,9 +209,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { patient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) @@ -256,42 +225,29 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), - if (patient.appointmentDate != null && - patient.appointmentDate.isNotEmpty && - !isFromLabResult) + if (patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult) HeaderRow( - label: - TranslationBase.of(context).appointmentDate + " : ", - value: AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - patient.appointmentDate)), + label: TranslationBase.of(context).appointmentDate + " : ", + value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate)), ), if (isFromLabResult) HeaderRow( label: "Result Date: ", - value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patient.admissionDate != null && - patient.admissionDate.isNotEmpty) + if (patient.admissionDate != null && patient.admissionDate.isNotEmpty) HeaderRow( - label: patient.admissionDate == null - ? "" - : TranslationBase.of(context).admissionDate + - " : ", - value: patient.admissionDate == null - ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", + label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ", + value: patient.admissionDate == null ? "" : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", ), if (patient.admissionDate != null) HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", - value: isDischargedPatient && - patient.dischargeDate != null + value: isDischargedPatient && patient.dischargeDate != null ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", ) @@ -308,15 +264,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Container( width: 30, height: 30, - margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), + 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), + bottom: BorderSide(color: Colors.grey[400], width: 2.5), left: BorderSide(color: Colors.grey[400], width: 2.5), )), ), @@ -339,65 +291,50 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { flex: 5, child: Container( margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - Utils.convertToTitleCase( - '${TranslationBase.of(context).dr}$doctorName'), - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, - isCopyable: true, - ), - if (orderNo != null && !isPrescriptions) - HeaderRow( - label: 'Order No: ', - value: orderNo ?? '', - ), - if (invoiceNO != null && !isPrescriptions) - HeaderRow( - label: 'Invoice: ', - value: invoiceNO ?? "", - ), - if (branch != null) - HeaderRow( - label: 'Branch: ', - value: branch ?? '', - ), - if (clinic != null) - Container( - width: - MediaQuery.of(context).size.width * - 0.51, - child: HeaderRow( - label: 'Clinic: ', - value: Utils.convertToTitleCase( - clinic) ?? - '', - isExpanded: true), - ), - if (isMedicalFile && episode != null) - HeaderRow( - label: 'Episode: ', - value: episode ?? '', - ), - if (isMedicalFile && visitDate != null) - HeaderRow( - label: 'Visit Date: ', - value: visitDate ?? '', - ), - if (!isMedicalFile) - HeaderRow( - label: !isPrescriptions - ? 'Result Date:' - : 'Prescriptions Date ', - value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - ), - ]), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText( + Utils.convertToTitleCase('${TranslationBase.of(context).dr}$doctorName'), + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + isCopyable: true, + ), + if (orderNo != null && !isPrescriptions) + HeaderRow( + label: 'Order No: ', + value: orderNo ?? '', + ), + if (invoiceNO != null && !isPrescriptions) + HeaderRow( + label: 'Invoice: ', + value: invoiceNO ?? "", + ), + if (branch != null) + HeaderRow( + label: 'Branch: ', + value: branch ?? '', + ), + if (clinic != null) + Container( + width: MediaQuery.of(context).size.width * 0.51, + child: HeaderRow(label: 'Clinic: ', value: Utils.convertToTitleCase(clinic) ?? '', isExpanded: true), + ), + if (isMedicalFile && episode != null) + HeaderRow( + label: 'Episode: ', + value: episode ?? '', + ), + if (isMedicalFile && visitDate != null) + HeaderRow( + label: 'Visit Date: ', + value: visitDate ?? '', + ), + if (!isMedicalFile) + HeaderRow( + label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', + value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + ), + ]), ), ), ], @@ -424,7 +361,6 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? 137 : SizeConfig.isHeightShort ? 190 - : SizeConfig.heightMultiplier * - (SizeConfig.isWidthLarge ? 25 : 20) + : SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge ? 25 : 20) : height); }