Merge branch 'Stepper_header' into 'development'
Stepper header See merge request Cloud_Solution/doctor_app_flutter!484merge-requests/485/merge
commit
8ed9b3c023
@ -0,0 +1,48 @@
|
|||||||
|
class PatchAssessmentReqModel {
|
||||||
|
int patientMRN;
|
||||||
|
int appointmentNo;
|
||||||
|
int episodeID;
|
||||||
|
String icdcode10Id;
|
||||||
|
String prevIcdCode10ID;
|
||||||
|
int conditionId;
|
||||||
|
int diagnosisTypeId;
|
||||||
|
bool complexDiagnosis;
|
||||||
|
String remarks;
|
||||||
|
|
||||||
|
PatchAssessmentReqModel(
|
||||||
|
{this.patientMRN,
|
||||||
|
this.appointmentNo,
|
||||||
|
this.episodeID,
|
||||||
|
this.icdcode10Id,
|
||||||
|
this.prevIcdCode10ID,
|
||||||
|
this.conditionId,
|
||||||
|
this.diagnosisTypeId,
|
||||||
|
this.complexDiagnosis,
|
||||||
|
this.remarks});
|
||||||
|
|
||||||
|
PatchAssessmentReqModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
patientMRN = json['PatientMRN'];
|
||||||
|
appointmentNo = json['AppointmentNo'];
|
||||||
|
episodeID = json['EpisodeID'];
|
||||||
|
icdcode10Id = json['Icdcode10Id'];
|
||||||
|
prevIcdCode10ID = json['PrevIcdCode10ID'];
|
||||||
|
conditionId = json['ConditionId'];
|
||||||
|
diagnosisTypeId = json['DiagnosisTypeId'];
|
||||||
|
complexDiagnosis = json['ComplexDiagnosis'];
|
||||||
|
remarks = json['Remarks'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['PatientMRN'] = this.patientMRN;
|
||||||
|
data['AppointmentNo'] = this.appointmentNo;
|
||||||
|
data['EpisodeID'] = this.episodeID;
|
||||||
|
data['Icdcode10Id'] = this.icdcode10Id;
|
||||||
|
data['PrevIcdCode10ID'] = this.prevIcdCode10ID;
|
||||||
|
data['ConditionId'] = this.conditionId;
|
||||||
|
data['DiagnosisTypeId'] = this.diagnosisTypeId;
|
||||||
|
data['ComplexDiagnosis'] = this.complexDiagnosis;
|
||||||
|
data['Remarks'] = this.remarks;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SOAPOpenItems extends StatelessWidget {
|
||||||
|
final Function onTap;
|
||||||
|
final String label;
|
||||||
|
|
||||||
|
const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key);
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: onTap,
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 8, horizontal: 8.0),
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.grey.shade400, width: 0.5),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(8),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
"$label",
|
||||||
|
fontSize:15,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
"${TranslationBase.of(context).searchHere}",
|
||||||
|
fontSize:13,
|
||||||
|
color: Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
Icon(
|
||||||
|
Icons.add_box_rounded,
|
||||||
|
size: 25,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,563 @@
|
|||||||
|
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
||||||
|
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/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
|
||||||
|
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/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/bottom_sheet_title.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:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import '../custom_validation_error.dart';
|
||||||
|
|
||||||
|
class AddAssessmentDetails extends StatefulWidget {
|
||||||
|
final MySelectedAssessment mySelectedAssessment;
|
||||||
|
final List<MySelectedAssessment> mySelectedAssessmentList;
|
||||||
|
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate)
|
||||||
|
addSelectedAssessment;
|
||||||
|
final PatiantInformtion patientInfo;
|
||||||
|
final bool isUpdate;
|
||||||
|
AddAssessmentDetails(
|
||||||
|
{Key key,
|
||||||
|
this.mySelectedAssessment,
|
||||||
|
this.addSelectedAssessment,
|
||||||
|
this.patientInfo,
|
||||||
|
this.isUpdate = false,
|
||||||
|
this.mySelectedAssessmentList});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
|
||||||
|
remarkController.text = widget.mySelectedAssessment.remark ?? "";
|
||||||
|
appointmentIdController.text =
|
||||||
|
widget.mySelectedAssessment.appointmentId.toString();
|
||||||
|
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(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
|
||||||
|
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
disabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
hintText: selectedText != null ? selectedText : hintText,
|
||||||
|
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
|
||||||
|
filled: true,
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
fontSize: 10,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return FractionallySizedBox(
|
||||||
|
heightFactor: 1,
|
||||||
|
child: BaseView<SOAPViewModel>(
|
||||||
|
onModelReady: (model) async {
|
||||||
|
if (model.listOfDiagnosisCondition.length == 0) {
|
||||||
|
await model.getMasterLookup(MasterKeysService.DiagnosisCondition);
|
||||||
|
}
|
||||||
|
if (model.listOfDiagnosisType.length == 0) {
|
||||||
|
await model.getMasterLookup(MasterKeysService.DiagnosisType);
|
||||||
|
}
|
||||||
|
if (model.listOfICD10.length == 0) {
|
||||||
|
await model.getMasterLookup(MasterKeysService.ICD10);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: false,
|
||||||
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
BottomSheetTitle(
|
||||||
|
title: TranslationBase.of(context).addAssessmentDetails),
|
||||||
|
FractionallySizedBox(
|
||||||
|
widthFactor: 0.9,
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 16,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
|
||||||
|
child: AppTextFieldCustom(
|
||||||
|
height: 55.0,
|
||||||
|
hintText:
|
||||||
|
TranslationBase.of(context).appointmentNumber,
|
||||||
|
//fontSize: 13.5,
|
||||||
|
// hintColor: Colors.black,
|
||||||
|
//hasLabelText: appointmentIdController.text != ''
|
||||||
|
// ? true
|
||||||
|
// : false,
|
||||||
|
//showLabelText: true,
|
||||||
|
//fontWeight: FontWeight.w600,
|
||||||
|
//readOnly: true,
|
||||||
|
isDropDown: false,
|
||||||
|
enabled: false,
|
||||||
|
controller: appointmentIdController,
|
||||||
|
// validator: (value) {
|
||||||
|
// if (value == null)
|
||||||
|
// return TranslationBase.of(context)
|
||||||
|
// .emptyMessage;
|
||||||
|
// else
|
||||||
|
// return null;
|
||||||
|
// },
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 55.0,
|
||||||
|
child: InkWell(
|
||||||
|
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: Icons.keyboard_arrow_down),
|
||||||
|
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()),
|
||||||
|
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
|
||||||
|
? () {
|
||||||
|
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;
|
||||||
|
// },
|
||||||
|
|
||||||
|
isDropDown: true,
|
||||||
|
enabled: false,
|
||||||
|
height: 55.0,
|
||||||
|
)
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
CustomValidationError(),
|
||||||
|
SizedBox(
|
||||||
|
height: 7,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: 55.0,
|
||||||
|
onClick: model.listOfDiagnosisCondition != null
|
||||||
|
? () {
|
||||||
|
MasterKeyDailog dialog = MasterKeyDailog(
|
||||||
|
list: model.listOfDiagnosisCondition,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
okFunction:
|
||||||
|
(MasterKeyModel selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
widget.mySelectedAssessment
|
||||||
|
.selectedDiagnosisCondition =
|
||||||
|
selectedValue;
|
||||||
|
conditionController
|
||||||
|
.text = projectViewModel
|
||||||
|
.isArabic
|
||||||
|
? widget
|
||||||
|
.mySelectedAssessment
|
||||||
|
.selectedDiagnosisCondition
|
||||||
|
.nameAr
|
||||||
|
: widget
|
||||||
|
.mySelectedAssessment
|
||||||
|
.selectedDiagnosisCondition
|
||||||
|
.nameEn;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
showDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
//hasLabelText:
|
||||||
|
// conditionController.text != '' ? true : false,
|
||||||
|
//showLabelText: true,
|
||||||
|
hintText: TranslationBase.of(context).condition,
|
||||||
|
//fontSize: 13.5,
|
||||||
|
//readOnly: true,
|
||||||
|
//suffixIcon: EvaIcons.arrowDown,
|
||||||
|
// 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;
|
||||||
|
// },
|
||||||
|
|
||||||
|
isDropDown: true,
|
||||||
|
enabled: false,
|
||||||
|
),
|
||||||
|
if (isFormSubmitted &&
|
||||||
|
widget.mySelectedAssessment
|
||||||
|
.selectedDiagnosisCondition ==
|
||||||
|
null)
|
||||||
|
CustomValidationError(),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: 55.0,
|
||||||
|
onClick: model.listOfDiagnosisType != null
|
||||||
|
? () {
|
||||||
|
MasterKeyDailog dialog = MasterKeyDailog(
|
||||||
|
list: model.listOfDiagnosisType,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
okFunction:
|
||||||
|
(MasterKeyModel selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
// _selectedDiagnosisType =
|
||||||
|
// selectedValue;
|
||||||
|
widget.mySelectedAssessment
|
||||||
|
.selectedDiagnosisType =
|
||||||
|
selectedValue;
|
||||||
|
typeController.text =
|
||||||
|
projectViewModel.isArabic
|
||||||
|
? selectedValue.nameAr
|
||||||
|
: selectedValue.nameEn;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
showDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
//hasLabelText:
|
||||||
|
// typeController.text != '' ? true : false,
|
||||||
|
//prefixIcon: Icon(Icons.add),
|
||||||
|
//showLabelText: true,
|
||||||
|
hintText: TranslationBase.of(context).dType,
|
||||||
|
//fontSize: 13.5,
|
||||||
|
//readOnly: true,
|
||||||
|
// hintColor: Colors.black,
|
||||||
|
//suffixIcon: EvaIcons.arrowDown,
|
||||||
|
//fontWeight: FontWeight.w600,
|
||||||
|
maxLines: 2,
|
||||||
|
minLines: 1,
|
||||||
|
enabled: false,
|
||||||
|
isDropDown: true,
|
||||||
|
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
|
||||||
|
child: TextFields(
|
||||||
|
hintText: TranslationBase.of(context).remarks,
|
||||||
|
fontSize: 13.5,
|
||||||
|
// hintColor: Colors.black,
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
])),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomSheet: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(0.0),
|
||||||
|
),
|
||||||
|
border: Border.all(color: HexColor('#707070'), width: 0),
|
||||||
|
),
|
||||||
|
height: MediaQuery.of(context).size.height * 0.1,
|
||||||
|
width: double.infinity,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: FractionallySizedBox(
|
||||||
|
widthFactor: .80,
|
||||||
|
child: Center(
|
||||||
|
child: AppButton(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
color: Colors.green,
|
||||||
|
title: (widget.isUpdate
|
||||||
|
? 'Update Assessment Details'
|
||||||
|
: 'Add Assessment Details'),
|
||||||
|
loading: model.state == ViewState.BusyLocal,
|
||||||
|
onPressed: () async {
|
||||||
|
setState(() {
|
||||||
|
isFormSubmitted = true;
|
||||||
|
});
|
||||||
|
widget.mySelectedAssessment.remark =
|
||||||
|
remarkController.text;
|
||||||
|
widget.mySelectedAssessment.appointmentId =
|
||||||
|
int.parse(appointmentIdController.text);
|
||||||
|
if (widget.mySelectedAssessment
|
||||||
|
.selectedDiagnosisCondition !=
|
||||||
|
null &&
|
||||||
|
widget.mySelectedAssessment
|
||||||
|
.selectedDiagnosisType !=
|
||||||
|
null &&
|
||||||
|
widget.mySelectedAssessment.selectedICD != null) {
|
||||||
|
await submitAssessment(
|
||||||
|
isUpdate: widget.isUpdate,
|
||||||
|
model: model,
|
||||||
|
mySelectedAssessment:
|
||||||
|
widget.mySelectedAssessment);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
submitAssessment(
|
||||||
|
{SOAPViewModel model,
|
||||||
|
MySelectedAssessment mySelectedAssessment,
|
||||||
|
bool isUpdate = false}) async {
|
||||||
|
if (isUpdate) {
|
||||||
|
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
|
||||||
|
patientMRN: widget.patientInfo.patientMRN,
|
||||||
|
episodeID: widget.patientInfo.episodeNo,
|
||||||
|
appointmentNo: widget.patientInfo.appointmentNo,
|
||||||
|
remarks: mySelectedAssessment.remark,
|
||||||
|
complexDiagnosis: true,
|
||||||
|
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
|
||||||
|
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
|
||||||
|
icdcode10Id: mySelectedAssessment.selectedICD.code,
|
||||||
|
prevIcdCode10ID: mySelectedAssessment.icdCode10ID);
|
||||||
|
|
||||||
|
await model.patchAssessment(patchAssessmentReqModel);
|
||||||
|
} else {
|
||||||
|
PostAssessmentRequestModel postAssessmentRequestModel =
|
||||||
|
new PostAssessmentRequestModel(
|
||||||
|
patientMRN: widget.patientInfo.patientMRN,
|
||||||
|
episodeId: widget.patientInfo.episodeNo,
|
||||||
|
appointmentNo: widget.patientInfo.appointmentNo,
|
||||||
|
icdCodeDetails: [
|
||||||
|
new IcdCodeDetails(
|
||||||
|
remarks: mySelectedAssessment.remark,
|
||||||
|
complexDiagnosis: true,
|
||||||
|
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
|
||||||
|
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
|
||||||
|
icdcode10Id: mySelectedAssessment.selectedICD.code)
|
||||||
|
]);
|
||||||
|
|
||||||
|
await model.postAssessment(postAssessmentRequestModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (model.state == ViewState.ErrorLocal) {
|
||||||
|
helpers.showErrorToast(model.error);
|
||||||
|
} else {
|
||||||
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
||||||
|
|
||||||
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
||||||
|
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
|
||||||
|
mySelectedAssessment.doctorName = doctorProfile.doctorName;
|
||||||
|
|
||||||
|
if (!isUpdate) {
|
||||||
|
// widget.mySelectedAssessmentList.add(mySelectedAssessment);
|
||||||
|
widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
|
||||||
|
}
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
// widget.changePageViewIndex(3);
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue