Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into sultan
commit
f0539860c2
@ -0,0 +1,200 @@
|
|||||||
|
class AdmissionRequest {
|
||||||
|
int patientMRN;
|
||||||
|
int admitToClinic;
|
||||||
|
bool isPregnant;
|
||||||
|
int pregnancyWeeks;
|
||||||
|
int pregnancyType;
|
||||||
|
int noOfBabies;
|
||||||
|
int mrpDoctorID;
|
||||||
|
String admissionDate;
|
||||||
|
int expectedDays;
|
||||||
|
int admissionType;
|
||||||
|
int admissionLocationID;
|
||||||
|
int roomCategoryID;
|
||||||
|
int wardID;
|
||||||
|
bool isSickLeaveRequired;
|
||||||
|
String sickLeaveComments;
|
||||||
|
bool isTransport;
|
||||||
|
String transportComments;
|
||||||
|
bool isPhysioAppointmentNeeded;
|
||||||
|
String physioAppointmentComments;
|
||||||
|
bool isOPDFollowupAppointmentNeeded;
|
||||||
|
String opdFollowUpComments;
|
||||||
|
bool isDietType;
|
||||||
|
int dietType;
|
||||||
|
String dietRemarks;
|
||||||
|
bool isPhysicalActivityModification;
|
||||||
|
String physicalActivityModificationComments;
|
||||||
|
int orStatus;
|
||||||
|
String mainLineOfTreatment;
|
||||||
|
int estimatedCost;
|
||||||
|
String elementsForImprovement;
|
||||||
|
bool isPackagePatient;
|
||||||
|
String complications;
|
||||||
|
String otherDepartmentInterventions;
|
||||||
|
String otherProcedures;
|
||||||
|
String pastMedicalHistory;
|
||||||
|
String pastSurgicalHistory;
|
||||||
|
List<dynamic> admissionRequestDiagnoses;
|
||||||
|
List<dynamic> admissionRequestProcedures;
|
||||||
|
int appointmentNo;
|
||||||
|
int episodeID;
|
||||||
|
int admissionRequestNo;
|
||||||
|
|
||||||
|
AdmissionRequest(
|
||||||
|
{this.patientMRN,
|
||||||
|
this.admitToClinic,
|
||||||
|
this.isPregnant,
|
||||||
|
this.pregnancyWeeks = 0,
|
||||||
|
this.pregnancyType = 0,
|
||||||
|
this.noOfBabies = 0,
|
||||||
|
this.mrpDoctorID,
|
||||||
|
this.admissionDate,
|
||||||
|
this.expectedDays,
|
||||||
|
this.admissionType,
|
||||||
|
this.admissionLocationID = 0,
|
||||||
|
this.roomCategoryID = 0,
|
||||||
|
this.wardID,
|
||||||
|
this.isSickLeaveRequired,
|
||||||
|
this.sickLeaveComments = "",
|
||||||
|
this.isTransport = false,
|
||||||
|
this.transportComments = "",
|
||||||
|
this.isPhysioAppointmentNeeded = false,
|
||||||
|
this.physioAppointmentComments = "",
|
||||||
|
this.isOPDFollowupAppointmentNeeded = false,
|
||||||
|
this.opdFollowUpComments = "",
|
||||||
|
this.isDietType,
|
||||||
|
this.dietType,
|
||||||
|
this.dietRemarks,
|
||||||
|
this.isPhysicalActivityModification = false,
|
||||||
|
this.physicalActivityModificationComments = "",
|
||||||
|
this.orStatus = 1,
|
||||||
|
this.mainLineOfTreatment,
|
||||||
|
this.estimatedCost,
|
||||||
|
this.elementsForImprovement,
|
||||||
|
this.isPackagePatient = false,
|
||||||
|
this.complications = "",
|
||||||
|
this.otherDepartmentInterventions = "",
|
||||||
|
this.otherProcedures = "",
|
||||||
|
this.pastMedicalHistory = "",
|
||||||
|
this.pastSurgicalHistory = "",
|
||||||
|
this.admissionRequestDiagnoses,
|
||||||
|
this.admissionRequestProcedures,
|
||||||
|
this.appointmentNo,
|
||||||
|
this.episodeID,
|
||||||
|
this.admissionRequestNo});
|
||||||
|
|
||||||
|
AdmissionRequest.fromJson(Map<String, dynamic> json) {
|
||||||
|
patientMRN = json['patientMRN'];
|
||||||
|
admitToClinic = json['admitToClinic'];
|
||||||
|
isPregnant = json['isPregnant'];
|
||||||
|
pregnancyWeeks = json['pregnancyWeeks'];
|
||||||
|
pregnancyType = json['pregnancyType'];
|
||||||
|
noOfBabies = json['noOfBabies'];
|
||||||
|
mrpDoctorID = json['mrpDoctorID'];
|
||||||
|
admissionDate = json['admissionDate'];
|
||||||
|
expectedDays = json['expectedDays'];
|
||||||
|
admissionType = json['admissionType'];
|
||||||
|
admissionLocationID = json['admissionLocationID'];
|
||||||
|
roomCategoryID = json['roomCategoryID'];
|
||||||
|
wardID = json['wardID'];
|
||||||
|
isSickLeaveRequired = json['isSickLeaveRequired'];
|
||||||
|
sickLeaveComments = json['sickLeaveComments'];
|
||||||
|
isTransport = json['isTransport'];
|
||||||
|
transportComments = json['transportComments'];
|
||||||
|
isPhysioAppointmentNeeded = json['isPhysioAppointmentNeeded'];
|
||||||
|
physioAppointmentComments = json['physioAppointmentComments'];
|
||||||
|
isOPDFollowupAppointmentNeeded = json['isOPDFollowupAppointmentNeeded'];
|
||||||
|
opdFollowUpComments = json['opdFollowUpComments'];
|
||||||
|
isDietType = json['isDietType'];
|
||||||
|
dietType = json['dietType'];
|
||||||
|
dietRemarks = json['dietRemarks'];
|
||||||
|
isPhysicalActivityModification = json['isPhysicalActivityModification'];
|
||||||
|
physicalActivityModificationComments =
|
||||||
|
json['physicalActivityModificationComments'];
|
||||||
|
orStatus = json['orStatus'];
|
||||||
|
mainLineOfTreatment = json['mainLineOfTreatment'];
|
||||||
|
estimatedCost = json['estimatedCost'];
|
||||||
|
elementsForImprovement = json['elementsForImprovement'];
|
||||||
|
isPackagePatient = json['isPackagePatient'];
|
||||||
|
complications = json['complications'];
|
||||||
|
otherDepartmentInterventions = json['otherDepartmentInterventions'];
|
||||||
|
otherProcedures = json['otherProcedures'];
|
||||||
|
pastMedicalHistory = json['pastMedicalHistory'];
|
||||||
|
pastSurgicalHistory = json['pastSurgicalHistory'];
|
||||||
|
if (json['admissionRequestDiagnoses'] != null) {
|
||||||
|
admissionRequestDiagnoses = new List<dynamic>();
|
||||||
|
json['admissionRequestDiagnoses'].forEach((v) {
|
||||||
|
admissionRequestDiagnoses.add(v);
|
||||||
|
// admissionRequestDiagnoses
|
||||||
|
// .add(new AdmissionRequestDiagnoses.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (json['admissionRequestProcedures'] != null) {
|
||||||
|
admissionRequestProcedures = new List<dynamic>();
|
||||||
|
json['admissionRequestProcedures'].forEach((v) {
|
||||||
|
admissionRequestProcedures.add(v);
|
||||||
|
// admissionRequestProcedures
|
||||||
|
// .add(new AdmissionRequestProcedures.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
appointmentNo = json['appointmentNo'];
|
||||||
|
episodeID = json['episodeID'];
|
||||||
|
admissionRequestNo = json['admissionRequestNo'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['patientMRN'] = this.patientMRN;
|
||||||
|
data['admitToClinic'] = this.admitToClinic;
|
||||||
|
data['isPregnant'] = this.isPregnant;
|
||||||
|
data['pregnancyWeeks'] = this.pregnancyWeeks;
|
||||||
|
data['pregnancyType'] = this.pregnancyType;
|
||||||
|
data['noOfBabies'] = this.noOfBabies;
|
||||||
|
data['mrpDoctorID'] = this.mrpDoctorID;
|
||||||
|
data['admissionDate'] = this.admissionDate;
|
||||||
|
data['expectedDays'] = this.expectedDays;
|
||||||
|
data['admissionType'] = this.admissionType;
|
||||||
|
data['admissionLocationID'] = this.admissionLocationID;
|
||||||
|
data['roomCategoryID'] = this.roomCategoryID;
|
||||||
|
data['wardID'] = this.wardID;
|
||||||
|
data['isSickLeaveRequired'] = this.isSickLeaveRequired;
|
||||||
|
data['sickLeaveComments'] = this.sickLeaveComments;
|
||||||
|
data['isTransport'] = this.isTransport;
|
||||||
|
data['transportComments'] = this.transportComments;
|
||||||
|
data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded;
|
||||||
|
data['physioAppointmentComments'] = this.physioAppointmentComments;
|
||||||
|
data['isOPDFollowupAppointmentNeeded'] =
|
||||||
|
this.isOPDFollowupAppointmentNeeded;
|
||||||
|
data['opdFollowUpComments'] = this.opdFollowUpComments;
|
||||||
|
data['isDietType'] = this.isDietType;
|
||||||
|
data['dietType'] = this.dietType;
|
||||||
|
data['dietRemarks'] = this.dietRemarks;
|
||||||
|
data['isPhysicalActivityModification'] =
|
||||||
|
this.isPhysicalActivityModification;
|
||||||
|
data['physicalActivityModificationComments'] =
|
||||||
|
this.physicalActivityModificationComments;
|
||||||
|
data['orStatus'] = this.orStatus;
|
||||||
|
data['mainLineOfTreatment'] = this.mainLineOfTreatment;
|
||||||
|
data['estimatedCost'] = this.estimatedCost;
|
||||||
|
data['elementsForImprovement'] = this.elementsForImprovement;
|
||||||
|
data['isPackagePatient'] = this.isPackagePatient;
|
||||||
|
data['complications'] = this.complications;
|
||||||
|
data['otherDepartmentInterventions'] = this.otherDepartmentInterventions;
|
||||||
|
data['otherProcedures'] = this.otherProcedures;
|
||||||
|
data['pastMedicalHistory'] = this.pastMedicalHistory;
|
||||||
|
data['pastSurgicalHistory'] = this.pastSurgicalHistory;
|
||||||
|
if (this.admissionRequestDiagnoses != null) {
|
||||||
|
data['admissionRequestDiagnoses'] = this.admissionRequestDiagnoses;
|
||||||
|
// this.admissionRequestDiagnoses.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
if (this.admissionRequestProcedures != null) {
|
||||||
|
data['admissionRequestProcedures'] =
|
||||||
|
this.admissionRequestProcedures.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['appointmentNo'] = this.appointmentNo;
|
||||||
|
data['episodeID'] = this.episodeID;
|
||||||
|
data['admissionRequestNo'] = this.admissionRequestNo;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
class Clinic {
|
||||||
|
int clinicGroupID;
|
||||||
|
String clinicGroupName;
|
||||||
|
int clinicID;
|
||||||
|
String clinicNameArabic;
|
||||||
|
String clinicNameEnglish;
|
||||||
|
|
||||||
|
Clinic(
|
||||||
|
{this.clinicGroupID,
|
||||||
|
this.clinicGroupName,
|
||||||
|
this.clinicID,
|
||||||
|
this.clinicNameArabic,
|
||||||
|
this.clinicNameEnglish});
|
||||||
|
|
||||||
|
Clinic.fromJson(Map<String, dynamic> json) {
|
||||||
|
clinicGroupID = json['clinicGroupID'];
|
||||||
|
clinicGroupName = json['clinicGroupName'];
|
||||||
|
clinicID = json['clinicID'];
|
||||||
|
clinicNameArabic = json['clinicNameArabic'];
|
||||||
|
clinicNameEnglish = json['clinicNameEnglish'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['clinicGroupID'] = this.clinicGroupID;
|
||||||
|
data['clinicGroupName'] = this.clinicGroupName;
|
||||||
|
data['clinicID'] = this.clinicID;
|
||||||
|
data['clinicNameArabic'] = this.clinicNameArabic;
|
||||||
|
data['clinicNameEnglish'] = this.clinicNameEnglish;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,487 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import '../../../../routes.dart';
|
||||||
|
|
||||||
|
class AdmissionRequestFirstScreen extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_AdmissionRequestThirdScreenState createState() =>
|
||||||
|
_AdmissionRequestThirdScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AdmissionRequestThirdScreenState
|
||||||
|
extends State<AdmissionRequestFirstScreen> {
|
||||||
|
final _dietTypeRemarksController = TextEditingController();
|
||||||
|
final _sickLeaveCommentsController = TextEditingController();
|
||||||
|
final _postMedicalHistoryController = TextEditingController();
|
||||||
|
final _postSurgicalHistoryController = TextEditingController();
|
||||||
|
|
||||||
|
dynamic _selectedClinic;
|
||||||
|
dynamic _selectedDoctor;
|
||||||
|
dynamic _selectedDietType;
|
||||||
|
|
||||||
|
bool _isSickLeaveRequired = false;
|
||||||
|
bool _patientPregnant = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||||
|
PatiantInformtion patient = routeArgs['patient'];
|
||||||
|
final screenSize = MediaQuery.of(context).size;
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
|
||||||
|
return BaseView<AdmissionRequestViewModel>(
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
appBarTitle: TranslationBase.of(context).admissionRequest,
|
||||||
|
body: GestureDetector(
|
||||||
|
onTap: (){
|
||||||
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
||||||
|
if (!currentFocus.hasPrimaryFocus) {
|
||||||
|
currentFocus.unfocus();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
PatientPageHeaderWidget(patient),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
vertical: 16, horizontal: 16),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 16,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.specialityAndDoctorDetail,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: screenSize.height * 0.070,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: model.clinicList != null &&
|
||||||
|
model.clinicList.length > 0
|
||||||
|
? () {
|
||||||
|
openListDialogField(
|
||||||
|
'clinicGroupName',
|
||||||
|
'clinicID',
|
||||||
|
model.clinicList,
|
||||||
|
(selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedClinic = selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
: () async {
|
||||||
|
GifLoaderDialogUtils.showMyDialog(
|
||||||
|
context);
|
||||||
|
await model.getClinics().then((_) =>
|
||||||
|
GifLoaderDialogUtils.hideDialog(
|
||||||
|
context));
|
||||||
|
if (model.state == ViewState.Idle &&
|
||||||
|
model.clinicList.length > 0) {
|
||||||
|
openListDialogField(
|
||||||
|
'clinicGroupName',
|
||||||
|
'clinicID',
|
||||||
|
model.clinicList,
|
||||||
|
(selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedClinic =
|
||||||
|
selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else if (model.state ==
|
||||||
|
ViewState.ErrorLocal) {
|
||||||
|
DrAppToastMsg.showErrorToast(
|
||||||
|
model.error);
|
||||||
|
} else {
|
||||||
|
DrAppToastMsg.showErrorToast(
|
||||||
|
"Empty List");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: TextField(
|
||||||
|
decoration:
|
||||||
|
Helpers.textFieldSelectorDecoration(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.clinic,
|
||||||
|
_selectedClinic != null
|
||||||
|
? _selectedClinic[
|
||||||
|
'clinicGroupName']
|
||||||
|
: null,
|
||||||
|
true),
|
||||||
|
enabled: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: screenSize.height * 0.070,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: _selectedClinic != null
|
||||||
|
? model.doctorsList != null &&
|
||||||
|
model.doctorsList.length > 0
|
||||||
|
? () {
|
||||||
|
openListDialogField(
|
||||||
|
'DoctorName',
|
||||||
|
'DoctorID',
|
||||||
|
model.doctorsList,
|
||||||
|
(selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedDoctor =
|
||||||
|
selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
: () async {
|
||||||
|
GifLoaderDialogUtils
|
||||||
|
.showMyDialog(context);
|
||||||
|
await model
|
||||||
|
.getClinicDoctors(
|
||||||
|
_selectedClinic[
|
||||||
|
'clinicID'])
|
||||||
|
.then((_) =>
|
||||||
|
GifLoaderDialogUtils
|
||||||
|
.hideDialog(
|
||||||
|
context));
|
||||||
|
if (model.state ==
|
||||||
|
ViewState.Idle &&
|
||||||
|
model.doctorsList.length >
|
||||||
|
0) {
|
||||||
|
openListDialogField(
|
||||||
|
'DoctorName',
|
||||||
|
'DoctorID',
|
||||||
|
model.doctorsList,
|
||||||
|
(selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedDoctor =
|
||||||
|
selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else if (model.state ==
|
||||||
|
ViewState.ErrorLocal) {
|
||||||
|
DrAppToastMsg.showErrorToast(
|
||||||
|
model.error);
|
||||||
|
} else {
|
||||||
|
DrAppToastMsg.showErrorToast(
|
||||||
|
"Empty List");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
child: TextField(
|
||||||
|
decoration:
|
||||||
|
Helpers.textFieldSelectorDecoration(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.doctor,
|
||||||
|
_selectedDoctor != null
|
||||||
|
? _selectedDoctor[
|
||||||
|
'DoctorName']
|
||||||
|
: null,
|
||||||
|
true),
|
||||||
|
enabled: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 16,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context).patientDetails,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
CheckboxListTile(
|
||||||
|
title: AppText(
|
||||||
|
TranslationBase.of(context).patientPregnant,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 2.1,
|
||||||
|
),
|
||||||
|
value: _patientPregnant,
|
||||||
|
onChanged: (newValue) {
|
||||||
|
setState(() {
|
||||||
|
_patientPregnant = newValue;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
controlAffinity:
|
||||||
|
ListTileControlAffinity.leading,
|
||||||
|
contentPadding: EdgeInsets.all(0),
|
||||||
|
),
|
||||||
|
CheckboxListTile(
|
||||||
|
title: AppText(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.isSickLeaveRequired,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 2.1,
|
||||||
|
),
|
||||||
|
value: _isSickLeaveRequired,
|
||||||
|
onChanged: (newValue) {
|
||||||
|
setState(() {
|
||||||
|
_isSickLeaveRequired = newValue;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
controlAffinity:
|
||||||
|
ListTileControlAffinity.leading,
|
||||||
|
contentPadding: EdgeInsets.all(0),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: TextField(
|
||||||
|
decoration:
|
||||||
|
Helpers.textFieldSelectorDecoration(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.sickLeaveComments,
|
||||||
|
null,
|
||||||
|
false),
|
||||||
|
enabled: true,
|
||||||
|
controller: _sickLeaveCommentsController,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
minLines: 2,
|
||||||
|
maxLines: 4,
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: screenSize.height * 0.070,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: model.dietTypesList != null &&
|
||||||
|
model.dietTypesList.length > 0
|
||||||
|
? () {
|
||||||
|
openListDialogField('nameEn', 'id',
|
||||||
|
model.dietTypesList,
|
||||||
|
(selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedDietType =
|
||||||
|
selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
: () async {
|
||||||
|
GifLoaderDialogUtils.showMyDialog(
|
||||||
|
context);
|
||||||
|
await model.getDietTypes().then(
|
||||||
|
(_) => GifLoaderDialogUtils
|
||||||
|
.hideDialog(context));
|
||||||
|
if (model.state == ViewState.Idle &&
|
||||||
|
model.dietTypesList.length >
|
||||||
|
0) {
|
||||||
|
openListDialogField('nameEn',
|
||||||
|
'id', model.dietTypesList,
|
||||||
|
(selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedDietType =
|
||||||
|
selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else if (model.state ==
|
||||||
|
ViewState.ErrorLocal) {
|
||||||
|
DrAppToastMsg.showErrorToast(
|
||||||
|
model.error);
|
||||||
|
} else {
|
||||||
|
DrAppToastMsg.showErrorToast(
|
||||||
|
"Empty List");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: TextField(
|
||||||
|
decoration:
|
||||||
|
Helpers.textFieldSelectorDecoration(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.dietType,
|
||||||
|
_selectedDietType != null
|
||||||
|
? _selectedDietType['nameEn']
|
||||||
|
: null,
|
||||||
|
true),
|
||||||
|
enabled: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: TextField(
|
||||||
|
decoration:
|
||||||
|
Helpers.textFieldSelectorDecoration(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.dietTypeRemarks,
|
||||||
|
null,
|
||||||
|
false),
|
||||||
|
enabled: true,
|
||||||
|
controller: _dietTypeRemarksController,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
minLines: 4,
|
||||||
|
maxLines: 6,
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: TextField(
|
||||||
|
decoration:
|
||||||
|
Helpers.textFieldSelectorDecoration(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.pastMedicalHistory,
|
||||||
|
null,
|
||||||
|
false),
|
||||||
|
enabled: true,
|
||||||
|
controller: _postMedicalHistoryController,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
minLines: 2,
|
||||||
|
maxLines: 4,
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: TextField(
|
||||||
|
decoration:
|
||||||
|
Helpers.textFieldSelectorDecoration(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.pastSurgicalHistory,
|
||||||
|
null,
|
||||||
|
false),
|
||||||
|
enabled: true,
|
||||||
|
controller: _postSurgicalHistoryController,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
minLines: 2,
|
||||||
|
maxLines: 4,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).next,
|
||||||
|
color: HexColor("#B8382B"),
|
||||||
|
onPressed: () {
|
||||||
|
model.admissionRequestData = AdmissionRequest();
|
||||||
|
if (_selectedClinic != null &&
|
||||||
|
_selectedDoctor != null &&
|
||||||
|
_sickLeaveCommentsController.text != "" &&
|
||||||
|
_postMedicalHistoryController.text != "" &&
|
||||||
|
_postSurgicalHistoryController.text != "") {
|
||||||
|
model.admissionRequestData.patientMRN =
|
||||||
|
patient.patientMRN;
|
||||||
|
model.admissionRequestData.appointmentNo =
|
||||||
|
patient.appointmentNo;
|
||||||
|
model.admissionRequestData.episodeID =
|
||||||
|
patient.episodeNo;
|
||||||
|
model.admissionRequestData.admissionRequestNo = 0;
|
||||||
|
|
||||||
|
model.admissionRequestData.admitToClinic =
|
||||||
|
_selectedClinic['clinicID'];
|
||||||
|
model.admissionRequestData.mrpDoctorID =
|
||||||
|
_selectedDoctor['DoctorID'];
|
||||||
|
|
||||||
|
model.admissionRequestData.isPregnant =
|
||||||
|
_patientPregnant;
|
||||||
|
model.admissionRequestData.isSickLeaveRequired =
|
||||||
|
_isSickLeaveRequired;
|
||||||
|
model.admissionRequestData.sickLeaveComments =
|
||||||
|
_sickLeaveCommentsController.text;
|
||||||
|
model.admissionRequestData.isDietType =
|
||||||
|
_selectedDietType != null ? true : false;
|
||||||
|
model.admissionRequestData.dietType =
|
||||||
|
_selectedDietType != null
|
||||||
|
? _selectedDietType['id']
|
||||||
|
: 0;
|
||||||
|
model.admissionRequestData.dietRemarks =
|
||||||
|
_dietTypeRemarksController.text;
|
||||||
|
model.admissionRequestData.pastMedicalHistory =
|
||||||
|
_postMedicalHistoryController.text;
|
||||||
|
model.admissionRequestData.pastSurgicalHistory =
|
||||||
|
_postSurgicalHistoryController.text;
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
PATIENT_ADMISSION_REQUEST_2,
|
||||||
|
arguments: {
|
||||||
|
'patient': patient,
|
||||||
|
'admission-data': model.admissionRequestData
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
DrAppToastMsg.showErrorToast(
|
||||||
|
TranslationBase.of(context).pleaseFill);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future _selectDate(BuildContext context, DateTime dateTime,
|
||||||
|
Function(DateTime picked) updateDate) async {
|
||||||
|
final DateTime picked = await showDatePicker(
|
||||||
|
context: context,
|
||||||
|
initialDate: dateTime,
|
||||||
|
firstDate: DateTime.now(),
|
||||||
|
lastDate: DateTime(2040),
|
||||||
|
initialEntryMode: DatePickerEntryMode.calendar,
|
||||||
|
);
|
||||||
|
if (picked != null && picked != dateTime) {
|
||||||
|
updateDate(picked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void openListDialogField(String attributeName, String attributeValueId,
|
||||||
|
List<dynamic> list, Function(dynamic selectedValue) okFunction) {
|
||||||
|
ListSelectDialog dialog = ListSelectDialog(
|
||||||
|
list: list,
|
||||||
|
attributeName: attributeName,
|
||||||
|
attributeValueId: attributeValueId,
|
||||||
|
usingSearch: true,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
okFunction: (selectedValue) {
|
||||||
|
okFunction(selectedValue);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
showDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue