diff --git a/lib/config/config.dart b/lib/config/config.dart index 52fb8c3f..654f704a 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 = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index deb9ee41..194ee2af 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -837,5 +837,10 @@ const Map> localizedValues = { "enter_credentials": { "en": "Enter the user credentials below", "ar": "أدخل بيانات اعتماد المستخدم أدناه" + + }, + "step": { + "en": "Step", + "ar": "خطوة" }, }; diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart index 093c4066..097047cf 100644 --- a/lib/core/service/patient-admission-request-service.dart +++ b/lib/core/service/patient-admission-request-service.dart @@ -161,9 +161,12 @@ class AdmissionRequestService extends LookupService { ); } - Future getDietTypesList() async { + Future getDietTypesList(int patientMrn) async { hasError = false; + Map body = Map(); + body['patientMRN'] = patientMrn; + await baseAppClient.post( GET_DIET_TYPES, onSuccess: (dynamic response, int statusCode) { @@ -180,7 +183,7 @@ class AdmissionRequestService extends LookupService { hasError = true; super.error = error; }, - body: Map(), + body: body, ); } diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 787aecae..052f78b6 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -101,12 +101,14 @@ class PatientReferralService extends LookupService { ); } - Future getDoctorsList(String clinicId) async { + Future getDoctorsList(String clinicId, int branchId) async { hasError = false; DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); + _doctorsByClinicIdRequest.projectID = branchId; _doctorsByClinicIdRequest.clinicID = clinicId; + await baseAppClient.post( PATIENT_GET_DOCTOR_BY_CLINIC_URL, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 44261c26..0f0b9bf0 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -114,9 +114,9 @@ class AdmissionRequestViewModel extends BaseViewModel{ } } - Future getDietTypes() async { + Future getDietTypes(int patientMrn) async { setState(ViewState.BusyLocal); - await _admissionRequestService.getDietTypesList(); + await _admissionRequestService.getDietTypesList(patientMrn); if (_admissionRequestService.hasError) { error = _admissionRequestService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 7458456c..f46fe463 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -82,9 +82,9 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getClinicDoctors(String clinicId) async { + Future getClinicDoctors(String clinicId, int branchId) async { setState(ViewState.BusyLocal); - await _referralPatientService.getDoctorsList(clinicId); + await _referralPatientService.getDoctorsList(clinicId, branchId); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.ErrorLocal); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index b0c3bcde..13e17077 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -1020,12 +1020,12 @@ class _DashboardScreenState extends State { ), hasBorder: false, onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - SearchMedicinePatientScreen(), - )); + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // SearchMedicinePatientScreen(), + // )); }, ) ], diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index add08730..c5331910 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -160,95 +160,109 @@ class _InsuranceApprovalsDetailsState extends State { ), ], ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - height: 25.0, - ), - Row( - children: [ - Texts( - 'Clinic: ', - color: Colors.grey[500], - ), - Texts( - model - .insuranceApproval[ - indexInsurance] - .clinicName, - ) - ], - ), - Row( - children: [ - Texts( - 'Approval No: ', - color: Colors.grey[500], - ), - Texts( - model + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( + children: [ + Texts( + 'Clinic: ', + color: Colors.grey[500], + fontSize: 14, + ), + Expanded( + child: Texts( + model + .insuranceApproval[ + indexInsurance] + .clinicName, + fontSize: 14, + ), + ) + ], + ), + Row( + children: [ + Texts( + 'Approval No: ', + color: Colors.grey[500], + fontSize: 14, + ), + Texts( + model + .insuranceApproval[ + indexInsurance] + .approvalNo + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + Texts( + 'Unused Count:', + color: Colors.grey[500], + fontSize: 14, + ), + Texts(model .insuranceApproval[ indexInsurance] - .approvalNo + .unUsedCount .toString(), - ) - ], - ), - Row( - children: [ - Texts( - 'Unused Count:', - color: Colors.grey[500], - ), - Texts(model - .insuranceApproval[ - indexInsurance] - .unUsedCount - .toString()) - ], - ), - Row( - children: [ - Texts( - 'Company Name :', - color: Colors.grey[500], - ), - Texts('Sample') - ], - ), - Row( - children: [ - Texts( - 'Receipt on: ', - color: Colors.grey[500], - ), - Texts( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - ), - ], - ), - Row( - children: [ - Texts( - 'Exp on: ', - color: Colors.grey[500], - ), - Texts( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - ), - ], - ), - ], + fontSize: 14, + ) + + ], + ), + Row( + children: [ + Texts( + 'Company Name :', + color: Colors.grey[500], + ), + Texts('Sample') + ], + ), + Row( + children: [ + Texts( + 'Receipt on: ', + color: Colors.grey[500], + ), + Expanded( + child: Texts( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + Row( + children: [ + Texts( + 'Exp on: ', + color: Colors.grey[500], + ), + Texts( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), + ], + ), + ], + ), ), ), ], @@ -264,34 +278,20 @@ class _InsuranceApprovalsDetailsState extends State { padding: const EdgeInsets.symmetric( horizontal: 8.0), child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.33, + Expanded( child: Texts( 'Procedure', fontWeight: FontWeight.w700, ), ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.33, + Expanded( child: Texts( 'Status', fontWeight: FontWeight.w700, ), ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.21, + Expanded( child: Texts( 'Usage Status', fontWeight: FontWeight.w700, @@ -316,78 +316,58 @@ class _InsuranceApprovalsDetailsState extends State { itemBuilder: (BuildContext context, int index) { return Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - crossAxisAlignment: - CrossAxisAlignment.start, + child: Column( children: [ - Container( - height: - MediaQuery.of(context) - .size - .height * - 0.15, //130.0, - width: - MediaQuery.of(context) - .size - .width * - 0.33, - child: Texts(model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.procedureName ?? - ""), - ), - Container( - height: - MediaQuery.of(context) - .size - .height * - 0.15, - width: - MediaQuery.of(context) - .size - .width * - 0.33, - child: Texts(model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.status ?? - ""), + Row( + + children: [ + Expanded( + child: Container( + + child: Texts(model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.procedureName ?? + "",textAlign: TextAlign.start,), + ), + ), + Expanded( + child: Container( + + child: Texts(model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.status ?? + "",textAlign: TextAlign.center,), + ), + ), + Expanded( + child: Container( + child: Texts(model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.isInvoicedDesc ?? + "",textAlign: TextAlign.center,), + ), + ), + ], ), - Container( - height: - MediaQuery.of(context) - .size - .height * - 0.15, - width: - MediaQuery.of(context) - .size - .width * - 0.21, - child: Texts(model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.isInvoicedDesc ?? - ""), + SizedBox(width: 5,), + Divider( + color: Colors.black38, ), ], ), ); }), ), - Divider( - color: Colors.black45, - ), + ], ), ), diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index f4b26f6a..99948bed 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -32,6 +32,9 @@ class _UcafDetailScreenState extends State { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + final screenSize = MediaQuery.of(context).size; return BaseView( diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index d4c1b803..18939d54 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -3,9 +3,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.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/PatientHeaderWidgetNoAvatar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app-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'; @@ -53,337 +56,385 @@ class _UCAFInputScreenState extends State { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) => model.getUCAFData(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).ucaf, body: model.patientVitalSigns != null && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 - ? SingleChildScrollView( - child: Column( - children: [ - PatientHeaderWidgetNoAvatar(patient), - Container( - margin: - EdgeInsets.symmetric(vertical: 16, horizontal: 16), + ? Column( + children: [ + Expanded( + child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CheckboxListTile( - title: AppText( - TranslationBase.of(context).inPatient, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, + // PatientHeaderWidgetNoAvatar(patient), + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).patient}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + ), + AppText( + "${TranslationBase.of(context).ucaf}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], ), - value: _inPatient, - onChanged: (newValue) { - setState(() { - _inPatient = newValue; - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), ), - CheckboxListTile( - title: AppText( - TranslationBase.of(context).emergencyCase, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, - ), - value: _emergencyCase, - onChanged: (newValue) { - setState(() { - _emergencyCase = newValue; - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), + PageStepperWidget( + stepsCount: 2, + currentStepIndex: 1, + screenSize: screenSize, ), Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .durationOfIllness, - null, - false), - enabled: true, - controller: _durationOfIllnessController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - keyboardType: TextInputType.number, - )), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "BP (H/L)", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, + margin: EdgeInsets.symmetric( + vertical: 0, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CheckboxListTile( + title: AppText( + TranslationBase.of(context).inPatient, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, ), - AppText( - "${model.patientVitalSigns.bloodPressureHigher}/${model.patientVitalSigns.bloodPressureLower}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, + value: _inPatient, + onChanged: (newValue) { + setState(() { + _inPatient = newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + CheckboxListTile( + title: AppText( + TranslationBase.of(context).emergencyCase, fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, ), - ], - ), - SizedBox( - width: 4, - ), - Expanded( - child: Row( + value: _emergencyCase, + onChanged: (newValue) { + setState(() { + _emergencyCase = newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: + TranslationBase.of(context).durationOfIllness, + dropDownText: "3", + inputType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + ), + SizedBox( + height: 16, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - "${TranslationBase.of(context).temperature}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + "BP (H/L)", + fontSize: + SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.normal, + ), + SizedBox( + width: 8, + ), + AppText( + "${model.patientVitalSigns.bloodPressureHigher}/${model.patientVitalSigns.bloodPressureLower}", + fontSize: + SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.w700, + ), + ], ), SizedBox( - width: 8, + width: 4, ), Expanded( - child: AppText( - "${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, + child: Row( + children: [ + AppText( + "${TranslationBase.of(context).temperature}", + fontSize: + SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.normal, + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)", + fontSize: + SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.w700, + ), + ), + ], ), ), ], ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).pulseBeats} :", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.pulseBeatPerMinute}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context) - .chiefComplaintsAndSymptoms, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 8, - ), - AppText( - TranslationBase.of(context) - .patientFeelsPainInHisBackAndCough, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - SizedBox( - height: 8, - ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .additionalTextComplaints, - helpers.parseHtmlString(model - .patientChiefComplaintList[0] - .chiefComplaint), - false), - enabled: false, - controller: _additionalComplaintsController, - keyboardType: TextInputType.multiline, - minLines: 1, - maxLines: 20, - )), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).otherConditions, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - ...List.generate( - conditionsData.length, - (index) => CheckboxListTile( - title: AppText( - conditionsData[index]['name'], - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, + SizedBox( + height: 4, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).pulseBeats} :", + fontSize: + SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.normal, + ), + SizedBox( + width: 8, + ), + AppText( + "${model.patientVitalSigns.pulseBeatPerMinute}", + fontSize: + SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.w700, + ), + ], ), - value: conditionsData[index]['isChecked'], - onChanged: (newValue) { - setState(() { - conditionsData[index]['isChecked'] = - newValue; - }); - }, - controlAffinity: - ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - )), - SizedBox( - height: 8, - ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).other, - null, - false), - enabled: true, - controller: _otherController, - keyboardType: TextInputType.text, - )), - SizedBox( - height: 8, - ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).how, - null, - false), - enabled: true, - controller: _howController, - keyboardType: TextInputType.text, - )), - SizedBox( - height: 8, - ), - Row( - children: [ - Expanded( - child: Container( + ], + ), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).chiefComplaintsAndSymptoms, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 4, + ), + AppText( + TranslationBase.of(context) + .patientFeelsPainInHisBackAndCough, + fontFamily: 'Poppins', + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 1.8, + ), + SizedBox( + height: 8, + ), + AppTextFieldCustom( + hintText: TranslationBase.of(context).instruction, + dropDownText: helpers.parseHtmlString(model + .patientChiefComplaintList[0] + .chiefComplaint), + controller: _additionalComplaintsController, + inputType: TextInputType.multiline, + enabled: false, + minLines: 1, + maxLines: 20, + ), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).otherConditions, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ...List.generate( + conditionsData.length, + (index) => CheckboxListTile( + title: AppText( + conditionsData[index]['name'], + fontWeight: FontWeight.bold, + fontSize: + SizeConfig.textMultiplier * 2.1, + ), + value: conditionsData[index] + ['isChecked'], + onChanged: (newValue) { + setState(() { + conditionsData[index] + ['isChecked'] = newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + )), + SizedBox( + height: 8, + ), + Container( height: screenSize.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).when, + TranslationBase.of(context).other, null, false), enabled: true, - controller: _whenController, + controller: _otherController, keyboardType: TextInputType.text, )), - ), - SizedBox( - width: 4, - ), - Expanded( - child: Container( + SizedBox( + height: 8, + ), + Container( height: screenSize.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).where, + TranslationBase.of(context).how, null, false), enabled: true, - controller: _whereController, + controller: _howController, keyboardType: TextInputType.text, )), - ), - ], - ), - SizedBox( - height: 8, - ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .specifyPossibleLineManagement, - null, - false), - enabled: true, - controller: _managementsLineController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).significantSigns, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - SizedBox( - height: 8, - ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).backAbdomen, - null, - false), - enabled: true, - controller: _signsController, - keyboardType: TextInputType.multiline, - minLines: null, - maxLines: null, - )), - SizedBox( - height: 16, - ), - AppButton( - title: TranslationBase.of(context).next, - color: HexColor("#B8382B"), - onPressed: () { - Navigator.of(context).pushNamed( - PATIENT_UCAF_DETAIL, - arguments: {'patient': patient}); - }, + SizedBox( + height: 8, + ), + Row( + children: [ + Expanded( + child: Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers + .textFieldSelectorDecoration( + TranslationBase.of(context) + .when, + null, + false), + enabled: true, + controller: _whenController, + keyboardType: TextInputType.text, + )), + ), + SizedBox( + width: 4, + ), + Expanded( + child: Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers + .textFieldSelectorDecoration( + TranslationBase.of(context) + .where, + null, + false), + enabled: true, + controller: _whereController, + keyboardType: TextInputType.text, + )), + ), + ], + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .specifyPossibleLineManagement, + null, + false), + enabled: true, + controller: _managementsLineController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).significantSigns, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .backAbdomen, + null, + false), + enabled: true, + controller: _signsController, + keyboardType: TextInputType.multiline, + minLines: null, + maxLines: null, + )), + ], + ), ), ], ), ), - ], - ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#D02127"), + onPressed: () { + Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, + arguments: {'patient': patient}); + }, + ), + ), + ], ) : Container( child: Center( diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart new file mode 100644 index 00000000..5e93f141 --- /dev/null +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -0,0 +1,145 @@ +import 'package:doctor_app_flutter/config/size_config.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'; + +class PageStepperWidget extends StatelessWidget { + final int stepsCount; + final int currentStepIndex; + final Size screenSize; + + PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize}); + + @override + Widget build(BuildContext context) { + double dividerWidth = (screenSize.width / stepsCount) - (10 * stepsCount); + + return Container( + margin: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + for (int i = 1; i <= stepsCount; i++) + if (i == currentStepIndex) + StepWidget(i, true, i == stepsCount, i < currentStepIndex, + dividerWidth) + else + StepWidget(i, false, i == stepsCount, i < currentStepIndex, + dividerWidth) + ], + ) + ], + ), + ); + } +} + +class StepWidget extends StatelessWidget { + final int index; + final bool isInProgress; + final bool isFinalStep; + final bool isStepFinish; + final double dividerWidth; + + StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, + this.dividerWidth); + + @override + Widget build(BuildContext context) { + StepStatus status; + if (isInProgress) { + status = StepStatus.InProgress; + } else { + if(isStepFinish){ + status = StepStatus.Completed; + }else { + status = StepStatus.Locked; + } + } + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: EdgeInsets.all(0.0), + margin: EdgeInsets.symmetric(horizontal: 1), + width: 25, + height: 25, + decoration: BoxDecoration( + color: isInProgress ? Color(0xFFCC9B14) : Color(0xFFC9C9C9), + shape: BoxShape.circle, + border: Border.all( + color: isInProgress ? Color(0xFFCC9B14) : Color(0xFFC9C9C9), + width: 1), + ), + child: Center( + child: Icon( + Icons.check, + size: 20, + color: status == StepStatus.InProgress ? Colors.white : status == StepStatus.Locked ? Colors.grey.shade800 : Color(0xFF359846), + )), + ), + if (!isFinalStep) + Container( + width: dividerWidth, + height: 2, + color: Colors.grey, + ), + ], + ), + SizedBox( + height: 8, + ), + AppText( + "${TranslationBase.of(context).step} $index", + fontWeight: FontWeight.bold, + color: status == StepStatus.InProgress ? Colors.black : status == StepStatus.Locked ? Colors.grey : Color(0xFF359846), + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + ), + Container( + margin: EdgeInsets.symmetric(vertical: 4), + padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), + decoration: BoxDecoration( + color: status == StepStatus.InProgress + ? Color(0xFFF1E9D3) + : status == StepStatus.Locked + ? Color(0xFFD8E8DB) + : Color(0xFFCCCCCC), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0.30), + ), + child: AppText( + status == StepStatus.InProgress + ? "inProgress" + : status == StepStatus.Locked + ? "Locked" + : "Completed", + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFF969696) + : Color(0xFF359846), + ), + ) + ], + ); + } +} + +enum StepStatus { + InProgress, + Locked, + Completed, +} \ No newline at end of file diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 3fa16be2..8095d04a 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.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/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -55,7 +56,9 @@ class _AdmissionRequestThirdScreenState return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { @@ -72,9 +75,8 @@ class _AdmissionRequestThirdScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // PatientPageHeaderWidget(patient), - PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), + // PatientProfileHeaderNewDesign( + // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( @@ -220,23 +222,24 @@ class _AdmissionRequestThirdScreenState SizedBox( height: 10, ), - CheckboxListTile( - title: AppText( - TranslationBase.of(context).patientPregnant, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.0, + if(patient.gender != 1) + CheckboxListTile( + title: AppText( + TranslationBase.of(context).patientPregnant, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.0, + ), + value: _patientPregnant, + activeColor: HexColor("#D02127"), + onChanged: (newValue) { + setState(() { + _patientPregnant = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), ), - value: _patientPregnant, - activeColor: HexColor("#D02127"), - onChanged: (newValue) { - setState(() { - _patientPregnant = newValue; - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - ), CheckboxListTile( title: AppText( TranslationBase.of(context).isSickLeaveRequired, @@ -287,7 +290,7 @@ class _AdmissionRequestThirdScreenState : () async { GifLoaderDialogUtils.showMyDialog( context); - await model.getDietTypes().then((_) => + await model.getDietTypes(patient.patientId).then((_) => GifLoaderDialogUtils.hideDialog( context)); if (model.state == ViewState.Idle && diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index b5cf732a..a48a7c45 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.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/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -51,7 +52,9 @@ class _AdmissionRequestThirdScreenState return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { @@ -67,8 +70,6 @@ class _AdmissionRequestThirdScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 987f5f43..2dcfbbf9 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.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/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -63,7 +64,9 @@ class _AdmissionRequestSecondScreenState return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { @@ -79,8 +82,8 @@ class _AdmissionRequestSecondScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), + // PatientProfileHeaderNewDesign( + // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 43c1382e..2619b200 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -303,7 +303,7 @@ class _PatientMakeReferralScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); await model .getClinicDoctors( - _selectedClinic['ClinicID'].toString()) + _selectedClinic['ClinicID'].toString(), _selectedBranch['facilityId']) .then((_) => GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.ErrorLocal) { diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 4197b5b6..f2bbe274 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -35,7 +35,6 @@ class PrescriptionItemsPage extends StatelessWidget { patient: patient, patientType: patientType??"0", arrivalType: arrivalType??"0", - branch: '', clinic: prescriptions.clinicDescription, isPrescriptions: true, appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index b4299d2e..e8fdd882 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -61,7 +61,7 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if (patientType != null && patientType == '7') + if (patientType != null && patientType == '7' && patient.patientStatusType == 43) InkWell( onTap: () { addSelectedProcedure(context, model, patient); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6fa147f0..6094331f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1209,6 +1209,9 @@ class TranslationBase { localizedValues['typeHereToReply'][locale.languageCode]; String get searchHere => localizedValues['searchHere'][locale.languageCode]; String get remove => localizedValues['remove'][locale.languageCode]; + + String get step => localizedValues['step'][locale.languageCode]; + String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; String get changeOfSchedule => localizedValues['changeOfSchedule'][locale.languageCode]; diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index 951e14ed..9cdda71b 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -236,9 +236,11 @@ class SMSOTP { Padding( padding: EdgeInsets.only(top: 10), child: Row(children: [ - AppText( - TranslationBase.of(context).validationMessage + ' ', - fontWeight: FontWeight.w600, + Expanded( + child: AppText( + TranslationBase.of(context).validationMessage + ' ', + fontWeight: FontWeight.w600, + ), ), AppText( displayTime, diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 3ac6888e..bfe8fcad 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -15,9 +15,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final PatiantInformtion patient; final String patientType; final String arrivalType; + final double height; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); @override Widget build(BuildContext context) { @@ -36,7 +37,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: 200, + height: height == 0 ? 200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index a00ae6ef..ddb52e84 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -27,6 +27,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre final String invoiceNO; final String orderNo; final bool isPrescriptions; + final String clinic; PatientProfileHeaderWhitAppointmentAppBar( {this.patient, @@ -406,7 +407,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre ) ], ), - if(isPrescriptions) + if(isPrescriptions && branch!=null) Row( children: [ Texts( diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 512e6d49..8dc2a8c0 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -151,7 +151,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { arrivalType: arrivalType, route: REFER_PATIENT_TO_DOCTOR, isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).myReferral, + nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 18f4f19d..f5b3def9 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -692,17 +692,18 @@ class _AddAssessmentDetailsState extends State { height: 16, ), Row( + children: [ - AppText( - TranslationBase.of(context) - .addAssessmentDetails - .toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 13, - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.42, + Expanded( + child: AppText( + TranslationBase.of(context) + .addAssessmentDetails + .toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 13, + ), ), + InkWell( child: Icon( Icons.close, diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index e1388ef1..5c69a8ae 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -9,15 +10,18 @@ import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model. import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.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'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -58,6 +62,7 @@ class _UpdatePlanPageState extends State { )), ); } + TextEditingController typeController = TextEditingController(); @override Widget build(BuildContext context) { @@ -84,221 +89,251 @@ class _UpdatePlanPageState extends State { }, builder: (_, model, w) => AppScaffold( // baseViewModel: model, + backgroundColor: Colors.grey[200], isShowAppBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase - .of(context) - .progressNoteSOAP, - variant: isProgressNoteExpand ? "bodyText" : '', - bold: isProgressNoteExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isProgressNoteExpand = !isProgressNoteExpand; - }); - }, - child: Icon(isProgressNoteExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], + widthFactor: 0.95, + child: Container( + margin: EdgeInsets.all(8.0), + padding: EdgeInsets.all(12.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 10, ), - bodyWidget: Column(children: [ - SizedBox( - height: 20, - ), - Column( + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - if(widget.patientProgressNote.planNote == null) - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( + Row( + children: [ + Texts(TranslationBase + .of(context) + .progressNoteSOAP, + variant: isProgressNoteExpand ? "bodyText" : '', + bold: isProgressNoteExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: Colors.black, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isProgressNoteExpand = !isProgressNoteExpand; + }); + }, + child: Icon(isProgressNoteExpand + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 2, + ), + Column( + children: [ + if(widget.patientProgressNote.planNote == null) + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), - hintText: TranslationBase - .of(context) - .addProgressNote, - fontSize: 13.5, - onTapTextFields: () { - openProgressNote(context); + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).progressNote, + controller: progressNoteController, + minLines: 2, + maxLines: 4, + inputType: TextInputType.multiline, + onChanged: (value){ + // examination.remark = value; }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - if ( widget.patientProgressNote.planNote != null) - Container( - margin: - EdgeInsets.only(left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( + ), + ), + SizedBox( + height: 20, + ), + if ( widget.patientProgressNote.planNote != null) + Container( + margin: + EdgeInsets.only(left: 5, right: 5, top: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ - widget.patientProgressNote.createdOn !=null?DateTime.parse(widget.patientProgressNote.createdOn).day.toString():DateTime.now().day.toString(), - fontWeight: FontWeight - .bold, - fontSize: 16, - ), - AppText( - Helpers.getMonth(widget.patientProgressNote.createdOn !=null?(DateTime.parse(widget.patientProgressNote.createdOn).month):DateTime.now().month).toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - ], - ) - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - Padding( - padding: const EdgeInsets.all(0.0), - child: Container( - width: MediaQuery.of(context) - .size - .width * - 0.6, - child: AppText( - progressNoteController.text, - fontSize: 10, - color: Colors.grey, - ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Row( + children: [ + Texts('Appointment No: '), + Texts(widget.patientProgressNote.appointmentNo.toString()), + + ], + ), + AppText( + widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight + .bold, + fontSize: 16, + ) + + ], + ), + Row( + children: [ + Texts('Condition: '), + Texts(widget.patientProgressNote.mName.toString()), + + ], + ), + if(widget.patientProgressNote.createdByName !=null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).createdBy, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + widget.patientProgressNote.createdByName??"", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + if(widget.patientProgressNote.editedByName !=null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).editedBy, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + widget.patientProgressNote.editedByName??"", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + Padding( + padding: const EdgeInsets.all(0.0), + child: Container( + width: MediaQuery.of(context) + .size + .width * + 0.6, + child: Texts( + progressNoteController.text, + fontSize: 10, + color: Colors.grey, ), ), - ], - ), - SizedBox( - height: 8, - ), - if(widget.patientProgressNote.createdByName !=null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).createdBy, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.patientProgressNote.createdByName??"", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - if(widget.patientProgressNote.editedByName !=null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).editedBy, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.patientProgressNote.editedByName??"", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - ], - ), - Column( - children: [ - InkWell( - onTap: () { - openProgressNote(context); - }, - child: Icon(EvaIcons.edit2Outline), - ) - ], - ), - ], - ), - ) - ], - ) - ]), - isExpand: isProgressNoteExpand, - ), - DividerWithSpacesAround( - height: 30, - ), - AppButton( - title: TranslationBase.of(context).next, - loading: model.state == ViewState.BusyLocal, - onPressed: () { - submitPlan(model); - // widget.changePageViewIndex(2); - }, - ), - SizedBox( - height: 30, - ), - ], + ), + ], + ), + ], + ), + ) + ], + ) + ]), + isExpand: isProgressNoteExpand, + ), + + ], + ), ), ), ), ), + bottomSheet: Container( + width: double.maxFinite, + height: 70, + child: Container( + margin: EdgeInsets.all(6), + child: Column( + children: [ + + Row( + children: [ + Expanded( + child: AppButton( + title: 'Previous', + color: Colors.white38, + fontColor: Colors.black, + fontWeight: FontWeight.w700, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + setState(() { + widget.changePageViewIndex(2); + }); + }, + ), + ), + SizedBox(width: 5,), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w700, + loading: model.state == ViewState.BusyLocal, + disabled: progressNoteController.text.isEmpty, + onPressed: () async { + + if(widget.patientProgressNote.planNote.isEmpty) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + setState(() { + widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; + widget.patientProgressNote.editedByName = doctorProfile.doctorName; + widget.patientProgressNote.createdOn = DateTime.now().toString(); + widget.patientProgressNote.planNote = progressNoteController.text; + }); + + } else + submitPlan(model); + }, + ), + ), + ], + ), + + ], + ), + ), + ), ), ); } @@ -333,74 +368,5 @@ class _UpdatePlanPageState extends State { } } - openProgressNote(BuildContext context) { - showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return FractionallySizedBox( - heightFactor: 0.6, - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - // crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).addProgressNote, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: TextFields( - hasLabelText: progressNoteController.text != ''?true:false, - showLabelText: true, - hintText: TranslationBase.of(context).addProgressNote, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 16, - minLines: 8, - controller: progressNoteController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ),SizedBox( - height: 10, - ), - AppButton( - title: TranslationBase.of(context).add.toUpperCase(), - onPressed: () async{ - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName??doctorProfile.doctorName; - widget.patientProgressNote.editedByName=doctorProfile.doctorName; - widget.patientProgressNote.createdOn= DateTime.now().toString() ; - widget.patientProgressNote.planNote = progressNoteController.text; - setState(() { - print(progressNoteController.text); - }); - Navigator.of(context).pop(); - }, - ), - ]), - )), - ); - }); - } } diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index db9bf63a..72c8c714 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -69,6 +69,7 @@ class _UpdateSoapIndexState extends State isLoading: _isLoading, isShowAppBar: false, body: SingleChildScrollView( + child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -141,6 +142,6 @@ class _UpdateSoapIndexState extends State ), ), ), - ); + )); } } diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 41d58931..6193204d 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -46,7 +46,7 @@ class _AppDrawerState extends State { child: ListView(padding: EdgeInsets.zero, children: [ Container( margin: EdgeInsets.symmetric(horizontal: 20), - height: SizeConfig.heightMultiplier * 50, + // height: SizeConfig.heightMultiplier * 50, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -54,9 +54,9 @@ class _AppDrawerState extends State { child: Image.asset( 'assets/images/dr_app_logo.png', ), - margin: EdgeInsets.only(top: 10, bottom: 15), + margin: EdgeInsets.only(top: 10, bottom: 10), ), - SizedBox(height: 15), + SizedBox(height: 10), if (authProvider.doctorProfile != null) InkWell( onTap: () { @@ -91,7 +91,7 @@ class _AppDrawerState extends State { ], ), ), - SizedBox(height: 15), + SizedBox(height: 10), InkWell( child: DrawerItem( TranslationBase.of(context).rescheduleLeaves, @@ -111,6 +111,29 @@ class _AppDrawerState extends State { )); }, ), + + SizedBox(height: 10), + InkWell( + child: DrawerItem( + 'My QR Code', + // " or " + + // TranslationBase.of(context).leaves, + + DoctorApp.qr_code_3, + // subTitle: , + ), + ), + + InkWell( + child: Container( + height: 80, + child: Image.asset('assets/images/qr_code.png'), + ), + onTap: () { + }, + ), + + ], ), ), @@ -121,6 +144,8 @@ class _AppDrawerState extends State { margin: EdgeInsets.symmetric(horizontal: 20), child: Column( children: [ + + InkWell( child: DrawerItem( projectsProvider.isArabic diff --git a/pubspec.lock b/pubspec.lock index e15e02c9..46eca7cf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: @@ -1084,5 +1084,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0"