diff --git a/lib/config/config.dart b/lib/config/config.dart index 98393a63..f402bea2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -//const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = @@ -121,7 +121,7 @@ const GET_DASHBOARD = const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; const ARRIVED_PATIENT_URL = - 'Services/DoctorApplication.svc/REST/PatientArrivalList​'; + 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; @@ -143,9 +143,6 @@ const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_ARRIVAL_LIST = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; - ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_SPECIAL_RESULT = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f4124842..cec5693c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -333,7 +333,7 @@ const Map> localizedValues = { 'branch': {'en': "Branch", 'ar': 'الفرع'}, 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, 'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'}, - 'refer': {'en': "REFER", 'ar': 'إحالة'}, + 'refer': {'en': "Refer", 'ar': 'إحالة'}, 'rejected': {'en': "Rejected", 'ar': 'مرفوض'}, 'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'}, 'otherBranch': {'en': "Other Branch", 'ar': 'فرع آخر'}, diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 6f4c5d1e..c97fdea9 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -38,15 +38,15 @@ class BaseService { body['To'] = date; body['PageIndex'] = 0; body['PageSize'] = 0; - if(patientMrn == -1){ + if(patientMrn != -1){ body['PatientMRN'] = patientMrn; } - if(appointmentNo == -1){ + if(appointmentNo != -1){ body['AppointmentNo'] = appointmentNo; } await baseAppClient.post( - GET_PATIENT_ARRIVAL_LIST, + ARRIVED_PATIENT_URL, onSuccess: (dynamic response, int statusCode) { patientArrivalList.clear(); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 00ef09f6..7458456c 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -158,8 +158,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, - patientMrn: patientMrn, - appointmentNo: appointmentNo); + patientMrn: patientMrn); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.Error); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 5c4bfbfe..9627353f 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -225,7 +225,7 @@ class ProcedureViewModel extends BaseViewModel { await _labsService.getPatientLabOrdersList(patient); if (_labsService.hasError) { error = _labsService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { _labsService.patientLabOrdersList.forEach((element) { List patientLabOrdersClinic = diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 77fddfe5..b52fabed 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -61,10 +61,10 @@ class _MedicalFileDetailsState extends State { this.encounterNumber, this.pp, this.patient}); - bool isPhysicalExam = false; - bool isProcedureExpand = false; - bool isHistoryExpand = false; - bool isAssessmentExpand = false; + bool isPhysicalExam = true; + bool isProcedureExpand = true; + bool isHistoryExpand = true; + bool isAssessmentExpand = true; @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index ffb12ee1..4b462225 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -5,6 +5,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/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/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -28,15 +29,16 @@ class ECGPage extends StatelessWidget { patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, backgroundColor: Color(0xffF8F8F8), + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + // PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), SizedBox(height: 12,), Texts('Service',style: "caption2",color: Colors.black,), Texts('ECG',bold: true,fontSize: 22,), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index ddbbcd45..a61477e7 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; @@ -34,22 +35,22 @@ class _LaboratoryResultPageState extends State { orderNo: widget.patientLabOrders.orderNo, patient: widget.patient), builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - // appBarTitle: TranslationBase.of(context).labResults, + isShowAppBar: true, + appBar: PatientProfileHeaderWhitAppointmentAppBar( + patient: widget.patient, + patientType: widget.patientType??"0", + arrivalType: widget.arrivalType??"0", + orderNo: widget.patientLabOrders.orderNo, + appointmentDate:widget.patientLabOrders.orderDate, + doctorName: widget.patientLabOrders.doctorName, + profileUrl: widget.patientLabOrders.doctorImageURL, + invoiceNO: widget.patientLabOrders.invoiceNo, + ), baseViewModel: model, body: Scaffold( body: SingleChildScrollView( child: Column( children: [ - PatientProfileHeaderWhitAppointment(patient: widget.patient, - patientType: widget.patientType??"0", - arrivalType: widget.arrivalType??"0", - orderNo: widget.patientLabOrders.orderNo, - appointmentDate:widget.patientLabOrders.orderDate, - doctorName: widget.patientLabOrders.doctorName, - profileUrl: widget.patientLabOrders.doctorImageURL, - invoiceNO: widget.patientLabOrders.invoiceNo, - ), ...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget( onTap: () async { 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 bbf60821..bdc001fb 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -7,6 +7,7 @@ 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/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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; @@ -34,7 +35,8 @@ class LabsHomePage extends StatelessWidget { onModelReady: (model) => model.getLabs(patient), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString() ?? '0', patientType), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -42,8 +44,6 @@ class LabsHomePage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign(patient, - patient.patientType.toString() ?? '0', patientType), SizedBox( height: 12, ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index ac94b3d3..72d75f89 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -6,6 +6,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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -29,25 +30,23 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - - isShowAppBar: false, + appBar: PatientProfileHeaderWhitAppointmentAppBar( + patient: patient, + patientType: patientType??"0", + arrivalType: arrivalType??"0", + orderNo: finalRadiology.orderNo.toString(), + appointmentDate:finalRadiology.orderDate, + doctorName: finalRadiology.doctorName, + profileUrl: finalRadiology.doctorImageURL, + invoiceNO: finalRadiology.invoiceNo.toString(), + ), + isShowAppBar: true, baseViewModel: model, body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - - PatientProfileHeaderWhitAppointment(patient: patient, - patientType: patientType??"0", - arrivalType: arrivalType??"0", - orderNo: finalRadiology.orderNo.toString(), - appointmentDate:finalRadiology.orderDate, - doctorName: finalRadiology.doctorName, - profileUrl: finalRadiology.doctorImageURL, - invoiceNO: finalRadiology.invoiceNo.toString(), - ), - Container( decoration: BoxDecoration( diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index f083f779..51330bb1 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_ import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.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/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; @@ -30,16 +31,15 @@ class RadiologyHomePage extends StatelessWidget { return BaseView( onModelReady: (model) => model.getPatientRadOrders(patient), builder: (_, model, widget) => AppScaffold( - isShowAppBar: false, + isShowAppBar: true, // appBarTitle: TranslationBase.of(context).radiology, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString() ?? '0', arrivalType), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( physics: BouncingScrollPhysics(), children: [ - PatientProfileHeaderNewDesign( - patient, patient.patientType.toString() ?? '0', arrivalType), SizedBox( height: 12, ), diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index d6d9e8b6..3c2197f3 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -70,12 +70,14 @@ class MyReferralDetailScreen extends StatelessWidget { color: Colors.black, //Colors.black, onPressed: () => Navigator.pop(context), ), - AppText( - (Helpers.capitalize(model.patientArrivalList[0].patientDetails.fullName)), - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', + Expanded( + child: AppText( + (Helpers.capitalize(model.patientArrivalList[0].patientDetails.fullName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), ), model.patientArrivalList[0].patientDetails.gender == 1 ? Icon( diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 6f053089..43c1382e 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -1,4 +1,5 @@ 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/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -9,6 +10,8 @@ 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/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -46,6 +49,8 @@ class _PatientMakeReferralScreenState extends State { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; referToList = List(); dynamic sameBranch = { @@ -66,46 +71,69 @@ class _PatientMakeReferralScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, + isShowAppBar: false, body: SingleChildScrollView( child: Container( child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - /*if (model.state == ViewState.BusyLocal) - Container( - color: Colors.white, - width: 50, - height: 50, - child: AppLoaderWidget( - containerColor: Colors.white, - )),*/ Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientPageHeaderWidget(patient), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, + PatientProfileHeaderNewDesign( + patient, patientType, arrivalType), + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).refer}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + ), + AppText( + "${TranslationBase.of(context).patient}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), ), model.patientReferral.length == 0 - ? ReferralForm(model, screenSize) + ? referralForm(model, screenSize) : PatientReferralItemWidget( - "${model.patientReferral[model.patientReferral.length -1].patientID}", - patientName: model.patientReferral[model.patientReferral.length -1].patientName, + "${model.patientReferral[model.patientReferral.length - 1].patientID}", + patientName: model + .patientReferral[ + model.patientReferral.length - 1] + .patientName, referralStatus: - "${model.patientReferral[model.patientReferral.length -1].referralStatus}", + "${model.patientReferral[model.patientReferral.length - 1].referralStatus}", isReferredTo: true, isSameBranch: model - .patientReferral[model.patientReferral.length -1].isReferralDoctorSameBranch, - referralDoctorName: - model.patientReferral[model.patientReferral.length -1].referredByDoctorInfo, + .patientReferral[ + model.patientReferral.length - 1] + .isReferralDoctorSameBranch, + referralDoctorName: model + .patientReferral[ + model.patientReferral.length - 1] + .referredByDoctorInfo, clinicDescription: null, - remark: model.patientReferral[model.patientReferral.length -1].remarksFromSource, - referredOn: model.patientReferral[model.patientReferral.length -1].referredOn, - answerFromTarget: - model.patientReferral[model.patientReferral.length -1].answerFromTarget, + remark: model + .patientReferral[ + model.patientReferral.length - 1] + .remarksFromSource, + referredOn: model + .patientReferral[ + model.patientReferral.length - 1] + .referredOn, + answerFromTarget: model + .patientReferral[ + model.patientReferral.length - 1] + .answerFromTarget, ), ], ), @@ -114,7 +142,8 @@ class _PatientMakeReferralScreenState extends State { margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: AppButton( title: TranslationBase.of(context).refer, - color: HexColor("#B8382B"), + fontWeight: FontWeight.w700, + color: HexColor("#359846"), onPressed: () { if (appointmentDate == null || _selectedBranch == null || @@ -145,262 +174,221 @@ class _PatientMakeReferralScreenState extends State { ); } - Widget ReferralForm(PatientReferralViewModel model, Size screenSize) { + Widget referralForm(PatientReferralViewModel model, Size screenSize) { return Container( - margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).referPatient, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: referToList != null - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: referToList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _referTo = selectedValue; - _selectedBranch = null; - _selectedClinic = null; - _selectedDoctor = null; - model.getDoctorBranch().then((value) async { - _selectedBranch = value; - if (_referTo['id'] == 1) { - GifLoaderDialogUtils.showMyDialog(context); - await model - .getClinics(_selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: TranslationBase.of(context).branch, + dropDownText: _referTo != null ? _referTo['name'] : null, + enabled: false, + isDropDown: true, + onClick: referToList != null + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: referToList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _referTo = selectedValue; + _selectedBranch = null; + _selectedClinic = null; + _selectedDoctor = null; + model.getDoctorBranch().then((value) async { + _selectedBranch = value; + if (_referTo['id'] == 1) { + GifLoaderDialogUtils.showMyDialog(context); + await model + .getClinics(_selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } - }); + } else { + _selectedBranch = null; + } }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).referTo, - _referTo != null ? _referTo['name'] : null, - true), - enabled: false, - ), - ), + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, ), SizedBox( height: 10, ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.branchesList != null && - model.branchesList.length > 0 && - _referTo != null && - _referTo['id'] == 2 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.branchesList, - attributeName: 'facilityName', - attributeValueId: 'facilityId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() async { - _selectedBranch = selectedValue; - _selectedClinic = null; - _selectedDoctor = null; - GifLoaderDialogUtils.showMyDialog(context); - await model - .getClinics(_selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).branch, - _selectedBranch != null - ? _selectedBranch['facilityName'] - : null, - true), - enabled: false, - ), - ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: TranslationBase.of(context).hospital, + dropDownText: _selectedBranch != null + ? _selectedBranch['facilityName'] + : null, + enabled: false, + isDropDown: true, + onClick: model.branchesList != null && + model.branchesList.length > 0 && + _referTo != null && + _referTo['id'] == 2 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.branchesList, + attributeName: 'facilityName', + attributeValueId: 'facilityId', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() async { + _selectedBranch = selectedValue; + _selectedClinic = null; + _selectedDoctor = null; + GifLoaderDialogUtils.showMyDialog(context); + await model + .getClinics(_selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, ), SizedBox( height: 10, ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: _selectedBranch != null && - model.clinicsList != null && - model.clinicsList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.clinicsList, - attributeName: 'ClinicDescription', - attributeValueId: 'ClinicID', - usingSearch: true, - hintSearchText: - TranslationBase.of(context).clinicSearch, - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() async { - _selectedDoctor = null; - _selectedClinic = selectedValue; - GifLoaderDialogUtils.showMyDialog(context); - await model - .getClinicDoctors( - _selectedClinic['ClinicID'].toString()) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).clinic, - _selectedClinic != null - ? _selectedClinic['ClinicDescription'] - : null, - true), - enabled: false, - ), - ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: TranslationBase.of(context).clinic, + dropDownText: _selectedClinic != null + ? _selectedClinic['ClinicDescription'] + : null, + enabled: false, + isDropDown: true, + onClick: _selectedBranch != null && + model.clinicsList != null && + model.clinicsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.clinicsList, + attributeName: 'ClinicDescription', + attributeValueId: 'ClinicID', + usingSearch: true, + hintSearchText: TranslationBase.of(context).clinicSearch, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() async { + _selectedDoctor = null; + _selectedClinic = selectedValue; + GifLoaderDialogUtils.showMyDialog(context); + await model + .getClinicDoctors( + _selectedClinic['ClinicID'].toString()) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, ), SizedBox( height: 10, ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: _selectedClinic != null && - model.doctorsList != null && - model.doctorsList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - usingSearch: true, - hintSearchText: - TranslationBase.of(context).doctorSearch, - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).doctor, - _selectedDoctor != null - ? _selectedDoctor['DoctorName'] - : null, - true), - enabled: false, - ), - ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: TranslationBase.of(context).doctor, + dropDownText: + _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null, + enabled: false, + isDropDown: true, + onClick: _selectedClinic != null && + model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + usingSearch: true, + hintSearchText: TranslationBase.of(context).doctorSearch, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, ), SizedBox( height: 10, ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () => _selectDate(context, model), - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).chooseAppointment, - appointmentDate != null - ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: TranslationBase.of(context).date, + dropDownText: appointmentDate != null + ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" + : null, + enabled: false, + isDropDown: true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, ), + onClick: (){ + _selectDate(context, model); + }, ), SizedBox( height: 10, ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).remarks, null, false), - enabled: true, + AppTextFieldCustom( + hintText: + TranslationBase.of(context).dietTypeRemarks, controller: _remarksController, - // inputFormatters: [ - // FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS)) - // ], - keyboardType: TextInputType.text, + inputType: TextInputType.multiline, minLines: 4, maxLines: 6, - )), + ), ], ), ); 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 3dd45782..ffe08225 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 @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sig import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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_with_appointment_card_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/transitions/fade_page.dart'; @@ -38,6 +39,11 @@ class VitalSignDetailsScreen extends StatelessWidget { builder: (_, mode, widget) => AppScaffold( isShowAppBar: false, baseViewModel: mode, + /* appBar: PatientProfileHeaderWhitAppointmentAppBar( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ),*/ appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 ? Column( diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 5dc04221..1330dae4 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -218,8 +218,8 @@ class _PrescriptionFormWidgetState extends State { FocusScope.of(context).requestFocus(new FocusNode()); }, child: DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, + initialChildSize: 0.98, + maxChildSize: 0.98, minChildSize: 0.9, builder: (BuildContext context, ScrollController scrollController) { @@ -234,25 +234,30 @@ class _PrescriptionFormWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, //mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Row( + Column( children: [ - AppText( - 'New Prescription Order', - fontWeight: FontWeight.w700, - fontSize: 20, + Row( + children: [ + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ), + ], ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.32, + Row( + children: [ + AppText( + 'New Prescription Order', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], ), - InkWell( - child: Icon( - Icons.close, - size: 23.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) ], ), SizedBox( @@ -511,15 +516,15 @@ class _PrescriptionFormWidgetState extends State { } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT', - units != null - ? units['description'] - : null, - true), - enabled: false, - ), + decoration: + textFieldSelectorDecoration( + 'UNIT', + units != null + ? units[ + 'description'] + : null, + true), + enabled: false), ), ), ], diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index af5bbb3f..0a26a708 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/prescription/prescription_details_pag 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_with_appointment_card.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; @@ -27,23 +28,23 @@ class PrescriptionItemsPage extends StatelessWidget { onModelReady: (model) => model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), builder: (_, model, widget) => AppScaffold( - isShowAppBar: false, + isShowAppBar: true, baseViewModel: model, + appBar: PatientProfileHeaderWhitAppointmentAppBar( + patient: patient, + patientType: patientType??"0", + arrivalType: arrivalType??"0", + branch: '', + clinic: prescriptions.clinicDescription, + isPrescriptions: true, + appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), + doctorName: prescriptions.doctorName, + profileUrl: prescriptions.doctorImageURL, + ), body: SingleChildScrollView( child: Container( child: Column( children: [ - PatientProfileHeaderWhitAppointment(patient: patient, - patientType: patientType??"0", - arrivalType: arrivalType??"0", - branch: '', - clinic: prescriptions.clinicDescription, - isPrescriptions: true, - appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, - // invoiceNO: widget.patientLabOrders.invoiceNo, - ), if (!prescriptions.isInOutPatient) ...List.generate( diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index aca973da..478d364b 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.da 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/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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; @@ -30,14 +31,13 @@ class PrescriptionsPage extends StatelessWidget { onModelReady: (model) => model.getPrescriptions(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType), body: FractionallySizedBox( widthFactor: 1.0, child: ListView( physics: BouncingScrollPhysics(), children: [ - PatientProfileHeaderNewDesign( - patient, arrivalType ?? '0', patientType), SizedBox( height: 12, ), diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart new file mode 100644 index 00000000..d023dbc2 --- /dev/null +++ b/lib/screens/procedures/ProcedureCard.dart @@ -0,0 +1,142 @@ +import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/shared/Text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ProcedureCard extends StatelessWidget { + final Function onTap; + final EntityList entityList; + + const ProcedureCard({Key key, this.onTap, this.entityList}) : super(key: key); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * .22, + margin: EdgeInsets.all(10), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of(context).size.height * .20, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10), + ), + color: entityList.orderType == 1 + ? Colors.red[500] + : Colors.black, + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.only( + left: projectViewModel.isArabic ? 0 : 15, + right: projectViewModel.isArabic ? 15 : 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + entityList.orderType == 0 + ? 'Routine' + : 'Urgent', + color: entityList.orderType == 0 + ? Colors.black + : Colors.red[800], + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 5, + ), + Texts( + entityList.procedureName, + bold: true, + fontSize: 14, + ), + ], + ), + ), + SizedBox( + width: 5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Texts( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + Texts( + '${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).orderNo, + color: Colors.grey, + fontSize: 12, + ), + Texts( + entityList.orderNo.toString(), + color: Colors.grey, + fontSize: 12, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + entityList.remarks ?? '', + fontSize: 12, + ), + Icon(Icons.edit) + ], + ) + ], + ), + onTap: onTap, + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 605bb61c..39aed026 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -156,10 +156,31 @@ class _AddSelectedProcedureState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - 'Please Select Category', - fontWeight: FontWeight.w900, - fontSize: 15.0, + Column( + children: [ + Row( + children: [ + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ), + ], + ), + Row( + children: [ + AppText( + 'Please Select Category', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], + ), + ], ), SizedBox( height: 10.0, diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index d72ffa65..5c0cde24 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -157,10 +157,31 @@ class _AddSelectedLabOrderState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - 'New Lab Order', - fontWeight: FontWeight.w900, - fontSize: 18.0, + Column( + children: [ + Row( + children: [ + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ), + ], + ), + Row( + children: [ + AppText( + 'New Radiology Order', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], + ), + ], ), SizedBox( height: 10.0, diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index d3ae723d..9fc76dc4 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -157,10 +157,31 @@ class _AddSelectedRadiologyOrderState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - 'New Radiology Order', - fontWeight: FontWeight.w900, - fontSize: 18.0, + Column( + children: [ + Row( + children: [ + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ), + ], + ), + Row( + children: [ + AppText( + 'New Radiology Order', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], + ), + ], ), SizedBox( height: 10.0, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index fd3b78b9..ca658661 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -7,601 +7,149 @@ 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-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.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/network_base_view.dart'; import 'package:flutter/material.dart'; -class ProcedureScreen extends StatefulWidget { - @override - _ProcedureScreenState createState() => _ProcedureScreenState(); -} - -class _ProcedureScreenState extends State { - int selectedType = 0; - int testNum = 1; - PatiantInformtion patient; - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } +import 'ProcedureCard.dart'; - TextEditingController procedureController = TextEditingController(); - //TODO Jammal +class ProcedureScreen extends StatelessWidget { @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; + PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; return BaseView( onModelReady: (model) => model.getProcedure(mrn: patient.patientId), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).orderProcedure, - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - color: Colors.white, + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).orderProcedure, + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign( + patient, arrivalType ?? '0', patientType), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, + Texts( + 'Order Test or', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + Texts( + 'Procedure', + bold: true, + fontSize: 22, ), - (model.procedureList.length != 0) - ? SizedBox( - height: model.procedureList[0].rowcount == 0 - ? 200.0 - : 10.0) - : SizedBox(height: 200.0), - //model.prescriptionList == null - (model.procedureList.length != 0) - ? model.procedureList[0].rowcount == 0 - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - model - .getProcedureCategory() - .then((value) { - addSelectedProcedure( - context, model, patient); - }); - - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, - ), - ), - ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - 'NO ORDER FOR PROCEDURE LISTED', - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ) - : Padding( - padding: EdgeInsets.all(16.0), - child: NetworkBaseView( - baseViewModel: model, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - InkWell( - child: Container( - height: 50.0, - width: 450.0, - decoration: BoxDecoration( - color: Colors.white, - border: Border.all( - color: Colors.grey), - borderRadius: - BorderRadius.circular(10.0), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - TranslationBase.of( - context) - .addMoreProcedure, - fontWeight: - FontWeight.w100, - fontSize: 12.5, - ), - Icon( - Icons.add, - color: Color(0XFFB8382C), - ) - ], - ), - ), - ), - onTap: () { - model - .getProcedureCategory() - .then((value) { - addSelectedProcedure( - context, model, patient); - }); - - //model.postPrescription(); - }, - ), - // Container( - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // child: AppTextFormField( - // labelText: 'Add more procedure', - // borderColor: Colors.white, - // //suffixIcon: Icons.search, - // - // //textInputType: TextInputType.number, - // inputFormatter: ONLY_NUMBERS, - // onTap: () { - // addSelectedProcedure(context); - // }, - // ), - // ), - SizedBox( - height: 10.0, - ), - ...List.generate( - model.procedureList[0].rowcount, - (index) => Container( - color: Colors.white, - child: Column( - children: [ - SizedBox( - height: - MediaQuery.of(context) - .size - .height * - 0.022, - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Container( - height: MediaQuery.of( - context) - .size - .height * - 0.18, - width: MediaQuery.of( - context) - .size - .width * - 0.135, - child: Column( - children: [ - AppText( - DateTime.parse(model - .procedureList[ - 0] - .entityList[ - index] - .orderDate) - .year - .toString(), - color: model - .procedureList[ - 0] - .entityList[ - index] - .orderType == - 1 - ? Color( - 0xFFB9382C) - : Colors - .green), - AppText( - Helpers.getMonth(model.procedureList[0].entityList[index].orderDate != - null - ? (DateTime.parse(model.procedureList[0].entityList[index].orderDate) - .month) - : DateTime.now() - .month) - .toUpperCase(), - color: model - .procedureList[ - 0] - .entityList[ - index] - .orderType == - 1 - ? Color( - 0xFFB9382C) - : Colors - .green), - AppText( - DateTime.parse(model - .procedureList[ - 0] - .entityList[ - index] - .orderDate) - .day - .toString(), - color: model - .procedureList[ - 0] - .entityList[ - index] - .orderType == - 1 - ? Color( - 0xFFB9382C) - : Colors - .green), - ], - ), - ), - Expanded( - child: Container( - width: MediaQuery.of( - context) - .size - .width * - 0.05, - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context) - .codeNo + - " : ", - fontWeight: - FontWeight - .w700, - fontSize: - 13.0, - ), - AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .procedureId - .toString(), - fontSize: - 12.0, - ), - SizedBox( - width: 12.0, - ), - AppText( - TranslationBase.of(context) - .orderType + - " : ", - fontWeight: - FontWeight - .w700, - fontSize: - 13.0, - ), - Expanded( - child: AppText( - model.procedureList[0].entityList[index].orderType == - 0 - ? 'Routine' - : 'Urgent', - fontSize: - 13.5, - color: model.procedureList[0].entityList[index].orderType == - 1 - ? Color(0xFFB9382C) - : Colors.green), - ), - ], - ), - Row( - children: [ - AppText( - 'Order.NO' + - " : ", - fontWeight: - FontWeight - .w700, - fontSize: - 15.0, - ), - AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .orderNo - .toString(), - fontSize: - 13.0, - ), - ], - ), - Row( - children: [ - Container( - child: - Expanded( - child: - AppText( - model - .procedureList[0] - .entityList[index] - .procedureName, - fontWeight: - FontWeight.w800, - ), - ), - ) - ], - ), - - Row( - children: [ - // AppText( - // TranslationBase.of(context) - // .price + - // " : ", - // fontWeight: - // FontWeight - // .w700, - // ), - // Expanded( - // child: AppText( - // model - // .procedureList[ - // 0] - // .entityList[ - // index] - // .price - // .toString(), - // fontSize: - // 13.0), - // ) - ], - ), - SizedBox( - height: 10.0, - ), - - Row( - children: [ - Expanded( - child: - Container( - height: MediaQuery.of(context) - .size - .height * - 0.047, - width: MediaQuery.of(context) - .size - .width * - 0.10, - child: - AppText( - model.procedureList[0].entityList[index].remarks != - null - ? model.procedureList[0].entityList[index].remarks.toString() - : "", - fontSize: - 11.5, - ), - ), - ), - ], - ), - SizedBox( - height: 20.0, - ), - - // SizedBox( - // height: 40, - // ), - ], - ), - ), - ), - Container( - child: Column( - children: [ - InkWell( - child: Icon( - Icons.edit), - onTap: () { - // model - // .updateProcedure(); - if (model.procedureList[0].entityList[index].categoryID == 02 || - model - .procedureList[ - 0] - .entityList[ - index] - .categoryID == - 03 || - model - .procedureList[0] - .entityList[index] - .categoryID == - 55) { - updateProcedureForm( - context, - limetNo: model - .procedureList[ - 0] - .entityList[ - index] - .lineItemNo, - model: - model, - orderNo: model - .procedureList[ - 0] - .entityList[ - index] - .orderNo, - remarks: model - .procedureList[ - 0] - .entityList[ - index] - .remarks, - procedureName: model - .procedureList[ - 0] - .entityList[ - index] - .procedureName, - patient: - patient, - procedureId: model - .procedureList[ - 0] - .entityList[ - index] - .procedureId, - categoreId: model - .procedureList[ - 0] - .entityList[ - index] - .categoryID - .toString()); - } else { - helpers.showErrorToast( - 'You cant Update this Procedure'); - } - }, - ) - ], - ), - ), - ], - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - ], - ), - ), - ), - ], - ), - ), - ) - : Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - model - .getProcedureCategory() - .then((value) { - addSelectedProcedure( - context, model, patient); - }); - - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, - ), - ), - ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - 'NO ORDER FOR PROCEDURE LISTED', - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ) ], ), ), - ), - )), + if (patientType != null && patientType == '7') + InkWell( + onTap: () { + addSelectedProcedure(context, model, patient); + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + SizedBox( + height: 10, + ), + Texts( + 'Add More Procedure', + color: Colors.grey[600], + fontWeight: FontWeight.w600, + ) + ], + ), + ), + ), + ), + ), + if (model.procedureList.isNotEmpty) + ...List.generate( + model.procedureList[0].rowcount, + (index) => ProcedureCard( + entityList: model.procedureList[0].entityList[index], + onTap: () { + if (model.procedureList[0].entityList[index] + .categoryID == + 2 || + model.procedureList[0].entityList[index] + .categoryID == + 4) { + updateProcedureForm(context, + model: model, + patient: patient, + remarks: model + .procedureList[0].entityList[index].remarks, + orderType: model.procedureList[0] + .entityList[index].orderType + .toString(), + orderNo: model + .procedureList[0].entityList[index].orderNo, + procedureName: model.procedureList[0] + .entityList[index].procedureName, + categoreId: model.procedureList[0] + .entityList[index].categoryID + .toString(), + procedureId: model.procedureList[0] + .entityList[index].procedureId, + limetNo: model.procedureList[0] + .entityList[index].lineItemNo); + } else + helpers.showErrorToast( + 'You Cant Update This Procedure'); + }, + ), + ), + ], + ), + ), + ), + ), + ), ); } } diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 873e8bcf..d9c6a20a 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -102,241 +102,245 @@ class _UpdateProcedureWidgetState extends State { (BuildContext context, ProcedureViewModel model, Widget child) => NetworkBaseView( baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.65, + child: Form( + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.procedureName.toUpperCase(), + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 30.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) + // NetworkBaseView( + // baseViewModel: model, + // child: selectedCategory != null + // ? selectedCategory['categoryId'] == + // 02 || + // selectedCategory[ + // 'categoryId'] == + // 03 || + // selectedCategory[ + // 'categoryId'] == + // 55 + // ? 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), + Container( + child: Row( children: [ - AppText( - widget.procedureName.toUpperCase(), - fontWeight: FontWeight.w700, - ), - SizedBox( - height: 30.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, - ), - ), + AppText(TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, ), - if (widget.model.categoriesList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: selectedCategory != null - ? selectedCategory['categoryId'] == - 02 || - selectedCategory[ - 'categoryId'] == - 03 || - selectedCategory[ - 'categoryId'] == - 55 - ? 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), - Container( - child: Row( - children: [ - AppText( - TranslationBase.of(context).orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('routine'), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).urgent), - ], - ), + Text('routine'), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value); + }, ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - fontSize: 15.0, - controller: widget.remarksController, - maxLines: 3, - minLines: 2, - onChanged: (value) {}, - ), + Text(TranslationBase.of(context).urgent), + ], + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + fontSize: 15.0, + controller: widget.remarksController, + hintText: widget.remarksController.text.isEmpty + ? 'No Remarks Added' + : '', + maxLines: 3, + minLines: 2, + onChanged: (value) {}, + ), + ), + SizedBox( + height: 70.0, + ), + Container( + margin: + EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Column( + //alignment: WrapAlignment.center, + children: [ + AppButton( + color: Color(0xff359846), + title: TranslationBase.of(context) + .updateProcedure + .toUpperCase(), + onPressed: () { + // if (entityList.isEmpty == true && + // widget.remarksController.text == + // widget.remarks) { + // DrAppToastMsg.showErrorToast( + // "Fill the mandatory procedure details"); + // return; + // } + Navigator.pop(context); + updateProcedure( + limetNO: widget.limetNo, + orderNo: widget.orderNo, + orderType: selectedType.toString(), + categorieId: widget.categoryId, + procedureId: widget.procedureId, + entityList: entityList, + patient: widget.patient, + model: widget.model, + remarks: widget.remarksController.text); + // authorizationForm(context); + }, ), SizedBox( - height: 50.0, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .updateProcedure - .toUpperCase(), - onPressed: () { - // if (entityList.isEmpty == true && - // widget.remarksController.text == - // widget.remarks) { - // DrAppToastMsg.showErrorToast( - // "Fill the mandatory procedure details"); - // return; - // } - Navigator.pop(context); - updateProcedure( - limetNO: widget.limetNo, - orderNo: widget.orderNo, - orderType: selectedType.toString(), - categorieId: widget.categoryId, - procedureId: widget.procedureId, - entityList: entityList, - patient: widget.patient, - model: widget.model, - remarks: - widget.remarksController.text); - // authorizationForm(context); - }, - ), - ], - ), + height: 20.0, ), + AppButton( + title: TranslationBase.of(context).cancel, + color: Color(0xFFB9382C), + onPressed: () { + Navigator.pop(context); + }, + ) ], ), ), - )), - ); - }), + ], + ), + ), + )), + ), ), ); }); @@ -366,22 +370,24 @@ class _UpdateProcedureWidgetState extends State { updateProcedureReqModel.lineItemNo = limetNO; updateProcedureReqModel.orderNo = orderNo; - if (entityList.isNotEmpty) { - entityList.forEach((element) { - controls.add( - Controls(code: "remarks", controlValue: element.remarks ?? ''), - ); - controls.add( - Controls(code: "ordertype", controlValue: '1'), - ); - - controlsProcedure.procedure = element.procedureId; - controlsProcedure.category = int.parse(element.categoryID) > 9 - ? element.categoryID - : "0" + element.categoryID; - controlsProcedure.controls = controls; - }); - } else { + // if (entityList.isNotEmpty) { + // entityList.forEach((element) { + // controls.add( + // Controls(code: "remarks", controlValue: element.remarks ?? ''), + // ); + // controls.add( + // Controls(code: "ordertype", controlValue: '1'), + // ); + // + // controlsProcedure.procedure = element.procedureId; + // controlsProcedure.category = int.parse(element.categoryID) > 9 + // ? element.categoryID + // : "0" + element.categoryID; + // controlsProcedure.controls = controls; + // }); + // } + // else { + { controls.add( Controls( code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index ef292220..d55675c3 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -7,6 +7,14 @@ class DateUtils { return DateFormat(dateFormat).format(dateTime); } + static DateTime convertISOStringToDateTime(String date){ + DateTime newDate; + + newDate = DateTime.parse(date); + + return newDate; + } + static String convertStringToDateFormat(String date, String dateFormat) { DateTime dateTime = DateTime.parse(date); return convertDateToFormat(dateTime, dateFormat); diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index d0d8c3ca..d056f816 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -1,4 +1,5 @@ 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/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -8,6 +9,8 @@ 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:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; @@ -22,6 +25,8 @@ class DoctorReplyWidget extends StatefulWidget { class _DoctorReplyWidgetState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( child: CardWithBgWidget( bgColor: @@ -57,26 +62,44 @@ class _DoctorReplyWidgetState extends State { ], ), ), - AppText( - DateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .day - .toString() + - " " + - DateUtils.getMonth( - DateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .month) - .toString() - .substring(0, 3) + - ' ' + + Column( + children: [ + AppText( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .day + .toString() + + " " + + DateUtils.getMonth( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .month) + .toString() + .substring(0, 3) + + ' ' + + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .year + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + AppText( DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .hour + .toString() + + ":"+ + DateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) - .year - .toString(), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + .minute + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + + ], + ), ], ), Row( @@ -197,6 +220,8 @@ class _DoctorReplyWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.5, child: RichText( + maxLines: 2, + overflow: TextOverflow.ellipsis, text: new TextSpan( style: new TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, @@ -207,11 +232,11 @@ class _DoctorReplyWidgetState extends State { style: TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), new TextSpan( - text: widget.reply.remarks, + text: widget.reply.remarks.trim(), style: TextStyle( fontFamily: 'Poppins', color: Color(0xFF575757), - fontSize: 15)), + fontSize: 12)), ], ), ), @@ -219,234 +244,15 @@ class _DoctorReplyWidgetState extends State { ],) ], ), - - SizedBox( - height: 20, - ), + Container( + alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, + child: Icon(FontAwesomeIcons.arrowRight, + size: 20, color: Colors.black),) ], ), // onTap: onTap, )), ), ); - // Stack( - // children: [ - // Container( - // margin: EdgeInsets.symmetric(vertical: 10.0), - // width: double.infinity, - // decoration: BoxDecoration( - // color: HexColor('#FFFFFF'), - // borderRadius: BorderRadius.all( - // Radius.circular(20.0), - // ), - // ), - // child: Container( - // margin: EdgeInsets.all(5), - // child: Column( - // children: [ - // SizedBox(height: 18,), - // Container( - // margin: EdgeInsets.only(right: 15), - // child: Row( - // children: [ - // SizedBox(width: 5,), - // //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), - // Container( - // decoration: BoxDecoration( - // gradient: LinearGradient( - // begin: Alignment(-1, -1), - // end: Alignment(1, 1), - // colors: [ - // Colors.grey[100], - // Colors.grey[200], - // ]), - // boxShadow: [ - // BoxShadow( - // color: Color.fromRGBO(0, 0, 0, 0.08), - // offset: Offset(0.0, 5.0), - // blurRadius: 16.0) - // ], - // borderRadius: BorderRadius.all(Radius.circular(50.0)), - // ), - // width: 80, - // height: 80, - // child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.female_icon,size: 80,)), - // - // SizedBox(width: 15,), - // Expanded( - // child: Container( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // AppText( - // widget.reply.patientName, - // fontSize: 1.5 * SizeConfig.textMultiplier, - // fontWeight: FontWeight.bold, - // ), - // SizedBox( - // height: 5, - // ), - // - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).fileNo, - // fontSize: 1.7 * SizeConfig.textMultiplier, - // fontWeight: FontWeight.bold, - // ), - // Container( - // margin: EdgeInsets.only(left: 5), - // child: AppText( - // '${widget.reply.patientID}', - // fontSize: 1.7 * SizeConfig.textMultiplier, - // fontWeight: FontWeight.bold, - // ), - // ), - // ], - // ), - // SizedBox( - // height: 5, - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).mobileNo, - // fontSize: 1.7 * SizeConfig.textMultiplier, - // fontWeight: FontWeight.bold, - // ), - // Container( - // margin: EdgeInsets.only(left: 5), - // child: AppText( - // widget.reply.mobileNumber, - // fontSize: 1.7 * SizeConfig.textMultiplier, - // fontWeight: FontWeight.bold, - // ), - // ), - // ], - // ), - // SizedBox( - // height: 5, - // ), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Container( - // width: 70, - // height: 20, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all(Radius.circular(60.0)), - // color: Colors.green[600] - // ), - // child: Center( - // child: AppText( - // widget.reply.requestTime, - // fontSize: 1.5 * SizeConfig.textMultiplier, - // color: Colors.white, - // ), - // ), - // ), - // Container( - // - // child: AppText( - // '${Helpers.getDate(widget.reply.requestDate)}', - // fontSize: 1.7 * SizeConfig.textMultiplier, - // fontWeight: FontWeight.bold, - // color: Colors.black, - // ), - // ), - // ], - // ), - // - // ], - // ), - // ), - // ) - // - // ], - // ), - // ), - // - // !widget.isShowMore ? SizedBox(height: 18,) : - // AnimatedContainer( - // duration: Duration(milliseconds: 200), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Divider(color: Colors.grey), - // SizedBox(height: 5,), - // Row( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // AppText( - // TranslationBase.of(context).remarks + " : ", - // fontSize: 2.5 * SizeConfig.textMultiplier, - // //fontWeight: FontWeight.bold, - // ),Expanded( - // child: AppText( - // widget.reply.remarks, - // fontSize: 2.5 * SizeConfig.textMultiplier, - // //fontWeight: FontWeight.bold, - // ), - // ), - // ], - // ), - // SizedBox(height: 10,), - // Row( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // AppText( - // TranslationBase.of(context).doctorResponse + " : ", - // fontSize: 2.5 * SizeConfig.textMultiplier, - // //fontWeight: FontWeight.bold, - // ),Expanded( - // child: AppText( - // widget.reply.doctorResponse, - // fontSize: 2.5 * SizeConfig.textMultiplier, - // //fontWeight: FontWeight.bold, - // ), - // ), - // ], - // ),SizedBox(height: 10,), - // Row( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // AppText( - // TranslationBase.of(context).infoStatus + " : ", - // fontSize: 2.5 * SizeConfig.textMultiplier, - // //fontWeight: FontWeight.bold, - // ),Expanded( - // child: AppText( - // widget.reply.infoStatus, - // fontSize: 2.5 * SizeConfig.textMultiplier, - // //fontWeight: FontWeight.bold, - // ), - // ), - // ], - // ) - // ], - // ), - // ), - // - // ], - // ), - // ), - // ), - // Positioned( - // right: 5, - // top: 20, - // child: InkWell( - // onTap: (){ - // setState(() { - // widget.isShowMore = !widget.isShowMore; - // }); - // }, - // child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), - // ) - // ], - // - // ); } } diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index c53a38d7..394ea216 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -227,13 +227,16 @@ class PatientCard extends StatelessWidget { "List_MyOutPatient") Container( child: Row( + crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context) - .appointmentDate + - " : ", - fontSize: 14, + Expanded( + child: AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, + ), ), patientInfo.startTimes != null ? Container( diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 14afa5b6..1404f9af 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,4 +1,5 @@ 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/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; class PatientReferralItemWidget extends StatelessWidget { final String patientName; @@ -39,6 +41,8 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), child: Column( @@ -298,7 +302,8 @@ class PatientReferralItemWidget extends StatelessWidget { : Colors.grey[500], fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: 2.0 * SizeConfig.textMultiplier)), + fontSize: + 2.0 * SizeConfig.textMultiplier)), ], ), ), @@ -325,15 +330,15 @@ class PatientReferralItemWidget extends StatelessWidget { SizedBox( width: 4, ), - /*patient.gender*/1 == 1 + /*patient.gender*/ 1 == 1 ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) + DoctorApp.male_2, + color: Colors.blue, + ) : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), + DoctorApp.female_1, + color: Colors.pink, + ), ], ), SizedBox( @@ -351,7 +356,8 @@ class PatientReferralItemWidget extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).fileNumber, + text: TranslationBase.of(context) + .fileNumber, style: TextStyle( fontSize: 14, fontFamily: 'Poppins')), new TextSpan( @@ -371,13 +377,17 @@ class PatientReferralItemWidget extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).referredFrom, + text: TranslationBase.of(context) + .referredFrom, style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), + fontSize: 14, + fontFamily: 'Poppins')), new TextSpan( text: isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch, + ? TranslationBase.of(context) + .sameBranch + : TranslationBase.of(context) + .otherBranch, style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -392,11 +402,12 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ AppText( /*patient.nationalityName ?? - patient.nationality*/ "Saudi", + patient.nationality*/ + "Saudi", fontWeight: FontWeight.bold, fontSize: 12, ), - /* patient.nationality != null + /* patient.nationality != null ? ClipRRect( borderRadius: BorderRadius @@ -418,7 +429,7 @@ class PatientReferralItemWidget extends StatelessWidget { 'No Image'); }, ))*/ - /*:*/ SizedBox() + /*:*/ SizedBox() ], ) ], @@ -445,32 +456,56 @@ class PatientReferralItemWidget extends StatelessWidget { ), ), ), - SizedBox( - height: 20, - ), - Column( + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - TextSpan( - text: TranslationBase.of(context) - .referralDoctor + - " : ", - style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), - TextSpan( - text: referralDoctorName, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], + Container( + width: 30, + height: 30, + margin: EdgeInsets.only( + left: projectViewModel.isArabic ? 10 : 10 /*10:85*/, + right: projectViewModel.isArabic ? 10 : 10 /*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( + flex: 4, + child: Container( + margin: EdgeInsets.only(left: 10, top: 25, right : 10, bottom: 0), + child: Column( + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + TextSpan( + text: TranslationBase.of(context) + .referralDoctor + + " : ", + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + TextSpan( + text: referralDoctorName, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ) + ], + ), ), - ) + ), ], ), Container( 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 new file mode 100644 index 00000000..ca8d6a4e --- /dev/null +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -0,0 +1,359 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.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/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:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; + +class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget{ + + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + + PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType); + + @override + Widget build(BuildContext context) { + return PreferredSize( + preferredSize: Size(double.infinity, 200), + child: Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5,), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 200, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + patient.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, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patient + .arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), + ), + child: AppText( + patient.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2(patient.appointmentDate.toString()?? ''), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig + .textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of( + context) + .fileNumber, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: patient.patientId + .toString(), + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 14)), + ], + ), + ), + ), + ], + ), + ), + ]), + ], + ), + ), + ), + ); + } + + convertDateFormat2(String str) { + String newDate; + const start = "/Date("; + if (str.isNotEmpty) { + 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))); + 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)); + } + + @override + Size get preferredSize => Size(double.maxFinite,200); +} + + 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 848bda41..93069432 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -42,10 +42,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { onPressed: () => Navigator.pop(context), ), AppText( + patient.firstName != null ? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize( - patient.lastName)), + patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart new file mode 100644 index 00000000..7a499010 --- /dev/null +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -0,0 +1,499 @@ +import 'package:doctor_app_flutter/config/config.dart'; +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/icons_app/doctor_app_icons.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/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; + +import 'large_avatar.dart'; + +class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with PreferredSizeWidget { + + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + final bool isPrescriptions; + final String clinic; + PatientProfileHeaderWhitAppointmentAppBar( + {this.patient, + this.patientType, + this.arrivalType, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo, this.isPrescriptions = false, this.clinic}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + //height: 300, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + patient.firstName != null ? + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + patient.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, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patient + .arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), + ), + child: AppText( + patient.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2(patient.appointmentDate??''), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig + .textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of( + context) + .fileNumber, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: patient.patientId + .toString(), + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 14)), + ], + ), + ), + ), + ], + ), + ), + ]), + 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: profileUrl, + ), + width: 25, + height: 25, + margin: EdgeInsets.only(top: 10), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + '${TranslationBase.of(context).dr}$doctorName', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (orderNo != null && !isPrescriptions) + Row( + children: [ + Texts( + 'Order No: ', + color: Colors.grey[800], + fontSize: 14 + ), + Texts( + orderNo ?? '',fontSize: 14 + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + Texts( + 'Invoice: ', + color: Colors.grey[800], + fontSize: 14 + ), + Texts( + invoiceNO, + fontSize: 14 + ) + ], + ), + if(isPrescriptions) + Row( + children: [ + Texts( + 'Branch: ', + color: Colors.grey[800], + fontSize: 14 + ), + Texts( + branch?? '', + fontSize: 14 + ) + ], + ), + if(isPrescriptions) + Row( + children: [ + Texts( + 'Clinic: ', + color: Colors.grey[800], + fontSize: 14 + ), + Texts( + clinic?? '', + fontSize: 14 + ) + ], + ), + Row( + children: [ + Texts( + !isPrescriptions? 'Result Date: ': 'Prescriptions Date ', + color: Colors.grey[800], + fontSize: 14, + ), + Expanded( + child: Texts( + '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',fontSize: 14, + ), + ) + ], + ) + ]), + ), + ), + + ], + ), + ), + ), + ], + ) + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String newDate =""; + const start = "/Date("; + const end = "+0300)"; + + if (str.isNotEmpty) { + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + } + + 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)); + } + + @override + Size get preferredSize => Size(double.maxFinite,270); +} 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 c49c4576..b4c445ca 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -134,6 +134,16 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'patient/Progress_notes.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'), ], ), ); diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 100e8c1d..43106db1 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -76,7 +76,7 @@ class _AppDrawerState extends State { fontWeight: FontWeight.bold, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.5, + fontSize: 17, ), ), Padding( @@ -85,7 +85,7 @@ class _AppDrawerState extends State { authProvider.doctorProfile?.clinicDescription, fontWeight: FontWeight.w600, color: Color(0xFF2E303A), - fontSize: SizeConfig.textMultiplier * 2, + fontSize: 15, fontFamily: 'Poppins', )) ], diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 37dfda14..81fc59e8 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -19,12 +19,13 @@ class AppScaffold extends StatelessWidget { final BaseViewModel baseViewModel; final Widget bottomSheet; final Color backgroundColor; + final Widget appBar; AppScaffold( {this.appBarTitle = '', this.body, this.isLoading = false, this.isShowAppBar = true, - this.baseViewModel, this.bottomSheet, this.backgroundColor}); + this.baseViewModel, this.bottomSheet, this.backgroundColor, this.appBar}); @override Widget build(BuildContext context) { @@ -37,7 +38,7 @@ class AppScaffold extends StatelessWidget { child: Scaffold( backgroundColor: backgroundColor??Colors.white, appBar: isShowAppBar - ? AppBar( + ? appBar ?? AppBar( elevation: 0, backgroundColor: HexColor('#515B5D'), textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index dc6f5adc..9cb1ab21 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -127,7 +127,7 @@ class DoctorCard extends StatelessWidget { Row( children: [ Texts( - 'Clinic:', + 'Clinic: ', color: Colors.grey[500], ), Texts( @@ -139,7 +139,7 @@ class DoctorCard extends StatelessWidget { Row( children: [ Texts( - 'Branch:', + 'Branch: ', color: Colors.grey[500], ), Texts( @@ -151,7 +151,7 @@ class DoctorCard extends StatelessWidget { ), ), Icon( - isPrescriptions? Icons.arrow_forward: EvaIcons.eye, + EvaIcons.eye, ) ], ), diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 84691f7f..fefea780 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -47,7 +47,7 @@ class _DrawerItemState extends State { marginLeft: 5, marginRight: 5, color:widget.color ??Color(0xFF2E303A), - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: 14, fontFamily: 'Poppins', fontWeight: FontWeight.bold, ),