@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/utils/date-utils.dart';
import ' package:doctor_app_flutter/utils/dr_app_toast_msg.dart ' ;
import ' package:doctor_app_flutter/utils/translations_delegate_base_utils.dart ' ;
import ' package:doctor_app_flutter/utils/utils.dart ' ;
import ' package:doctor_app_flutter/widgets/bottom_sheet/two_bottom_sheet_dialog_buttons.dart ' ;
import ' package:doctor_app_flutter/widgets/patients/patient_service_title.dart ' ;
import ' package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart ' ;
import ' package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart ' ;
@ -456,6 +457,9 @@ class _AdmissionRequestSecondScreenState
}
} ,
) ,
SizedBox (
height: 100 ,
) ,
] ,
) ,
) ,
@ -463,184 +467,187 @@ class _AdmissionRequestSecondScreenState
) ,
) ,
) ,
] ,
) ,
) ,
bottomSheet: TwoBottomSheetDialogButtons (
widget: Row (
children: [
Container (
margin: EdgeInsets . symmetric ( horizontal: 16 , vertical: 8 ) ,
child: Row (
children: [
Expanded (
child: AppButton (
title: TranslationBase . of ( context ) . previous ,
color: Color ( 0xffEAEAEA ) ,
fontColor: Colors . black ,
onPressed: ( ) {
Navigator . pop ( context ) ;
} ,
) ,
) ,
SizedBox (
width: 10 ,
) ,
Expanded (
child: AppButton (
title: TranslationBase . of ( context ) . next ,
color: HexColor ( " #D02127 " ) ,
onPressed: ( ) async {
await locator < AnalyticsService > ( ) . logEvent (
eventCategory: " Admission Request Second Screen " ,
eventAction: " Go To Admission Request Three " ,
) ;
if ( _estimatedCostController . text ! = " " & &
_postPlansEstimatedCostController . text ! = " " & &
_expectedDaysController . text ! = " " & &
_expectedAdmissionDate ! = null & &
_otherDepartmentsInterventionsController . text ! =
" " & &
_selectedFloor ! = null & &
_selectedRoomCategory ! =
null /*_selectedWard is not required*/ & &
_treatmentLineController . text ! = " " & &
_complicationsController . text ! = " " & &
_otherProceduresController . text ! = " " & &
_selectedAdmissionType ! = null ) {
model . admissionRequestData = admissionRequest ;
width: MediaQuery . of ( context ) . size . width * 0.4 ,
child: AppButton (
title: TranslationBase . of ( context ) . previous ,
color: HexColor ( ' #EFEFEF ' ) ,
fontColor: Colors . black ,
onPressed: ( ) {
Navigator . pop ( context ) ;
} ,
) ,
) ,
SizedBox (
width: 10 ,
) ,
Container (
width: MediaQuery . of ( context ) . size . width * 0.4 ,
child: AppButton (
title: TranslationBase . of ( context ) . next ,
color: AppGlobal . appRedColor ,
fontColor: Colors . white ,
onPressed: ( ) async {
await locator < AnalyticsService > ( ) . logEvent (
eventCategory: " Admission Request Second Screen " ,
eventAction: " Go To Admission Request Three " ,
) ;
if ( _estimatedCostController . text ! = " " & &
_postPlansEstimatedCostController . text ! = " " & &
_expectedDaysController . text ! = " " & &
_expectedAdmissionDate ! = null & &
_otherDepartmentsInterventionsController . text ! =
" " & &
_selectedFloor ! = null & &
_selectedRoomCategory ! =
null /*_selectedWard is not required*/ & &
_treatmentLineController . text ! = " " & &
_complicationsController . text ! = " " & &
_otherProceduresController . text ! = " " & &
_selectedAdmissionType ! = null ) {
model . admissionRequestData = admissionRequest ;
model . admissionRequestData . estimatedCost =
int . parse ( _estimatedCostController . text ) ;
model . admissionRequestData
. elementsForImprovement =
_postPlansEstimatedCostController . text ;
model . admissionRequestData . estimatedCost =
int . parse ( _estimatedCostController . text ) ;
model . admissionRequestData
. elementsForImprovement =
_postPlansEstimatedCostController . text ;
model . admissionRequestData . expectedDays =
int . parse ( _expectedDaysController . text ) ;
model . admissionRequestData . admissionDate =
_expectedAdmissionDate . toIso8601String ( ) ;
model . admissionRequestData
. otherDepartmentInterventions =
_otherDepartmentsInterventionsController . text ;
model . admissionRequestData . admissionLocationID =
_selectedFloor [ ' floorID ' ] ;
model . admissionRequestData . wardID =
_selectedWard ! = null
? _selectedWard [ ' nursingStationID ' ]
: 0 ;
model . admissionRequestData . roomCategoryID =
_selectedRoomCategory [ ' categoryID ' ] ;
model . admissionRequestData . expectedDays =
int . parse ( _expectedDaysController . text ) ;
model . admissionRequestData . admissionDate =
_expectedAdmissionDate . toIso8601String ( ) ;
model . admissionRequestData
. otherDepartmentInterventions =
_otherDepartmentsInterventionsController . text ;
model . admissionRequestData . admissionLocationID =
_selectedFloor [ ' floorID ' ] ;
model . admissionRequestData . wardID =
_selectedWard ! = null
? _selectedWard [ ' nursingStationID ' ]
: 0 ;
model . admissionRequestData . roomCategoryID =
_selectedRoomCategory [ ' categoryID ' ] ;
model . admissionRequestData
. admissionRequestProcedures = [ ] ;
model . admissionRequestData
. admissionRequestProcedures = [ ] ;
model . admissionRequestData . mainLineOfTreatment =
_treatmentLineController . text ;
model . admissionRequestData . complications =
_complicationsController . text ;
model . admissionRequestData . otherProcedures =
_otherProceduresController . text ;
model . admissionRequestData . admissionType =
_selectedAdmissionType [ ' id ' ] ;
model . admissionRequestData . mainLineOfTreatment =
_treatmentLineController . text ;
model . admissionRequestData . complications =
_complicationsController . text ;
model . admissionRequestData . otherProcedures =
_otherProceduresController . text ;
model . admissionRequestData . admissionType =
_selectedAdmissionType [ ' id ' ] ;
Navigator . of ( context ) . pushNamed (
PATIENT_ADMISSION_REQUEST_3 ,
arguments: {
' patient ' : patient ,
' patientType ' : patientType ,
' arrivalType ' : arrivalType ,
' admission-data ' : model . admissionRequestData
} ) ;
} else {
DrAppToastMsg . showErrorToast (
TranslationBase . of ( context ) . pleaseFill ) ;
Navigator . of ( context ) . pushNamed (
PATIENT_ADMISSION_REQUEST_3 ,
arguments: {
' patient ' : patient ,
' patientType ' : patientType ,
' arrivalType ' : arrivalType ,
' admission-data ' : model . admissionRequestData
} ) ;
} else {
DrAppToastMsg . showErrorToast (
TranslationBase . of ( context ) . pleaseFill ) ;
setState ( ( ) {
if ( _estimatedCostController . text = = " " ) {
costError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
costError = null ;
}
setState ( ( ) {
if ( _estimatedCostController . text = = " " ) {
costError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
costError = null ;
}
if ( _postPlansEstimatedCostController . text = =
" " ) {
plansError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
plansError = null ;
}
if ( _postPlansEstimatedCostController . text = =
" " ) {
plansError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
plansError = null ;
}
if ( _expectedDaysController . text = = " " ) {
expectedDaysError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
expectedDaysError = null ;
}
if ( _expectedDaysController . text = = " " ) {
expectedDaysError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
expectedDaysError = null ;
}
if ( _expectedAdmissionDate = = null ) {
expectedDatesError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
expectedDatesError = null ;
}
if ( _expectedAdmissionDate = = null ) {
expectedDatesError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
expectedDatesError = null ;
}
if ( _otherDepartmentsInterventionsController
. text = =
" " ) {
otherInterventionsError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
otherInterventionsError = null ;
}
if ( _otherDepartmentsInterventionsController
. text = =
" " ) {
otherInterventionsError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
otherInterventionsError = null ;
}
if ( _selectedFloor = = null ) {
floorError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
floorError = null ;
}
if ( _selectedFloor = = null ) {
floorError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
floorError = null ;
}
if ( _selectedRoomCategory = = null ) {
roomError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
roomError = null ;
}
if ( _selectedRoomCategory = = null ) {
roomError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
roomError = null ;
}
if ( _treatmentLineController . text = = " " ) {
treatmentsError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
treatmentsError = null ;
}
if ( _treatmentLineController . text = = " " ) {
treatmentsError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
treatmentsError = null ;
}
if ( _complicationsController . text = = " " ) {
complicationsError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
complicationsError = null ;
}
if ( _complicationsController . text = = " " ) {
complicationsError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
complicationsError = null ;
}
if ( _otherProceduresController . text = = " " ) {
proceduresError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
proceduresError = null ;
}
if ( _otherProceduresController . text = = " " ) {
proceduresError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
proceduresError = null ;
}
if ( _selectedAdmissionType = = null ) {
admissionTypeError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
admissionTypeError = null ;
}
} ) ;
}
} ,
) ,
) ,
] ,
if ( _selectedAdmissionType = = null ) {
admissionTypeError =
TranslationBase . of ( context ) . fieldRequired ;
} else {
admissionTypeError = null ;
}
} ) ;
}
} ,
) ,
) ,
] ,
) ,
) ) ,
)
) ,
) ,
) ;
}