diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 878a1850..2f4607e0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 74f3da60..e520374e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -287,7 +287,7 @@ const Map> localizedValues = { 'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, 'bed': {'en': 'BED:', 'ar': 'السرير'}, 'next': {'en': 'Next', 'ar': 'التالي'}, - 'previous': {'en': 'PREVIOUS', 'ar': 'السابق'}, + 'previous': {'en': 'Previous', 'ar': 'السابق'}, 'healthRecordInformation': { 'en': 'HEALTH RECORD INFORMATION', 'ar': 'معلومات السجل الصحي' @@ -596,8 +596,8 @@ const Map> localizedValues = { "en": "The verification code expires in", "ar": "تنتهي صلاحية رمز التحقق خلال" }, - 'addAssessment': {'en': "Add ASSESSMENT", 'ar': "أضف التقييم"}, - 'assessment': {'en': "ASSESSMENT", 'ar': " التقييم"}, + 'addAssessment': {'en': "Add Assessment", 'ar': "أضف التقييم"}, + 'assessment': {'en': "Assessment", 'ar': " التقييم"}, 'physicalSystemExamination': { 'en': "Physical System / Examination", 'ar': "الفحص البدني / النظام" @@ -848,8 +848,8 @@ const Map> localizedValues = { "ar": "هذه الخانة مطلوبه" }, "applyOrRescheduleLeave": { - "en": "Apply Or Reschedule Leave", - "ar": "التقدم بطلب أو إعادة جدولة الإجازة" + "en": "Apply Reschedule Leave", + "ar": "التقدم بطلب إعادة جدولة الإجازة" },"myQRCode": { "en": "My QR Code", "ar": "My QR Code" diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index d0cebe77..be772515 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 600a83a5..e3df5a7c 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; diff --git a/lib/models/SOAP/PatchAssessmentReqModel.dart b/lib/models/SOAP/PatchAssessmentReqModel.dart new file mode 100644 index 00000000..8cbf5cb7 --- /dev/null +++ b/lib/models/SOAP/PatchAssessmentReqModel.dart @@ -0,0 +1,48 @@ +class PatchAssessmentReqModel { + int patientMRN; + int appointmentNo; + int episodeID; + String icdcode10Id; + String prevIcdCode10ID; + int conditionId; + int diagnosisTypeId; + bool complexDiagnosis; + String remarks; + + PatchAssessmentReqModel( + {this.patientMRN, + this.appointmentNo, + this.episodeID, + this.icdcode10Id, + this.prevIcdCode10ID, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); + + PatchAssessmentReqModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + icdcode10Id = json['Icdcode10Id']; + prevIcdCode10ID = json['PrevIcdCode10ID']; + conditionId = json['ConditionId']; + diagnosisTypeId = json['DiagnosisTypeId']; + complexDiagnosis = json['ComplexDiagnosis']; + remarks = json['Remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['Icdcode10Id'] = this.icdcode10Id; + data['PrevIcdCode10ID'] = this.prevIcdCode10ID; + data['ConditionId'] = this.conditionId; + data['DiagnosisTypeId'] = this.diagnosisTypeId; + data['ComplexDiagnosis'] = this.complexDiagnosis; + data['Remarks'] = this.remarks; + return data; + } +} diff --git a/lib/widgets/patients/profile/soap_update/SOAP_open_items.dart b/lib/widgets/patients/profile/soap_update/SOAP_open_items.dart new file mode 100644 index 00000000..e3b0c483 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/SOAP_open_items.dart @@ -0,0 +1,62 @@ +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'; + +class SOAPOpenItems extends StatelessWidget { + final Function onTap; + final String label; + + const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key); + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 8, horizontal: 8.0), + margin: EdgeInsets.symmetric(vertical: 8), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey.shade400, width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(8), + ), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "$label", + fontSize:15, + color: Colors.black, + fontWeight: FontWeight.w600, + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize:13, + color: Colors.grey.shade700, + ), + ], + )), + Icon( + Icons.add_box_rounded, + size: 25, + ) + ], + ), + ), + ); + } +} + + + diff --git a/lib/widgets/patients/profile/soap_update/SOAP_step_header.dart b/lib/widgets/patients/profile/soap_update/SOAP_step_header.dart index dcd0daa1..e4d8d67e 100644 --- a/lib/widgets/patients/profile/soap_update/SOAP_step_header.dart +++ b/lib/widgets/patients/profile/soap_update/SOAP_step_header.dart @@ -19,13 +19,14 @@ class SOAPStepHeader extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox(height: 15,), AppText( TranslationBase.of(context).createNew, - fontSize: 3 * SizeConfig.textMultiplier, + fontSize: 14, fontWeight: FontWeight.w500, ), AppText(TranslationBase.of(context).episode, - fontSize: 3.5 * SizeConfig.textMultiplier, + fontSize: 26, fontWeight: FontWeight.bold, ), Container( diff --git a/lib/widgets/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/widgets/patients/profile/soap_update/assessment/add_assessment_details.dart new file mode 100644 index 00000000..c9e24dbc --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -0,0 +1,563 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; +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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/bottom_sheet_title.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/dialogs/master_key_dailog.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +import '../custom_validation_error.dart'; + +class AddAssessmentDetails extends StatefulWidget { + final MySelectedAssessment mySelectedAssessment; + final List mySelectedAssessmentList; + final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) + addSelectedAssessment; + final PatiantInformtion patientInfo; + final bool isUpdate; + AddAssessmentDetails( + {Key key, + this.mySelectedAssessment, + this.addSelectedAssessment, + this.patientInfo, + this.isUpdate = false, + this.mySelectedAssessmentList}); + + @override + _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); +} + +class _AddAssessmentDetailsState extends State { + TextEditingController remarkController = TextEditingController(); + TextEditingController appointmentIdController = TextEditingController(); + TextEditingController conditionController = TextEditingController(); + TextEditingController typeController = TextEditingController(); + TextEditingController icdNameController = TextEditingController(); + + GlobalKey key = new GlobalKey>(); + bool isFormSubmitted = false; + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + remarkController.text = widget.mySelectedAssessment.remark ?? ""; + appointmentIdController.text = + widget.mySelectedAssessment.appointmentId.toString(); + if (widget.isUpdate) { + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) + conditionController.text = projectViewModel.isArabic + ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr + : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + if (widget.mySelectedAssessment.selectedDiagnosisType != null) + typeController.text = projectViewModel.isArabic + ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr + : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; + if (widget.mySelectedAssessment.selectedICD != null) + icdNameController.text = widget.mySelectedAssessment.selectedICD.code; + } + final screenSize = MediaQuery.of(context).size; + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {IconData icon}) { + return InputDecoration( + fillColor: Colors.white, + + contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, + filled: true, + hintStyle: TextStyle( + fontSize: 10, + color: Colors.grey.shade600, + ), + ); + } + + return FractionallySizedBox( + heightFactor: 1, + child: BaseView( + onModelReady: (model) async { + if (model.listOfDiagnosisCondition.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisCondition); + } + if (model.listOfDiagnosisType.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisType); + } + if (model.listOfICD10.length == 0) { + await model.getMasterLookup(MasterKeysService.ICD10); + } + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Center( + child: Column( + children: [ + BottomSheetTitle( + title: TranslationBase.of(context).addAssessmentDetails), + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + height: 55.0, + hintText: + TranslationBase.of(context).appointmentNumber, + //fontSize: 13.5, + // hintColor: Colors.black, + //hasLabelText: appointmentIdController.text != '' + // ? true + // : false, + //showLabelText: true, + //fontWeight: FontWeight.w600, + //readOnly: true, + isDropDown: false, + enabled: false, + controller: appointmentIdController, + // validator: (value) { + // if (value == null) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + ), + ), + SizedBox( + height: 10, + ), + Container( + height: 55.0, + child: InkWell( + onTap: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment + .selectedICD = null; + icdNameController.text = null; + }); + } + : null, + child: widget + .mySelectedAssessment.selectedICD == + null + ? AutoCompleteTextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .nameOrICD, + widget.mySelectedAssessment + .selectedICD != + null + ? widget.mySelectedAssessment + .selectedICD.nameEn + : null, + true, + icon: Icons.keyboard_arrow_down), + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment + .selectedICD = item; + icdNameController.text = item.code; + }), + key: key, + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => + new Padding( + child: Texts(suggestion + .description + + " / " + + suggestion.code.toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.code + .toLowerCase() + .startsWith( + input.toLowerCase()), + ) + : AppTextFieldCustom( + onClick: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment + .selectedICD = null; + icdNameController.text = null; + }); + } + : null, + //hasLabelText: + // icdNameController.text != '' + // ? true + // : false, + //showLabelText: true, + hintText: TranslationBase.of(context) + .nameOrICD, + + //fontSize: 13.5, + //readOnly: true, + //fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: icdNameController, + //suffixIcon: EvaIcons.search, + // validator: (value) { + // if (value == null) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + + isDropDown: true, + enabled: false, + height: 55.0, + ) + + // TextField( + // decoration: textFieldSelectorDecoration( + // widget.mySelectedAssessment.selectedICD != + // null ? widget.mySelectedAssessment + // .selectedICD.code : "Name or ICD", + // widget.mySelectedAssessment.selectedICD != + // null ? projectViewModel.isArabic + // ? widget.mySelectedAssessment + // .selectedICD.nameAr + // : widget.mySelectedAssessment + // .selectedICD.nameEn : null, true, + // icon: EvaIcons.search), + // enabled: false, + // ), + ), + ), + if (isFormSubmitted && + widget.mySelectedAssessment.selectedICD == null) + CustomValidationError(), + SizedBox( + height: 7, + ), + AppTextFieldCustom( + height: 55.0, + onClick: model.listOfDiagnosisCondition != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase.of(context).ok, + okFunction: + (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment + .selectedDiagnosisCondition = + selectedValue; + conditionController + .text = projectViewModel + .isArabic + ? widget + .mySelectedAssessment + .selectedDiagnosisCondition + .nameAr + : widget + .mySelectedAssessment + .selectedDiagnosisCondition + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + //hasLabelText: + // conditionController.text != '' ? true : false, + //showLabelText: true, + hintText: TranslationBase.of(context).condition, + //fontSize: 13.5, + //readOnly: true, + //suffixIcon: EvaIcons.arrowDown, + // hintColor: Colors.black, + //fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: conditionController, + // validator: (value) { + // if (value == null) + // return TranslationBase.of(context).emptyMessage; + // else + // return null; + // }, + + isDropDown: true, + enabled: false, + ), + if (isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisCondition == + null) + CustomValidationError(), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: 55.0, + onClick: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase.of(context).ok, + okFunction: + (MasterKeyModel selectedValue) { + setState(() { + // _selectedDiagnosisType = + // selectedValue; + widget.mySelectedAssessment + .selectedDiagnosisType = + selectedValue; + typeController.text = + projectViewModel.isArabic + ? selectedValue.nameAr + : selectedValue.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + //hasLabelText: + // typeController.text != '' ? true : false, + //prefixIcon: Icon(Icons.add), + //showLabelText: true, + hintText: TranslationBase.of(context).dType, + //fontSize: 13.5, + //readOnly: true, + // hintColor: Colors.black, + //suffixIcon: EvaIcons.arrowDown, + //fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + enabled: false, + isDropDown: true, + + controller: typeController, + // validator: (value) { + // if (value == null) + // return TranslationBase.of(context).emptyMessage; + // else + // return null; + // }, + ), + if (isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisType == + null) + CustomValidationError(), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: TextFields( + hintText: TranslationBase.of(context).remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 18, + minLines: 5, + hasLabelText: + remarkController.text != '' ? true : false, + showLabelText: true, + controller: remarkController, + onChanged: (value) { + widget.mySelectedAssessment.remark = + remarkController.text; + }, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + ])), + ), + ], + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + color: Colors.green, + title: (widget.isUpdate + ? 'Update Assessment Details' + : 'Add Assessment Details'), + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + setState(() { + isFormSubmitted = true; + }); + widget.mySelectedAssessment.remark = + remarkController.text; + widget.mySelectedAssessment.appointmentId = + int.parse(appointmentIdController.text); + if (widget.mySelectedAssessment + .selectedDiagnosisCondition != + null && + widget.mySelectedAssessment + .selectedDiagnosisType != + null && + widget.mySelectedAssessment.selectedICD != null) { + await submitAssessment( + isUpdate: widget.isUpdate, + model: model, + mySelectedAssessment: + widget.mySelectedAssessment); + } + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ), + ), + ); + } + + submitAssessment( + {SOAPViewModel model, + MySelectedAssessment mySelectedAssessment, + bool isUpdate = false}) async { + if (isUpdate) { + PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code, + prevIcdCode10ID: mySelectedAssessment.icdCode10ID); + + await model.patchAssessment(patchAssessmentReqModel); + } else { + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ + new IcdCodeDetails( + remarks: mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code) + ]); + + await model.postAssessment(postAssessmentRequestModel); + } + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + mySelectedAssessment.doctorName = doctorProfile.doctorName; + + if (!isUpdate) { + // widget.mySelectedAssessmentList.add(mySelectedAssessment); + widget.addSelectedAssessment(mySelectedAssessment, isUpdate); + } + Navigator.of(context).pop(); + } + + // widget.changePageViewIndex(3); + } +} \ No newline at end of file diff --git a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart index 81bdf613..a55662ce 100644 --- a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart +++ b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart @@ -31,28 +31,35 @@ class ExpandableSOAPWidget extends StatelessWidget { width: 0.30), ), child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(headerTitle, - variant: isExpanded ? "bodyText" : '', - // bold: isExpanded ? true : false, - fontSize: 15, - color: Colors.black), - if(isRequired) - Icon( - FontAwesomeIcons.asterisk, - size: 12, - ) - ], - ), - InkWell( + headerWidget: InkWell( + onTap: onTap, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: onTap, + child: Row( + children: [ + Texts(headerTitle, + variant: isExpanded ? "bodyText" : '', + // bold: isExpanded ? true : false, + fontSize: 15, + color: Colors.black), + if(isRequired) + Icon( + FontAwesomeIcons.asterisk, + size: 12, + ) + ], + ), + ), + InkWell( onTap: onTap, child: Icon( - isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline)) - ], + isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline), + ) + ], + ), ), bodyWidget: child, isExpand: isExpanded, diff --git a/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart b/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart index 09610a75..8d53bbd0 100644 --- a/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart +++ b/lib/widgets/patients/profile/soap_update/objective/examination-item-card.dart @@ -36,7 +36,7 @@ class ExaminationIitemCard extends StatelessWidget { : examination.selectedExamination.nameEn, fontWeight: FontWeight.w600, fontFamily: 'Poppins', - color: Color(0x2B353E), + color: Color(0xFF2B353E), fontSize: SizeConfig.textMultiplier * 1.8, ), )), diff --git a/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart index 43525272..457bfe5f 100644 --- a/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; @@ -14,19 +13,17 @@ 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/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_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/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import '../SOAP_open_items.dart'; import '../SOAP_step_header.dart'; +import '../expandable_SOAP_widget.dart'; import 'examination-item-card.dart'; import 'objective-add-examination-page.dart'; @@ -104,205 +101,110 @@ class _UpdateObjectivePageState extends State { widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - // baseViewModel: model, - body: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), - - Expanded( - child: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - color: Color.fromRGBO(248, 248, 248, 1), - child: Center( - child: FractionallySizedBox( - 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: [ - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).physicalSystemExamination}", - fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 2.1, - fontWeight: isSysExaminationExpand - ? FontWeight.w700 - : FontWeight.normal, - color: Color(0xFF2E303A), - ), - Icon( - FontAwesomeIcons.asterisk, - color: Colors.black/*AppGlobal.appPrimaryColor*/, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isSysExaminationExpand = - !isSysExaminationExpand; - }); - }, - child: Icon(isSysExaminationExpand - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)) - ], - ), - bodyWidget: Column( - children: [ - InkWell( - onTap: () { - openExaminationList(context); - }, - child: Container( - padding: EdgeInsets.symmetric( - vertical: 8, horizontal: 8.0), - margin: - EdgeInsets.symmetric(vertical: 8), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade400, - width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(8), - ), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).addExamination}", - fontSize: SizeConfig - .textMultiplier * - 1.8, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize: SizeConfig - .textMultiplier * - 1.8, - color: Colors.grey.shade700, - fontWeight: FontWeight.bold, - ), - ], - )), - Icon( - Icons.add_box_rounded, - size: 25, - ) - ], - ), - ), - ), - /* ...List.generate( - widget.mySelectedExamination.length, - (index) => Container( - child: ExaminationIitemCard( - widget.mySelectedExamination[ - index], () { - removeExamination(widget - .mySelectedExamination[ - index] - .selectedExamination); - }), - )),*/ - Column( - children: widget.mySelectedExamination - .map((examination) { - return ExaminationIitemCard( - examination, () { - removeExamination(examination - .selectedExamination); - }); - }).toList(), - ) - ], - ), - isExpand: isSysExaminationExpand, - ), - ], - ), - ), - ), - ), + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // baseViewModel: model, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex), + ExpandableSOAPWidget( + headerTitle: + TranslationBase.of(context).physicalSystemExamination, + onTap: () { + setState(() { + isSysExaminationExpand = !isSysExaminationExpand; + }); + }, + child: Column( + children: [ + SOAPOpenItems(label: "${TranslationBase.of(context).addExamination}",onTap: () { + openExaminationList(context); + },), + Column( + children: + widget.mySelectedExamination.map((examination) { + return ExaminationIitemCard(examination, () { + removeExamination(examination.selectedExamination); + }); + }).toList(), + ) + ], ), + isExpanded: isSysExaminationExpand, ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: HexColor("#EAEAEA"), - fontColor: Colors.black, - onPressed: () { - widget.changePageViewIndex(0); - }, - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - loading: model.state == ViewState.BusyLocal, - color: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 - ? HexColor("#D02127") - : HexColor("#A5A5A5"), - fontColor: widget.mySelectedExamination != null && + ], + ), + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0), + ), + height: MediaQuery + .of(context) + .size + .height * 0.1, + width: double.infinity, + child: FractionallySizedBox( + widthFactor: 0.9, + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width *0.4, + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + onPressed: () { + widget.changePageViewIndex(0); + }, + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width *0.1, + ), + Container( + width: MediaQuery.of(context).size.width *0.4, + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + loading: model.state == ViewState.BusyLocal, + color: widget.mySelectedExamination != null && + widget.mySelectedExamination.length > 0 + ? Colors.red[700] + : HexColor("#A5A5A5"), + fontColor: widget.mySelectedExamination != null && widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"), - disabled: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 - ? false - : true, - fontWeight: FontWeight.bold, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, - ), - ), - ], + disabled: widget.mySelectedExamination != null && + widget.mySelectedExamination.length > 0 + ? false + : true, + onPressed: () async { + await submitUpdateObjectivePage(model); + }, + ), ), - ), - ], - ))); + ], + ), + ), + ), + ), + ); } submitUpdateObjectivePage(SOAPViewModel model) async { @@ -462,33 +364,6 @@ class _AddExaminationDailogState extends State { SizedBox( height: 16, ), - /*MasterKeyCheckboxSearchWidget( - model: model, - hintSearchText: - TranslationBase.of(context).searchExamination, - buttonName: - TranslationBase.of(context).addExamination, - masterList: model.physicalExaminationList, - removeHistory: (history) { - setState(() { - widget.removeExamination(history); - }); - }, - addHistory: (history) { - setState(() { - MySelectedExamination mySelectedExamination = - new MySelectedExamination( - selectedExamination: history); - widget.mySelectedExamination - .add(mySelectedExamination); - }); - }, - addSelectedHistories: () { - widget.addSelectedExamination(); - }, - isServiceSelected: (master) => - isServiceSelected(master), - ),*/ ]), ))), )), diff --git a/lib/widgets/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/widgets/patients/profile/soap_update/subjective/allergies/add_allergies.dart index 3ee67799..59569e22 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -6,10 +6,12 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../bottom_sheet_title.dart'; @@ -133,9 +135,48 @@ class _AddAllergiesState extends State { ), ), ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.11, + ), ]), ), - )), + ),bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: + TranslationBase.of(context).addAllergies, + padding: 10, + color: Color(0xFF359846), + onPressed: () { + widget.addAllergiesFun(myAllergiesListLocal); + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ),), ), ); } diff --git a/lib/widgets/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 5fa3535b..442268e7 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -20,6 +20,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import '../../SOAP_open_items.dart'; import 'add_allergies.dart'; class UpdateAllergiesWidget extends StatefulWidget { @@ -43,61 +44,11 @@ class _UpdateAllergiesWidgetState extends State { return Column( children: [ - InkWell( - onTap: () { - openAllergiesList(context, changeAllState); - }, - child: Container( - padding: EdgeInsets.symmetric( - vertical: 8, horizontal: 8.0), - margin: - EdgeInsets.symmetric(vertical: 8), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade400, - width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(8), - ), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).addAllergies}", - fontSize: SizeConfig - .textMultiplier * - 1.8, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize: SizeConfig - .textMultiplier * - 1.8, - color: Colors.grey.shade700, - fontWeight: FontWeight.bold, - ), - ], - )), - Icon( - Icons.add_box_rounded, - size: 25, - ) - ], - ), - ), - ), + + + SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () { + openAllergiesList(context, changeAllState); + },), SizedBox( height: 20, ), @@ -242,11 +193,11 @@ class _UpdateAllergiesWidgetState extends State { }); if (isAllDataFilled) { mySelectedAllergy.forEach((element) { - if (!widget.myAllergiesList.contains(element)) { + if (!widget.myAllergiesList.contains(element.selectedAllergySeverity.id)) { widget.myAllergiesList.add(element); } }); - // changeParentState(); + changeParentState(); Navigator.of(context).pop(); } else { helpers.showErrorToast(TranslationBase diff --git a/lib/widgets/patients/profile/soap_update/subjective/bottom_sheet_title.dart b/lib/widgets/patients/profile/soap_update/subjective/bottom_sheet_title.dart index a6c59c86..ba893520 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/bottom_sheet_title.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/bottom_sheet_title.dart @@ -40,7 +40,7 @@ class BottomSheetTitle extends StatelessWidget { color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 20)), + fontSize: 22)), ], ), ), diff --git a/lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart b/lib/widgets/patients/profile/soap_update/subjective/history/PriorityBar.dart similarity index 98% rename from lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart rename to lib/widgets/patients/profile/soap_update/subjective/history/PriorityBar.dart index 0bc1080a..693ab59e 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/history/PriorityBar.dart @@ -65,8 +65,10 @@ class _PriorityBarState extends State { (projectViewModel.isArabic) ? _prioritiesAr[index] : item, + textAlign: TextAlign.center, style: TextStyle( fontSize: 14, + color: Colors.black, //Colors.black, fontWeight: FontWeight.bold, ), diff --git a/lib/widgets/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/widgets/patients/profile/soap_update/subjective/history/add_history_dialog.dart index d66f35fb..e39bd72a 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -4,13 +4,15 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; -import '../PriorityBar.dart'; import '../bottom_sheet_title.dart'; +import 'PriorityBar.dart'; class AddHistoryDialog extends StatefulWidget { final Function changePageViewIndex; @@ -140,15 +142,55 @@ class _AddHistoryDialogState extends State { addSelectedHistories: (){ widget.addSelectedHistories(); }, - isServiceSelected: (master) =>isServiceSelected(master), - ), - ), - ], + isServiceSelected: (master) => + isServiceSelected(master), + ), ), + ], + ), + ), + ), + SizedBox(height:MediaQuery.of(context).size.height * 0.11 ,) + ], + ) + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: + TranslationBase.of(context).addSelectedHistories, + padding: 10, + color: Color(0xFF359846), + onPressed: () { + widget.addSelectedHistories(); + }, ), ), - ], - )), + ), + ), + SizedBox( + height: 5, + ), + ], + ), ), ), )); diff --git a/lib/widgets/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/history/update_history_widget.dart index 873c01d2..f2adc388 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -18,7 +18,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import '../PriorityBar.dart'; +import '../../SOAP_open_items.dart'; +import 'PriorityBar.dart'; import '../bottom_sheet_title.dart'; import 'add_history_dialog.dart'; @@ -52,61 +53,11 @@ class _UpdateHistoryWidgetState extends State ProjectViewModel projectViewModel = Provider.of(context); return Column( children: [ - InkWell( - onTap: () { - openHistoryList(context); - }, - child: Container( - padding: EdgeInsets.symmetric( - vertical: 8, horizontal: 8.0), - margin: - EdgeInsets.symmetric(vertical: 8), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade400, - width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(8), - ), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).addHistory}", - fontSize: SizeConfig - .textMultiplier * - 1.8, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize: SizeConfig - .textMultiplier * - 1.8, - color: Colors.grey.shade700, - fontWeight: FontWeight.bold, - ), - ], - )), - Icon( - Icons.add_box_rounded, - size: 25, - ) - ], - ), - ), - ), + + SOAPOpenItems(label: "${TranslationBase.of(context).addHistory}",onTap: () { + openHistoryList(context); + + },), SizedBox( height: 20, ), diff --git a/lib/widgets/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index e2cb28c4..8bc01b35 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -21,6 +21,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import '../../SOAP_open_items.dart'; import '../../custom_validation_error.dart'; import '../bottom_sheet_title.dart'; import 'add_medication.dart'; @@ -44,53 +45,11 @@ class _UpdateMedicationWidgetState extends State { return Column( children: [ - InkWell( - onTap: () { - openMedicationList(context); - }, - child: Container( - padding: EdgeInsets.symmetric( - vertical: 8, horizontal: 8.0), - margin: - EdgeInsets.symmetric(vertical: 8), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade400, - width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(8), - ), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).addMedication}", - fontSize: SizeConfig - .textMultiplier * - 1.8, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ], - )), - Icon( - Icons.add_box_rounded, - size: 25, - ) - ], - ), - ), - ), + + SOAPOpenItems(label: "${TranslationBase.of(context).addMedication}",onTap: () { + openMedicationList(context); + + },), SizedBox( height: 20, ) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 2b17709d..37291faa 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -345,7 +345,8 @@ class _UpdateSubjectivePageState extends State { title: TranslationBase .of(context) .next, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w600, + color:Colors.red[700], loading: model.state == ViewState.BusyLocal, onPressed: () async { addSubjectiveInfo( 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 475596d4..3ff18103 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -1,36 +1,27 @@ -import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.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'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; -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/helpers.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/soap_update/subjective/update_subjective_page.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/dialogs/master_key_dailog.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:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'SOAP_open_items.dart'; import 'SOAP_step_header.dart'; -import 'custom_validation_error.dart'; +import 'assessment/add_assessment_details.dart'; +import 'expandable_SOAP_widget.dart'; class UpdateAssessmentPage extends StatefulWidget { final Function changePageViewIndex; @@ -113,11 +104,17 @@ class _UpdateAssessmentPageState extends State { }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( - color: Color(0xffF8F8F8), + + color: Theme + .of(context) + .scaffoldBackgroundColor, child: Center( child: FractionallySizedBox( widthFactor: 0.9, @@ -125,387 +122,328 @@ class _UpdateAssessmentPageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).assessment + , + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Column(children: [ + SizedBox( + height: 20, ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + Column( children: [ - Padding( - padding: EdgeInsets.all(12.0), - child: Row( - children: [ - Texts(TranslationBase.of(context).assessment, - variant: - isAssessmentExpand ? "bodyText" : '', - bold: isAssessmentExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: Colors.black, - size: 10, - ) - ], - ), + + SOAPOpenItems(label: "${TranslationBase.of(context).addAssessment}",onTap: () { + openAssessmentDialog(context, + isUpdate: false, model: model); + },), + + SizedBox( + height: 20, ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - Container( - margin: - EdgeInsets.only(left: 5, right: 5, top: 15), - child: TextFields( - hintText: TranslationBase.of(context) - .addAssessment, - fontSize: 13.5, - onTapTextFields: () { - openAssessmentDialog(context, - isUpdate: false, model: model); - }, - readOnly: true, - suffixIcon: EvaIcons.plusSquare, - suffixIconColor: Colors.black, - fontWeight: FontWeight.w600, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Column( - children: widget.mySelectedAssessmentList - .map((assessment) { - return Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - "ICD : ".toUpperCase(), - fontSize: 10, - color: Colors.grey, + Column( + children: widget.mySelectedAssessmentList + .map((assessment) { + return Container( + margin: EdgeInsets.only( + left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: "ICD : ".toUpperCase(), ), - Container( - child: AppText( - assessment.selectedICD.code - .trim() - .toUpperCase() ?? - "", - fontWeight: FontWeight.w700, - fontSize: 11, - ), + new TextSpan( + text: assessment + .selectedICD.code + .trim() + .toUpperCase() ?? + "", ), ], ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .ICDName + - " : ", - fontSize: 13, - color: Colors.grey, - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.29, - child: AppText( - assessment + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.50, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 16, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + children: [ + new TextSpan( + text: assessment .selectedICD.description .toString(), - fontWeight: FontWeight.w700, - fontSize: 10, ), - ), - ], + ], + ), ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) .appointmentNo, - fontSize: 10, - color: Colors.grey, + style: new TextStyle( + color: Color(0xFF575757), + ), ), - AppText( - assessment.appointmentId - .toString(), - fontSize: 11, - fontWeight: FontWeight.w700, + new TextSpan( + text: assessment + .appointmentId.toString() + + ?? + "", + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), ], ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) .condition + " : ", - fontSize: 10, - color: Colors.grey, + style: new TextStyle( + color: Color(0xFF575757), + ), ), - AppText( - projectViewModel.isArabic + new TextSpan( + text: projectViewModel + .isArabic ? assessment .selectedDiagnosisCondition .nameAr : assessment .selectedDiagnosisCondition .nameEn, - fontSize: 11, - fontWeight: FontWeight.w700, + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), ], ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) .dType + ' : ', - fontSize: 10, - color: Colors.grey, + style: new TextStyle( + color: Color(0xFF575757), + ), ), - AppText( - projectViewModel.isArabic + new TextSpan( + text: projectViewModel + .isArabic ? assessment .selectedDiagnosisType .nameAr : assessment .selectedDiagnosisType .nameEn, - fontSize: 11, - fontWeight: FontWeight.w700, + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), ], ), - if (assessment.doctorName != null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .doc, - fontSize: 10, - color: Colors.grey, + ), + if (assessment.doctorName != null) + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .doc + + ' : ', + style: new TextStyle( + color: Color(0xFF575757), + ), ), - AppText( - assessment.doctorName ?? '', - fontSize: 11, - fontWeight: FontWeight.w700, + new TextSpan( + text: + assessment.doctorName ?? + '', + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), ], ), - SizedBox( - height: 6, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - AppText( - assessment.remark != null || - assessment.remark == - '' - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - fontSize: 10, - color: Colors.grey, + SizedBox( + height: 6, + ), + + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + AppText( + (assessment.remark != null || + assessment.remark != + '') + ? TranslationBase.of( + context) + .remarks + + " : " + : '', + + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600 + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.38, + child: AppText( + assessment.remark ?? "", + fontSize: 11, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.38, - child: AppText( - assessment.remark ?? "", - fontSize: 11, - fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Row( + children: [ + Column( + children: [ + Texts( + assessment.createdOn != null + ? DateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + assessment + .createdOn)) + : DateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight + .w600, + fontSize: 14, + ), Texts( + assessment.createdOn != null + ? DateUtils.getHour( + DateTime.parse( + assessment + .createdOn)) + : DateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight + .w600, + fontSize: 14, ), - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - assessment.createdOn != null - ? DateTime.parse( - assessment - .createdOn) - .day - .toString() - : DateTime.now() - .day - .toString(), - fontWeight: FontWeight.bold, - fontSize: 15, - ), - AppText(" "), - AppText( - Helpers.getMonth(assessment - .createdOn != - null - ? DateTime.parse( - assessment - .createdOn) - .month - : DateTime.now() - .month) - .toUpperCase(), - fontSize: 13, - color: Colors.grey, - ), - ], - ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, - ), - InkWell( - onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); - }, - child: Icon(EvaIcons.edit2), - ) - ], - ), - // Column( - // children: [ - // // SizedBox( - // // height: 60, - // // ), - // InkWell( - // onTap: () { - // openAssessmentDialog( - // context, - // isUpdate: true, - // assessment: assessment, - // model: model); - // }, - // child: Icon(EvaIcons.edit2), - // ) - // ], - // ), - ], - ), - ); - }).toList(), - ) - ], - ) - ]), - isExpand: isAssessmentExpand, - ), - ), - DividerWithSpacesAround( - height: 30, + ], + ), + ], + ), + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon( + DoctorApp.edit, size: 18,), + ) + ], + ), + ], + ), + ); + }).toList(), + ) + ], + ) + ]), + isExpanded: isAssessmentExpand, ), - // Row( - // children: [ - // Container( - // width: MediaQuery.of(context).size.width * 0.4, - // child: AppButton( - // title: 'Previous', - // color: Colors.white38, - // fontColor: Colors.black, - // fontWeight: FontWeight.w700, - // loading: model.state == ViewState.BusyLocal, - // onPressed: () async { - // Navigator.pop(context); - // }, - // ), - // ), - // SizedBox( - // width: MediaQuery.of(context).size.width * 0.05, - // ), - // Container( - // width: MediaQuery.of(context).size.width * 0.4, - // child: AppButton( - // title: TranslationBase.of(context).next, - // fontWeight: FontWeight.w700, - // loading: model.state == ViewState.BusyLocal, - // onPressed: () async { - // if (widget.mySelectedAssessmentList.isEmpty) { - // helpers.showErrorToast( - // TranslationBase.of(context) - // .assessmentErrorMsg); - // } else { - // widget.changePageViewIndex(3); - // widget.changeLoadingState(true); - // } - // }, - // ), - // ), - // ], - // ), SizedBox( height: 130, ), @@ -515,45 +453,62 @@ class _UpdateAssessmentPageState extends State { ), ), ), - bottomSheet: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: 'Previous', - color: Colors.white38, - fontColor: Colors.black, - fontWeight: FontWeight.w700, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(1); - }, + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0), + ), child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: TranslationBase + .of(context) + .previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(1); + }, + ), ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.05, - ), - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w700, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { - helpers.showErrorToast( - TranslationBase.of(context).assessmentErrorMsg); - } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - } - }, + SizedBox( + width: MediaQuery.of(context).size.width * 0.05, ), - ), - ], + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: TranslationBase + .of(context) + .next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + if (widget.mySelectedAssessmentList.isEmpty) { + helpers.showErrorToast( + TranslationBase + .of(context) + .assessmentErrorMsg); + } else { + widget.changePageViewIndex(3); + widget.changeLoadingState(true); + } + }, + ), + ), + ], + ), ), ), ), @@ -586,580 +541,3 @@ class _UpdateAssessmentPageState extends State { } } -class AddAssessmentDetails extends StatefulWidget { - final MySelectedAssessment mySelectedAssessment; - final List mySelectedAssessmentList; - final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) - addSelectedAssessment; - final PatiantInformtion patientInfo; - final bool isUpdate; - AddAssessmentDetails( - {Key key, - this.mySelectedAssessment, - this.addSelectedAssessment, - this.patientInfo, - this.isUpdate = false, - this.mySelectedAssessmentList}); - - @override - _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); -} - -class _AddAssessmentDetailsState extends State { - TextEditingController remarkController = TextEditingController(); - TextEditingController appointmentIdController = TextEditingController(); - TextEditingController conditionController = TextEditingController(); - TextEditingController typeController = TextEditingController(); - TextEditingController icdNameController = TextEditingController(); - - GlobalKey key = new GlobalKey>(); - bool isFormSubmitted = false; - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - - remarkController.text = widget.mySelectedAssessment.remark ?? ""; - appointmentIdController.text = - widget.mySelectedAssessment.appointmentId.toString(); - if (widget.isUpdate) { - if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) - conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr - : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; - if (widget.mySelectedAssessment.selectedDiagnosisType != null) - typeController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr - : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; - if (widget.mySelectedAssessment.selectedICD != null) - icdNameController.text = widget.mySelectedAssessment.selectedICD.code; - } - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { - return InputDecoration( - fillColor: Colors.white, - - contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - filled: true, - hintStyle: TextStyle( - fontSize: 10, - color: Colors.grey.shade600, - ), - ); - } - - return FractionallySizedBox( - heightFactor: 0.75, - child: BaseView( - onModelReady: (model) async { - if (model.listOfDiagnosisCondition.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisCondition); - } - if (model.listOfDiagnosisType.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisType); - } - if (model.listOfICD10.length == 0) { - await model.getMasterLookup(MasterKeysService.ICD10); - } - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - SizedBox( - height: 16, - ), - Row( - - children: [ - Expanded( - child: AppText( - TranslationBase.of(context) - .addAssessmentDetails - .toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 13, - ), - ), - - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ), - ], - ), - SizedBox( - height: 16, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - height: 55.0, - hintText: - TranslationBase.of(context).appointmentNumber, - //fontSize: 13.5, - // hintColor: Colors.black, - //hasLabelText: appointmentIdController.text != '' - // ? true - // : false, - //showLabelText: true, - //fontWeight: FontWeight.w600, - //readOnly: true, - isDropDown: false, - enabled: false, - controller: appointmentIdController, - // validator: (value) { - // if (value == null) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, - ), - ), - SizedBox( - height: 10, - ), - Container( - height: 55.0, - child: InkWell( - onTap: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } - : null, - child: widget - .mySelectedAssessment.selectedICD == - null - ? AutoCompleteTextField( - - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .nameOrICD, - widget.mySelectedAssessment - .selectedICD != - null - ? widget.mySelectedAssessment - .selectedICD.nameEn - : null, - true, - icon: Icons.keyboard_arrow_down), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment - .selectedICD = item; - icdNameController.text = item.code; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts(suggestion - .description + - " / " + - suggestion.code.toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.code - .toLowerCase() - .startsWith( - input.toLowerCase()), - ) - : AppTextFieldCustom( - onClick: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } - : null, - //hasLabelText: - // icdNameController.text != '' - // ? true - // : false, - //showLabelText: true, - hintText: TranslationBase.of(context) - .nameOrICD, - - //fontSize: 13.5, - //readOnly: true, - //fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: icdNameController, - //suffixIcon: EvaIcons.search, - // validator: (value) { - // if (value == null) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, - - isDropDown: true, - enabled: false, - height: 55.0, - ) - - // TextField( - // decoration: textFieldSelectorDecoration( - // widget.mySelectedAssessment.selectedICD != - // null ? widget.mySelectedAssessment - // .selectedICD.code : "Name or ICD", - // widget.mySelectedAssessment.selectedICD != - // null ? projectViewModel.isArabic - // ? widget.mySelectedAssessment - // .selectedICD.nameAr - // : widget.mySelectedAssessment - // .selectedICD.nameEn : null, true, - // icon: EvaIcons.search), - // enabled: false, - // ), - ), - ), - if (isFormSubmitted && - widget.mySelectedAssessment.selectedICD == null) - CustomValidationError(), - SizedBox( - height: 7, - ), - AppTextFieldCustom( - height: 55.0, - onClick: model.listOfDiagnosisCondition != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - okText: TranslationBase.of(context).ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisCondition = - selectedValue; - conditionController - .text = projectViewModel - .isArabic - ? widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameAr - : widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - //hasLabelText: - // conditionController.text != '' ? true : false, - //showLabelText: true, - hintText: TranslationBase.of(context).condition, - //fontSize: 13.5, - //readOnly: true, - //suffixIcon: EvaIcons.arrowDown, - // hintColor: Colors.black, - //fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: conditionController, - // validator: (value) { - // if (value == null) - // return TranslationBase.of(context).emptyMessage; - // else - // return null; - // }, - - isDropDown: true, - enabled: false, - ), - if (isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisCondition == - null) - CustomValidationError(), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: 55.0, - onClick: model.listOfDiagnosisType != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, - okText: TranslationBase.of(context).ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - // _selectedDiagnosisType = - // selectedValue; - widget.mySelectedAssessment - .selectedDiagnosisType = - selectedValue; - typeController.text = - projectViewModel.isArabic - ? selectedValue.nameAr - : selectedValue.nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - //hasLabelText: - // typeController.text != '' ? true : false, - //prefixIcon: Icon(Icons.add), - //showLabelText: true, - hintText: TranslationBase.of(context).dType, - //fontSize: 13.5, - //readOnly: true, - // hintColor: Colors.black, - //suffixIcon: EvaIcons.arrowDown, - //fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - enabled: false, - isDropDown: true, - - controller: typeController, - // validator: (value) { - // if (value == null) - // return TranslationBase.of(context).emptyMessage; - // else - // return null; - // }, - ), - if (isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisType == - null) - CustomValidationError(), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: TextFields( - hintText: TranslationBase.of(context).remarks, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 18, - minLines: 5, - hasLabelText: - remarkController.text != '' ? true : false, - showLabelText: true, - controller: remarkController, - onChanged: (value) { - widget.mySelectedAssessment.remark = - remarkController.text; - }, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, - ), - AppButton( - fontWeight: FontWeight.w700, - color: Colors.green, - title: (widget.isUpdate - ? 'Update Assessment Details' - : 'Add Assessment Details'), - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - setState(() { - isFormSubmitted = true; - }); - widget.mySelectedAssessment.remark = - remarkController.text; - widget.mySelectedAssessment.appointmentId = - int.parse(appointmentIdController.text); - if (widget.mySelectedAssessment - .selectedDiagnosisCondition != - null && - widget.mySelectedAssessment - .selectedDiagnosisType != - null && - widget.mySelectedAssessment.selectedICD != - null) { - await submitAssessment( - isUpdate: widget.isUpdate, - model: model, - mySelectedAssessment: - widget.mySelectedAssessment); - } - }, - ), - ])), - ), - ), - ))), - ); - } - - submitAssessment( - {SOAPViewModel model, - MySelectedAssessment mySelectedAssessment, - bool isUpdate = false}) async { - if (isUpdate) { - PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code, - prevIcdCode10ID: mySelectedAssessment.icdCode10ID); - - await model.patchAssessment(patchAssessmentReqModel); - } else { - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ - new IcdCodeDetails( - remarks: mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code) - ]); - - await model.postAssessment(postAssessmentRequestModel); - } - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; - mySelectedAssessment.doctorName = doctorProfile.doctorName; - - if (!isUpdate) { - // widget.mySelectedAssessmentList.add(mySelectedAssessment); - widget.addSelectedAssessment(mySelectedAssessment, isUpdate); - } - Navigator.of(context).pop(); - } - - // widget.changePageViewIndex(3); - } -} - -class PatchAssessmentReqModel { - int patientMRN; - int appointmentNo; - int episodeID; - String icdcode10Id; - String prevIcdCode10ID; - int conditionId; - int diagnosisTypeId; - bool complexDiagnosis; - String remarks; - - PatchAssessmentReqModel( - {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.icdcode10Id, - this.prevIcdCode10ID, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); - - PatchAssessmentReqModel.fromJson(Map json) { - patientMRN = json['PatientMRN']; - appointmentNo = json['AppointmentNo']; - episodeID = json['EpisodeID']; - icdcode10Id = json['Icdcode10Id']; - prevIcdCode10ID = json['PrevIcdCode10ID']; - conditionId = json['ConditionId']; - diagnosisTypeId = json['DiagnosisTypeId']; - complexDiagnosis = json['ComplexDiagnosis']; - remarks = json['Remarks']; - } - - Map toJson() { - final Map data = new Map(); - data['PatientMRN'] = this.patientMRN; - data['AppointmentNo'] = this.appointmentNo; - data['EpisodeID'] = this.episodeID; - data['Icdcode10Id'] = this.icdcode10Id; - data['PrevIcdCode10ID'] = this.prevIcdCode10ID; - data['ConditionId'] = this.conditionId; - data['DiagnosisTypeId'] = this.diagnosisTypeId; - data['ComplexDiagnosis'] = this.complexDiagnosis; - data['Remarks'] = this.remarks; - return data; - } -} 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 ad6390ea..dc993928 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -21,8 +21,10 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'SOAP_step_header.dart'; +import 'expandable_SOAP_widget.dart'; class UpdatePlanPage extends StatefulWidget { final Function changePageViewIndex; @@ -46,6 +48,7 @@ class UpdatePlanPage extends StatefulWidget { class _UpdatePlanPageState extends State { bool isAddProgress = true; + bool isProgressExpanded = true; TextEditingController progressNoteController = TextEditingController(text: null); @@ -101,149 +104,154 @@ class _UpdatePlanPageState extends State { }, builder: (_, model, w) => AppScaffold( // baseViewModel: model, - backgroundColor: Colors.grey[200], + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, isShowAppBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( child: FractionallySizedBox( - widthFactor: 0.95, + widthFactor: 0.90, child: Column( children: [ SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), SizedBox(height: 10,), - 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, - )), - ), + + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).progressNote + , + onTap: () { + setState(() { + isProgressExpanded = !isProgressExpanded; + }); + }, child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if(isAddProgress) Container( - margin: EdgeInsets.only(left: 5, right: 5), - child: Texts(TranslationBase - .of(context) - .progressNote)), - if(isAddProgress) - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).progressNote, - controller: progressNoteController, - minLines: 2, - maxLines: 4, - inputType: TextInputType.multiline, - onChanged: (value){ - widget.patientProgressNote.planNote = value; - }, - ), + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).progressNote, + controller: progressNoteController, + minLines: 2, + maxLines: 4, + inputType: TextInputType.multiline, + onChanged: (value){ + widget.patientProgressNote.planNote = value; + }, ), - SizedBox( - height: 9, - ), - if ( widget.patientProgressNote.planNote != null&& !isAddProgress) - Container( - margin: - EdgeInsets.only(left: 5, right: 5, ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ + ), + SizedBox( + height: 9, + ), + if ( widget.patientProgressNote.planNote != null&& !isAddProgress) + Container( + margin: + EdgeInsets.only(left: 5, right: 5, ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Texts('Appointment No: ',fontSize: 12,), - Texts(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,), - - ], - ), - Texts( - widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight - .w600, - fontSize: 14, - ) + Texts('Appointment No: ',fontSize: 12,), + Texts(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,), ], ), - Row( + Texts( + widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight + .w600, + fontSize: 14, + ) + + ], + ), + Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( children: [ - Row( - children: [ - Texts('Condition: ', + Texts('Condition: ', fontSize: 12,), Texts( - widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600), - ], - ), + widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600), + ], + ), Texts( - widget.patientProgressNote.createdOn !=null?DateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getHour(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ) - ], - ), - SizedBox(height: 8, + widget.patientProgressNote.createdOn !=null?DateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ) + ], + ), + SizedBox(height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: Texts( + progressNoteController.text, + fontSize: 10, + ), ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: Texts( - progressNoteController.text, - fontSize: 10, - ), + InkWell( + onTap: (){ + setState(() { + isAddProgress = true; + widget.changePageViewIndex(3,isChangeState:false); + }); + }, + child: Icon(DoctorApp.edit,size: 18,)) + ], ), - InkWell( - onTap: (){ - setState(() { - isAddProgress = true; - widget.changePageViewIndex(3,isChangeState:false); - }); - }, - child: Icon(DoctorApp.edit,size: 18,)) - ], - ), + ], + ), + ) ], - ), - ) - ], ), ], ), + isExpanded: isProgressExpanded, ), + ], ), ), ), ), bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0), + ), width: double.maxFinite, height: 90, child: Padding( @@ -256,10 +264,10 @@ class _UpdatePlanPageState extends State { children: [ Expanded( child: AppButton( - title: 'Previous', + title: TranslationBase.of(context).previous, color: Colors.grey[300], fontColor: Colors.black, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w600, loading: model.state == ViewState.BusyLocal, onPressed: () async { setState(() { @@ -272,9 +280,9 @@ class _UpdatePlanPageState extends State { Expanded( child: AppButton( title: isAddProgress? TranslationBase.of(context).next: "Finish", - fontWeight: FontWeight.w400, - loading: model.state == ViewState.BusyLocal, + fontWeight: FontWeight.w600, color: Colors.red[700], + loading: model.state == ViewState.BusyLocal, disabled: progressNoteController.text.isEmpty, onPressed: () async { 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 07f1aef5..78ceaec5 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -89,7 +89,7 @@ class _UpdateSoapIndexState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ // PatientPageHeaderWidget(patient), - PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,), + PatientProfileHeaderNewDesign(patient, '7', '7',), Container( width: double.infinity, height: 1, diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 52aa5e99..07d5d7e4 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -16,6 +16,7 @@ import 'package:provider/provider.dart'; import 'app-textfield-custom.dart'; import 'app_texts_widget.dart'; import 'dialogs/master_key_dailog.dart'; +import 'divider_with_spaces_around.dart'; import 'expandable-widget-header-body.dart'; class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { @@ -77,17 +78,21 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState color: Colors.white), child: Column( children: [ - TextFields( - hintText: widget.hintSearchText ?? - TranslationBase.of(context).selectAllergy, - borderWidth: 0.0, - padding: EdgeInsets.all(20), - borderRadius: 0, - suffixIcon: EvaIcons.search, + AppTextFieldCustom( + height: MediaQuery.of(context).size.height * 0.070, + hintText: TranslationBase.of(context).selectAllergy, + isDropDown: true, + hasBorder: false, + // controller: filteredSearchController, onChanged: (value) { filterSearchResults(value); }, + suffixIcon: Icon( + Icons.search, + color: Colors.black, + ), ), + DividerWithSpacesAround(), SizedBox( height: 10, ), @@ -240,106 +245,113 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState .arrowIosDownwardOutline)) ], ), - bodyWidget: Column( - children: [ - AppTextFieldCustom( - onClick: widget.model - .allergySeverityList != - null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: widget.model - .allergySeverityList, - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - mySelectedAllergy - .selectedAllergySeverity = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: (BuildContext - context) { - return dialog; - }, - ); - } - : null, - isDropDown: true, - hintText: - TranslationBase - .of(context) - .selectSeverity, - enabled: false, - maxLines: 2, - minLines: 2, - controller: severityController,), - SizedBox( - height: 5, - ), - if(isSubmitted && mySelectedAllergy !=null && - mySelectedAllergy - .selectedAllergySeverity == null) - Row( + bodyWidget: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: Column( + children: [ + AppTextFieldCustom( + onClick: widget.model + .allergySeverityList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: widget.model + .allergySeverityList, + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + mySelectedAllergy + .selectedAllergySeverity = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, + isDropDown: true, + hintText: + TranslationBase + .of(context) + .selectSeverity, + enabled: false, + maxLines: 2, + minLines: 2, + controller: severityController,), + SizedBox( + height: 5, + ), + if(isSubmitted && mySelectedAllergy !=null && + mySelectedAllergy + .selectedAllergySeverity == null) + Row( - children: [ - CustomValidationError(), - ], - mainAxisAlignment: MainAxisAlignment.start, - ), + children: [ + CustomValidationError(), + ], + mainAxisAlignment: MainAxisAlignment.start, + ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: NewTextFields( - hintText: TranslationBase - .of( - context) - .remarks, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 3, - initialValue: isSelected - ? mySelectedAllergy - .remark : '', - // controller: remarkControlle + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: NewTextFields( + hintText: TranslationBase + .of( + context) + .remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 3, + initialValue: isSelected + ? mySelectedAllergy + .remark : '', + // controller: remarkControlle - onChanged: (value) { - if (isSelected) { - mySelectedAllergy - .remark = value; - } - }, + onChanged: (value) { + if (isSelected) { + mySelectedAllergy + .remark = value; + } + }, - validator: (value) { - if (value == null) - return TranslationBase - .of( - context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, + validator: (value) { + if (value == null) + return TranslationBase + .of( + context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + ],), + ), ), - ],), + ), isExpand: mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false, @@ -357,18 +369,6 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState SizedBox( height: 10, ), - if (widget.model.state == ViewState.Idle) - AppButton( - title: "Add Selected Allergy", - padding: 10, - color: Color(0xFF359846), - onPressed: () { - setState(() { - isSubmitted = true; - }); - widget.addSelectedAllergy(); - }, - ), ], ), ), diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index abe383e3..f0ef63bd 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -3,16 +3,15 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; 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_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'app-textfield-custom.dart'; import 'app_texts_widget.dart'; class MasterKeyCheckboxSearchWidget extends StatefulWidget { @@ -56,7 +55,16 @@ class _MasterKeyCheckboxSearchWidgetState extends State