allergies work in progress
parent
f1b87f2568
commit
d44f6f8eb0
@ -0,0 +1,107 @@
|
|||||||
|
class AllergiesListVidaPlus {
|
||||||
|
int? allergyID;
|
||||||
|
String? allergyName;
|
||||||
|
List<AllergyReactionDTOs>? allergyReactionDTOs;
|
||||||
|
int? allergyRevisionID;
|
||||||
|
String? allergyTypeCode;
|
||||||
|
int? allergyTypeID;
|
||||||
|
String? allergyTypeName;
|
||||||
|
int? hospitalGroupID;
|
||||||
|
int? hospitalID;
|
||||||
|
bool? isActive;
|
||||||
|
bool? isSnowMedAllergy;
|
||||||
|
String? snowMedCode;
|
||||||
|
|
||||||
|
AllergiesListVidaPlus(
|
||||||
|
{this.allergyID,
|
||||||
|
this.allergyName,
|
||||||
|
this.allergyReactionDTOs,
|
||||||
|
this.allergyRevisionID,
|
||||||
|
this.allergyTypeCode,
|
||||||
|
this.allergyTypeID,
|
||||||
|
this.allergyTypeName,
|
||||||
|
this.hospitalGroupID,
|
||||||
|
this.hospitalID,
|
||||||
|
this.isActive,
|
||||||
|
this.isSnowMedAllergy,
|
||||||
|
this.snowMedCode});
|
||||||
|
|
||||||
|
AllergiesListVidaPlus.fromJson(Map<String, dynamic> json) {
|
||||||
|
allergyID = json['allergyID'];
|
||||||
|
allergyName = json['allergyName'];
|
||||||
|
if (json['allergyReactionDTOs'] != null) {
|
||||||
|
allergyReactionDTOs = <AllergyReactionDTOs>[];
|
||||||
|
json['allergyReactionDTOs'].forEach((v) {
|
||||||
|
allergyReactionDTOs!.add(new AllergyReactionDTOs.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
allergyRevisionID = json['allergyRevisionID'];
|
||||||
|
allergyTypeCode = json['allergyTypeCode'];
|
||||||
|
allergyTypeID = json['allergyTypeID'];
|
||||||
|
allergyTypeName = json['allergyTypeName'];
|
||||||
|
hospitalGroupID = json['hospitalGroupID'];
|
||||||
|
hospitalID = json['hospitalID'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
isSnowMedAllergy = json['isSnowMedAllergy'];
|
||||||
|
snowMedCode = json['snowMedCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['allergyID'] = this.allergyID;
|
||||||
|
data['allergyName'] = this.allergyName;
|
||||||
|
if (this.allergyReactionDTOs != null) {
|
||||||
|
data['allergyReactionDTOs'] =
|
||||||
|
this.allergyReactionDTOs!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['allergyRevisionID'] = this.allergyRevisionID;
|
||||||
|
data['allergyTypeCode'] = this.allergyTypeCode;
|
||||||
|
data['allergyTypeID'] = this.allergyTypeID;
|
||||||
|
data['allergyTypeName'] = this.allergyTypeName;
|
||||||
|
data['hospitalGroupID'] = this.hospitalGroupID;
|
||||||
|
data['hospitalID'] = this.hospitalID;
|
||||||
|
data['isActive'] = this.isActive;
|
||||||
|
data['isSnowMedAllergy'] = this.isSnowMedAllergy;
|
||||||
|
data['snowMedCode'] = this.snowMedCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AllergyReactionDTOs {
|
||||||
|
int? allergyReactionID;
|
||||||
|
String? allergyReactionName;
|
||||||
|
int? allergyReactionRevisionID;
|
||||||
|
int? hospitalGroupID;
|
||||||
|
int? hospitalID;
|
||||||
|
bool? isActive;
|
||||||
|
int? reactionSelection =1;
|
||||||
|
AllergyReactionDTOs(
|
||||||
|
{this.allergyReactionID,
|
||||||
|
this.allergyReactionName,
|
||||||
|
this.allergyReactionRevisionID,
|
||||||
|
this.hospitalGroupID,
|
||||||
|
this.hospitalID,
|
||||||
|
this.isActive,
|
||||||
|
this.reactionSelection
|
||||||
|
});
|
||||||
|
|
||||||
|
AllergyReactionDTOs.fromJson(Map<String, dynamic> json) {
|
||||||
|
allergyReactionID = json['allergyReactionID'];
|
||||||
|
allergyReactionName = json['allergyReactionName'];
|
||||||
|
allergyReactionRevisionID = json['allergyReactionRevisionID'];
|
||||||
|
hospitalGroupID = json['hospitalGroupID'];
|
||||||
|
hospitalID = json['hospitalID'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['allergyReactionID'] = this.allergyReactionID;
|
||||||
|
data['allergyReactionName'] = this.allergyReactionName;
|
||||||
|
data['allergyReactionRevisionID'] = this.allergyReactionRevisionID;
|
||||||
|
data['hospitalGroupID'] = this.hospitalGroupID;
|
||||||
|
data['hospitalID'] = this.hospitalID;
|
||||||
|
data['isActive'] = this.isActive;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/enum/view_state.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/SOAP/allergy/get_allergies_list_vida_plus.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.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/rounded_container_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
|
||||||
|
import '../../../../../../widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import '../../../soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
||||||
|
|
||||||
|
class ReactionsSelectionAllergiesWidget extends StatefulWidget {
|
||||||
|
final SOAPViewModel? model;
|
||||||
|
final AllergiesListVidaPlus mySelectedAllergy;
|
||||||
|
final Function(AllergiesListVidaPlus mySelectedAllergy) addReactionFun;
|
||||||
|
|
||||||
|
final String? buttonName;
|
||||||
|
|
||||||
|
ReactionsSelectionAllergiesWidget({
|
||||||
|
Key? key,
|
||||||
|
required this.model,
|
||||||
|
required this.addReactionFun,
|
||||||
|
required this.mySelectedAllergy,
|
||||||
|
this.buttonName,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ReactionsSelectionAllergiesWidgetState createState() =>
|
||||||
|
_ReactionsSelectionAllergiesWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ReactionsSelectionAllergiesWidgetState
|
||||||
|
extends State<ReactionsSelectionAllergiesWidget> {
|
||||||
|
// List<MasterKeyModel> items = [];
|
||||||
|
bool loading = false;
|
||||||
|
|
||||||
|
// TextEditingController filteredSearchController = TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AppScaffold(
|
||||||
|
// baseViewModel: model,
|
||||||
|
isShowAppBar: true,
|
||||||
|
appBar: BottomSheetTitle(
|
||||||
|
title: "Reactive" // TranslationBase.of(context).reac,
|
||||||
|
),
|
||||||
|
backgroundColor: Color(0xffbacF7F7F7),
|
||||||
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: RoundedContainer(
|
||||||
|
|
||||||
|
margin: EdgeInsets.all(15),
|
||||||
|
child: ListView.builder(
|
||||||
|
|
||||||
|
itemCount:
|
||||||
|
widget.mySelectedAllergy.allergyReactionDTOs!.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
loading = false;
|
||||||
|
return Column(children: [ ExpansionTile(
|
||||||
|
dense: false,
|
||||||
|
enableFeedback: false,
|
||||||
|
showTrailingIcon: false,
|
||||||
|
leading: Checkbox(value: false, onChanged: (bool) {}),
|
||||||
|
title: AppText(widget.mySelectedAllergy
|
||||||
|
.allergyReactionDTOs![index].allergyReactionName!),
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ListTile(
|
||||||
|
title: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Radio(
|
||||||
|
activeColor: Color(0xffD02127),
|
||||||
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, // Reduces padding around checkbox
|
||||||
|
visualDensity: VisualDensity.compact,
|
||||||
|
value: widget
|
||||||
|
.mySelectedAllergy
|
||||||
|
.allergyReactionDTOs![index]
|
||||||
|
.reactionSelection,
|
||||||
|
groupValue: widget
|
||||||
|
.mySelectedAllergy
|
||||||
|
.allergyReactionDTOs![index]
|
||||||
|
.allergyReactionID,
|
||||||
|
onChanged: (value) {
|
||||||
|
print(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
AppText('Mild', fontSize: 10,),
|
||||||
|
],
|
||||||
|
))),
|
||||||
|
Expanded(
|
||||||
|
child: ListTile(
|
||||||
|
title: Row(
|
||||||
|
|
||||||
|
children: <Widget>[
|
||||||
|
Radio(
|
||||||
|
activeColor: Color(0xffD02127),
|
||||||
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, // Reduces padding around checkbox
|
||||||
|
visualDensity: VisualDensity.compact,
|
||||||
|
value: widget
|
||||||
|
.mySelectedAllergy
|
||||||
|
.allergyReactionDTOs![index]
|
||||||
|
.reactionSelection,
|
||||||
|
groupValue: widget
|
||||||
|
.mySelectedAllergy
|
||||||
|
.allergyReactionDTOs![index]
|
||||||
|
.allergyReactionID,
|
||||||
|
onChanged: (value) {
|
||||||
|
print(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
AppText('Moderate', fontSize: 10,),
|
||||||
|
],
|
||||||
|
))),
|
||||||
|
Expanded(
|
||||||
|
child: ListTile(
|
||||||
|
title: Row(
|
||||||
|
|
||||||
|
children: <Widget>[
|
||||||
|
Radio(
|
||||||
|
activeColor: Color(0xffD02127),
|
||||||
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, // Reduces padding around checkbox
|
||||||
|
visualDensity: VisualDensity.compact,
|
||||||
|
value: widget
|
||||||
|
.mySelectedAllergy
|
||||||
|
.allergyReactionDTOs![index]
|
||||||
|
.reactionSelection,
|
||||||
|
groupValue: widget
|
||||||
|
.mySelectedAllergy
|
||||||
|
.allergyReactionDTOs![index]
|
||||||
|
.allergyReactionID,
|
||||||
|
onChanged: (value) {
|
||||||
|
print(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
AppText('Severe', fontSize: 10,),
|
||||||
|
],
|
||||||
|
)))
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
)))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue