WD: get Progress note api integrated

update_flutter_3.24_vida_plus_episode_v2
taha.alam 1 year ago
parent a1960c8799
commit d098b419e2

@ -336,6 +336,8 @@ const GET_SPECIALITY_DETAILS = 'Services/DoctorApplication.svc/REST/SearchGenera
const POST_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; const POST_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const GET_PROGRESS_NOTE_NEW = 'Services/DoctorApplication.svc/REST/GetProgressNote';
var selectedPatientType = 1; var selectedPatientType = 1;

@ -21,6 +21,11 @@ class SearchDiagnosis {
String? specification; String? specification;
int? specificationId; int? specificationId;
String? specificationNo; String? specificationNo;
String? selectedIcdCode;
String? selectedCategoryCode;
String? selectedSectionCode;
String? selectedChapterCode;
String? selectedNandaCode;
// Default constructor // Default constructor
SearchDiagnosis(); SearchDiagnosis();
@ -51,6 +56,11 @@ class SearchDiagnosis {
specification = json['specification']; specification = json['specification'];
specificationId = json['specificationId']; specificationId = json['specificationId'];
specificationNo = json['specificationNo']; specificationNo = json['specificationNo'];
selectedIcdCode = json['selectedIcdCode'];
selectedCategoryCode = json['selectedCategoryCode'];
selectedSectionCode = json['selectedSectionCode'];
selectedChapterCode = json['selectedChapterCode'];
selectedNandaCode = json['selectedNandaCode'];
} }
// toJson method // toJson method
@ -78,6 +88,11 @@ class SearchDiagnosis {
'specification': specification, 'specification': specification,
'specificationId': specificationId, 'specificationId': specificationId,
'specificationNo': specificationNo, 'specificationNo': specificationNo,
'selectedIcdCode': selectedIcdCode,
'selectedCategoryCode': selectedCategoryCode,
'selectedSectionCode': selectedSectionCode,
'selectedChapterCode': selectedChapterCode,
'selectedNandaCode': selectedNandaCode,
}; };
} }
} }

@ -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<String, dynamic> 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<String, dynamic> 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,
};
}
}

@ -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/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/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/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/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import '../../../../config/shared_pref_kay.dart'; import '../../../../config/shared_pref_kay.dart';
@ -48,6 +49,7 @@ class SOAPService extends LookupService {
List<GetHistoryResModel> patientHistoryList = []; List<GetHistoryResModel> patientHistoryList = [];
List<GetPhysicalExamResModel> patientPhysicalExamList = []; List<GetPhysicalExamResModel> patientPhysicalExamList = [];
List<GetPatientProgressNoteResModel> patientProgressNoteList = []; List<GetPatientProgressNoteResModel> patientProgressNoteList = [];
List<ProgressNote> patientProgressNoteListVidaPlus = [];
List<GetAssessmentResModel> patientAssessmentList = []; List<GetAssessmentResModel> patientAssessmentList = [];
List<AllergiesListVidaPlus> searchAllergiesList = []; List<AllergiesListVidaPlus> searchAllergiesList = [];
List<PatientAllergiesVidaPlus> patientAllergiesVidaPlus = []; List<PatientAllergiesVidaPlus> patientAllergiesVidaPlus = [];
@ -961,6 +963,35 @@ class SOAPService extends LookupService {
}, body: request); }, body: request);
} }
Future getProgressNoteNew(
PatiantInformtion patientInformation) async {
Map<String, dynamic> 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, getSpecialityDetails(String speciality, int? specialityId,
PatiantInformtion patientInfo) async { PatiantInformtion patientInfo) async {
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER); Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);

@ -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/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/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/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/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/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_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; _SOAPService.auditDiagnosislist;
List<GeneralSpeciality> get speciality => _SOAPService.generalSpeciality; List<GeneralSpeciality> get speciality => _SOAPService.generalSpeciality;
List<ProgressNote> get progressNote => _SOAPService.patientProgressNoteListVidaPlus;
Map<String, List<Category>> get specialityDetails => Map<String, List<Category>> get specialityDetails =>
_SOAPService.specialityDetails; _SOAPService.specialityDetails;
@ -1219,6 +1221,9 @@ class SOAPViewModel extends BaseViewModel {
_SOAPService.showAuditBottomSheet = status; _SOAPService.showAuditBottomSheet = status;
} }
/**
* todo as physical examination is having some issue and under discussion
*/
void savePhysicalexamination() { void savePhysicalexamination() {
var mappedItems = var mappedItems =
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -1229,4 +1234,14 @@ class SOAPViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); 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);
}
} }

@ -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/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.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/patient/patiant_info_model.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/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/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/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/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/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/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/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/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/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/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_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:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -50,14 +39,7 @@ class UpdatePlanPageVidaPlus extends StatefulWidget {
class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus> class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
implements PlanCallBack { implements PlanCallBack {
bool isAddProgress = true;
bool isProgressExpanded = true; bool isProgressExpanded = true;
List<GetPatientProgressNoteResModel> listOfProgressNote = [GetPatientProgressNoteResModel()];
GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
TextEditingController progressNoteController =
TextEditingController(text: null);
BoxDecoration containerBorderDecoration( BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) { Color containerColor, Color borderColor) {
@ -75,88 +57,56 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (patientProgressNote.planNote != null) {
setState(() {
isAddProgress = false;
});
}
} }
getPatientProgressNote(SOAPViewModel model, // getPatientProgressNote(SOAPViewModel model,
{bool isAddProgress = false}) async { // {bool isAddProgress = false}) async {
GetProgressNoteReqModel getGetProgressNoteReqModel = // GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel( // GetProgressNoteReqModel(
appointmentNo: // appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()), // int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN, // patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), // episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', // editedBy: '',
doctorID: ''); // doctorID: '');
await widget.sOAPViewModel // await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel); // .getPatientProgressNote(getGetProgressNoteReqModel);
//
///TODO set progressNote in model; // ///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { // if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString( // progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote!); // widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; // patientProgressNote.planNote = progressNoteController.text;
//
patientProgressNote.createdByName = // patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; // widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = // patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn; // widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = // patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn; // widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = // patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName; // widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = // patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; // widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() { // setState(() {
isAddProgress = isAddProgress; // isAddProgress = isAddProgress;
widget.sOAPViewModel.isAddProgress = isAddProgress; // widget.sOAPViewModel.isAddProgress = isAddProgress;
widget.sOAPViewModel.progressNoteText = progressNoteController.text; // widget.sOAPViewModel.progressNoteText = progressNoteController.text;
}); // });
} // }
} // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.sOAPViewModel.setPlanCallBack(this); widget.sOAPViewModel.setPlanCallBack(this);
GetProgressNoteReqModel getGetProgressNoteReqModel = widget.changeLoadingState(true);
GetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
await widget.sOAPViewModel if (model.progressNote.isEmpty) {
.getPatientProgressNote(getGetProgressNoteReqModel);}); await model.getProgressNote(widget.patientInfo);
}
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;
});
}
widget.changeLoadingState(false); widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -168,7 +118,6 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.90, widthFactor: 0.90,
child: Column( child: Column(
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex, currentIndex: widget.currentIndex,
@ -202,7 +151,7 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
height: 16, height: 16,
), ),
if (listOfProgressNote.isEmpty) ...{ if (model.progressNote.isEmpty) ...{
Center( Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(65), padding: const EdgeInsets.all(65),
@ -211,9 +160,7 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
), ),
} else ...{ } else ...{
Divider(), Divider(),
ListOfNotes( ListOfNotes(notes: model.progressNote)
notes: listOfProgressNote
)
} }
// if (mySelectedExamination.isEmpty) ...{ // if (mySelectedExamination.isEmpty) ...{
@ -365,94 +312,84 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
)); ));
} }
submitPlan(SOAPViewModel model) async { // submitPlan(SOAPViewModel model) async {
if (progressNoteController.text.isNotEmpty) { // if (progressNoteController.text.isNotEmpty) {
widget.changeLoadingState(true); // widget.changeLoadingState(true);
PostProgressNoteRequestModel postProgressNoteRequestModel = // PostProgressNoteRequestModel postProgressNoteRequestModel =
new PostProgressNoteRequestModel( // new PostProgressNoteRequestModel(
patientMRN: widget.patientInfo.patientMRN, // patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, // episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, // appointmentNo: widget.patientInfo.appointmentNo,
planNote: patientProgressNote.planNote, // planNote: patientProgressNote.planNote,
doctorID: widget.patientInfo.doctorId, // doctorID: widget.patientInfo.doctorId,
createdBy: widget.patientInfo.doctorId, // createdBy: widget.patientInfo.doctorId,
createdByName: widget.patientInfo.doctorName, // createdByName: widget.patientInfo.doctorName,
editedBy: ''); // editedBy: '');
//
if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { // if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
await widget.sOAPViewModel // await widget.sOAPViewModel
.postProgressNote(postProgressNoteRequestModel); // .postProgressNote(postProgressNoteRequestModel);
} else { // } else {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); // Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); // DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; // postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await widget.sOAPViewModel // await widget.sOAPViewModel
.patchProgressNote(postProgressNoteRequestModel); // .patchProgressNote(postProgressNoteRequestModel);
} // }
//
if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { // if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.sOAPViewModel.error); // Utils.showErrorToast(widget.sOAPViewModel.error);
} else { // } else {
GetProgressNoteReqModel getGetProgressNoteReqModel = // GetProgressNoteReqModel getGetProgressNoteReqModel =
GetProgressNoteReqModel( // GetProgressNoteReqModel(
appointmentNo: // appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()), // int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN, // patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), // episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', // editedBy: '',
doctorID: ''); // doctorID: '');
await widget.sOAPViewModel // await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel); // .getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { // if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString( // progressNoteController.text = Utils.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote!); // widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; // patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = // patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; // widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = // patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn; // widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = // patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn; // widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = // patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName; // widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = // patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; // widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
//
setState(() { // setState(() {
isAddProgress = false; // isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false; // widget.sOAPViewModel.isAddProgress = false;
}); // });
} // }
//
Navigator.of(context).pop(); // Navigator.of(context).pop();
Utils.showErrorToast("Episode Created Successfully"); // Utils.showErrorToast("Episode Created Successfully");
} // }
widget.changeLoadingState(false); // widget.changeLoadingState(false);
} else { // } else {
Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); // Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
} // }
} // }
@override @override
nextFunction(model) { nextFunction(model) {
if (progressNoteController.text.isNotEmpty) { //todo handle the next event here
if (isAddProgress) {
submitPlan(model);
} else {
Navigator.of(context).pop();
}
} else {
Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
}
} }
void navigateToAddPlan() { void navigateToAddPlan() {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: AddProgressNote ( page: AddProgressNote(),
));
),
));
} }
} }

@ -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/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:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/ProgressNoteItem.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ListOfNotes extends StatelessWidget{ class ListOfNotes extends StatelessWidget{
final List<GetPatientProgressNoteResModel> notes; final List<ProgressNote> notes;
const ListOfNotes({super.key, required this.notes}); const ListOfNotes({super.key, required this.notes});
@override @override

Loading…
Cancel
Save