|
|
|
|
@ -49,7 +49,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
|
|
|
|
|
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
|
|
|
|
|
bool isFormSubmitted = false;
|
|
|
|
|
bool complexDiagnosis =true;
|
|
|
|
|
bool complexDiagnosis = true;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
@ -98,7 +99,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBar: BottomSheetTitle(title: widget.isUpdate ? TranslationBase.of(context).updateAssessmentDetails: TranslationBase.of(context).addAssessmentDetails),
|
|
|
|
|
appBar: BottomSheetTitle(title: widget.isUpdate ? TranslationBase.of(context).updateAssessmentDetails : TranslationBase.of(context).addAssessmentDetails),
|
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Center(
|
|
|
|
|
@ -111,26 +112,23 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
Row(children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value:complexDiagnosis,
|
|
|
|
|
onChanged: (bool value) {
|
|
|
|
|
complexDiagnosis =value;
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
checkColor: Colors.white,
|
|
|
|
|
activeColor: Colors.green,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).complexDiagnosis,
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
Row(children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: complexDiagnosis,
|
|
|
|
|
onChanged: (bool value) {
|
|
|
|
|
complexDiagnosis = value;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
checkColor: Colors.white,
|
|
|
|
|
activeColor: Colors.green,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).complexDiagnosis,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
@ -145,8 +143,8 @@ Row(children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children:[ InkWell(
|
|
|
|
|
Column(children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: model.listOfICD10 != null
|
|
|
|
|
? () {
|
|
|
|
|
setState(() {
|
|
|
|
|
@ -156,7 +154,7 @@ Row(children: [
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
onChanged: (text){
|
|
|
|
|
onChanged: (text) {
|
|
|
|
|
setState(() {
|
|
|
|
|
icdNameController.text;
|
|
|
|
|
});
|
|
|
|
|
@ -164,22 +162,22 @@ Row(children: [
|
|
|
|
|
height: Utils.getTextFieldHeight(),
|
|
|
|
|
onClick: model.listOfICD10 != null
|
|
|
|
|
? () {
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.mySelectedAssessment.selectedICD = null;
|
|
|
|
|
icdNameController.text = null;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.mySelectedAssessment.selectedICD = null;
|
|
|
|
|
icdNameController.text = null;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
hintText: TranslationBase.of(context).nameOrICD,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: icdNameController,
|
|
|
|
|
enabled:true,
|
|
|
|
|
enabled: true,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (icdNameController.text.length <= 3) {
|
|
|
|
|
DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
|
|
|
|
|
if (icdNameController.text.length <= 2) {
|
|
|
|
|
DrAppToastMsg.showErrorToast("Please enter 3 or more characters");
|
|
|
|
|
} else {
|
|
|
|
|
model.listOfICD10.clear();
|
|
|
|
|
model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
|
|
|
|
|
@ -191,75 +189,71 @@ Row(children: [
|
|
|
|
|
)),
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
|
|
model.listOfICD10.length >0 && icdNameController.text.isNotEmpty ? Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
|
|
|
|
|
child:ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: model.listOfICD10.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return InkWell(child:ListTile(
|
|
|
|
|
title: AppText( model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
|
|
|
|
|
onTap: (){
|
|
|
|
|
|
|
|
|
|
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
|
|
|
|
|
icdNameController.text = model.listOfICD10[index].description;
|
|
|
|
|
model.listOfICD10.clear();
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
|
|
model.listOfICD10.length > 0 && icdNameController.text.isNotEmpty
|
|
|
|
|
? Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: model.listOfICD10.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
child: ListTile(title: AppText(model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
|
|
|
|
|
onTap: () {
|
|
|
|
|
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
|
|
|
|
|
icdNameController.text = model.listOfICD10[index].description;
|
|
|
|
|
model.listOfICD10.clear();
|
|
|
|
|
setState(() {});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
)) :SizedBox()
|
|
|
|
|
// CustomAutoCompleteTextField(
|
|
|
|
|
// isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// children: [
|
|
|
|
|
// AutoCompleteTextField<MasterKeyModel>(
|
|
|
|
|
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
|
|
|
|
|
// controller: icdNameController,
|
|
|
|
|
// itemSubmitted: (item) => setState(() {
|
|
|
|
|
// widget.mySelectedAssessment.selectedICD = item;
|
|
|
|
|
// // icdNameController.text = '${item.code.trim()}/${item.description}';
|
|
|
|
|
// icdNameController.text = '${item.description}';
|
|
|
|
|
// }),
|
|
|
|
|
// key: key,
|
|
|
|
|
// suggestions: model.listOfICD10,
|
|
|
|
|
// suggestionsAmount: model.listOfICD10.length,
|
|
|
|
|
// itemBuilder: (context, suggestion) =>
|
|
|
|
|
// new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), 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().contains(input.toLowerCase()) ||
|
|
|
|
|
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
|
|
|
|
|
// suggestion.code.toLowerCase().contains(input.toLowerCase()),
|
|
|
|
|
//
|
|
|
|
|
// ),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: IconButton(
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// print(icdNameController.text);
|
|
|
|
|
// if (icdNameController.text.length <= 3) {
|
|
|
|
|
// DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
|
|
|
|
|
// } else {
|
|
|
|
|
// model.listOfICD10.clear();
|
|
|
|
|
// model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// icon: Icon(Icons.search),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
: SizedBox()
|
|
|
|
|
// CustomAutoCompleteTextField(
|
|
|
|
|
// isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// children: [
|
|
|
|
|
// AutoCompleteTextField<MasterKeyModel>(
|
|
|
|
|
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
|
|
|
|
|
// controller: icdNameController,
|
|
|
|
|
// itemSubmitted: (item) => setState(() {
|
|
|
|
|
// widget.mySelectedAssessment.selectedICD = item;
|
|
|
|
|
// // icdNameController.text = '${item.code.trim()}/${item.description}';
|
|
|
|
|
// icdNameController.text = '${item.description}';
|
|
|
|
|
// }),
|
|
|
|
|
// key: key,
|
|
|
|
|
// suggestions: model.listOfICD10,
|
|
|
|
|
// suggestionsAmount: model.listOfICD10.length,
|
|
|
|
|
// itemBuilder: (context, suggestion) =>
|
|
|
|
|
// new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), 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().contains(input.toLowerCase()) ||
|
|
|
|
|
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
|
|
|
|
|
// suggestion.code.toLowerCase().contains(input.toLowerCase()),
|
|
|
|
|
//
|
|
|
|
|
// ),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: IconButton(
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// print(icdNameController.text);
|
|
|
|
|
// if (icdNameController.text.length <= 3) {
|
|
|
|
|
// DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
|
|
|
|
|
// } else {
|
|
|
|
|
// model.listOfICD10.clear();
|
|
|
|
|
// model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// icon: Icon(Icons.search),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
]),
|
|
|
|
|
if (widget.mySelectedAssessment.selectedICD != null)
|
|
|
|
|
Column(
|
|
|
|
|
@ -387,7 +381,7 @@ Row(children: [
|
|
|
|
|
height: 0,
|
|
|
|
|
)
|
|
|
|
|
: CustomBottomSheetContainer(
|
|
|
|
|
label: (widget.isUpdate ? TranslationBase.of(context).updateAssessmentDetails: TranslationBase.of(context).addAssessmentDetails),
|
|
|
|
|
label: (widget.isUpdate ? TranslationBase.of(context).updateAssessmentDetails : TranslationBase.of(context).addAssessmentDetails),
|
|
|
|
|
onTap: () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
isFormSubmitted = true;
|
|
|
|
|
@ -411,7 +405,6 @@ Row(children: [
|
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
if (isUpdate) {
|
|
|
|
|
|
|
|
|
|
PostAssessmentRequestUpdateModel patchAssessmentReqModel = PostAssessmentRequestUpdateModel(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
|
@ -419,13 +412,14 @@ Row(children: [
|
|
|
|
|
createdByName: doctorProfile.doctorName,
|
|
|
|
|
createdBy: doctorProfile.doctorID,
|
|
|
|
|
icdCodeDetails: [
|
|
|
|
|
new IcdCodeDetailsUpdate(
|
|
|
|
|
remarks: mySelectedAssessment.remark,
|
|
|
|
|
complexDiagnosis: complexDiagnosis,
|
|
|
|
|
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
|
|
|
|
|
prevIcdCode10ID: mySelectedAssessment.icdCode10ID,
|
|
|
|
|
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
|
|
|
|
|
icdcode10Id: mySelectedAssessment.selectedICD.code)]);
|
|
|
|
|
new IcdCodeDetailsUpdate(
|
|
|
|
|
remarks: mySelectedAssessment.remark,
|
|
|
|
|
complexDiagnosis: complexDiagnosis,
|
|
|
|
|
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
|
|
|
|
|
prevIcdCode10ID: mySelectedAssessment.icdCode10ID,
|
|
|
|
|
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
|
|
|
|
|
icdcode10Id: mySelectedAssessment.selectedICD.code)
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
await model.patchAssessment(patchAssessmentReqModel);
|
|
|
|
|
} else {
|
|
|
|
|
|