|
|
|
@ -491,6 +491,10 @@ class AddAssessmentDetails extends StatefulWidget {
|
|
|
|
|
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
TextEditingController remarkController = TextEditingController();
|
|
|
|
|
TextEditingController appointmentIdController = TextEditingController();
|
|
|
|
|
TextEditingController conditionController = TextEditingController();
|
|
|
|
|
TextEditingController typeController = TextEditingController();
|
|
|
|
|
TextEditingController icdNameController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
|
|
|
|
|
bool isFormSubmitted = false;
|
|
|
|
|
|
|
|
|
@ -501,31 +505,52 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
remarkController.text = widget.mySelectedAssessment.remark ?? "";
|
|
|
|
|
appointmentIdController.text =
|
|
|
|
|
widget.mySelectedAssessment.appointmentId.toString();
|
|
|
|
|
final screenSize = MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size;
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(String hintText,
|
|
|
|
|
String selectedText, bool isDropDown, {IconData icon}) {
|
|
|
|
|
//TODO: make one Input InputDecoration for all
|
|
|
|
|
if(widget.isUpdate){
|
|
|
|
|
if(widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition != null)
|
|
|
|
|
conditionController.text = projectViewModel.isArabic
|
|
|
|
|
? widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition
|
|
|
|
|
.nameAr
|
|
|
|
|
: widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition
|
|
|
|
|
.nameEn;
|
|
|
|
|
if(widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType !=null)
|
|
|
|
|
typeController.text = projectViewModel.isArabic
|
|
|
|
|
? widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType
|
|
|
|
|
.nameAr
|
|
|
|
|
: widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType
|
|
|
|
|
.nameEn;
|
|
|
|
|
if(widget.mySelectedAssessment.selectedICD !=null)
|
|
|
|
|
icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
|
|
|
|
|
}
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown,
|
|
|
|
|
{IconData icon}) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderSide: BorderSide(color: Colors.grey, width: 1.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderSide: BorderSide(color: Colors.grey, width: 1.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
disabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderSide: BorderSide(color: Colors.grey, width: 1.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
hintText: selectedText != null ? selectedText : hintText,
|
|
|
|
|
suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null,
|
|
|
|
|
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
|
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.grey.shade600,
|
|
|
|
|
),
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Theme.of(context).hintColor,
|
|
|
|
|
fontWeight: FontWeight.w700),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
return FractionallySizedBox(
|
|
|
|
@ -590,46 +615,109 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
height: screenSize.height * 0.080,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.listOfDiagnosisType != null
|
|
|
|
|
? () {
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.mySelectedAssessment.selectedICD = null;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
onTap: model.listOfICD10 != null
|
|
|
|
|
? () {
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD = null;
|
|
|
|
|
icdNameController.text = null;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField<MasterKeyModel>(
|
|
|
|
|
decoration: textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
|
|
|
|
|
itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item),
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.nameOrICD,
|
|
|
|
|
widget.mySelectedAssessment.selectedICD !=
|
|
|
|
|
null ? widget.mySelectedAssessment
|
|
|
|
|
.selectedICD.nameEn : null, true,
|
|
|
|
|
icon: EvaIcons.search),
|
|
|
|
|
itemSubmitted: (item) =>
|
|
|
|
|
setState(()
|
|
|
|
|
{
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD = item;
|
|
|
|
|
icdNameController.text =item.code;
|
|
|
|
|
}),
|
|
|
|
|
key: key,
|
|
|
|
|
suggestions: model.listOfICD10,
|
|
|
|
|
itemBuilder: (context, suggestion) => new Padding(
|
|
|
|
|
child:Texts( suggestion.description +" / "+ suggestion.code.toString()),
|
|
|
|
|
itemBuilder: (context, suggestion) =>
|
|
|
|
|
new Padding(
|
|
|
|
|
child: Texts(
|
|
|
|
|
suggestion.description + " / " +
|
|
|
|
|
suggestion.code.toString()),
|
|
|
|
|
padding: EdgeInsets.all(8.0)),
|
|
|
|
|
itemSorter: (a, b) => 1,
|
|
|
|
|
itemFilter: (suggestion, input) =>
|
|
|
|
|
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase())
|
|
|
|
|
||suggestion.code.toLowerCase().startsWith(input.toLowerCase())
|
|
|
|
|
suggestion.description.toLowerCase().startsWith(
|
|
|
|
|
input.toLowerCase()) ||
|
|
|
|
|
suggestion.description.toLowerCase()
|
|
|
|
|
.startsWith(input.toLowerCase())
|
|
|
|
|
|| suggestion.code.toLowerCase().startsWith(
|
|
|
|
|
input.toLowerCase())
|
|
|
|
|
,
|
|
|
|
|
): TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD",
|
|
|
|
|
widget.mySelectedAssessment.selectedICD != null ? projectViewModel.isArabic?widget.mySelectedAssessment.selectedICD.nameAr:widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: TextFields(
|
|
|
|
|
onTapTextFields: model.listOfICD10 != null
|
|
|
|
|
? () {
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.mySelectedAssessment.selectedICD =
|
|
|
|
|
null;
|
|
|
|
|
icdNameController.text = null;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
hasLabelText: icdNameController.text !=
|
|
|
|
|
'' ? true : false,
|
|
|
|
|
showLabelText: true,
|
|
|
|
|
hintText: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.nameOrICD,
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
readOnly: true,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: icdNameController,
|
|
|
|
|
suffixIcon: EvaIcons.search,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null)
|
|
|
|
|
return TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// TextField(
|
|
|
|
|
// decoration: textFieldSelectorDecoration(
|
|
|
|
|
// widget.mySelectedAssessment.selectedICD !=
|
|
|
|
|
// null ? widget.mySelectedAssessment
|
|
|
|
|
// .selectedICD.code : "Name or ICD",
|
|
|
|
|
// widget.mySelectedAssessment.selectedICD !=
|
|
|
|
|
// null ? projectViewModel.isArabic
|
|
|
|
|
// ? widget.mySelectedAssessment
|
|
|
|
|
// .selectedICD.nameAr
|
|
|
|
|
// : widget.mySelectedAssessment
|
|
|
|
|
// .selectedICD.nameEn : null, true,
|
|
|
|
|
// icon: EvaIcons.search),
|
|
|
|
|
// enabled: false,
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if(isFormSubmitted && widget.mySelectedAssessment
|
|
|
|
|
.selectedICD == null)
|
|
|
|
|
if(isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD == null)
|
|
|
|
|
CustomValidationError(),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.listOfDiagnosisCondition !=
|
|
|
|
|
TextFields(
|
|
|
|
|
onTapTextFields: model
|
|
|
|
|
.listOfDiagnosisCondition !=
|
|
|
|
|
null
|
|
|
|
|
? () {
|
|
|
|
|
MasterKeyDailog dialog = MasterKeyDailog(
|
|
|
|
@ -643,6 +731,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition =
|
|
|
|
|
selectedValue;
|
|
|
|
|
conditionController.text =
|
|
|
|
|
projectViewModel.isArabic
|
|
|
|
|
? widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition
|
|
|
|
|
.nameAr
|
|
|
|
|
: widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition
|
|
|
|
|
.nameEn;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
@ -655,32 +751,39 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).condition,
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition != null
|
|
|
|
|
? projectViewModel.isArabic?widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition
|
|
|
|
|
.nameAr:widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition
|
|
|
|
|
.nameEn
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if(isFormSubmitted && widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition == null)
|
|
|
|
|
hasLabelText: conditionController.text !=
|
|
|
|
|
'' ? true : false,
|
|
|
|
|
showLabelText: true,
|
|
|
|
|
hintText: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.condition,
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
readOnly: true,
|
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: conditionController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null)
|
|
|
|
|
return TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
if(isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition == null)
|
|
|
|
|
CustomValidationError(),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.listOfDiagnosisType != null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TextFields(
|
|
|
|
|
onTapTextFields: model
|
|
|
|
|
.listOfDiagnosisType != null
|
|
|
|
|
? () {
|
|
|
|
|
MasterKeyDailog dialog = MasterKeyDailog(
|
|
|
|
|
list: model.listOfDiagnosisType,
|
|
|
|
@ -695,6 +798,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType =
|
|
|
|
|
selectedValue;
|
|
|
|
|
typeController.text =
|
|
|
|
|
projectViewModel.isArabic
|
|
|
|
|
? selectedValue
|
|
|
|
|
.nameAr
|
|
|
|
|
: selectedValue
|
|
|
|
|
.nameEn;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
@ -707,22 +816,30 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).dType,
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType != null
|
|
|
|
|
?projectViewModel.isArabic?widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType.nameAr: widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType.nameEn
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if(isFormSubmitted && widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType == null)
|
|
|
|
|
hasLabelText: typeController.text !=
|
|
|
|
|
'' ? true : false,
|
|
|
|
|
showLabelText: true,
|
|
|
|
|
hintText: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.dType,
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
readOnly: true,
|
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: typeController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null)
|
|
|
|
|
return TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
if(isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType == null)
|
|
|
|
|
CustomValidationError(),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
@ -731,17 +848,21 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 0, right: 0, top: 15),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context).remarks,
|
|
|
|
|
hintText: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.remarks,
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
maxLines: 18,
|
|
|
|
|
minLines: 5,
|
|
|
|
|
hasLabelText: remarkController.text != ''?true:false,
|
|
|
|
|
hasLabelText: remarkController.text !=
|
|
|
|
|
'' ? true : false,
|
|
|
|
|
showLabelText: true,
|
|
|
|
|
controller: remarkController,
|
|
|
|
|
onChanged:(value) {
|
|
|
|
|
widget.mySelectedAssessment.remark = remarkController.text;
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
widget.mySelectedAssessment.remark =
|
|
|
|
|
remarkController.text;
|
|
|
|
|
},
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null)
|
|
|
|
|