|
|
|
@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.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/soap_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
@ -46,7 +47,8 @@ class UpdateSubjectivePage extends StatefulWidget {
|
|
|
|
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
|
|
|
|
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
|
|
|
implements SubjectiveCallBack {
|
|
|
|
bool isChiefExpand = false;
|
|
|
|
bool isChiefExpand = false;
|
|
|
|
bool isHistoryExpand = false;
|
|
|
|
bool isHistoryExpand = false;
|
|
|
|
bool isAllergiesExpand = false;
|
|
|
|
bool isAllergiesExpand = false;
|
|
|
|
@ -208,7 +210,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
onModelReady: (model) async {
|
|
|
|
onModelReady: (model) async {
|
|
|
|
myAllergiesList.clear();
|
|
|
|
myAllergiesList.clear();
|
|
|
|
myHistoryList.clear();
|
|
|
|
myHistoryList.clear();
|
|
|
|
|
|
|
|
model.setSubjectiveCallBack(this);
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel =
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel =
|
|
|
|
GetChiefComplaintReqModel(
|
|
|
|
GetChiefComplaintReqModel(
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
@ -320,49 +322,6 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
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: AppButton(
|
|
|
|
|
|
|
|
title: TranslationBase.of(context).next,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
height: SizeConfig.heightMultiplier *
|
|
|
|
|
|
|
|
(SizeConfig.isHeightVeryShort ? 8 : 6),
|
|
|
|
|
|
|
|
padding: 10,
|
|
|
|
|
|
|
|
color: Colors.red[700],
|
|
|
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
addSubjectiveInfo(
|
|
|
|
|
|
|
|
model: model,
|
|
|
|
|
|
|
|
myAllergiesList: myAllergiesList,
|
|
|
|
|
|
|
|
myHistoryList: myHistoryList);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 5,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -371,7 +330,6 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
{SOAPViewModel model,
|
|
|
|
{SOAPViewModel model,
|
|
|
|
List<MySelectedAllergy> myAllergiesList,
|
|
|
|
List<MySelectedAllergy> myAllergiesList,
|
|
|
|
List<MySelectedHistory> myHistoryList}) async {
|
|
|
|
List<MySelectedHistory> myHistoryList}) async {
|
|
|
|
|
|
|
|
|
|
|
|
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
|
|
|
|
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
formKey.currentState.save();
|
|
|
|
formKey.currentState.save();
|
|
|
|
@ -380,50 +338,54 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
complaintsControllerError = '';
|
|
|
|
complaintsControllerError = '';
|
|
|
|
medicationControllerError = '';
|
|
|
|
medicationControllerError = '';
|
|
|
|
illnessControllerError = '';
|
|
|
|
illnessControllerError = '';
|
|
|
|
if (complaintsController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
illnessController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
complaintsController.text.length > 25) {
|
|
|
|
|
|
|
|
await postChiefComplaint(model: model);
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (myHistoryList.length != 0) {
|
|
|
|
|
|
|
|
await postHistories(model: model, myHistoryList: myHistoryList);
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (myAllergiesList.length != 0) {
|
|
|
|
|
|
|
|
await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///TODO Elham*
|
|
|
|
|
|
|
|
///
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
} else {
|
|
|
|
// if (complaintsController.text.isNotEmpty &&
|
|
|
|
setState(() {
|
|
|
|
// illnessController.text.isNotEmpty &&
|
|
|
|
if (complaintsController.text.isEmpty) {
|
|
|
|
// complaintsController.text.length > 25) {
|
|
|
|
complaintsControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
// await postChiefComplaint(model: model);
|
|
|
|
} else if (complaintsController.text.length < 25) {
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
complaintsControllerError =
|
|
|
|
// Helpers.showErrorToast(model.error);
|
|
|
|
TranslationBase.of(context).chiefComplaintLength;
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// if (myHistoryList.length != 0) {
|
|
|
|
|
|
|
|
// await postHistories(model: model, myHistoryList: myHistoryList);
|
|
|
|
if (illnessController.text.isEmpty) {
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
illnessControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
// Helpers.showErrorToast(model.error);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
if (medicationController.text.isEmpty) {
|
|
|
|
// if (myAllergiesList.length != 0) {
|
|
|
|
medicationControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
}
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
});
|
|
|
|
// Helpers.showErrorToast(model.error);
|
|
|
|
|
|
|
|
// }
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
// }
|
|
|
|
Helpers.showErrorToast(
|
|
|
|
// widget.changeLoadingState(true);
|
|
|
|
TranslationBase.of(context).chiefComplaintErrorMsg);
|
|
|
|
//
|
|
|
|
}
|
|
|
|
// widget.changePageViewIndex(1);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// if (complaintsController.text.isEmpty) {
|
|
|
|
|
|
|
|
// complaintsControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
|
|
|
// } else if (complaintsController.text.length < 25) {
|
|
|
|
|
|
|
|
// complaintsControllerError =
|
|
|
|
|
|
|
|
// TranslationBase.of(context).chiefComplaintLength;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (illnessController.text.isEmpty) {
|
|
|
|
|
|
|
|
// illnessControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (medicationController.text.isEmpty) {
|
|
|
|
|
|
|
|
// medicationControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// widget.changeLoadingState(false);
|
|
|
|
|
|
|
|
// Helpers.showErrorToast(
|
|
|
|
|
|
|
|
// TranslationBase.of(context).chiefComplaintErrorMsg);
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
postAllergy(
|
|
|
|
postAllergy(
|
|
|
|
@ -528,4 +490,12 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
Function nextFunction(model) {
|
|
|
|
|
|
|
|
addSubjectiveInfo(
|
|
|
|
|
|
|
|
model: model,
|
|
|
|
|
|
|
|
myAllergiesList: myAllergiesList,
|
|
|
|
|
|
|
|
myHistoryList: myHistoryList);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|