From 0745d2d56e27f986906fc63ea4f7178b17d8843d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 12 Apr 2021 15:20:34 +0300 Subject: [PATCH 1/3] update the design on the progress note (SOAP) --- .../profile/soap_update/update_plan_page.dart | 328 ++++++++---------- .../shared/expandable-widget-header-body.dart | 12 +- 2 files changed, 144 insertions(+), 196 deletions(-) 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 5c69a8ae..de6f740d 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; @@ -44,8 +45,7 @@ class UpdatePlanPage extends StatefulWidget { } class _UpdatePlanPageState extends State { - bool isProgressNoteExpand = false; - + bool isAddProgress = true; TextEditingController progressNoteController = TextEditingController(text: null); @@ -64,6 +64,17 @@ class _UpdatePlanPageState extends State { } TextEditingController typeController = TextEditingController(); + @override + void initState() { + super.initState(); + if(widget.patientProgressNote.planNote !=null ){ + setState(() { + isAddProgress = true; + }); + } + } + + @override Widget build(BuildContext context) { return BaseView( @@ -111,166 +122,97 @@ class _UpdatePlanPageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - SizedBox( - height: 10, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Row( - children: [ - Texts(TranslationBase - .of(context) - .progressNoteSOAP, - variant: isProgressNoteExpand ? "bodyText" : '', - bold: isProgressNoteExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: Colors.black, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isProgressNoteExpand = !isProgressNoteExpand; - }); + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 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; }, - child: Icon(isProgressNoteExpand - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)) - ], - ), - bodyWidget: Column(children: [ + ), + ), SizedBox( - height: 2, + height: 9, ), - Column( - children: [ - if(widget.patientProgressNote.planNote == null) - 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){ - // examination.remark = value; - }, - ), - ), - SizedBox( - height: 20, - ), - if ( widget.patientProgressNote.planNote != null) - Container( - margin: - EdgeInsets.only(left: 5, right: 5, top: 15), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + 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: [ - - SizedBox( - height: 8, - ), Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Row( - children: [ - Texts('Appointment No: '), - Texts(widget.patientProgressNote.appointmentNo.toString()), - - ], - ), - AppText( - widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight - .bold, - fontSize: 16, - ) + Texts('Appointment No: ',fontSize: 12,), + Texts(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,), ], ), - Row( - children: [ - Texts('Condition: '), - Texts(widget.patientProgressNote.mName.toString()), + Texts( + widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ) - ], - ), - if(widget.patientProgressNote.createdByName !=null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).createdBy, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.patientProgressNote.createdByName??"", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - if(widget.patientProgressNote.editedByName !=null) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context).editedBy, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.patientProgressNote.editedByName??"", - fontSize: 10, - color: Colors.grey, - ), + Texts('Condition: ',fontSize: 12,), + Texts(widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600), ], ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - Padding( - padding: const EdgeInsets.all(0.0), - child: Container( - width: MediaQuery.of(context) - .size - .width * - 0.6, - child: Texts( - progressNoteController.text, - fontSize: 10, - color: Colors.grey, - ), - ), - ), - ], + Texts( + 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+"asdasd sdakfjhg gfadsfg dashkfgasd hgd sfnbsd,fbnsdafbasdnzb", + fontSize: 10, + + ), ), + InkWell( + onTap: (){ + setState(() { + isAddProgress = true; + }); + }, + child: Icon(DoctorApp.edit,size: 18,)) ], ), - ) - ], - ) - ]), - isExpand: isProgressNoteExpand, + ], + ), + ) + ], ), ], @@ -281,56 +223,62 @@ class _UpdatePlanPageState extends State { ), bottomSheet: Container( width: double.maxFinite, - height: 70, - child: Container( - margin: EdgeInsets.all(6), - child: Column( - children: [ - - Row( - children: [ - Expanded( - child: AppButton( - title: 'Previous', - color: Colors.white38, - fontColor: Colors.black, - fontWeight: FontWeight.w700, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - setState(() { - widget.changePageViewIndex(2); - }); - }, + height: 90, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + margin: EdgeInsets.all(6), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: AppButton( + title: 'Previous', + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w400, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + setState(() { + widget.changePageViewIndex(2); + }); + }, + ), ), - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w700, - loading: model.state == ViewState.BusyLocal, - disabled: progressNoteController.text.isEmpty, - onPressed: () async { + SizedBox(width: 5,), + Expanded( + child: AppButton( + title: isAddProgress? TranslationBase.of(context).next: "Finish", + fontWeight: FontWeight.w400, + loading: model.state == ViewState.BusyLocal, + color: Colors.red[700], + disabled: progressNoteController.text.isEmpty, + onPressed: () async { - if(widget.patientProgressNote.planNote.isEmpty) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - setState(() { - widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; - widget.patientProgressNote.editedByName = doctorProfile.doctorName; - widget.patientProgressNote.createdOn = DateTime.now().toString(); - widget.patientProgressNote.planNote = progressNoteController.text; - }); + if(isAddProgress) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + setState(() { + widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; + widget.patientProgressNote.editedByName = doctorProfile.doctorName; + widget.patientProgressNote.createdOn = DateTime.now().toString(); + widget.patientProgressNote.planNote = progressNoteController.text; + isAddProgress = !isAddProgress; + }); - } else - submitPlan(model); - }, + } else{ + var asd =""; + // submitPlan(model); + } + }, + ), ), - ), - ], - ), + ], + ), - ], + ], + ), ), ), ), diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index 7adef404..97930285 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -18,14 +18,14 @@ class HeaderBodyExpandableNotifier extends StatefulWidget { class _HeaderBodyExpandableNotifierState extends State { + + @override + void initState() { + super.initState(); + + } @override Widget build(BuildContext context) { - setState(() { - if (widget.isExpand == true) { - widget.expandFlag = widget.isExpand; - widget.controller.expanded = true; - } - }); return ExpandableNotifier( child: Padding( From ab20be2ea17b60b0e0ae4a7521c8f63685b3b18e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 12 Apr 2021 15:36:24 +0300 Subject: [PATCH 2/3] insurance aprovals changes --- lib/widgets/shared/doctor_card_insurance.dart | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index 42b001b3..6b144f53 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -1,4 +1,5 @@ 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/widgets/patients/profile/large_avatar.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; @@ -89,7 +90,7 @@ class DoctorCardInsurance extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(5.0), child: Texts( - '$patientOut', + '$patientOut'.replaceAll(" ", ""), color: Colors.white, fontSize: 13.0, ), @@ -102,7 +103,7 @@ class DoctorCardInsurance extends StatelessWidget { Expanded( child: Texts( doctorName, - bold: true, + fontWeight: FontWeight.w700, )), ], ), @@ -153,11 +154,13 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Texts( 'Clinic: ', - color: Colors.grey[500], + //fontWeight: FontWeight.w600, + //color: Colors.grey[500], ), Expanded( child: Texts( clinic, + fontWeight: FontWeight.w700, ), ) ], @@ -167,19 +170,24 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Texts( 'Approval No: ', - color: Colors.grey[500], + //color: Colors.grey[500], ), Texts( branch, + fontWeight: FontWeight.w700, ) ], ) ]), ), ), - Icon( - EvaIcons.eye, - size: 38.0, + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 15.0), + child: Icon( + DoctorApp.view, + size: 22.0, + ), ) ], ), From 3a734f4718eb38fe2c6d2d13ba64bea977d3aafe Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 12 Apr 2021 16:21:58 +0300 Subject: [PATCH 3/3] finish the new design on the progress note (SOAP) --- .../profile/soap_update/update_plan_page.dart | 16 +++++++++------- .../profile/soap_update/update_soap_index.dart | 8 ++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) 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 de6f740d..e965d482 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -62,14 +62,13 @@ class _UpdatePlanPageState extends State { )), ); } - TextEditingController typeController = TextEditingController(); @override void initState() { super.initState(); if(widget.patientProgressNote.planNote !=null ){ setState(() { - isAddProgress = true; + isAddProgress = false; }); } } @@ -94,7 +93,9 @@ class _UpdatePlanPageState extends State { widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; - + setState(() { + isAddProgress = false; + }); } widget.changeLoadingState(false); }, @@ -195,7 +196,7 @@ class _UpdatePlanPageState extends State { children: [ Expanded( child: Texts( - progressNoteController.text+"asdasd sdakfjhg gfadsfg dashkfgasd hgd sfnbsd,fbnsdafbasdnzb", + progressNoteController.text, fontSize: 10, ), @@ -204,6 +205,7 @@ class _UpdatePlanPageState extends State { onTap: (){ setState(() { isAddProgress = true; + widget.changePageViewIndex(3,isChangeState:false); }); }, child: Icon(DoctorApp.edit,size: 18,)) @@ -266,10 +268,10 @@ class _UpdatePlanPageState extends State { widget.patientProgressNote.planNote = progressNoteController.text; isAddProgress = !isAddProgress; }); + submitPlan(model); } else{ - var asd =""; - // submitPlan(model); + Navigator.of(context).pop(); } }, ), @@ -309,7 +311,7 @@ class _UpdatePlanPageState extends State { if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } else { - Navigator.of(context).pop(); + widget.changePageViewIndex(4,isChangeState:false); } } else { helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); 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 0c69d71d..fa4631aa 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -38,9 +38,13 @@ class _UpdateSoapIndexState extends State GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); - changePageViewIndex(pageIndex) { - if (pageIndex != _currentIndex) changeLoadingState(true); + changePageViewIndex(pageIndex,{isChangeState = true}) { + if (pageIndex != _currentIndex && isChangeState) + changeLoadingState(true); _controller.jumpToPage(pageIndex); + setState(() { + _currentIndex = pageIndex; + }); } bool _isLoading = true;