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

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

@ -149,7 +149,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: getBottomSheet(model)
child: getBottomSheet(model, patient)
),
),
SizedBox(
@ -163,7 +163,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
);
}
Widget getBottomSheet(SOAPViewModel model) {
Widget getBottomSheet(SOAPViewModel model, PatiantInformtion patient) {
switch (_currentIndex) {
case 0:
{
@ -206,7 +206,8 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
),
Expanded(
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,
color: Colors.red[700],
height: SizeConfig.heightMultiplier *

Loading…
Cancel
Save