Merge branch 'episode_fixes_dev' into 'episode_fixes_dev_merge'

fix issues related to add progress exam

See merge request Cloud_Solution/doctor_app_flutter!786
merge-requests/788/head
Elham Ali 5 years ago
commit d362793fb4

@ -92,6 +92,7 @@ class SOAPViewModel extends BaseViewModel {
int get episodeID => _SOAPService.episodeID;
bool isAddProgress = true;
bool isAddExamInProgress = true;
String progressNoteText ="";
String complaintsControllerError = '';
String medicationControllerError = '';

@ -68,7 +68,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
onModelReady: (model) async {
model.setObjectiveCallBack(this);
mySelectedExamination.clear();
model.isAddExamInProgress = true;
await model.getPatientPhysicalExam(widget.patientInfo);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
@ -208,6 +208,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) {
if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
Navigator.of(context).pop();
}else{
widget.changeLoadingState(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -267,16 +271,25 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false);
Helpers.showErrorToast(model.error);
if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
// Navigator.of(context).pop();
model.isAddExamInProgress = false;
}
} else {
if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
Navigator.of(context).pop();
// Navigator.of(context).pop();
widget.changeLoadingState(false);
model.isAddExamInProgress = false;
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
}
}
} else {
Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
}

@ -207,7 +207,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
Expanded(
child: AppButton(
title: patient.admissionNo != null &&
patient.admissionNo.isNotEmpty?TranslationBase.of(context).finish: TranslationBase.of(context).next,
patient.admissionNo.isNotEmpty && !model.isAddExamInProgress?TranslationBase.of(context).finish: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
height: SizeConfig.heightMultiplier *

Loading…
Cancel
Save