remove unnecessary step for inpatient

merge-requests/787/head
Elham Rababh 5 years ago
parent 42ecf9a0fb
commit 74a6ebebdc

@ -265,10 +265,16 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false); widget.changeLoadingState(false);
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else {
if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
Navigator.of(context).pop();
} else { } else {
widget.changeLoadingState(true); widget.changeLoadingState(true);
widget.changePageViewIndex(2); widget.changePageViewIndex(2);
} }
}
} else { } else {
Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
} }
@ -310,7 +316,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
element.selectedExamination.id, element.selectedExamination.id,
orElse: () => null)) == orElse: () => null)) ==
null) { null) {
mySelectedExamination.add(element); mySelectedExamination.insert(0,element);
} }
}); });

@ -15,14 +15,28 @@ class StepsWidget extends StatelessWidget {
final double height; final double height;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0, this.patientInfo}); StepsWidget(
{Key key,
this.index,
this.changeCurrentTab,
this.height = 0.0,
this.patientInfo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
double circleHeight = (SizeConfig.isHeightVeryShort ?30:SizeConfig.isHeightShort?38:38); double circleHeight = (SizeConfig.isHeightVeryShort
double circleTop = (SizeConfig.isHeightVeryShort ?12:SizeConfig.isHeightShort?10:10); ? 30
double containerHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?16:15); : SizeConfig.isHeightShort
? 38
: 38);
double circleTop = (SizeConfig.isHeightVeryShort
? 12
: SizeConfig.isHeightShort
? 10
: 10);
double containerHeight =
SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 16 : 15);
return !projectViewModel.isArabic return !projectViewModel.isArabic
? Stack( ? Stack(
@ -33,21 +47,22 @@ class StepsWidget extends StatelessWidget {
color: Colors.transparent, color: Colors.transparent,
), ),
Positioned( Positioned(
top: 30 top: 30,
,
child: Center( child: Center(
child: Container( child: Container(
width: MediaQuery width: MediaQuery.of(context).size.width *
.of(context) (patientInfo.admissionNo == null &&
.size patientInfo.admissionNo.isEmpty
.width * 0.9, ? 0.9
: 0.85),
child: Divider( child: Divider(
color: Colors.grey, color: Colors.grey,
height: 0.75, height: 0.75,
thickness: 0.75, thickness: 0.75,
), ),
), ),
),), ),
),
Positioned( Positioned(
top: circleTop, top: circleTop,
left: 0, left: 0,
@ -84,7 +99,9 @@ class StepsWidget extends StatelessWidget {
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
StepDetailsWidget(stepLabel: "Subjective",), StepDetailsWidget(
stepLabel: "Subjective",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 0, stepId: 0,
@ -97,10 +114,10 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: circleTop, top: circleTop,
left: MediaQuery left: patientInfo.admissionNo == null &&
.of(context) patientInfo.admissionNo.isEmpty
.size ? MediaQuery.of(context).size.width * 0.25
.width * 0.25, : MediaQuery.of(context).size.width * 0.71,
child: InkWell( child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null, onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -136,7 +153,9 @@ class StepsWidget extends StatelessWidget {
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
StepDetailsWidget(stepLabel: "Objective",), StepDetailsWidget(
stepLabel: "Objective",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 1, stepId: 1,
@ -147,12 +166,11 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
), ),
if (patientInfo.admissionNo == null &&
patientInfo.admissionNo.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
left: MediaQuery left: MediaQuery.of(context).size.width * 0.47,
.of(context)
.size
.width * 0.47,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (index >= 3) changeCurrentTab(2); if (index >= 3) changeCurrentTab(2);
@ -190,7 +208,9 @@ class StepsWidget extends StatelessWidget {
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
StepDetailsWidget(stepLabel: "Assessment",), StepDetailsWidget(
stepLabel: "Assessment",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 2, stepId: 2,
@ -201,6 +221,8 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
), ),
if (patientInfo.admissionNo == null &&
patientInfo.admissionNo.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
right: 0, right: 0,
@ -239,7 +261,10 @@ class StepsWidget extends StatelessWidget {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
StepDetailsWidget(stepLabel: "Plan",marginLeft: 30,), StepDetailsWidget(
stepLabel: "Plan",
marginLeft: 30,
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 3, stepId: 3,
@ -260,21 +285,19 @@ class StepsWidget extends StatelessWidget {
color: Colors.transparent, color: Colors.transparent,
), ),
Positioned( Positioned(
top: 30 top: 30,
,
child: Center( child: Center(
child: Container( child: Container(
width: MediaQuery width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null &&
.of(context) patientInfo.admissionNo.isEmpty?0.9:0.85),
.size
.width * 0.9,
child: Divider( child: Divider(
color: Colors.grey, color: Colors.grey,
height: 0.75, height: 0.75,
thickness: 0.75, thickness: 0.75,
), ),
), ),
),), ),
),
Positioned( Positioned(
top: circleTop, top: circleTop,
right: 0, right: 0,
@ -310,7 +333,9 @@ class StepsWidget extends StatelessWidget {
SizedBox(height: 3), SizedBox(height: 3),
Column( Column(
children: [ children: [
StepDetailsWidget(stepLabel: "شخصي",), StepDetailsWidget(
stepLabel: "شخصي",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 0, stepId: 0,
@ -323,10 +348,8 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: circleTop, top: circleTop,
right: MediaQuery right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null &&
.of(context) patientInfo.admissionNo.isEmpty?0.25:0.71),
.size
.width * 0.25,
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -359,7 +382,9 @@ class StepsWidget extends StatelessWidget {
SizedBox(height: 5), SizedBox(height: 5),
Column( Column(
children: [ children: [
StepDetailsWidget(stepLabel: "هدف",), StepDetailsWidget(
stepLabel: "هدف",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 1, stepId: 1,
@ -370,12 +395,11 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
), ),
if (patientInfo.admissionNo == null &&
patientInfo.admissionNo.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
right: MediaQuery right: MediaQuery.of(context).size.width * 0.50,
.of(context)
.size
.width * 0.50,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null, onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column( child: Column(
@ -412,7 +436,9 @@ class StepsWidget extends StatelessWidget {
padding: const EdgeInsets.only(right: 2), padding: const EdgeInsets.only(right: 2),
child: Column( child: Column(
children: [ children: [
StepDetailsWidget(stepLabel: "تقدير",), StepDetailsWidget(
stepLabel: "تقدير",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 2, stepId: 2,
@ -424,6 +450,8 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
), ),
if (patientInfo.admissionNo == null &&
patientInfo.admissionNo.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
left: 0, left: 0,
@ -463,7 +491,9 @@ class StepsWidget extends StatelessWidget {
margin: EdgeInsets.only(right: index == 3 ? 15 : 0), margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: Column( child: Column(
children: [ children: [
StepDetailsWidget(stepLabel: "خطة",), StepDetailsWidget(
stepLabel: "خطة",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 3, stepId: 3,

@ -149,7 +149,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
Container( Container(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: .80, widthFactor: .80,
child: getBottomSheet(model) child: getBottomSheet(model, patient)
), ),
), ),
SizedBox( SizedBox(
@ -163,7 +163,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
); );
} }
Widget getBottomSheet(SOAPViewModel model) { Widget getBottomSheet(SOAPViewModel model, PatiantInformtion patient) {
switch (_currentIndex) { switch (_currentIndex) {
case 0: case 0:
{ {
@ -206,7 +206,8 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
), ),
Expanded( Expanded(
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: patient.admissionNo != null &&
patient.admissionNo.isNotEmpty?TranslationBase.of(context).finish: TranslationBase.of(context).next,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.red[700], color: Colors.red[700],
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier *

Loading…
Cancel
Save