diff --git a/lib/config/config.dart b/lib/config/config.dart index 36be5e92..599f072f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -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 93c3a2de..a4eb5dbc 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -713,4 +713,8 @@ const Map> localizedValues = { "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}, "registerNewPatient": {"en": "Register\nNew Patient", "ar": "تسجيل\n مريض جديد"}, "registeraPatient": {"en": "Register a Patient", "ar": "تسجيل المريض"}, + "occupation": {"en": "Occupation", "ar": "مهنة"}, + "healthID": {"en": "Health ID", "ar": "معرف الصحة"}, + "identityNumber": {"en": "Identity Number", "ar": "رقم الهوية"}, + "maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"}, }; diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart new file mode 100644 index 00000000..e4de6aae --- /dev/null +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -0,0 +1,87 @@ +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; + +class CustomEditableText extends StatefulWidget { + CustomEditableText({ + Key key, + @required this.controller, + this.hint, + this.isEditable = false, + }) : super(key: key); + + final TextEditingController controller; + + final String hint; + bool isEditable; + + @override + _CustomEditableTextState createState() => _CustomEditableTextState(); +} + +class _CustomEditableTextState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + if(!widget.isEditable) + Container( + height: 60, + decoration: BoxDecoration( + color: Colors.grey[300], + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(20)), + border: Border.fromBorderSide( + BorderSide( + color: Colors.grey[300], + width: 2, + ), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(widget.hint, fontSize: 12, color: Colors.black), + AppText( + widget.controller.text, + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + InkWell( + child: Icon( + DoctorApp.edit_1, + size: 20, + + ), + onTap: () { + setState(() { + widget.isEditable = true; + }); + }, + ) + ], + ), + ), + ), + if(widget.isEditable) + AppTextFieldCustom( + hintText: widget.hint, + //TranslationBase.of(context).addoperationReports, + controller: widget.controller, + maxLines: 1, + minLines: 1, + hasBorder: true, + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart new file mode 100644 index 00000000..153670c4 --- /dev/null +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -0,0 +1,345 @@ +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/model/note/CreateNoteModel.dart'; +import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +import 'CustomEditableText.dart'; + +class RegisterConfirmationPatientPage extends StatefulWidget { + final GetOperationReportModel operationReport; + final OperationReportViewModel operationReportViewModel; + final PatiantInformtion patient; + final int visitType; + final bool isUpdate; + + const RegisterConfirmationPatientPage( + {Key key, + this.operationReportViewModel, + this.patient, + this.visitType, + this.isUpdate, + this.operationReport}) + : super(key: key); + + @override + _RegisterConfirmationPatientPageState createState() => + _RegisterConfirmationPatientPageState(); +} + +class _RegisterConfirmationPatientPageState + extends State { + int selectedType; + bool isSubmitted = false; + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + ProjectViewModel projectViewModel; + TextEditingController firstName = TextEditingController(text: "Elham"); + TextEditingController middleName = TextEditingController(text: "Ali"); + TextEditingController lastName = TextEditingController(text: "Rababah"); + TextEditingController emailAddressController = TextEditingController(text: "Elham@Rababah.com"); + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: false, + backgroundColor: Color(0xFFF8F8F8), + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10.0, + ), + SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + CustomEditableText( + controller: firstName, hint: TranslationBase.of(context).firstName), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: middleName, hint: TranslationBase.of(context).middleName), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: lastName, hint: TranslationBase.of(context).lastName), + SizedBox( + height: 20, + ), + + FractionallySizedBox( + widthFactor: .9, + child: Center( + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).healthID, fontSize: 12, color: Colors.black), + AppText( + "123456", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).identityNumber, fontSize: 12, color: Colors.black), + AppText( + "ss", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + SizedBox(width: 20,) + ], + ), + SizedBox( + height: 20, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).nationality, fontSize: 12, color: Colors.black), + AppText( + "Jordanian", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).occupation, fontSize: 12, color: Colors.black), + AppText( + "--", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + SizedBox(width: 20,) + ], + ), + SizedBox( + height: 20, + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).mobileNo, fontSize: 12, color: Colors.black), + AppText( + "075XXXXXX", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + SizedBox(width: 20,) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ), + + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: () { + // MasterKeyDailog dialog = + // MasterKeyDailog( + // list: + // model.medicationDoseTimeList, + // okText: + // TranslationBase.of(context) + // .ok, + // selectedValue: + // _selectedMedicationDose, + // okFunction: (selectedValue) { + // setState(() { + // _selectedMedicationDose = + // selectedValue; + // + // doseController + // .text = projectViewModel + // .isArabic + // ? _selectedMedicationDose + // .nameAr + // : _selectedMedicationDose + // .nameEn; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: (BuildContext context) { + // return dialog; + // }, + // ); + }, + hintText: + TranslationBase.of(context).maritalStatus, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + // controller: doseController, + // validationError: isFormSubmitted && + // _selectedMedicationDose == null + // ? TranslationBase.of(context) + // .emptyMessage + // : null, + ), + SizedBox( + height: 20, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: () { + // MasterKeyDailog dialog = + // MasterKeyDailog( + // list: + // model.medicationDoseTimeList, + // okText: + // TranslationBase.of(context) + // .ok, + // selectedValue: + // _selectedMedicationDose, + // okFunction: (selectedValue) { + // setState(() { + // _selectedMedicationDose = + // selectedValue; + // + // doseController + // .text = projectViewModel + // .isArabic + // ? _selectedMedicationDose + // .nameAr + // : _selectedMedicationDose + // .nameEn; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: (BuildContext context) { + // return dialog; + // }, + // ); + }, + hintText: + TranslationBase.of(context).lanEnglish, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + // controller: doseController, + // validationError: isFormSubmitted && + // _selectedMedicationDose == null + // ? TranslationBase.of(context) + // .emptyMessage + // : null, + ), + SizedBox( + height: 20, + ), + AppTextFieldCustom( + hintText: "Email Address", + //TranslationBase.of(context).addoperationReports, + controller: emailAddressController, + maxLines: 1, + minLines: 1, + hasBorder: true, + ), + + SizedBox( + height: 400, + ), + ], + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 8b79225d..3604a943 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.d import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart'; +import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterConfirmationPatientPage.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -98,6 +99,8 @@ class _RegisterPatientPageState extends State scrollDirection: Axis.horizontal, children: [ RegisterSearchPatientPage(), + RegisterConfirmationPatientPage(), + ]), ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 58e17a94..397f8b36 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -294,6 +294,10 @@ class TranslationBase { String get age => localizedValues['age'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; + String get occupation => localizedValues['occupation'][locale.languageCode]; + String get healthID => localizedValues['healthID'][locale.languageCode]; + String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; + String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; String get today => localizedValues['today'][locale.languageCode];