finish update on soap

episode_fixes
Elham Rababh 3 years ago
parent e58ce34aa4
commit a502308a8a

@ -27,6 +27,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objectiveCallBack.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/planCallBack.dart';
@ -356,8 +357,21 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientPhysicalExam(
GetPhysicalExamReqModel getPhysicalExamReqModel) async {
Future getPatientPhysicalExam(PatiantInformtion patientInfo,
) async {
GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel(
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo.toString(),
appointmentNo: int.parse(
patientInfo.appointmentNo.toString(),
),
);
if(patientInfo.admissionNo !=null &&patientInfo.admissionNo.isNotEmpty)
getPhysicalExamReqModel.admissionNo =int.parse(patientInfo.admissionNo);
else
getPhysicalExamReqModel.admissionNo = 0;
setState(ViewState.Busy);
await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel);
if (_SOAPService.hasError) {

@ -299,8 +299,7 @@ class AuthenticationViewModel extends BaseViewModel {
clinicID: clinicInfo.clinicID,
license: true,
projectID: clinicInfo.projectID,
tokenID: '',
languageID: 2);//TODO change the lan
languageID: 2);///TODO change the lan
await _authService.getDoctorProfileBasedOnClinic(docInfo);
if (_authService.hasError) {
error = _authService.error;

@ -1,6 +1,7 @@
class GetPhysicalExamReqModel {
int patientMRN;
int appointmentNo;
int admissionNo;
String episodeID;
String from;
String to;
@ -10,6 +11,7 @@ class GetPhysicalExamReqModel {
GetPhysicalExamReqModel({
this.patientMRN,
this.appointmentNo,
this.admissionNo,
this.episodeID,
this.from,
this.to,
@ -31,6 +33,7 @@ class GetPhysicalExamReqModel {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['AdmissionNo'] = this.admissionNo;
data['EpisodeID'] = this.episodeID;
data['From'] = this.from;
data['To'] = this.to;

@ -1,12 +1,13 @@
class PostPhysicalExamRequestModel {
List<ListHisProgNotePhysicalExaminationVM> listHisProgNotePhysicalExaminationVM;
List<ListHisProgNotePhysicalExaminationVM>
listHisProgNotePhysicalExaminationVM;
PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM});
PostPhysicalExamRequestModel.fromJson(Map<String, dynamic> json) {
if (json['listHisProgNotePhysicalExaminationVM'] != null) {
listHisProgNotePhysicalExaminationVM = new List<ListHisProgNotePhysicalExaminationVM>();
listHisProgNotePhysicalExaminationVM =
new List<ListHisProgNotePhysicalExaminationVM>();
json['listHisProgNotePhysicalExaminationVM'].forEach((v) {
listHisProgNotePhysicalExaminationVM
.add(new ListHisProgNotePhysicalExaminationVM.fromJson(v));
@ -17,98 +18,105 @@ class PostPhysicalExamRequestModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.listHisProgNotePhysicalExaminationVM != null) {
data['listHisProgNotePhysicalExaminationVM'] =
this.listHisProgNotePhysicalExaminationVM.map((v) => v.toJson()).toList();
data['listHisProgNotePhysicalExaminationVM'] = this
.listHisProgNotePhysicalExaminationVM
.map((v) => v.toJson())
.toList();
}
return data;
}
}
class ListHisProgNotePhysicalExaminationVM {
int episodeId;
int appointmentNo;
int examType;
int examId;
int patientMRN;
bool isNormal;
bool isAbnormal;
bool notExamined;
String examName;
String examinationTypeName;
int examinationType;
String remarks;
bool isNew;
int createdBy;
String createdOn;
String createdByName;
int editedBy;
String editedOn;
String editedByName;
class ListHisProgNotePhysicalExaminationVM {
int episodeId;
int appointmentNo;
int admissionNo;
int examType;
int examId;
int patientMRN;
bool isNormal;
bool isAbnormal;
bool notExamined;
String examName;
String examinationTypeName;
int examinationType;
String remarks;
bool isNew;
int createdBy;
String createdOn;
String createdByName;
int editedBy;
String editedOn;
String editedByName;
ListHisProgNotePhysicalExaminationVM(
{this.episodeId,
this.appointmentNo,
this.examType,
this.examId,
this.patientMRN,
this.isNormal,
this.isAbnormal,
this.notExamined,
this.examName,
this.examinationTypeName,
this.examinationType,
this.remarks,
this.isNew,
this.createdBy,
this.createdOn,
this.createdByName,
this.editedBy,
this.editedOn,
this.editedByName});
ListHisProgNotePhysicalExaminationVM(
{this.episodeId,
this.appointmentNo,
this.admissionNo,
this.examType,
this.examId,
this.patientMRN,
this.isNormal,
this.isAbnormal,
this.notExamined,
this.examName,
this.examinationTypeName,
this.examinationType,
this.remarks,
this.isNew,
this.createdBy,
this.createdOn,
this.createdByName,
this.editedBy,
this.editedOn,
this.editedByName});
ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) {
episodeId = json['episodeId'];
appointmentNo = json['appointmentNo'];
examType = json['examType'];
examId = json['examId'];
patientMRN = json['patientMRN'];
isNormal = json['isNormal'];
isAbnormal = json['isAbnormal'];
notExamined = json['notExamined'];
examName = json['examName'];
examinationTypeName = json['examinationTypeName'];
examinationType = json['examinationType'];
remarks = json['remarks'];
isNew = json['isNew'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
createdByName = json['createdByName'];
editedBy = json['editedBy'];
editedOn = json['editedOn'];
editedByName = json['editedByName'];
}
ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) {
episodeId = json['episodeId'];
appointmentNo = json['appointmentNo'];
admissionNo = json['AdmissionNo'];
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['episodeId'] = this.episodeId;
data['appointmentNo'] = this.appointmentNo;
data['examType'] = this.examType;
data['examId'] = this.examId;
data['patientMRN'] = this.patientMRN;
data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal;
data['notExamined'] = this.notExamined;
data['examName'] = this.examName;
data['examinationTypeName'] = this.examinationTypeName;
data['examinationType'] = this.examinationType;
data['remarks'] = this.remarks;
data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['createdByName'] = this.createdByName;
data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn;
data['editedByName'] = this.editedByName;
return data;
}
examType = json['examType'];
examId = json['examId'];
patientMRN = json['patientMRN'];
isNormal = json['isNormal'];
isAbnormal = json['isAbnormal'];
notExamined = json['notExamined'];
examName = json['examName'];
examinationTypeName = json['examinationTypeName'];
examinationType = json['examinationType'];
remarks = json['remarks'];
isNew = json['isNew'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
createdByName = json['createdByName'];
editedBy = json['editedBy'];
editedOn = json['editedOn'];
editedByName = json['editedByName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['episodeId'] = this.episodeId;
data['appointmentNo'] = this.appointmentNo;
data['AdmissionNo'] = this.admissionNo;
data['examType'] = this.examType;
data['examId'] = this.examId;
data['patientMRN'] = this.patientMRN;
data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal;
data['notExamined'] = this.notExamined;
data['examName'] = this.examName;
data['examinationTypeName'] = this.examinationTypeName;
data['examinationType'] = this.examinationType;
data['remarks'] = this.remarks;
data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['createdByName'] = this.createdByName;
data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn;
data['editedByName'] = this.editedByName;
return data;
}
}

@ -475,73 +475,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
),
),
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 12 : 10),
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
fontColor: Colors.black,
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
widget.changePageViewIndex(1);
},
),
),
SizedBox(
width: 5,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
},
),
),
],
),
),
),
),
SizedBox(
height: 5,
),
],
),
)),
),),
);
}

@ -44,7 +44,8 @@ class UpdateObjectivePage extends StatefulWidget {
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
}
class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements ObjectiveCallBack {
class _UpdateObjectivePageState extends State<UpdateObjectivePage>
implements ObjectiveCallBack {
bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = List();
@ -67,13 +68,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
onModelReady: (model) async {
model.setObjectiveCallBack(this);
mySelectedExamination.clear();
GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
await model.getPatientPhysicalExam(widget.patientInfo);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
@ -102,109 +98,108 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
ExpandableSOAPWidget(
headerTitle:
TranslationBase.of(context).physicalSystemExamination,
onTap: () {
setState(() {
isSysExaminationExpand = !isSysExaminationExpand;
});
},
child: Column(
children: [
SOAPOpenItems(
label:
"${TranslationBase.of(context).addExamination}",
onTap: () {
openExaminationList(context);
},
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
ExpandableSOAPWidget(
headerTitle:
TranslationBase.of(context).physicalSystemExamination,
onTap: () {
setState(() {
isSysExaminationExpand = !isSysExaminationExpand;
});
},
child: Column(
children: [
SOAPOpenItems(
label:
"${TranslationBase.of(context).addExamination}",
onTap: () {
openExaminationList(context);
},
),
if (mySelectedExamination.isNotEmpty &&
mySelectedExamination.first.isLocal)
Row(
children: [
AppText(
"New",
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Color(0xFFCC9B14),
),
],
),
if (mySelectedExamination.isNotEmpty &&
mySelectedExamination.first.isLocal)
Row(
children: [
AppText(
"New",
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Color(0xFFCC9B14),
),
],
),
Column(
children: mySelectedExamination
.sublist(
0,
model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
});
}).toList(),
Column(
children: mySelectedExamination
.sublist(
0,
model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
});
}).toList(),
),
if (mySelectedExamination.isNotEmpty &&
model.getFirstIndexForOldExamination(
mySelectedExamination) >
-1)
Row(
children: [
AppText(
"Verified",
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Colors.green,
),
],
),
if (mySelectedExamination.isNotEmpty &&
model.getFirstIndexForOldExamination(
mySelectedExamination) >
-1)
Row(
children: [
AppText(
"Verified",
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Colors.green,
),
],
),
Column(
children: mySelectedExamination
.sublist(model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
});
}).toList(),
)
],
),
isExpanded: isSysExaminationExpand,
Column(
children: mySelectedExamination
.sublist(model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
});
}).toList(),
)
],
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 14 : 12),
)
],
),
isExpanded: isSysExaminationExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 14 : 12),
)
],
),
),
),
),
),
);
}
@ -213,6 +208,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
// TODO Elham*
widget.changePageViewIndex(2);
/// TODO Elham* move this logic to view model
// if (mySelectedExamination.isNotEmpty) {
// widget.changeLoadingState(true);
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -225,33 +221,41 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
// null)
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
// [];
//
// ListHisProgNotePhysicalExaminationVM
// listHisProgNotePhysicalExaminationVM =
// ListHisProgNotePhysicalExaminationVM(
// patientMRN: widget.patientInfo.patientMRN,
// episodeId: widget.patientInfo.episodeNo,
// appointmentNo: widget.patientInfo.appointmentNo,
// remarks: exam.remark ?? '',
// createdBy: exam.createdBy ?? doctorProfile.doctorID,
// createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
// editedBy: doctorProfile.doctorID,
// editedOn: DateTime.now().toIso8601String(),
// examId: exam.selectedExamination.id,
// examType: exam.selectedExamination.typeId,
// isAbnormal: exam.isAbnormal,
// isNormal: exam.isNormal,
// notExamined: exam.notExamined,
// examinationType: exam.isNormal
// ? 1
// : exam.isAbnormal
// ? 2
// : 3,
// examinationTypeName: exam.isNormal
// ? "Normal"
// : exam.isAbnormal
// ? 'AbNormal'
// : "Not Examined",
// isNew: exam.isNew,
// );
// if (widget.patientInfo.admissionNo != null &&
// widget.patientInfo.admissionNo.isNotEmpty) {
// listHisProgNotePhysicalExaminationVM.admissionNo =
// int.parse(widget.patientInfo.admissionNo);
// }
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
// .add(ListHisProgNotePhysicalExaminationVM(
// patientMRN: widget.patientInfo.patientMRN,
// episodeId: widget.patientInfo.episodeNo,
// appointmentNo: widget.patientInfo.appointmentNo,
// remarks: exam.remark ?? '',
// createdBy: exam.createdBy ?? doctorProfile.doctorID,
// createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
// editedBy: doctorProfile.doctorID,
// editedOn: DateTime.now().toIso8601String(),
// examId: exam.selectedExamination.id,
// examType: exam.selectedExamination.typeId,
// isAbnormal: exam.isAbnormal,
// isNormal: exam.isNormal,
// notExamined: exam.notExamined,
// examinationType: exam.isNormal
// ? 1
// : exam.isAbnormal
// ? 2
// : 3,
// examinationTypeName: exam.isNormal
// ? "Normal"
// : exam.isAbnormal
// ? 'AbNormal'
// : "Not Examined",
// isNew: exam.isNew));
// .add(listHisProgNotePhysicalExaminationVM);
// });
//
// if (model.patientPhysicalExamList.isEmpty) {
@ -297,15 +301,16 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
FadePage(
page: AddExaminationPage(
mySelectedExamination: mySelectedExamination,
addSelectedExamination: (List<MySelectedExamination> mySelectedExaminationLocal ) {
addSelectedExamination:
(List<MySelectedExamination> mySelectedExaminationLocal) {
setState(() {
{
mySelectedExaminationLocal.forEach((element) {
{
mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
null) {
mySelectedExamination.add(element);
}
@ -313,12 +318,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
/// remove items.
List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) {
mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
null) {
removedList.add(element);
}
@ -337,7 +342,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
}
@override
nextFunction(model) async {
nextFunction(model) async {
await submitUpdateObjectivePage(model);
}
}

@ -28,6 +28,8 @@ class UpdatePlanPage extends StatefulWidget {
final Function changePageViewIndex;
final PatiantInformtion patientInfo;
final Function changeLoadingState;
final Function changeStateFun;
final SOAPViewModel sOAPViewModel;
final int currentIndex;
@ -36,7 +38,7 @@ class UpdatePlanPage extends StatefulWidget {
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
this.currentIndex, this.sOAPViewModel, this.changeStateFun});
@override
_UpdatePlanPageState createState() => _UpdatePlanPageState();
@ -84,26 +86,27 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
///TODO set progressNote in model;
if (model.patientProgressNoteList.isNotEmpty) {
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote);
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName;
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = isAddProgress;
model.isAddProgress = isAddProgress;
widget.sOAPViewModel.isAddProgress = isAddProgress;
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
});
}
}
@ -112,7 +115,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
model.setPlanCallBack(this);
widget.sOAPViewModel.setPlanCallBack(this);
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo:
@ -121,26 +124,27 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote);
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName;
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
setState(() {
isAddProgress = false;
model.isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false;
});
}
widget.changeLoadingState(false);
@ -188,6 +192,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
onChanged: (value) {
setState(() {
patientProgressNote.planNote = value;
model.progressNoteText = value;
widget.changeStateFun();
});
},
),
@ -301,6 +307,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
onTap: () {
setState(() {
isAddProgress = true;
widget.sOAPViewModel.isAddProgress = true;
});
},
child: Icon(
@ -342,17 +349,17 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
doctorID: '',
editedBy: '');
if (model.patientProgressNoteList.isEmpty) {
await model.postProgressNote(postProgressNoteRequestModel);
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 model.patchProgressNote(postProgressNoteRequestModel);
await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.sOAPViewModel.error);
} else {
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
@ -363,25 +370,25 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote);
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName;
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = false;
model.isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false;
});
}
}

@ -60,6 +60,11 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
});
}
void changeStateFun(){
setState(() {
});
}
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
@ -94,25 +99,27 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateObjectivePage(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
changeLoadingState: changeLoadingState),
// UpdateSubjectivePage(
// changePageViewIndex: changePageViewIndex,
// currentIndex: _currentIndex,
// patientInfo: patient,
// changeLoadingState: changeLoadingState),
// UpdateObjectivePage(
// changePageViewIndex: changePageViewIndex,
// currentIndex: _currentIndex,
// patientInfo: patient,
// changeLoadingState: changeLoadingState),
// UpdateAssessmentPage(
// changePageViewIndex: changePageViewIndex,
// currentIndex: _currentIndex,
// patientInfo: patient,
// changeLoadingState: changeLoadingState),
UpdatePlanPage(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
patientInfo: patient,
sOAPViewModel: model,
changeStateFun: changeStateFun,
changeLoadingState: changeLoadingState)
],
),
@ -123,7 +130,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
],
),
),
bottomSheet: Container(
bottomSheet:_isLoading?Container(height: 0,): Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(

Loading…
Cancel
Save