From d098b419e283a1a1b5ca2da6cb40443772022bbb Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Tue, 26 Nov 2024 09:35:16 +0300 Subject: [PATCH] WD: get Progress note api integrated --- lib/config/config.dart | 2 + .../SOAP/assessment/search_diagnosis.dart | 15 + .../SOAP/progress_note/progress_note.dart | 85 +++++ .../soap/SOAP_service.dart | 31 ++ lib/core/viewModel/SOAP_view_model.dart | 15 + .../plan/update_plan_page_vida_plus.dart | 295 +++++++----------- .../plan/widget/list_of_notes.dart | 3 +- 7 files changed, 266 insertions(+), 180 deletions(-) create mode 100644 lib/core/model/SOAP/progress_note/progress_note.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 23a4af3e..8ef1f0e1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -336,6 +336,8 @@ const GET_SPECIALITY_DETAILS = 'Services/DoctorApplication.svc/REST/SearchGenera const POST_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const GET_PROGRESS_NOTE_NEW = 'Services/DoctorApplication.svc/REST/GetProgressNote'; + var selectedPatientType = 1; diff --git a/lib/core/model/SOAP/assessment/search_diagnosis.dart b/lib/core/model/SOAP/assessment/search_diagnosis.dart index 832ff167..3a02db9c 100644 --- a/lib/core/model/SOAP/assessment/search_diagnosis.dart +++ b/lib/core/model/SOAP/assessment/search_diagnosis.dart @@ -21,6 +21,11 @@ class SearchDiagnosis { String? specification; int? specificationId; String? specificationNo; + String? selectedIcdCode; + String? selectedCategoryCode; + String? selectedSectionCode; + String? selectedChapterCode; + String? selectedNandaCode; // Default constructor SearchDiagnosis(); @@ -51,6 +56,11 @@ class SearchDiagnosis { specification = json['specification']; specificationId = json['specificationId']; specificationNo = json['specificationNo']; + selectedIcdCode = json['selectedIcdCode']; + selectedCategoryCode = json['selectedCategoryCode']; + selectedSectionCode = json['selectedSectionCode']; + selectedChapterCode = json['selectedChapterCode']; + selectedNandaCode = json['selectedNandaCode']; } // toJson method @@ -78,6 +88,11 @@ class SearchDiagnosis { 'specification': specification, 'specificationId': specificationId, 'specificationNo': specificationNo, + 'selectedIcdCode': selectedIcdCode, + 'selectedCategoryCode': selectedCategoryCode, + 'selectedSectionCode': selectedSectionCode, + 'selectedChapterCode': selectedChapterCode, + 'selectedNandaCode': selectedNandaCode, }; } } \ No newline at end of file diff --git a/lib/core/model/SOAP/progress_note/progress_note.dart b/lib/core/model/SOAP/progress_note/progress_note.dart new file mode 100644 index 00000000..3afc7be9 --- /dev/null +++ b/lib/core/model/SOAP/progress_note/progress_note.dart @@ -0,0 +1,85 @@ +class ProgressNote { + int? clinicGroupId; + int? clinicId; + int? createdById; + String? createdOn; + int? employeeId; + int? hospitalGroupId; + int? hospitalId; + String? loginUserId; + String? manualDate; + String? modifiedOn; + String? patientCondition; + String? patientConditionName; + int? patientId; + int? patientPomrId; + String? progressNote; + int? progressNoteId; + String? progressNotesTypes; + String? progressNotesTypesName; + String? speciality; + String? specialityName; + int? subCategoryId; + String? userFullName; + int? userId; + String? userType; + + ProgressNote(); + + ProgressNote.fromJson(Map json) { + clinicGroupId = json['clinicGroupId']; + clinicId = json['clinicId']; + createdById = json['createdById']; + createdOn = json['createdOn']; + employeeId = json['employeeId']; + hospitalGroupId = json['hospitalGroupId']; + hospitalId = json['hospitalId']; + loginUserId = json['loginUserId']; + manualDate = json['manualDate']; + modifiedOn = json['modifiedOn']; + patientCondition = json['patientCondition']; + patientConditionName = json['patientConditionName']; + patientId = json['patientId']; + patientPomrId = json['patientPomrId']; + progressNote = json['progressNote']; + progressNoteId = json['progressNoteId']; + progressNotesTypes = json['progressNotesTypes']; + progressNotesTypesName = json['progressNotesTypesName']; + speciality = json['speciality']; + specialityName = json['specialityName']; + subCategoryId = json['subCategoryId']; + userFullName = json['userFullName']; + userId = json['userId']; + userType = json['userType']; + } + + // toJson method + Map toJson() { + return { + 'clinicGroupId': clinicGroupId, + 'clinicId': clinicId, + 'createdById': createdById, + 'createdOn': createdOn, + 'employeeId': employeeId, + 'hospitalGroupId': hospitalGroupId, + 'hospitalId': hospitalId, + 'loginUserId': loginUserId, + 'manualDate': manualDate, + 'modifiedOn': modifiedOn, + 'patientCondition': patientCondition, + 'patientConditionName': patientConditionName, + 'patientId': patientId, + 'patientPomrId': patientPomrId, + 'progressNote': progressNote, + 'progressNoteId': progressNoteId, + 'progressNotesTypes': progressNotesTypes, + 'progressNotesTypesName': progressNotesTypesName, + 'speciality': speciality, + 'specialityName': specialityName, + 'subCategoryId': subCategoryId, + 'userFullName': userFullName, + 'userId': userId, + 'userType': userType, + }; + } +} diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index 28f973dc..934f0ea0 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -34,6 +34,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_e import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import '../../../../config/shared_pref_kay.dart'; @@ -48,6 +49,7 @@ class SOAPService extends LookupService { List patientHistoryList = []; List patientPhysicalExamList = []; List patientProgressNoteList = []; + List patientProgressNoteListVidaPlus = []; List patientAssessmentList = []; List searchAllergiesList = []; List patientAllergiesVidaPlus = []; @@ -961,6 +963,35 @@ class SOAPService extends LookupService { }, body: request); } + Future getProgressNoteNew( + PatiantInformtion patientInformation) async { + Map request = { + "hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID), + "hospitalId": patientInformation.projectId, + "patientId": patientInformation.patientId, + "patientPomrId": patientInformation.pomrId, + "endRow": 10000, // because no information is provided for the end row + "startRow": 0, + "ProjectID":patientInformation.projectId + }; + hasError = false; + await baseAppClient.post(GET_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + patientProgressNoteListVidaPlus.clear(); + response['ProgressNoteList']['resultData'].forEach((v) { + v['data'].forEach((progressNote){ + patientProgressNoteListVidaPlus.add(ProgressNote.fromJson(progressNote)); + + }); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: request); + } + + getSpecialityDetails(String speciality, int? specialityId, PatiantInformtion patientInfo) async { Map? user = await sharedPref.getObj(LOGGED_IN_USER); diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 283d2586..bab64bde 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -36,6 +36,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart'; @@ -147,6 +148,7 @@ class SOAPViewModel extends BaseViewModel { _SOAPService.auditDiagnosislist; List get speciality => _SOAPService.generalSpeciality; + List get progressNote => _SOAPService.patientProgressNoteListVidaPlus; Map> get specialityDetails => _SOAPService.specialityDetails; @@ -1219,6 +1221,9 @@ class SOAPViewModel extends BaseViewModel { _SOAPService.showAuditBottomSheet = status; } + /** + * todo as physical examination is having some issue and under discussion + */ void savePhysicalexamination() { var mappedItems = setState(ViewState.BusyLocal); @@ -1229,4 +1234,14 @@ class SOAPViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + void getProgressNote(PatiantInformtion patientInformation) async { + setState(ViewState.BusyLocal); + await _SOAPService.getProgressNoteNew(patientInformation); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } 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 0921a8a0..98228a8c 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 @@ -1,28 +1,17 @@ -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/view_state.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart'; -import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.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/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/plan/plan_call_back.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_vida_plus/objective/list_of_examination.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/add_progress_note.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/empty_progress_note.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/list_of_notes.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/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:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -50,14 +39,7 @@ class UpdatePlanPageVidaPlus extends StatefulWidget { class _UpdatePlanPageVidaPlusState extends State implements PlanCallBack { - bool isAddProgress = true; bool isProgressExpanded = true; - List listOfProgressNote = [GetPatientProgressNoteResModel()]; - GetPatientProgressNoteResModel patientProgressNote = - GetPatientProgressNoteResModel(); - - TextEditingController progressNoteController = - TextEditingController(text: null); BoxDecoration containerBorderDecoration( Color containerColor, Color borderColor) { @@ -75,88 +57,56 @@ class _UpdatePlanPageVidaPlusState extends State @override void initState() { super.initState(); - if (patientProgressNote.planNote != null) { - setState(() { - isAddProgress = false; - }); - } } - getPatientProgressNote(SOAPViewModel model, - {bool isAddProgress = false}) async { - GetProgressNoteReqModel getGetProgressNoteReqModel = - GetProgressNoteReqModel( - 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 = Utils.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; - setState(() { - isAddProgress = isAddProgress; - widget.sOAPViewModel.isAddProgress = isAddProgress; - widget.sOAPViewModel.progressNoteText = progressNoteController.text; - }); - } - } + // getPatientProgressNote(SOAPViewModel model, + // {bool isAddProgress = false}) async { + // GetProgressNoteReqModel getGetProgressNoteReqModel = + // GetProgressNoteReqModel( + // 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 = Utils.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; + // 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); - GetProgressNoteReqModel getGetProgressNoteReqModel = - GetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); + widget.changeLoadingState(true); WidgetsBinding.instance.addPostFrameCallback((_) async { - await widget.sOAPViewModel - .getPatientProgressNote(getGetProgressNoteReqModel);}); - - if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.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; - }); - } + if (model.progressNote.isEmpty) { + await model.getProgressNote(widget.patientInfo); + } + }); widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( @@ -168,7 +118,6 @@ class _UpdatePlanPageVidaPlusState extends State child: FractionallySizedBox( widthFactor: 0.90, child: Column( - children: [ SOAPStepHeader( currentIndex: widget.currentIndex, @@ -202,7 +151,7 @@ class _UpdatePlanPageVidaPlusState extends State height: 16, ), - if (listOfProgressNote.isEmpty) ...{ + if (model.progressNote.isEmpty) ...{ Center( child: Padding( padding: const EdgeInsets.all(65), @@ -211,9 +160,7 @@ class _UpdatePlanPageVidaPlusState extends State ), } else ...{ Divider(), - ListOfNotes( - notes: listOfProgressNote - ) + ListOfNotes(notes: model.progressNote) } // if (mySelectedExamination.isEmpty) ...{ @@ -365,94 +312,84 @@ class _UpdatePlanPageVidaPlusState extends State )); } - submitPlan(SOAPViewModel model) async { - if (progressNoteController.text.isNotEmpty) { - widget.changeLoadingState(true); - PostProgressNoteRequestModel postProgressNoteRequestModel = - new PostProgressNoteRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - planNote: patientProgressNote.planNote, - doctorID: widget.patientInfo.doctorId, - createdBy: widget.patientInfo.doctorId, - createdByName: widget.patientInfo.doctorName, - editedBy: ''); - - if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { - 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); - } - - if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { - Utils.showErrorToast(widget.sOAPViewModel.error); - } else { - GetProgressNoteReqModel getGetProgressNoteReqModel = - GetProgressNoteReqModel( - 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 = Utils.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; - - setState(() { - isAddProgress = false; - widget.sOAPViewModel.isAddProgress = false; - }); - } - - Navigator.of(context).pop(); - Utils.showErrorToast("Episode Created Successfully"); - } - widget.changeLoadingState(false); - } else { - Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); - } - } + // submitPlan(SOAPViewModel model) async { + // if (progressNoteController.text.isNotEmpty) { + // widget.changeLoadingState(true); + // PostProgressNoteRequestModel postProgressNoteRequestModel = + // new PostProgressNoteRequestModel( + // patientMRN: widget.patientInfo.patientMRN, + // episodeId: widget.patientInfo.episodeNo, + // appointmentNo: widget.patientInfo.appointmentNo, + // planNote: patientProgressNote.planNote, + // doctorID: widget.patientInfo.doctorId, + // createdBy: widget.patientInfo.doctorId, + // createdByName: widget.patientInfo.doctorName, + // editedBy: ''); + // + // if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { + // 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); + // } + // + // if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { + // Utils.showErrorToast(widget.sOAPViewModel.error); + // } else { + // GetProgressNoteReqModel getGetProgressNoteReqModel = + // GetProgressNoteReqModel( + // 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 = Utils.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; + // + // setState(() { + // isAddProgress = false; + // widget.sOAPViewModel.isAddProgress = false; + // }); + // } + // + // Navigator.of(context).pop(); + // Utils.showErrorToast("Episode Created Successfully"); + // } + // widget.changeLoadingState(false); + // } else { + // Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); + // } + // } @override nextFunction(model) { - if (progressNoteController.text.isNotEmpty) { - if (isAddProgress) { - submitPlan(model); - } else { - Navigator.of(context).pop(); - } - } else { - Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); - } + //todo handle the next event here } void navigateToAddPlan() { Navigator.push( - context, - FadePage( - page: AddProgressNote ( - - ), - )); + context, + FadePage( + page: AddProgressNote(), + )); } } diff --git a/lib/screens/patients/profile/soap_update_vida_plus/plan/widget/list_of_notes.dart b/lib/screens/patients/profile/soap_update_vida_plus/plan/widget/list_of_notes.dart index 4929ca0e..d74ab0c3 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/plan/widget/list_of_notes.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/plan/widget/list_of_notes.dart @@ -1,9 +1,10 @@ import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/ProgressNoteItem.dart'; import 'package:flutter/material.dart'; class ListOfNotes extends StatelessWidget{ - final List notes; + final List notes; const ListOfNotes({super.key, required this.notes}); @override