|
|
|
|
@ -12,6 +12,9 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
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/bottom_sheet_container.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';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
@ -92,25 +95,15 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(16.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"${TranslationBase.of(context).admission}",
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.6,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).request,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 3,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
ServiceTitle(
|
|
|
|
|
title: "${TranslationBase.of(context).admission}",
|
|
|
|
|
subTitle: TranslationBase.of(context).request,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
@ -119,8 +112,8 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.postPlansEstimatedCost,
|
|
|
|
|
Utils.convertToTitleCase(TranslationBase.of(context)
|
|
|
|
|
.postPlansEstimatedCost,),
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.8,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
@ -464,6 +457,9 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 100,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -471,184 +467,187 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: BottomSheetContainer(
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|