|
|
|
@ -25,11 +25,13 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
|
|
|
|
|
class UpdateAssessmentPage extends StatefulWidget {
|
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
|
final MySelectedAssessment mySelectedAssessment;
|
|
|
|
|
List<MySelectedAssessment> mySelectedAssessmentList;
|
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
|
|
|
|
|
|
UpdateAssessmentPage(
|
|
|
|
|
{Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo});
|
|
|
|
|
UpdateAssessmentPage({Key key,
|
|
|
|
|
this.changePageViewIndex,
|
|
|
|
|
this.mySelectedAssessmentList,
|
|
|
|
|
this.patientInfo});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
|
|
|
|
@ -43,11 +45,12 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
|
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
|
onModelReady: (model) async{
|
|
|
|
|
|
|
|
|
|
widget.mySelectedAssessment.appointmentId =widget.patientInfo.appointmentNo;
|
|
|
|
|
widget.mySelectedAssessmentList.clear();
|
|
|
|
|
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
|
editedBy: '',
|
|
|
|
|
doctorID: '',
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo);
|
|
|
|
|
await model.getPatientAssessment(getAssessmentReqModel);
|
|
|
|
|
if(model.patientAssessmentList.isNotEmpty){
|
|
|
|
@ -60,25 +63,33 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
if (model.listOfICD10.length == 0) {
|
|
|
|
|
await model.getMasterLookup(MasterKeysService.ICD10);
|
|
|
|
|
}
|
|
|
|
|
model.patientAssessmentList.forEach((element) {
|
|
|
|
|
MasterKeyModel diagnosisType = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.DiagnosisType,
|
|
|
|
|
id: element.diagnosisTypeID,
|
|
|
|
|
);
|
|
|
|
|
MasterKeyModel selectedICD = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.ICD10,
|
|
|
|
|
id: element.icdCode10ID,
|
|
|
|
|
);
|
|
|
|
|
MasterKeyModel diagnosisCondition = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.DiagnosisCondition,
|
|
|
|
|
id: element.conditionID,
|
|
|
|
|
);
|
|
|
|
|
MySelectedAssessment temMySelectedAssessment = MySelectedAssessment(
|
|
|
|
|
appointmentId: element.appointmentNo,
|
|
|
|
|
remark: element.remarks,
|
|
|
|
|
selectedDiagnosisType: diagnosisType,
|
|
|
|
|
selectedDiagnosisCondition: diagnosisCondition,
|
|
|
|
|
selectedICD: selectedICD,
|
|
|
|
|
doctorID: element.doctorID,
|
|
|
|
|
doctorName: element.doctorName,
|
|
|
|
|
createdBy: element.createdBy,
|
|
|
|
|
icdCode10ID: element.icdCode10ID
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
MasterKeyModel selectedICD = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.ICD10,
|
|
|
|
|
id: model.patientAssessmentList[0].icdCode10ID,
|
|
|
|
|
);
|
|
|
|
|
widget.mySelectedAssessment.selectedICD= selectedICD;
|
|
|
|
|
MasterKeyModel diagnosisCondition = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.DiagnosisCondition,
|
|
|
|
|
id: model.patientAssessmentList[0].conditionID,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
widget.mySelectedAssessment.selectedDiagnosisCondition = diagnosisCondition;
|
|
|
|
|
MasterKeyModel diagnosisType = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.DiagnosisType,
|
|
|
|
|
id: model.patientAssessmentList[0].diagnosisTypeID,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
widget.mySelectedAssessment.selectedDiagnosisType = diagnosisType;
|
|
|
|
|
widget.mySelectedAssessment.remark = model.patientAssessmentList[0].remarks;
|
|
|
|
|
widget.mySelectedAssessmentList.add(temMySelectedAssessment);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
@ -101,7 +112,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts('ASSESSMENT',
|
|
|
|
|
Texts(TranslationBase.of(context).assessment.toUpperCase(),
|
|
|
|
|
variant:
|
|
|
|
|
isAssessmentExpand ? "bodyText" : '',
|
|
|
|
|
bold: isAssessmentExpand ? true : false,
|
|
|
|
@ -130,15 +141,15 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
if(model.patientAssessmentList.isEmpty)
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 5, right: 5, top: 15),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: "Add ASSESSMENT",
|
|
|
|
|
hintText: TranslationBase.of(context).addAssessment,
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
onTapTextFields: () {
|
|
|
|
|
openAssessmentDialog(context);
|
|
|
|
|
openAssessmentDialog(context,isUpdate: false,
|
|
|
|
|
model: model);
|
|
|
|
|
},
|
|
|
|
|
readOnly: true,
|
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
@ -159,266 +170,239 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
if(widget.mySelectedAssessment != null &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.appointmentId !=
|
|
|
|
|
null && widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType != null &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition != null)
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 5, right: 5, top: 15),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"12".toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"DEC".toUpperCase(),
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"Appointment #: ",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.appointmentId
|
|
|
|
|
.toString(),
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition
|
|
|
|
|
.nameEn,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"Type : ",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType
|
|
|
|
|
.nameEn,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"Doc : ",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"Anas Abdullah",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.5,
|
|
|
|
|
child: AppText(
|
|
|
|
|
widget.mySelectedAssessment.remark??"",
|
|
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
children: widget.mySelectedAssessmentList.map((
|
|
|
|
|
assessment) {
|
|
|
|
|
return Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 5, right: 5, top: 15),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"12".toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"DEC".toUpperCase(),
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"ICD: ".toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: AppText(
|
|
|
|
|
widget.mySelectedAssessment.selectedICD.code.trim().toUpperCase()??"",
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"Appointment #: ",
|
|
|
|
|
fontWeight: FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
assessment
|
|
|
|
|
.appointmentId
|
|
|
|
|
.toString(),
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
openAssessmentDialog(context);
|
|
|
|
|
},
|
|
|
|
|
child: Icon(EvaIcons
|
|
|
|
|
.edit2Outline),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
assessment
|
|
|
|
|
.selectedDiagnosisCondition
|
|
|
|
|
.nameEn,
|
|
|
|
|
fontWeight: FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"Type : ",
|
|
|
|
|
fontWeight: FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
assessment
|
|
|
|
|
.selectedDiagnosisType
|
|
|
|
|
.nameEn,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if(assessment.doctorName != null)
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"Doc : ",
|
|
|
|
|
fontWeight: FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
assessment.doctorName??'',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width * 0.5,
|
|
|
|
|
child: AppText(
|
|
|
|
|
assessment.remark ?? "",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"ICD: ".toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: AppText(
|
|
|
|
|
assessment.selectedICD
|
|
|
|
|
.code.trim()
|
|
|
|
|
.toUpperCase() ??
|
|
|
|
|
"",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
openAssessmentDialog(
|
|
|
|
|
context, isUpdate: true,
|
|
|
|
|
assessment: assessment,
|
|
|
|
|
model: model);
|
|
|
|
|
},
|
|
|
|
|
child: Icon(EvaIcons
|
|
|
|
|
.edit2Outline),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),)
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
isExpand: isAssessmentExpand,
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.next,
|
|
|
|
|
loading: model.state == ViewState.BusyLocal,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
await submitAssessment(model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
DividerWithSpacesAround(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.next,
|
|
|
|
|
loading: model.state == ViewState.BusyLocal,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
widget.changePageViewIndex(3);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)));
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
submitAssessment(SOAPViewModel model) async {
|
|
|
|
|
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
|
|
|
|
|
widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD !=null ) {
|
|
|
|
|
|
|
|
|
|
if(model.patientAssessmentList.isEmpty){
|
|
|
|
|
PostAssessmentRequestModel postAssessmentRequestModel =
|
|
|
|
|
new PostAssessmentRequestModel(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
icdCodeDetails: [
|
|
|
|
|
new IcdCodeDetails(
|
|
|
|
|
remarks: widget.mySelectedAssessment.remark,
|
|
|
|
|
complexDiagnosis: true,
|
|
|
|
|
conditionId:
|
|
|
|
|
widget.mySelectedAssessment.selectedDiagnosisCondition.id,
|
|
|
|
|
diagnosisTypeId:
|
|
|
|
|
widget.mySelectedAssessment.selectedDiagnosisType.id,
|
|
|
|
|
icdcode10Id: widget.mySelectedAssessment.selectedICD.code)
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
await model.postAssessment(postAssessmentRequestModel);
|
|
|
|
|
} else {
|
|
|
|
|
PatchAssessmentReqModel patchAssessmentReqModel =
|
|
|
|
|
PatchAssessmentReqModel(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
remarks: widget.mySelectedAssessment.remark,
|
|
|
|
|
complexDiagnosis: true,
|
|
|
|
|
conditionId:
|
|
|
|
|
widget.mySelectedAssessment.selectedDiagnosisCondition.id,
|
|
|
|
|
diagnosisTypeId:
|
|
|
|
|
widget.mySelectedAssessment.selectedDiagnosisType.id,
|
|
|
|
|
icdcode10Id: widget.mySelectedAssessment.selectedICD.code,
|
|
|
|
|
prevIcdCode10ID: model.patientAssessmentList[0].icdCode10ID
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
await model.patchAssessment(patchAssessmentReqModel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
widget.changePageViewIndex(3);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
|
|
|
|
|
openAssessmentDialog(BuildContext context,
|
|
|
|
|
{
|
|
|
|
|
MySelectedAssessment assessment, bool isUpdate,
|
|
|
|
|
SOAPViewModel model
|
|
|
|
|
}) {
|
|
|
|
|
if (assessment == null) {
|
|
|
|
|
assessment = MySelectedAssessment(
|
|
|
|
|
remark: '', appointmentId: widget.patientInfo.appointmentNo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
widget.changePageViewIndex(3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openAssessmentDialog(BuildContext context) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return AddAssessmentDetails(
|
|
|
|
|
mySelectedAssessment: widget.mySelectedAssessment,
|
|
|
|
|
addSelectedAssessment: () {
|
|
|
|
|
mySelectedAssessment: assessment,
|
|
|
|
|
patientInfo: widget.patientInfo,
|
|
|
|
|
isUpdate: isUpdate,
|
|
|
|
|
mySelectedAssessmentList: widget.mySelectedAssessmentList,
|
|
|
|
|
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment,
|
|
|
|
|
bool isUpdate) async {
|
|
|
|
|
setState(() {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
@ -428,32 +412,34 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
|
|
|
|
|
class AddAssessmentDetails extends StatefulWidget {
|
|
|
|
|
final MySelectedAssessment mySelectedAssessment;
|
|
|
|
|
final Function() addSelectedAssessment;
|
|
|
|
|
final List<MySelectedAssessment> mySelectedAssessmentList;
|
|
|
|
|
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment;
|
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
|
const AddAssessmentDetails(
|
|
|
|
|
{Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
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> {
|
|
|
|
|
// MasterKeyModel _selectedDiagnosisCondition;
|
|
|
|
|
// MasterKeyModel _selectedDiagnosisType;
|
|
|
|
|
TextEditingController remarkController = TextEditingController();
|
|
|
|
|
TextEditingController appointmentIdController = TextEditingController();
|
|
|
|
|
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
remarkController.text = widget.mySelectedAssessment.remark??"";
|
|
|
|
|
appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
|
|
|
|
|
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}) {
|
|
|
|
|
String selectedText, bool isDropDown, {IconData icon}) {
|
|
|
|
|
//TODO: make one Input InputDecoration for all
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
@ -686,16 +672,34 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
),
|
|
|
|
|
AppButton(
|
|
|
|
|
title: "Add".toUpperCase(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
loading: model.state == ViewState.BusyLocal,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
widget.mySelectedAssessment.remark =
|
|
|
|
|
remarkController.text;
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.appointmentId = int.parse(
|
|
|
|
|
appointmentIdController.text);
|
|
|
|
|
|
|
|
|
|
widget.addSelectedAssessment();
|
|
|
|
|
});
|
|
|
|
|
if (widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisCondition !=
|
|
|
|
|
null &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedDiagnosisType !=
|
|
|
|
|
null &&
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD != null) {
|
|
|
|
|
widget.addSelectedAssessment(
|
|
|
|
|
widget.mySelectedAssessment,
|
|
|
|
|
widget.isUpdate);
|
|
|
|
|
await submitAssessment(
|
|
|
|
|
isUpdate: widget.isUpdate,
|
|
|
|
|
model: model,
|
|
|
|
|
mySelectedAssessment: widget
|
|
|
|
|
.mySelectedAssessment);
|
|
|
|
|
} else {
|
|
|
|
|
helpers.showErrorToast(TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.requiredMsg);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
])),
|
|
|
|
@ -704,6 +708,61 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
))),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 {
|
|
|
|
|
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
|
|
|
|
|
|
|
|
|
|
if (!isUpdate) {
|
|
|
|
|
widget.mySelectedAssessmentList.add(mySelectedAssessment);
|
|
|
|
|
}
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// widget.changePageViewIndex(3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|