soap vida plus inprogress
parent
a95b5d331b
commit
f3876e9ef1
@ -0,0 +1,68 @@
|
||||
class GetChiefComplaintVidaPlus {
|
||||
int? appointmentId;
|
||||
String? chiefComplain;
|
||||
int? chiefComplainId;
|
||||
int? chiefComplainTemplateId;
|
||||
int? clinicGroupId;
|
||||
int? clinicId;
|
||||
int? doctorId;
|
||||
String? doctorName;
|
||||
int? episodeId;
|
||||
int? hospitalGroupId;
|
||||
int? hospitalId;
|
||||
String? loginUserId;
|
||||
int? patientId;
|
||||
int? patientPomrId;
|
||||
|
||||
GetChiefComplaintVidaPlus(
|
||||
{this.appointmentId,
|
||||
this.chiefComplain,
|
||||
this.chiefComplainId,
|
||||
this.chiefComplainTemplateId,
|
||||
this.clinicGroupId,
|
||||
this.clinicId,
|
||||
this.doctorId,
|
||||
this.doctorName,
|
||||
this.episodeId,
|
||||
this.hospitalGroupId,
|
||||
this.hospitalId,
|
||||
this.loginUserId,
|
||||
this.patientId,
|
||||
this.patientPomrId});
|
||||
|
||||
GetChiefComplaintVidaPlus.fromJson(Map<String, dynamic> json) {
|
||||
appointmentId = json['appointmentId'];
|
||||
chiefComplain = json['chiefComplain'];
|
||||
chiefComplainId = json['chiefComplainId'];
|
||||
chiefComplainTemplateId = json['chiefComplainTemplateId'];
|
||||
clinicGroupId = json['clinicGroupId'];
|
||||
clinicId = json['clinicId'];
|
||||
doctorId = json['doctorId'];
|
||||
doctorName = json['doctorName'];
|
||||
episodeId = json['episodeId'];
|
||||
hospitalGroupId = json['hospitalGroupId'];
|
||||
hospitalId = json['hospitalId'];
|
||||
loginUserId = json['loginUserId'];
|
||||
patientId = json['patientId'];
|
||||
patientPomrId = json['patientPomrId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['appointmentId'] = this.appointmentId;
|
||||
data['chiefComplain'] = this.chiefComplain;
|
||||
data['chiefComplainId'] = this.chiefComplainId;
|
||||
data['chiefComplainTemplateId'] = this.chiefComplainTemplateId;
|
||||
data['clinicGroupId'] = this.clinicGroupId;
|
||||
data['clinicId'] = this.clinicId;
|
||||
data['doctorId'] = this.doctorId;
|
||||
data['doctorName'] = this.doctorName;
|
||||
data['episodeId'] = this.episodeId;
|
||||
data['hospitalGroupId'] = this.hospitalGroupId;
|
||||
data['hospitalId'] = this.hospitalId;
|
||||
data['loginUserId'] = this.loginUserId;
|
||||
data['patientId'] = this.patientId;
|
||||
data['patientPomrId'] = this.patientPomrId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
class SearchChiefComplaint {
|
||||
String? chiefComplain;
|
||||
String? chiefComplainCode;
|
||||
int? chiefComplainId;
|
||||
String? clinic;
|
||||
int? hospitalGroupId;
|
||||
int? hospitalId;
|
||||
String? nursingGroup;
|
||||
|
||||
SearchChiefComplaint(
|
||||
{this.chiefComplain,
|
||||
this.chiefComplainCode,
|
||||
this.chiefComplainId,
|
||||
this.clinic,
|
||||
this.hospitalGroupId,
|
||||
this.hospitalId,
|
||||
this.nursingGroup});
|
||||
|
||||
SearchChiefComplaint.fromJson(Map<String, dynamic> json) {
|
||||
chiefComplain = json['chiefComplain'];
|
||||
chiefComplainCode = json['chiefComplainCode'];
|
||||
chiefComplainId = json['chiefComplainId'];
|
||||
clinic = json['clinic'];
|
||||
hospitalGroupId = json['hospitalGroupId'];
|
||||
hospitalId = json['hospitalId'];
|
||||
nursingGroup = json['nursingGroup'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['chiefComplain'] = this.chiefComplain;
|
||||
data['chiefComplainCode'] = this.chiefComplainCode;
|
||||
data['chiefComplainId'] = this.chiefComplainId;
|
||||
data['clinic'] = this.clinic;
|
||||
data['hospitalGroupId'] = this.hospitalGroupId;
|
||||
data['hospitalId'] = this.hospitalId;
|
||||
data['nursingGroup'] = this.nursingGroup;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
class GetHopiDetails {
|
||||
int? clinicId;
|
||||
int? doctorId;
|
||||
int? hospitalGroupId;
|
||||
int? hospitalId;
|
||||
String? hpi;
|
||||
int? hpiId;
|
||||
bool? isHpiTakenFamily;
|
||||
bool? isHpiTakenOther;
|
||||
bool? isHpiTakenPatient;
|
||||
String? loginUserId;
|
||||
int? patientId;
|
||||
int? patientPomrId;
|
||||
|
||||
GetHopiDetails(
|
||||
{this.clinicId,
|
||||
this.doctorId,
|
||||
this.hospitalGroupId,
|
||||
this.hospitalId,
|
||||
this.hpi,
|
||||
this.hpiId,
|
||||
this.isHpiTakenFamily,
|
||||
this.isHpiTakenOther,
|
||||
this.isHpiTakenPatient,
|
||||
this.loginUserId,
|
||||
this.patientId,
|
||||
this.patientPomrId});
|
||||
|
||||
GetHopiDetails.fromJson(Map<String, dynamic> json) {
|
||||
clinicId = json['clinicId'];
|
||||
doctorId = json['doctorId'];
|
||||
hospitalGroupId = json['hospitalGroupId'];
|
||||
hospitalId = json['hospitalId'];
|
||||
hpi = json['hpi'];
|
||||
hpiId = json['hpiId'];
|
||||
isHpiTakenFamily = json['isHpiTakenFamily'];
|
||||
isHpiTakenOther = json['isHpiTakenOther'];
|
||||
isHpiTakenPatient = json['isHpiTakenPatient'];
|
||||
loginUserId = json['loginUserId'];
|
||||
patientId = json['patientId'];
|
||||
patientPomrId = json['patientPomrId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['clinicId'] = this.clinicId;
|
||||
data['doctorId'] = this.doctorId;
|
||||
data['hospitalGroupId'] = this.hospitalGroupId;
|
||||
data['hospitalId'] = this.hospitalId;
|
||||
data['hpi'] = this.hpi;
|
||||
data['hpiId'] = this.hpiId;
|
||||
data['isHpiTakenFamily'] = this.isHpiTakenFamily;
|
||||
data['isHpiTakenOther'] = this.isHpiTakenOther;
|
||||
data['isHpiTakenPatient'] = this.isHpiTakenPatient;
|
||||
data['loginUserId'] = this.loginUserId;
|
||||
data['patientId'] = this.patientId;
|
||||
data['patientPomrId'] = this.patientPomrId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,181 +1,207 @@
|
||||
|
||||
import 'package:doctor_app_flutter/core/model/SOAP/allergy/get_patient_allergies_list_vida_plus.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/allergies/reactions_selection.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
|
||||
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
|
||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
||||
import 'package:doctor_app_flutter/utils/utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../../../../core/model/patient/patiant_info_model.dart';
|
||||
import '../../../../../../widgets/transitions/fade_page.dart';
|
||||
import '../chief_complaint/widgets/add_soap_item.dart';
|
||||
import 'add_allergies.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||
|
||||
class UpdateAllergiesWidgetVidaPlus extends StatefulWidget {
|
||||
List<PatientAllergiesVidaPlus>? myAllergiesList;
|
||||
final PatiantInformtion patientInfo;
|
||||
|
||||
UpdateAllergiesWidgetVidaPlus({Key? key, this.myAllergiesList});
|
||||
UpdateAllergiesWidgetVidaPlus(
|
||||
{Key? key, this.myAllergiesList, required this.patientInfo});
|
||||
|
||||
@override
|
||||
_UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState();
|
||||
}
|
||||
|
||||
bool noKnownAllergies = false;
|
||||
enum Severity {mild,moderate,severe }
|
||||
|
||||
enum Severity { mild, moderate, severe }
|
||||
|
||||
class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidgetVidaPlus> {
|
||||
SOAPViewModel? model;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
changeAllState() {
|
||||
setState(() {
|
||||
print(widget.myAllergiesList);
|
||||
});
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
AddSoapItem(
|
||||
title: "${TranslationBase.of(context).addAllergies}",
|
||||
onAddSoapItemClicked: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: AddAllergies(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
widget.myAllergiesList!.isEmpty
|
||||
? Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Checkbox(
|
||||
value: noKnownAllergies,
|
||||
checkColor: Colors.white,
|
||||
activeColor: Colors.red,
|
||||
onChanged: (value) {
|
||||
noKnownAllergies = value!;
|
||||
setState(() {});
|
||||
},
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
// Reduces padding around checkbox
|
||||
visualDensity:
|
||||
VisualDensity.compact, // Minimizes size further
|
||||
),
|
||||
AppText(TranslationBase.of(context).noKnownAllergies)
|
||||
],
|
||||
)
|
||||
: Divider(
|
||||
thickness: 1,
|
||||
color: Color(0xffEFEFEF),
|
||||
),
|
||||
ListView(
|
||||
padding: EdgeInsets.all(10),
|
||||
shrinkWrap: true,
|
||||
children: widget.myAllergiesList!.map((selectedAllergy) {
|
||||
return Column(
|
||||
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
selectedAllergy.allergyName!,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w800,
|
||||
letterSpacing: -0.48,
|
||||
),
|
||||
|
||||
selectedAllergy.patientsAllergyReactionsDTOs!.isNotEmpty ? ListView(
|
||||
shrinkWrap: true,
|
||||
children: selectedAllergy.patientsAllergyReactionsDTOs!.map((PatientsAllergyReactionsDTOs reaction) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
Row(children: [ AppText(reaction.allergyReactionName!, fontSize: 10,),
|
||||
AppText(" - "),
|
||||
AppText(
|
||||
Severity.values[reaction.severity! -1].name,
|
||||
|
||||
color: Color(0xFFCC9B14),
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.48,
|
||||
)],)
|
||||
|
||||
],)).toList()) : AppText("----"),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
TextButton.icon(
|
||||
onPressed: () {},
|
||||
icon: SvgPicture.asset(
|
||||
"assets/images/svgs/edit-icon.svg",
|
||||
height: 16,
|
||||
),
|
||||
label: AppText(
|
||||
"Edit",
|
||||
fontSize: 12,
|
||||
return BaseView<SOAPViewModel>(
|
||||
onModelReady: (model) {},
|
||||
builder: (_, model, w) => Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
AddSoapItem(
|
||||
title: "${TranslationBase.of(context).addAllergies}",
|
||||
onAddSoapItemClicked: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: AddAllergies(
|
||||
patientInfo: widget.patientInfo,
|
||||
// addAllergiesFun: (){
|
||||
// print("addAllergies save");
|
||||
// },
|
||||
),
|
||||
),
|
||||
TextButton.icon(
|
||||
onPressed: () {},
|
||||
icon: SvgPicture.asset(
|
||||
"assets/images/svgs/resolve.svg",
|
||||
height: 18,
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
widget.myAllergiesList!.isEmpty
|
||||
? Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Checkbox(
|
||||
value: noKnownAllergies,
|
||||
checkColor: Colors.white,
|
||||
activeColor: Colors.red,
|
||||
onChanged: (value) {
|
||||
noKnownAllergies = value!;
|
||||
setState(() {});
|
||||
},
|
||||
materialTapTargetSize:
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
// Reduces padding around checkbox
|
||||
visualDensity:
|
||||
VisualDensity.compact, // Minimizes size further
|
||||
),
|
||||
AppText(TranslationBase.of(context).noKnownAllergies)
|
||||
],
|
||||
)
|
||||
: Divider(
|
||||
thickness: 1,
|
||||
color: Color(0xffEFEFEF),
|
||||
),
|
||||
ListView(
|
||||
padding: EdgeInsets.all(10),
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
children: widget.myAllergiesList!.map((selectedAllergy) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
selectedAllergy.allergyName!,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w800,
|
||||
letterSpacing: -0.48,
|
||||
),
|
||||
label: AppText("Resolve",
|
||||
fontSize: 12, color: Color(0xff359846)))
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}).toList()),
|
||||
],
|
||||
);
|
||||
selectedAllergy
|
||||
.patientsAllergyReactionsDTOs!.isNotEmpty
|
||||
? ListView(
|
||||
shrinkWrap: true,
|
||||
children: selectedAllergy
|
||||
.patientsAllergyReactionsDTOs!
|
||||
.map((PatientsAllergyReactionsDTOs
|
||||
reaction) =>
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
reaction
|
||||
.allergyReactionName!,
|
||||
fontSize: 10,
|
||||
),
|
||||
AppText(" - "),
|
||||
AppText(
|
||||
Severity
|
||||
.values[
|
||||
reaction.severity! -
|
||||
1]
|
||||
.name,
|
||||
color:getColor(reaction.severity!),
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.48,
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
))
|
||||
.toList())
|
||||
: AppText("----"),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
TextButton.icon(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page:
|
||||
ReactionsSelectionAllergiesWidget(
|
||||
model: model,
|
||||
mySelectedAllergy: null,
|
||||
editSelectedAllergy: selectedAllergy!,
|
||||
patientInfo: widget.patientInfo,
|
||||
)));
|
||||
},
|
||||
icon: SvgPicture.asset(
|
||||
"assets/images/svgs/edit-icon.svg",
|
||||
height: 16,
|
||||
),
|
||||
label: AppText(
|
||||
TranslationBase.of(context).edit,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
TextButton.icon(
|
||||
onPressed: () {
|
||||
resolveAllergy(model, selectedAllergy);
|
||||
},
|
||||
icon: SvgPicture.asset(
|
||||
"assets/images/svgs/resolve.svg",
|
||||
height: 18,
|
||||
),
|
||||
label: AppText(
|
||||
TranslationBase.of(context).resolve,
|
||||
fontSize: 12,
|
||||
color: Color(0xff359846)))
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}).toList()),
|
||||
],
|
||||
));
|
||||
}
|
||||
//
|
||||
// removeAllergy(MySelectedAllergy mySelectedAllergy) {
|
||||
// List<MySelectedAllergy> allergy =
|
||||
// // ignore: missing_return
|
||||
// widget.myAllergiesList!
|
||||
// .where((element) => mySelectedAllergy.selectedAllergySeverity!.id == element.selectedAllergySeverity!.id && mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id)
|
||||
// .toList();
|
||||
//
|
||||
// if (allergy.length > 0) {
|
||||
// if (allergy.first.isLocal) {
|
||||
// setState(() {
|
||||
// widget.myAllergiesList!.remove(allergy.first);
|
||||
// });
|
||||
// }
|
||||
// setState(() {
|
||||
// allergy[0].isChecked = false;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// openAllergiesList(BuildContext context, Function changeParentState) {
|
||||
// showModalBottomSheet(
|
||||
// backgroundColor: Colors.white,
|
||||
// isScrollControlled: true,
|
||||
// isDismissible: false,
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return AddAllergies();
|
||||
// });
|
||||
// }
|
||||
resolveAllergy(
|
||||
SOAPViewModel model, PatientAllergiesVidaPlus selectedAllergy) async{
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
|
||||
await model.resolveAllergies(selectedAllergy, widget.patientInfo);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
|
||||
}
|
||||
Color getColor(int severity){
|
||||
Map<int,dynamic> color ={
|
||||
1:Color(0xff359846) ,
|
||||
2:Color(0xFFCC9B14),
|
||||
3:Color(0xffD02127)
|
||||
};
|
||||
return color[severity];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue