|
|
|
|
@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
|
|
|
|
// import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
|
|
|
|
@ -13,13 +13,16 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_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/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/shared/Text.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.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/dialogs/master_key_dailog.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_field_error.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_fields_utils.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
@ -75,22 +78,29 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
|
|
|
|
|
}
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown,
|
|
|
|
|
{IconData icon}) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown ,
|
|
|
|
|
|
|
|
|
|
{IconData icon, String validationError}) {
|
|
|
|
|
return new InputDecoration(
|
|
|
|
|
fillColor: Colors.white,
|
|
|
|
|
|
|
|
|
|
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
|
|
|
|
|
borderSide: BorderSide(color: (validationError != null
|
|
|
|
|
? Colors.red.shade700
|
|
|
|
|
:Color(0xFFEFEFEF)) , width: 2.5),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
|
|
|
|
|
borderSide: BorderSide(color: (validationError != null
|
|
|
|
|
? Colors.red.shade700
|
|
|
|
|
: Color(0xFFEFEFEF)), width: 2.5),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
disabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
|
|
|
|
|
borderSide: BorderSide(color: (validationError != null
|
|
|
|
|
? Colors.red.shade700
|
|
|
|
|
: Color(0xFFEFEFEF)), width: 2.5),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
hintText: selectedText != null ? selectedText : hintText,
|
|
|
|
|
@ -139,10 +149,10 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
height: 55.0,
|
|
|
|
|
// height: 55.0,
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).appointmentNumber,
|
|
|
|
|
isDropDown: false,
|
|
|
|
|
isTextFieldHasSuffix: false,
|
|
|
|
|
enabled: false,
|
|
|
|
|
controller: appointmentIdController,
|
|
|
|
|
),
|
|
|
|
|
@ -164,47 +174,45 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
child: widget
|
|
|
|
|
.mySelectedAssessment.selectedICD ==
|
|
|
|
|
null
|
|
|
|
|
? AutoCompleteTextField<MasterKeyModel>(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.nameOrICD,
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD !=
|
|
|
|
|
null
|
|
|
|
|
? widget.mySelectedAssessment
|
|
|
|
|
.selectedICD.nameEn
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
icon: Icons.keyboard_arrow_down),
|
|
|
|
|
itemSubmitted: (item) => setState(() {
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD = item;
|
|
|
|
|
icdNameController.text = '${item.code.trim()}/${item.description}';
|
|
|
|
|
}),
|
|
|
|
|
key: key,
|
|
|
|
|
suggestions: model.listOfICD10,
|
|
|
|
|
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()),
|
|
|
|
|
)
|
|
|
|
|
? CustomAutoCompleteTextField(
|
|
|
|
|
isShowError: isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment.selectedICD == null,
|
|
|
|
|
child:AutoCompleteTextField<MasterKeyModel>(
|
|
|
|
|
|
|
|
|
|
decoration: TextFieldsUtils.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.nameOrICD, null, true, suffixIcon: Icons.search),
|
|
|
|
|
|
|
|
|
|
itemSubmitted: (item) => setState(() {
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD = item;
|
|
|
|
|
icdNameController.text = '${item.code.trim()}/${item.description}';
|
|
|
|
|
}),
|
|
|
|
|
key: key,
|
|
|
|
|
suggestions: model.listOfICD10,
|
|
|
|
|
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()),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: AppTextFieldCustom(
|
|
|
|
|
onClick: model.listOfICD10 != null
|
|
|
|
|
? () {
|
|
|
|
|
@ -220,19 +228,16 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: icdNameController,
|
|
|
|
|
|
|
|
|
|
enabled: true,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
suffixIcon: Icon(Icons.search,color: Colors.grey.shade600,),
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment.selectedICD == null)
|
|
|
|
|
CustomValidationError(),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 7,
|
|
|
|
|
),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: 55.0,
|
|
|
|
|
onClick: model.listOfDiagnosisCondition != null
|
|
|
|
|
? () {
|
|
|
|
|
MasterKeyDailog dialog = MasterKeyDailog(
|
|
|
|
|
@ -271,19 +276,20 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: conditionController,
|
|
|
|
|
isDropDown: true,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
enabled: false,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError: isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition == null?TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage:null,
|
|
|
|
|
),
|
|
|
|
|
if (isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition ==
|
|
|
|
|
null)
|
|
|
|
|
CustomValidationError(),
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: 55.0,
|
|
|
|
|
onClick: model.listOfDiagnosisType != null
|
|
|
|
|
? () {
|
|
|
|
|
MasterKeyDailog dialog = MasterKeyDailog(
|
|
|
|
|
@ -315,40 +321,30 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
enabled: false,
|
|
|
|
|
isDropDown: true,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
controller: typeController,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError: isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType == null?TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage:null,
|
|
|
|
|
),
|
|
|
|
|
if (isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType ==
|
|
|
|
|
null)
|
|
|
|
|
CustomValidationError(),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context).remarks,
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
maxLines: 18,
|
|
|
|
|
minLines: 5,
|
|
|
|
|
hasLabelText:
|
|
|
|
|
remarkController.text != '' ? true : false,
|
|
|
|
|
showLabelText: true,
|
|
|
|
|
controller: remarkController,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
widget.mySelectedAssessment.remark =
|
|
|
|
|
remarkController.text;
|
|
|
|
|
},
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
@ -458,7 +454,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
|
|
|
|
|
|