diff --git a/assets/images/svgs/favorite.svg b/assets/images/svgs/favorite.svg new file mode 100644 index 00000000..c9ff828d --- /dev/null +++ b/assets/images/svgs/favorite.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/information.svg b/assets/images/svgs/information.svg new file mode 100644 index 00000000..5ec862f2 --- /dev/null +++ b/assets/images/svgs/information.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index bb4b956f..22b0cc41 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1177,6 +1177,16 @@ const Map> localizedValues = { "resolve": {"en": "Resolve", "ar":"حسم"}, "audit": {"en": "Audit", "ar":"مراجعه الحسابات"}, "delete": {"en": "Delete", "ar":"حذف"}, + "acute": {"en": "Acute", "ar":"شديد"}, + "chronic": {"en": "Acute", "ar":"مزمن"}, + "subAcute": {"en": "sub-acute", "ar":"شبه الحاد"}, + "addDiagnosis": {"en": "Add Diagnosis", "ar":"إضافة تشخيص"}, + "showAllDiagnosis": {"en": "Show all diagnosis", "ar":"عرض جميع التشخيصات"}, + "makeCurrentDiagnosis": {"en": "Make Current Diagnosis", "ar":"جعل التشخيص الحالي"}, + "mappedDiagnosis": {"en": "Mapped Diagnosis", "ar":"التشخيص المعين"}, + "previousDiagnosis": {"en": "Previous Diagnosis", "ar":"التشخيص السابق"}, + "addNewDiagnosis": {"en": "Add New Diagnosis", "ar":"إضافة تشخيص جديد"}, + "currentDiagnosis": {"en": "Current Diagnosis", "ar":"التشخيص الحالي"}, "progressNoteType": {"en": "Progress Note Type", "ar":"نوع ملاحظة التقدم"}, "doctorProgressNote": {"en": "Doctor Progress Note", "ar":"مذكرة تقدم الطبيب"}, "addYourNote": {"en": "Add Your Note", "ar":"أضف ملاحظتك"}, @@ -1194,4 +1204,6 @@ const Map> localizedValues = { "noProgressNote": {"en": "No Diagnosis added, please add it from the button above", "ar":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"}, "mild": {"en": "Mild", "ar":"خفيف"}, "moderate": {"en": "Moderate", "ar":"معتدل"}, + "noDiagnosisFound": {"en": "No Diagnosis added, please add it from the button above", "ar":"لم يتم إضافة تشخيص ، يرجى إضافته من الزر أعلاه"}, + }; diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/add_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/add_diagnosis.dart new file mode 100644 index 00000000..e9e5d933 --- /dev/null +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/add_diagnosis.dart @@ -0,0 +1,77 @@ +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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:flutter/material.dart'; + +class AddDiagnosis extends StatefulWidget { + @override + State createState() => _AddDiagnosisState(); +} + +class _AddDiagnosisState extends State + with SingleTickerProviderStateMixin { + TabController? _tabController; + + @override + void initState() { + _tabController = new TabController(length: 2, vsync: this); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBar: PatientSearchHeader( + title: TranslationBase.of(context).addDiagnosis), + backgroundColor: Colors.white, + body: Column( + children: [ + SizedBox( + height: 56, + child: TabBar( + indicatorColor: Color(0xFFD02127), + unselectedLabelColor: Color(0xFF6D6D6D), + labelColor: Color(0xFF2B353E), + controller: _tabController, + tabs: [ + Tab( + child: AppText( + TranslationBase.of(context).mappedDiagnosis, + color: Color(0xFF6D6D6D), + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.56, + ), + ), + Tab( + child: AppText( + TranslationBase.of(context).mappedDiagnosis, + color: Color(0xFF6D6D6D), + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.56, + ), + ), + ], + ), + ), + Expanded( + child: TabBarView( + controller: _tabController, + children: [ + EnterDiagnosis(), + EnterDiagnosis(), + ], + ), + ), + ], + ), + )); + } +} diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/update_assessment_page.dart new file mode 100644 index 00000000..a320ce92 --- /dev/null +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/update_assessment_page.dart @@ -0,0 +1,254 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; +import 'package:doctor_app_flutter/utils/date-utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.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:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../soap_update/assessment/add_assessment_details.dart'; + +import 'widget/current_diagnosis.dart'; +import 'widget/previous_diagnosis.dart'; + +// ignore: must_be_immutable +class UpdateAssessmentPage extends StatefulWidget { + final Function changePageViewIndex; + final PatiantInformtion patientInfo; + final Function changeLoadingState; + final int currentIndex; + + UpdateAssessmentPage( + {Key? key, + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); + + @override + _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); +} + +class _UpdateAssessmentPageState extends State + with SingleTickerProviderStateMixin + implements AssessmentCallBack { + bool isAssessmentExpand = false; + List mySelectedAssessmentList = []; + bool isPrescriptionOrder = false; + TabController? _tabController; + + @override + void initState() { + _tabController = new TabController(length: 2, vsync: this); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + onModelReady: (model) async { + model.setAssessmentCallBack(this); + mySelectedAssessmentList.clear(); + WidgetsBinding.instance.addPostFrameCallback((_) async { + await model.isPrescriptionOrderCreated(widget.patientInfo); + await model.onUpdateAssessmentStepStart(widget.patientInfo); + + if (model.patientAssessmentList.isNotEmpty) { + model.patientAssessmentList.forEach((element) { + MasterKeyModel? diagnosisType = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisType, + id: element.diagnosisTypeID, + ); + MasterKeyModel? selectedICD = model.getOneMasterKey( + masterKeys: MasterKeysService.ICD10, + id: element.icdCode10ID, + ); + MasterKeyModel? diagnosisCondition = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisCondition, + id: element.conditionID!, + ); + if (diagnosisCondition != null && + diagnosisType != null && + diagnosisCondition != null) { + MySelectedAssessment temMySelectedAssessment = + SoapUtils.generateMySelectedAssessment( + appointmentNo: element.appointmentNo, + remark: element.remarks, + diagnosisType: diagnosisType, + diagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID); + + mySelectedAssessmentList.add(temMySelectedAssessment); + } + }); + } + + 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, + patientInfo: widget.patientInfo, + ), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).assessment, + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Column(children: [ + SizedBox( + height: 20, + ), + + SizedBox( + height: 56, + child: TabBar( + indicatorColor: Color(0xFFD02127), + unselectedLabelColor: Color(0xFF6D6D6D), + labelColor: Color(0xFF2B353E), + tabs: [ + Tab( + child: AppText( + TranslationBase.of(context) + .currentDiagnosis, + color: Color(0xFF6D6D6D), + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.56, + ), + ), + Tab( + child: AppText( + TranslationBase.of(context) + .currentDiagnosis, + color: Color(0xFF6D6D6D), + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.56, + ), + ) + ], + controller: _tabController, + ), + ), + SizedBox( + height: 300, + child: TabBarView( + controller: _tabController, + children: [ + CurrentDiagnosis( + currentDiagnosisItems: [''], + ), + PreviousDiagnosis( + diagnosisItems: [''], + ) + ], + ), + ) + ]), + isExpanded: isAssessmentExpand, + ), + SizedBox( + height: 130, + ), + ], + ), + ), + ), + ), + ), + ), + ); + } + + openAssessmentDialog(BuildContext context, + {MySelectedAssessment? assessment, + bool isUpdate = false, + required SOAPViewModel model}) { + if (assessment == null) { + assessment = SoapUtils.generateMySelectedAssessment( + remark: '', appointmentNo: widget.patientInfo.appointmentNo); + } + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return AddAssessmentDetails( + mySelectedAssessment: assessment!, + patientInfo: widget.patientInfo, + isUpdate: isUpdate, + mySelectedAssessmentList: mySelectedAssessmentList, + addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, + bool isUpdate) async { + setState(() { + if (!isUpdate) + mySelectedAssessmentList.add(mySelectedAssessment); + }); + }); + }); + } + + @override + nextFunction(model) { + if (mySelectedAssessmentList.isEmpty) { + Utils.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); + } else if (!checkPrimaryDiagnosis()) { + Utils.showErrorToast(TranslationBase.of(context).onePrimaryDiagnosis); + } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(3); + } + } + + bool checkPrimaryDiagnosis() { + ProjectViewModel projectViewModel = + Provider.of(context, listen: false); + bool isVidaPlus = Utils.isVidaPlusProject( + projectViewModel, widget.patientInfo.projectId!); + List type = mySelectedAssessmentList + .where((element) => + (element.selectedDiagnosisType!.id == 2 && isVidaPlus == false) || + (element.selectedDiagnosisType!.code == '3' && isVidaPlus == true)) + .toList(); + return type.isEmpty ? false : true; + } +} diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart new file mode 100644 index 00000000..8d64deee --- /dev/null +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart @@ -0,0 +1,61 @@ +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/add_diagnosis.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_diagnosis.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; + +class CurrentDiagnosis extends StatelessWidget { + final List currentDiagnosisItems; + + const CurrentDiagnosis({super.key, required this.currentDiagnosisItems}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + height: 10, + ), + AddSoapItem( + title: TranslationBase.of(context).addNewDiagnosis, + onAddSoapItemClicked: () { + Navigator.push(context, FadePage(page: AddDiagnosis())); + }), + SizedBox( + height: 16, + ), + Divider(), + SizedBox( + height: 16, + ), + if (currentDiagnosisItems.isEmpty) ...{ + Center( + child: EmptyDiagnosis(), + ), + } else ...{ + Flexible( + + child: + ListView.separated( + itemBuilder: (_, index) { + return SoapDetailItem( + title: 'lorem ipsum', + status: 'active', + condition: 'acute', + remarks: 'initial', + onSoapDetailActionClicked: (action) {}, + ); + }, + separatorBuilder: (_, index) => Divider(), + itemCount: currentDiagnosisItems.length)) + } + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_diagnosis.dart new file mode 100644 index 00000000..704b41c2 --- /dev/null +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_diagnosis.dart @@ -0,0 +1,25 @@ +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class EmptyDiagnosis extends StatelessWidget{ + @override + Widget build(BuildContext context) { + return Column( + mainAxisAlignment : MainAxisAlignment.center, + children: [ + SvgPicture.asset('assets/images/svgs/unavailable.svg'), + SizedBox(height: 10,), + AppText( + TranslationBase.of(context).noDiagnosisFound, + fontSize: 12, + fontWeight: FontWeight.w400, + textAlign: TextAlign.center, + color: Color(0xFFADADAD), + ) + ], + ); + } + +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart new file mode 100644 index 00000000..8e34b682 --- /dev/null +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart @@ -0,0 +1,293 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:hexcolor/hexcolor.dart'; +List patientState = ["","Stable", "Not Stable", "Not Defined"]; + +class EnterDiagnosis extends StatefulWidget { + @override + State createState() => _EnterDiagnosisState(); +} + +class _EnterDiagnosisState extends State { + final TextEditingController filteredSearchController = + TextEditingController(); + bool showAllDiagnosis = true; + bool status = true; + String selectedItem = "Stable"; + TextEditingController remarksController = TextEditingController(); + + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).addDiagnosis, + fontWeight: FontWeight.w600, + color: Color(0xFF2E303A), + fontSize: 16, + ), + SizedBox( + height: 16, + ), + AppTextFieldCustom( + hintText: TranslationBase.of(context).selectAllergy, + isTextFieldHasSuffix: true, + hasBorder: true, + controller: filteredSearchController, + onChanged: (value) {}, + onFieldSubmitted: () {}, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Color(0xff2B353E), + size: 30, + ), + onPressed: () {}, + ), + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Switch( + value: showAllDiagnosis, + activeColor: Colors.red, + onChanged: (bool value) { + setState(() { + showAllDiagnosis = value; + }); + }, + ), + SizedBox( + width: 8, + ), + AppText( + TranslationBase.of(context).showAllDiagnosis, + fontWeight: FontWeight.w500, + color: Color(0xFF2E303A), + fontSize: 11, + ), + ], + ), + SvgPicture.asset('assets/images/svgs/information.svg'), + ], + ), + Container( + margin: EdgeInsets.only(bottom: 12), + child: AppText( + TranslationBase.of(context).condition, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 11, + ), + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () {}, + child: Row( + children: [ + Container( + padding: EdgeInsets.all(2.0), + margin: EdgeInsets.symmetric(horizontal: 6), + width: 20, + height: 20, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + border: Border.all(color: Colors.grey, width: 1), + ), + child: Container( + decoration: BoxDecoration( + color: status == 1 ? HexColor("#D02127") : Colors.white, + shape: BoxShape.circle, + ), + ), + ), + AppText( + TranslationBase.of(context).acute, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier! * 1.6, + ), + ], + ), + )), + Expanded( + child: InkWell( + onTap: () {}, + child: Row( + children: [ + Container( + padding: EdgeInsets.all(2.0), + margin: EdgeInsets.symmetric(horizontal: 6), + width: 20, + height: 20, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + border: Border.all(color: Colors.grey, width: 1), + ), + child: Container( + decoration: BoxDecoration( + color: + status == 2 ? HexColor("#D02127") : Colors.white, + shape: BoxShape.circle, + ), + ), + ), + AppText( + TranslationBase.of(context).subAcute, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier! * 1.6, + ), + ], + ), + ), + ), + Expanded( + child: InkWell( + onTap: () {}, + child: Row( + children: [ + Container( + padding: EdgeInsets.all(2.0), + margin: EdgeInsets.symmetric(horizontal: 6), + width: 20, + height: 20, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + border: Border.all(color: Colors.grey, width: 1), + ), + child: Container( + decoration: BoxDecoration( + color: + status == 3 ? HexColor("#D02127") : Colors.white, + shape: BoxShape.circle, + ), + ), + ), + AppText( + TranslationBase.of(context).chronic, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier! * 1.6, + ), + ], + ), + ), + ), + ], + ), + SizedBox(height: 8,), + + Material( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide( + width: 1, + color: Color(0xFFEFEFEF), + )), + color: Colors.white, + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patientCondition, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + fontSize: 11, + color: Color(0xFF2E303A), + ), + SizedBox( + height: 4, + ), + DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + icon: Icon(Icons.keyboard_arrow_down), + isExpanded: true, + value: selectedItem, + iconSize: 25, + elevation: 16, + + onChanged: (newValue) async { + setState(() { + selectedItem = newValue ?? ""; + }); + }, + items: patientState.map((item) { + return DropdownMenuItem( + child: AppText( + item, + fontSize: 14, + letterSpacing: -0.96, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.normal, + textAlign: TextAlign.left, + ), + value: item, + ); + }).toList(), + ), + ), + ], + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 8), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).remarks, + controller: remarksController, + minLines: 2, + maxLines: 4, + inputType: TextInputType.multiline, + onChanged: (value) {}, + onClick: () {}, + onFieldSubmitted: () {}, + ), + ), + SizedBox( + height: 16, + ), + Row( + children: [ + SvgPicture.asset('assets/images/svgs/save_as_draft.svg'), + SizedBox( + width: 4, + ), + AppText( + TranslationBase.of(context).saveAsDraft, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + fontSize: 10, + color: Color(0xFF449BF1), + ), + ], + ) + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart new file mode 100644 index 00000000..48dc1189 --- /dev/null +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart @@ -0,0 +1,43 @@ +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_diagnosis.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis_item.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:flutter/material.dart'; + +class PreviousDiagnosis extends StatelessWidget { + final List diagnosisItems; + + const PreviousDiagnosis({super.key, required this.diagnosisItems}); + + @override + Widget build(BuildContext context) { + if (diagnosisItems.isEmpty) + return Center( + child: EmptyDiagnosis(), + ); + + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Flexible( + child: ListView.separated( + itemBuilder: (_, index) { + return PreviousDiagnosisItem( + title: 'lorem ipsum', + status: 'active', + condition: 'acute', + remarks: 'initial', + onSoapDetailActionClicked: (action) {}, + ); + }, + separatorBuilder: (_, index) => Divider(), + itemCount: diagnosisItems.length), + ) + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis_item.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis_item.dart new file mode 100644 index 00000000..8cb6c800 --- /dev/null +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis_item.dart @@ -0,0 +1,120 @@ +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; + +typedef OnSoapDetailActionClicked = Function(SoapDetailItemActions); + +class PreviousDiagnosisItem extends StatelessWidget { + final String title; + final String condition; + final String status; + final String remarks; + final OnSoapDetailActionClicked onSoapDetailActionClicked; + + const PreviousDiagnosisItem( + {super.key, + required this.title, + required this.condition, + required this.remarks, + required this.onSoapDetailActionClicked, + required this.status}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + title, + color: Color(0XFF2B353E), + fontSize: 12, + fontWeight: FontWeight.bold, + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).condition}:", + color: Color(0XFF2B353E), + fontSize: 10, + fontWeight: FontWeight.w500, + ), + SizedBox( + width: 4, + ), + AppText( + condition, + color: Color(0xffD02127), + fontSize: 10, + fontWeight: FontWeight.w500, + ), + ], + ), + Visibility( + visible: remarks.isNotEmpty, + child: Column( + children: [ + SizedBox( + height: 8, + ), + AppText( + remarks, + color: Color(0XFF2B353E), + fontSize: 10, + fontWeight: FontWeight.w400, + ), + ], + )) + ], + ), + Align( + alignment: Alignment.topRight, child: Status(status: status)) + ], + ), + SizedBox( + height: 16, + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () => + onSoapDetailActionClicked(SoapDetailItemActions.AUDIT), + child: SoapDetailItemActionsView( + icon: 'assets/images/svgs/audit.svg', + fontColor: Color(0XFF2B353E), + text: TranslationBase.of(context).audit, + ), + ), + SizedBox( + width: 16, + ), + SizedBox( + width: 187, + child: AppButton( + onPressed: () { + onSoapDetailActionClicked( + SoapDetailItemActions.CHANGE_STATUS); + }, + title: TranslationBase.of(context).makeCurrentDiagnosis, + ), + ) + ], + ) + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/soap_update_vida_plus/plan/update_plan_page_vida_plus.dart b/lib/screens/patients/profile/soap_update_vida_plus/plan/update_plan_page_vida_plus.dart index a3aefa8b..0921a8a0 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/plan/update_plan_page_vida_plus.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/plan/update_plan_page_vida_plus.dart @@ -132,8 +132,9 @@ class _UpdatePlanPageVidaPlusState extends State episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); + WidgetsBinding.instance.addPostFrameCallback((_) async { await widget.sOAPViewModel - .getPatientProgressNote(getGetProgressNoteReqModel); + .getPatientProgressNote(getGetProgressNoteReqModel);}); if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Utils.parseHtmlString( diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart index a04cc041..0242bb46 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/update_allergies_widget.dart @@ -1,6 +1,9 @@ import 'package:doctor_app_flutter/core/model/SOAP/allergy/get_patient_allergies_list_vida_plus.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/allergies/reactions_selection.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update_vida_plus/update_soap_index_vida_plus.dart b/lib/screens/patients/profile/soap_update_vida_plus/update_soap_index_vida_plus.dart index 75f453ed..1bcc942a 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/update_soap_index_vida_plus.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/update_soap_index_vida_plus.dart @@ -16,6 +16,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'assessment/update_assessment_page.dart'; + class UpdateSoapIndexVidaPlus extends StatefulWidget { final bool isUpdate; @@ -30,7 +32,7 @@ class UpdateSoapIndexVidaPlus extends StatefulWidget { class _UpdateSoapIndexVidaPlusState extends State with TickerProviderStateMixin { PageController? _controller; - int _currentIndex = 3; + int _currentIndex = 2; List myAllergiesList = []; List myHistoryList = []; @@ -95,6 +97,12 @@ class _UpdateSoapIndexVidaPlusState extends State }, scrollDirection: Axis.horizontal, children: [ + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState, + ), UpdatePlanPageVidaPlus( changePageViewIndex: changePageViewIndex, currentIndex: _currentIndex, diff --git a/lib/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart b/lib/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart index 2750b32a..034c2976 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart @@ -191,4 +191,4 @@ class Status extends StatelessWidget { } } -enum SoapDetailItemActions { EDIT, RESOLVE, AUDIT, REMOVE } +enum SoapDetailItemActions { EDIT, RESOLVE, AUDIT, REMOVE,CHANGE_STATUS } diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index 1c1acd50..27db82f0 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -1920,6 +1920,18 @@ class TranslationBase { String get saveAsDraft => localizedValues['saveAsDraft']![locale.languageCode]!; String get mild => localizedValues['mild']![locale.languageCode]!; String get moderate => localizedValues['moderate']![locale.languageCode]!; + String get currentDiagnosis => localizedValues['currentDiagnosis']![locale.languageCode]!; + String get addNewDiagnosis => localizedValues['addNewDiagnosis']![locale.languageCode]!; + String get noDiagnosisFound => localizedValues['noDiagnosisFound']![locale.languageCode]!; + String get makeCurrentDiagnosis => localizedValues['makeCurrentDiagnosis']![locale.languageCode]!; + String get mappedDiagnosis => localizedValues['mappedDiagnosis']![locale.languageCode]!; + String get previousDiagnosis => localizedValues['previousDiagnosis']![locale.languageCode]!; + String get addDiagnosis => localizedValues['addDiagnosis']![locale.languageCode]!; + String get showAllDiagnosis => localizedValues['showAllDiagnosis']![locale.languageCode]!; + String get acute => localizedValues['acute']![locale.languageCode]!; + String get subAcute => localizedValues['subAcute']![locale.languageCode]!; + String get chronic => localizedValues['chronic']![locale.languageCode]!; + } class TranslationBaseDelegate extends LocalizationsDelegate {