|
|
|
|
@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/config/config.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/models/SOAP/GetAssessmentReqModel.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';
|
|
|
|
|
@ -36,19 +37,53 @@ class UpdateAssessmentPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
bool isAssessmentExpand = false;
|
|
|
|
|
|
|
|
|
|
List<dynamic> assessmentList;
|
|
|
|
|
dynamic _referTo;
|
|
|
|
|
|
|
|
|
|
TextEditingController remarksController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
|
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
|
onModelReady: (model) async{
|
|
|
|
|
|
|
|
|
|
widget.mySelectedAssessment.appointmentId =widget.patientInfo.appointmentNo;
|
|
|
|
|
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo);
|
|
|
|
|
await model.getPatientAssessment(getAssessmentReqModel);
|
|
|
|
|
if(model.patientAssessmentList.isNotEmpty){
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
child: Center(
|
|
|
|
|
@ -58,66 +93,67 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
HeaderBodyExpandableNotifier(
|
|
|
|
|
headerWidget: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
HeaderBodyExpandableNotifier(
|
|
|
|
|
headerWidget: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts('ASSESSMENT',
|
|
|
|
|
variant:
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts('ASSESSMENT',
|
|
|
|
|
variant:
|
|
|
|
|
isAssessmentExpand ? "bodyText" : '',
|
|
|
|
|
bold: isAssessmentExpand ? true : false,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
Icon(
|
|
|
|
|
FontAwesomeIcons.asterisk,
|
|
|
|
|
color: AppGlobal.appPrimaryColor,
|
|
|
|
|
size: 12,
|
|
|
|
|
)
|
|
|
|
|
bold: isAssessmentExpand ? true : false,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
Icon(
|
|
|
|
|
FontAwesomeIcons.asterisk,
|
|
|
|
|
color: AppGlobal.appPrimaryColor,
|
|
|
|
|
size: 12,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAssessmentExpand = !isAssessmentExpand;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Icon(isAssessmentExpand
|
|
|
|
|
? EvaIcons.minus
|
|
|
|
|
: EvaIcons.plus))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAssessmentExpand = !isAssessmentExpand;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Icon(isAssessmentExpand
|
|
|
|
|
? EvaIcons.minus
|
|
|
|
|
: EvaIcons.plus))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
bodyWidget: Column(children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
bodyWidget: Column(children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 5, right: 5, top: 15),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: "Add ASSESSMENT",
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
onTapTextFields: () {
|
|
|
|
|
openAssessmentDialog(context);
|
|
|
|
|
},
|
|
|
|
|
readOnly: true,
|
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
|
suffixIcon: EvaIcons.plusCircleOutline,
|
|
|
|
|
suffixIconColor: AppGlobal.appPrimaryColor,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
// controller: messageController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null)
|
|
|
|
|
return TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: "Add ASSESSMENT",
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
onTapTextFields: () {
|
|
|
|
|
openAssessmentDialog(context);
|
|
|
|
|
},
|
|
|
|
|
readOnly: true,
|
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
|
suffixIcon: EvaIcons.plusCircleOutline,
|
|
|
|
|
suffixIconColor: AppGlobal
|
|
|
|
|
.appPrimaryColor,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
// controller: messageController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null)
|
|
|
|
|
return TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
@ -242,7 +278,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
widget.mySelectedAssessment.remark,
|
|
|
|
|
widget.mySelectedAssessment.remark??"",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
@ -263,7 +299,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"R07.1".toUpperCase(),
|
|
|
|
|
widget.mySelectedAssessment.selectedICD.code.toUpperCase()??"",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
@ -291,44 +327,68 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
isExpand: isAssessmentExpand,
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context).next,
|
|
|
|
|
loading: model.state == ViewState.BusyLocal,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
await submitAssessment(model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.next,
|
|
|
|
|
loading: model.state == ViewState.BusyLocal,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
await submitAssessment(model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)));
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
submitAssessment(SOAPViewModel model) async {
|
|
|
|
|
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
|
|
|
|
|
widget.mySelectedAssessment.selectedDiagnosisType != null) {
|
|
|
|
|
PatchAssessmentReqModel patchAssessmentReqModel =
|
|
|
|
|
new 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: "1",
|
|
|
|
|
prevIcdCode10ID: "1"
|
|
|
|
|
);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await model.patchAssessment(patchAssessmentReqModel);
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
@ -363,9 +423,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
|
|
|
|
|
class AddAssessmentDetails extends StatefulWidget {
|
|
|
|
|
final MySelectedAssessment mySelectedAssessment;
|
|
|
|
|
final Function() addSelectedAssessment;
|
|
|
|
|
|
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
|
const AddAssessmentDetails(
|
|
|
|
|
{Key key, this.mySelectedAssessment, this.addSelectedAssessment})
|
|
|
|
|
{Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -376,13 +436,13 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
// MasterKeyModel _selectedDiagnosisCondition;
|
|
|
|
|
// MasterKeyModel _selectedDiagnosisType;
|
|
|
|
|
TextEditingController remarkController = TextEditingController();
|
|
|
|
|
TextEditingController appointmentIdController = TextEditingController(
|
|
|
|
|
text: "234567");
|
|
|
|
|
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();
|
|
|
|
|
final screenSize = MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size;
|
|
|
|
|
@ -644,7 +704,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
class PatchAssessmentReqModel {
|
|
|
|
|
int patientMRN;
|
|
|
|
|
int appointmentNo;
|
|
|
|
|
int episodeId;
|
|
|
|
|
int episodeID;
|
|
|
|
|
String icdcode10Id;
|
|
|
|
|
String prevIcdCode10ID;
|
|
|
|
|
int conditionId;
|
|
|
|
|
@ -655,7 +715,7 @@ class PatchAssessmentReqModel {
|
|
|
|
|
PatchAssessmentReqModel(
|
|
|
|
|
{this.patientMRN,
|
|
|
|
|
this.appointmentNo,
|
|
|
|
|
this.episodeId,
|
|
|
|
|
this.episodeID,
|
|
|
|
|
this.icdcode10Id,
|
|
|
|
|
this.prevIcdCode10ID,
|
|
|
|
|
this.conditionId,
|
|
|
|
|
@ -664,28 +724,28 @@ class PatchAssessmentReqModel {
|
|
|
|
|
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'];
|
|
|
|
|
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;
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|