|
|
|
|
@ -19,33 +19,30 @@ class AddChiefComplaint extends StatefulWidget {
|
|
|
|
|
final String? thirdField;
|
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
|
|
|
|
|
|
const AddChiefComplaint({super.key,
|
|
|
|
|
required this.complaints,
|
|
|
|
|
required this.selectedType,
|
|
|
|
|
this.firstField,
|
|
|
|
|
this.secondField,
|
|
|
|
|
this.thirdField,
|
|
|
|
|
required this.patientInfo
|
|
|
|
|
});
|
|
|
|
|
const AddChiefComplaint(
|
|
|
|
|
{super.key,
|
|
|
|
|
required this.complaints,
|
|
|
|
|
required this.selectedType,
|
|
|
|
|
this.firstField,
|
|
|
|
|
this.secondField,
|
|
|
|
|
this.thirdField,
|
|
|
|
|
required this.patientInfo});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<AddChiefComplaint> createState() => _AddChiefComplaintState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _AddChiefComplaintState extends State<AddChiefComplaint> {
|
|
|
|
|
class _AddChiefComplaintState extends State<AddChiefComplaint> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
|
onModelReady: (model){
|
|
|
|
|
onModelReady: (model) {
|
|
|
|
|
episodeByChiefComplaint(model);
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
|
|
|
|
|
appBar: PatientSearchHeader(
|
|
|
|
|
title: TranslationBase.of(context).addChiefComplaint
|
|
|
|
|
),
|
|
|
|
|
title: TranslationBase.of(context).addChiefComplaint),
|
|
|
|
|
body: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(20.0),
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
@ -57,27 +54,29 @@ class _AddChiefComplaintState extends State<AddChiefComplaint> {
|
|
|
|
|
complaints: widget.complaints,
|
|
|
|
|
selectedType: widget.selectedType,
|
|
|
|
|
firstField: widget.firstField,
|
|
|
|
|
secondField:widget. secondField,
|
|
|
|
|
secondField: widget.secondField,
|
|
|
|
|
thirdField: widget.thirdField,
|
|
|
|
|
searchData: model.searchChiefComplaintList,
|
|
|
|
|
onSearch:(String value){
|
|
|
|
|
onSearch: (String value) {
|
|
|
|
|
searchChiefComplaint(model, value);
|
|
|
|
|
},
|
|
|
|
|
onSave: (String chiefComplaint){
|
|
|
|
|
addChiefComplaint(model, chiefComplaint, context);
|
|
|
|
|
},
|
|
|
|
|
onCrossClicked: (GetChiefComplaintVidaPlus chiefComplaint){
|
|
|
|
|
onSave: (String chiefComplaint) {
|
|
|
|
|
addChiefComplaint(model, chiefComplaint, context);
|
|
|
|
|
},
|
|
|
|
|
onCrossClicked: (GetChiefComplaintVidaPlus chiefComplaint) {
|
|
|
|
|
updateChiefComplaint(model, chiefComplaint, context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 16,),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
PreviousChiefComplaints(
|
|
|
|
|
model.episodeByChiefComplaintListVidaPlus,
|
|
|
|
|
(chiefComplains , String){
|
|
|
|
|
var listOfChiefComplaint = [chiefComplains];
|
|
|
|
|
createCCByEpisode(model,listOfChiefComplaint );
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
model.episodeByChiefComplaintListVidaPlus,
|
|
|
|
|
(chiefComplains, String) {
|
|
|
|
|
var listOfChiefComplaint = [chiefComplains];
|
|
|
|
|
createCCByEpisode(model, listOfChiefComplaint);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -85,34 +84,39 @@ class _AddChiefComplaintState extends State<AddChiefComplaint> {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
addChiefComplaint(SOAPViewModel model, String CC, BuildContext context) async{
|
|
|
|
|
|
|
|
|
|
addChiefComplaint(
|
|
|
|
|
SOAPViewModel model, String CC, BuildContext context) async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.saveChiefComplaint(widget.patientInfo, CC);
|
|
|
|
|
await model.getChiefComplaint(widget.patientInfo);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
}
|
|
|
|
|
searchChiefComplaint(SOAPViewModel model, String CC) async{
|
|
|
|
|
await model.searchChiefComplaint(widget.patientInfo, CC);
|
|
|
|
|
|
|
|
|
|
searchChiefComplaint(SOAPViewModel model, String CC) async {
|
|
|
|
|
await model.searchChiefComplaint(widget.patientInfo, CC);
|
|
|
|
|
}
|
|
|
|
|
updateChiefComplaint(SOAPViewModel model, GetChiefComplaintVidaPlus cc, BuildContext context) async{
|
|
|
|
|
|
|
|
|
|
updateChiefComplaint(SOAPViewModel model, GetChiefComplaintVidaPlus cc,
|
|
|
|
|
BuildContext context) async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.updateChiefComplaint(widget.patientInfo, cc);
|
|
|
|
|
await model.getChiefComplaint(widget.patientInfo);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
setState(() {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
episodeByChiefComplaint(SOAPViewModel model) async {
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
|
await model.episodeByChiefComplaint(widget.patientInfo);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
episodeByChiefComplaint(SOAPViewModel model) async{
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async{
|
|
|
|
|
await model.episodeByChiefComplaint(widget.patientInfo);});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
createCCByEpisode(model, List<PatientPomrs> chiefComplaint) async{
|
|
|
|
|
createCCByEpisode(model, List<PatientPomrs> chiefComplaint) async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.createCCByEpisode(widget.patientInfo, chiefComplaint);
|
|
|
|
|
var result =
|
|
|
|
|
await model.createCCByEpisode(widget.patientInfo, chiefComplaint);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
if (result) Navigator.of(context).pop();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|