diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index dfcbba50..439cb61a 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -45,7 +45,8 @@ class UpdateAssessmentPage extends StatefulWidget { _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); } -class _UpdateAssessmentPageState extends State implements AssessmentCallBack{ +class _UpdateAssessmentPageState extends State + implements AssessmentCallBack { bool isAssessmentExpand = false; List mySelectedAssessmentList = List(); @@ -112,184 +113,237 @@ class _UpdateAssessmentPageState extends State implements widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - color: Theme.of(context).scaffoldBackgroundColor, - 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).assessment, - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - SOAPOpenItems( - label: - "${TranslationBase.of(context).addAssessment}", - onTap: () { - openAssessmentDialog(context, - isUpdate: false, model: model); - }, - ), - SizedBox( - height: 20, - ), - Column( - children: - mySelectedAssessmentList.map((assessment) { - return Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15, bottom: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.4), - children: [ - new TextSpan( - text: - "ICD : ".toUpperCase(), - ), - new TextSpan( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).assessment, + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + SOAPOpenItems( + label: + "${TranslationBase.of(context).addAssessment}", + onTap: () { + openAssessmentDialog(context, + isUpdate: false, model: model); + }, + ), + SizedBox( + height: 20, + ), + Column( + children: + mySelectedAssessmentList.map((assessment) { + return Container( + margin: EdgeInsets.only( + left: 5, right: 5, top: 15, bottom: 15), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.4), + children: [ + new TextSpan( + text: "ICD : ".toUpperCase(), + ), + new TextSpan( text: assessment .selectedICD.code .trim() .toUpperCase() ?? - "" - - ), - ], - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *5, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.64, - ), - children: [ - new TextSpan( - text: assessment - .selectedICD - .description - .toString(), - ), - ], - ), - ), + ""), + ], ), - RichText( + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.50, + child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 5, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), children: [ - new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, - letterSpacing: -0.4, - color: Color(0xFF575757), - ), - ), new TextSpan( text: assessment - .appointmentId - .toString() ?? - "", - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), + .selectedICD.description + .toString(), ), ], ), ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", - style: new TextStyle( - letterSpacing: -0.4, - color: Color(0xFF575757), - ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .appointmentNo, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), + ), + new TextSpan( + text: assessment.appointmentId + .toString() ?? + "", + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), ), - ], - ), + ), + ], + ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .condition + + " : ", + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisCondition + .nameAr + : assessment + .selectedDiagnosisCondition + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .dType + + ' : ', + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisType + .nameAr + : assessment + .selectedDiagnosisType + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), + ), + if (assessment.doctorName != null) RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: @@ -298,24 +352,24 @@ class _UpdateAssessmentPageState extends State implements new TextSpan( text: TranslationBase.of( context) - .dType + + .doctor + ' : ', style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, + text: + assessment.doctorName ?? + '', style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -323,159 +377,123 @@ class _UpdateAssessmentPageState extends State implements ], ), ), - if (assessment.doctorName != null) - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + AppText( + (assessment.remark != null && + assessment.remark != + '') + ? TranslationBase.of( context) - .doctor + - ' : ', - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,letterSpacing: -0.4, - color: - Color(0xFF575757), - ), - ), - new TextSpan( - text: assessment - .doctorName ?? - '', - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,letterSpacing: -0.48, - color: - Color(0xFF2B353E), - ), - ), - ], - ), + .remarks + + " : " + : '', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + RemarkText( + remark: assessment.remark ?? "", ), - 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: SizeConfig.getTextMultiplierBasedOnWidth() *3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), - RemarkText( - remark: - assessment.remark ?? "", - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Row( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - AppText( - assessment.createdOn != - null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime - .now()), - fontWeight: - FontWeight.w600, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ), - AppText( - assessment.createdOn != - null - ? AppDateUtils.getHour( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getHour(DateTime - .now()), - fontWeight: - FontWeight.w600, - color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ), - ], - ), - ], - ), - 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, + ], + ), + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Row( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + assessment.createdOn != null + ? AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + AppText( + assessment.createdOn != null + ? AppDateUtils.getHour( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + ], ), - ) - ], - ), - ], - ), - ); - }).toList(), - ) - ], - ) - ]), - isExpanded: isAssessmentExpand, - ), - SizedBox( - height: 130, - ), - ], - ), + ], + ), + 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, + ), + SizedBox( + height: 130, + ), + ], ), ), ), - ),), + ), + ), + ), ); } @@ -508,9 +526,7 @@ class _UpdateAssessmentPageState extends State implements @override nextFunction(model) { if (mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast( - TranslationBase.of(context) - .assessmentErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); } else { widget.changeLoadingState(true); widget.changePageViewIndex(3); diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index cb245b7d..c93a6c57 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -111,7 +111,9 @@ class _UpdateObjectivePageState extends State children: [ SOAPStepHeader( currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).physicalSystemExamination, diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 16d53804..d32634b2 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -29,7 +29,7 @@ class UpdatePlanPage extends StatefulWidget { final PatiantInformtion patientInfo; final Function changeLoadingState; final Function changeStateFun; - final SOAPViewModel sOAPViewModel; + final SOAPViewModel sOAPViewModel; final int currentIndex; @@ -38,13 +38,16 @@ class UpdatePlanPage extends StatefulWidget { this.changePageViewIndex, this.patientInfo, this.changeLoadingState, - this.currentIndex, this.sOAPViewModel, this.changeStateFun}); + this.currentIndex, + this.sOAPViewModel, + this.changeStateFun}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); } -class _UpdatePlanPageState extends State implements PlanCallBack { +class _UpdatePlanPageState extends State + implements PlanCallBack { bool isAddProgress = true; bool isProgressExpanded = true; GetPatientProgressNoteResModel patientProgressNote = @@ -76,17 +79,19 @@ class _UpdatePlanPageState extends State implements PlanCallBack } } - - getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async { + getPatientProgressNote(SOAPViewModel model, + {bool isAddProgress = false}) async { GetGetProgressNoteReqModel getGetProgressNoteReqModel = - GetGetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel + .getPatientProgressNote(getGetProgressNoteReqModel); + ///TODO set progressNote in model; if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Helpers.parseHtmlString( @@ -103,238 +108,251 @@ class _UpdatePlanPageState extends State implements PlanCallBack widget.sOAPViewModel.patientProgressNoteList[0].editedByName; patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; - setState(() { - isAddProgress = isAddProgress; - widget.sOAPViewModel.isAddProgress = isAddProgress; - widget.sOAPViewModel.progressNoteText = progressNoteController.text; - }); + setState(() { + isAddProgress = isAddProgress; + widget.sOAPViewModel.isAddProgress = isAddProgress; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; + }); } } @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - widget.sOAPViewModel.setPlanCallBack(this); - GetGetProgressNoteReqModel getGetProgressNoteReqModel = - GetGetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); + onModelReady: (model) async { + widget.sOAPViewModel.setPlanCallBack(this); + GetGetProgressNoteReqModel getGetProgressNoteReqModel = + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel + .getPatientProgressNote(getGetProgressNoteReqModel); - if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Helpers.parseHtmlString( - widget.sOAPViewModel.patientProgressNoteList[0].planNote); - patientProgressNote.planNote = progressNoteController.text; - patientProgressNote.createdByName = - widget.sOAPViewModel.patientProgressNoteList[0].createdByName; - patientProgressNote.createdOn = - widget.sOAPViewModel.patientProgressNoteList[0].createdOn; - patientProgressNote.editedOn = - widget.sOAPViewModel.patientProgressNoteList[0].editedOn; - patientProgressNote.editedByName = - widget.sOAPViewModel.patientProgressNoteList[0].editedByName; - patientProgressNote.appointmentNo = - widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; - widget.sOAPViewModel.progressNoteText = progressNoteController.text; + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { + progressNoteController.text = Helpers.parseHtmlString( + widget.sOAPViewModel.patientProgressNoteList[0].planNote); + patientProgressNote.planNote = progressNoteController.text; + patientProgressNote.createdByName = + widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = + widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = + widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = + widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = + widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; - setState(() { - isAddProgress = false; - widget.sOAPViewModel.isAddProgress = false; - }); - } - widget.changeLoadingState(false); - }, - builder: (_, model, w) => AppScaffold( - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.90, - child: Column( - children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), - SizedBox( - height: 10, - ), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).progressNote, - onTap: () { - setState(() { - isProgressExpanded = !isProgressExpanded; - }); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, + setState(() { + isAddProgress = false; + widget.sOAPViewModel.isAddProgress = false; + }); + } + widget.changeLoadingState(false); + }, + builder: (_, model, w) => AppScaffold( + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.90, + child: Column( + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), + SizedBox( + height: 10, + ), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).progressNote, + onTap: () { + setState(() { + isProgressExpanded = !isProgressExpanded; + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - 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) { - setState(() { - patientProgressNote.planNote = value; - model.progressNoteText = value; - widget.changeStateFun(); - }); - }, - ), - ), - SizedBox( - height: 9, - ), - if (patientProgressNote.planNote != null && - !isAddProgress) - Container( - margin: EdgeInsets.only( - left: 5, - right: 5, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 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) { + setState(() { + patientProgressNote.planNote = + value; + model.progressNoteText = value; + widget.changeStateFun(); + }); + }, + ), + ), + SizedBox( + height: 9, ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + if (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: [ - AppText( - 'Appointment No: ', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, - letterSpacing: -0.4, - color: Color(0xFF575757), + Row( + children: [ + AppText( + 'Appointment No: ', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + AppText( + patientProgressNote + .appointmentNo != + null + ? patientProgressNote + .appointmentNo + .toString() + : '', + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + ], ), AppText( - patientProgressNote - .appointmentNo != + patientProgressNote.createdOn != null - ? patientProgressNote - .appointmentNo - .toString() - : '', + ? AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + patientProgressNote + .createdOn)) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), fontWeight: FontWeight.w600, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ) ], ), - AppText( - patientProgressNote.createdOn != - null - ? AppDateUtils - .getDayMonthYearDateFormatted( + Row( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // Row( + // children: [ + // AppText( + // 'Condition: ', + // fontSize: 12, + // ), + // AppText( + // patientProgressNote.mName ?? + // '', + // fontWeight: FontWeight.w600), + // ], + // ), + AppText( + patientProgressNote.createdOn != + null + ? AppDateUtils.getHour( DateTime.parse( patientProgressNote .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( + : AppDateUtils.getHour( DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ) - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - // Row( - // children: [ - // AppText( - // 'Condition: ', - // fontSize: 12, - // ), - // AppText( - // patientProgressNote.mName ?? - // '', - // fontWeight: FontWeight.w600), - // ], - // ), - AppText( - patientProgressNote.createdOn != - null - ? AppDateUtils.getHour( - DateTime.parse( - patientProgressNote - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - progressNoteController.text, - fontSize: 10, - ), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + progressNoteController.text, + fontSize: 10, + ), + ), + InkWell( + onTap: () { + setState(() { + isAddProgress = true; + widget.sOAPViewModel + .isAddProgress = true; + }); + }, + child: Icon( + DoctorApp.edit, + size: 18, + )) + ], ), - InkWell( - onTap: () { - setState(() { - isAddProgress = true; - widget.sOAPViewModel.isAddProgress = true; - }); - }, - child: Icon( - DoctorApp.edit, - size: 18, - )) ], ), - ], - ), - ) + ) + ], + ), ], ), - ], - ), - isExpanded: isProgressExpanded, - ), - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 20 : 10), + isExpanded: isProgressExpanded, + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : 10), + ), + ], ), - ], + ), ), ), - ), - ),) - ); + )); } submitPlan(SOAPViewModel model) async { @@ -350,27 +368,29 @@ class _UpdatePlanPageState extends State implements PlanCallBack editedBy: ''); if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { - await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel); + await widget.sOAPViewModel + .postProgressNote(postProgressNoteRequestModel); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; - await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel); + await widget.sOAPViewModel + .patchProgressNote(postProgressNoteRequestModel); } if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.sOAPViewModel.error); } else { - GetGetProgressNoteReqModel getGetProgressNoteReqModel = - GetGetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel + .getPatientProgressNote(getGetProgressNoteReqModel); if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Helpers.parseHtmlString( widget.sOAPViewModel.patientProgressNoteList[0].planNote); @@ -407,9 +427,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack Navigator.of(context).pop(); } } else { - Helpers.showErrorToast( - TranslationBase.of(context) - .progressNoteErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } } } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index deddc4a1..51afcd1f 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -7,11 +8,12 @@ import 'package:flutter/material.dart'; class SOAPStepHeader extends StatelessWidget { const SOAPStepHeader({ Key key, - this.currentIndex, this.changePageViewIndex, + this.currentIndex, this.changePageViewIndex, this.patientInfo, }) : super(key: key); final int currentIndex; final Function changePageViewIndex; + final PatiantInformtion patientInfo; @override Widget build(BuildContext context) { @@ -39,6 +41,7 @@ class SOAPStepHeader extends StatelessWidget { child: StepsWidget( index: currentIndex, changeCurrentTab: changePageViewIndex, + patientInfo: patientInfo, ), ), SizedBox( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index 88ca392b..f18f61da 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -12,8 +13,9 @@ class StepsWidget extends StatelessWidget { final int index; final Function changeCurrentTab; final double height; + final PatiantInformtion patientInfo; - StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0}); + StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0, this.patientInfo}); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 134805c6..fb126a69 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -219,8 +219,9 @@ class _UpdateSubjectivePageState extends State ? 0 : int.parse(widget.patientInfo.admissionNo), patientMRN: widget.patientInfo.patientMRN, - appointmentNo:widget.patientInfo.appointmentNo == null?0: - int.parse(widget.patientInfo.appointmentNo.toString()), + appointmentNo: widget.patientInfo.appointmentNo == null + ? 0 + : int.parse(widget.patientInfo.appointmentNo.toString()), episodeId: widget.patientInfo.episodeNo, episodeID: widget.patientInfo.episodeNo, doctorID: ''); @@ -236,12 +237,11 @@ class _UpdateSubjectivePageState extends State '\n \n' : model.patientChiefComplaintList[0].currentMedication; } - if(widget.patientInfo.appointmentNo != null) { + if (widget.patientInfo.appointmentNo != null) { await getHistory(model); await getAllergies(model); } - widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( @@ -257,8 +257,10 @@ class _UpdateSubjectivePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).chiefComplaints, onTap: () { @@ -271,9 +273,11 @@ class _UpdateSubjectivePageState extends State complaintsController: complaintsController, illnessController: illnessController, medicationController: medicationController, - complaintsControllerError: model.complaintsControllerError, + complaintsControllerError: + model.complaintsControllerError, illnessControllerError: model.illnessControllerError, - medicationControllerError: model.medicationControllerError, + medicationControllerError: + model.medicationControllerError, ), isExpanded: isChiefExpand, ), @@ -370,18 +374,21 @@ class _UpdateSubjectivePageState extends State } else { setState(() { if (complaintsController.text.isEmpty) { - model.complaintsControllerError = TranslationBase.of(context).emptyMessage; + model.complaintsControllerError = + TranslationBase.of(context).emptyMessage; } else if (complaintsController.text.length < 25) { model.complaintsControllerError = TranslationBase.of(context).chiefComplaintLength; } if (illnessController.text.isEmpty) { - model.illnessControllerError = TranslationBase.of(context).emptyMessage; + model.illnessControllerError = + TranslationBase.of(context).emptyMessage; } if (medicationController.text.isEmpty) { - model.medicationControllerError = TranslationBase.of(context).emptyMessage; + model.medicationControllerError = + TranslationBase.of(context).emptyMessage; } });