|
|
|
@ -30,16 +30,12 @@ import 'history/update_history_widget.dart';
|
|
|
|
|
class UpdateSubjectivePage extends StatefulWidget {
|
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
|
final Function changeLoadingState;
|
|
|
|
|
final List<MySelectedAllergy> myAllergiesList;
|
|
|
|
|
final List<MySelectedHistory> myHistoryList;
|
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
|
final int currentIndex;
|
|
|
|
|
|
|
|
|
|
UpdateSubjectivePage(
|
|
|
|
|
{Key key,
|
|
|
|
|
this.changePageViewIndex,
|
|
|
|
|
this.myAllergiesList,
|
|
|
|
|
this.myHistoryList,
|
|
|
|
|
this.patientInfo,
|
|
|
|
|
this.changeLoadingState,
|
|
|
|
|
this.currentIndex});
|
|
|
|
@ -59,6 +55,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
String medicationControllerError = '';
|
|
|
|
|
String illnessControllerError = '';
|
|
|
|
|
final formKey = GlobalKey<FormState>();
|
|
|
|
|
List<MySelectedAllergy> myAllergiesList=List();
|
|
|
|
|
List<MySelectedHistory> myHistoryList=List();
|
|
|
|
|
|
|
|
|
|
getHistory(SOAPViewModel model) async {
|
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
@ -93,9 +91,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
);
|
|
|
|
|
if (history != null) {
|
|
|
|
|
MySelectedHistory mySelectedHistory =
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
|
|
|
|
|
|
|
|
|
|
widget.myHistoryList.add(mySelectedHistory);
|
|
|
|
|
myHistoryList.add(mySelectedHistory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
|
|
|
|
@ -105,9 +103,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
);
|
|
|
|
|
if (history != null) {
|
|
|
|
|
MySelectedHistory mySelectedHistory =
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
|
|
|
|
|
|
|
|
|
|
widget.myHistoryList.add(mySelectedHistory);
|
|
|
|
|
myHistoryList.add(mySelectedHistory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
|
|
|
|
@ -117,9 +115,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
);
|
|
|
|
|
if (history != null) {
|
|
|
|
|
MySelectedHistory mySelectedHistory =
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
|
|
|
|
|
|
|
|
|
|
widget.myHistoryList.add(mySelectedHistory);
|
|
|
|
|
myHistoryList.add(mySelectedHistory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
|
|
|
|
@ -129,9 +127,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
);
|
|
|
|
|
if (history != null) {
|
|
|
|
|
MySelectedHistory mySelectedHistory =
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
|
|
|
|
|
|
|
|
|
|
widget.myHistoryList.add(mySelectedHistory);
|
|
|
|
|
myHistoryList.add(mySelectedHistory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -169,8 +167,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
createdBy: element.createdBy,
|
|
|
|
|
remark: element.remarks,
|
|
|
|
|
isLocal : false,
|
|
|
|
|
selectedAllergySeverity: selectedAllergySeverity);
|
|
|
|
|
if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy);
|
|
|
|
|
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -179,8 +178,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
widget.myAllergiesList.clear();
|
|
|
|
|
widget.myHistoryList.clear();
|
|
|
|
|
myAllergiesList.clear();
|
|
|
|
|
myHistoryList.clear();
|
|
|
|
|
|
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
@ -246,7 +245,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [UpdateHistoryWidget(myHistoryList: widget.myHistoryList)],
|
|
|
|
|
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
|
|
|
|
|
),
|
|
|
|
|
isExpanded: isHistoryExpand,
|
|
|
|
|
),
|
|
|
|
@ -264,7 +263,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
UpdateAllergiesWidget(
|
|
|
|
|
myAllergiesList: widget.myAllergiesList,
|
|
|
|
|
myAllergiesList: myAllergiesList,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
@ -304,10 +303,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
title: TranslationBase.of(context).next,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Colors.red[700],
|
|
|
|
|
loading: model.state == ViewState.BusyLocal,
|
|
|
|
|
// loading: model.state == ViewState.BusyLocal,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
addSubjectiveInfo(
|
|
|
|
|
model: model, myAllergiesList: widget.myAllergiesList, myHistoryList: widget.myHistoryList);
|
|
|
|
|
model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -325,6 +324,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
|
|
|
|
|
addSubjectiveInfo(
|
|
|
|
|
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
|
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
formKey.currentState.validate();
|
|
|
|
|
|
|
|
|
@ -370,6 +370,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
medicationControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
|
Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -380,7 +382,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
|
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
|
widget.myAllergiesList.forEach((allergy) {
|
|
|
|
|
myAllergiesList.forEach((allergy) {
|
|
|
|
|
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null)
|
|
|
|
|
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
|
|
|
|
|
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
|
|
|
|
@ -419,7 +421,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
|
|
|
|
|
postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
|
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
|
|
|
|
|
widget.myHistoryList.forEach((history) {
|
|
|
|
|
myHistoryList.forEach((history) {
|
|
|
|
|
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
|
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|