|
|
|
@ -39,6 +39,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
DateTime appointmentDate;
|
|
|
|
DateTime appointmentDate;
|
|
|
|
final _remarksController = TextEditingController();
|
|
|
|
final _remarksController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String branchError = null;
|
|
|
|
|
|
|
|
String hospitalError = null;
|
|
|
|
|
|
|
|
String clinicError = null;
|
|
|
|
|
|
|
|
String doctorError = null;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
@ -148,6 +153,28 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
color: HexColor("#359846"),
|
|
|
|
color: HexColor("#359846"),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
if(_referTo == null){
|
|
|
|
|
|
|
|
branchError = TranslationBase.of(context).fieldRequired;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
branchError = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(_selectedBranch == null){
|
|
|
|
|
|
|
|
hospitalError = TranslationBase.of(context).fieldRequired;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
hospitalError = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(_selectedClinic == null){
|
|
|
|
|
|
|
|
clinicError = TranslationBase.of(context).fieldRequired;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
clinicError = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(_selectedDoctor == null){
|
|
|
|
|
|
|
|
doctorError = TranslationBase.of(context).fieldRequired;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
doctorError = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
if (appointmentDate == null ||
|
|
|
|
if (appointmentDate == null ||
|
|
|
|
_selectedBranch == null ||
|
|
|
|
_selectedBranch == null ||
|
|
|
|
_selectedClinic == null ||
|
|
|
|
_selectedClinic == null ||
|
|
|
|
@ -189,6 +216,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
dropDownText: _referTo != null ? _referTo['name'] : null,
|
|
|
|
dropDownText: _referTo != null ? _referTo['name'] : null,
|
|
|
|
enabled: false,
|
|
|
|
enabled: false,
|
|
|
|
isDropDown: true,
|
|
|
|
isDropDown: true,
|
|
|
|
|
|
|
|
validationError: branchError,
|
|
|
|
onClick: referToList != null
|
|
|
|
onClick: referToList != null
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
|
ListSelectDialog dialog = ListSelectDialog(
|
|
|
|
ListSelectDialog dialog = ListSelectDialog(
|
|
|
|
@ -241,6 +269,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
enabled: false,
|
|
|
|
enabled: false,
|
|
|
|
isDropDown: true,
|
|
|
|
isDropDown: true,
|
|
|
|
|
|
|
|
validationError: hospitalError,
|
|
|
|
onClick: model.branchesList != null &&
|
|
|
|
onClick: model.branchesList != null &&
|
|
|
|
model.branchesList.length > 0 &&
|
|
|
|
model.branchesList.length > 0 &&
|
|
|
|
_referTo != null &&
|
|
|
|
_referTo != null &&
|
|
|
|
@ -288,6 +317,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
enabled: false,
|
|
|
|
enabled: false,
|
|
|
|
isDropDown: true,
|
|
|
|
isDropDown: true,
|
|
|
|
|
|
|
|
validationError: clinicError,
|
|
|
|
onClick: _selectedBranch != null &&
|
|
|
|
onClick: _selectedBranch != null &&
|
|
|
|
model.clinicsList != null &&
|
|
|
|
model.clinicsList != null &&
|
|
|
|
model.clinicsList.length > 0
|
|
|
|
model.clinicsList.length > 0
|
|
|
|
@ -335,6 +365,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
_selectedDoctor != null ? _selectedDoctor['DoctorName'] : null,
|
|
|
|
_selectedDoctor != null ? _selectedDoctor['DoctorName'] : null,
|
|
|
|
enabled: false,
|
|
|
|
enabled: false,
|
|
|
|
isDropDown: true,
|
|
|
|
isDropDown: true,
|
|
|
|
|
|
|
|
validationError: doctorError,
|
|
|
|
onClick: _selectedClinic != null &&
|
|
|
|
onClick: _selectedClinic != null &&
|
|
|
|
model.doctorsList != null &&
|
|
|
|
model.doctorsList != null &&
|
|
|
|
model.doctorsList.length > 0
|
|
|
|
model.doctorsList.length > 0
|
|
|
|
|