|
@@ -11,6 +11,7 @@ import 'package:vitalapp/architecture/utils/compute_children_level.dart';
|
|
|
import 'package:vitalapp/architecture/utils/prompt_box.dart';
|
|
|
import 'package:vitalapp/components/button.dart';
|
|
|
import 'package:vitalapp/components/dialog_date.dart';
|
|
|
+import 'package:vitalapp/components/dialog_gxy_medication.dart';
|
|
|
import 'package:vitalapp/components/dialog_input.dart';
|
|
|
import 'package:vitalapp/components/dialog_medication.dart';
|
|
|
import 'package:vitalapp/components/dialog_number.dart';
|
|
@@ -47,6 +48,7 @@ import 'package:vitalapp/pages/check/widgets/follow_up_configurable/follow_up_ch
|
|
|
import 'package:vitalapp/pages/check/widgets/follow_up_configurable/follow_up_child_height_and_weight.dart';
|
|
|
import 'package:vitalapp/pages/check/widgets/follow_up_configurable/follow_up_child_radio_input.dart';
|
|
|
import 'package:vitalapp/pages/check/widgets/follow_up_configurable/follow_up_child_referral.dart';
|
|
|
+import 'package:vitalapp/pages/check/widgets/follow_up_configurable/follow_up_medication.dart';
|
|
|
import 'package:vitalapp/pages/check/widgets/follow_up_configurable/follow_up_resident_detail.dart';
|
|
|
import 'package:vitalapp/pages/check/widgets/title_clip_path.dart';
|
|
|
import 'package:flutter/services.dart' show rootBundle;
|
|
@@ -465,6 +467,7 @@ class _ConfigurableFormState extends State<ConfigurableCard> {
|
|
|
'radioHospitalization': _buildRadioHospitalization,
|
|
|
'radioReferral': _buildRadioReferral,
|
|
|
'medication': _buildMedication,
|
|
|
+ 'gxyAndTnbMedication': _buildGxyAndTnbMedication,
|
|
|
'radioExtraDescription': _buildRadioExtraDescription,
|
|
|
'checkBoxIncludeOther': _buildCheckBoxIncludeOther,
|
|
|
'inputAndRadio': _buildChildHeightAndWeight,
|
|
@@ -1228,6 +1231,60 @@ class _ConfigurableFormState extends State<ConfigurableCard> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ /// 高血压和糖尿病用药情况与指导
|
|
|
+ Widget _buildGxyAndTnbMedication(FormObject currentFormObject) {
|
|
|
+ List<dynamic> currentValue = [];
|
|
|
+ var value = formValue[currentFormObject.key!];
|
|
|
+ if (value is String) {
|
|
|
+ return Container();
|
|
|
+ } else {
|
|
|
+ if (value != null) currentValue = value;
|
|
|
+ }
|
|
|
+
|
|
|
+ Future<void> addVeterinaryDrug() async {
|
|
|
+ MedicationModel? result = await VDialogGxyMedication(
|
|
|
+ title: currentFormObject.label,
|
|
|
+ ).show();
|
|
|
+ if (result != null) {
|
|
|
+ currentValue.add(result.toJson());
|
|
|
+ formValue[currentFormObject.key!] = null;
|
|
|
+ formValue[currentFormObject.key!] = currentValue;
|
|
|
+ setState(() {});
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Future<void> deleteVeterinaryDrug(int index) async {
|
|
|
+ currentValue.removeAt(index);
|
|
|
+ formValue[currentFormObject.key!] = null;
|
|
|
+ formValue[currentFormObject.key!] = currentValue;
|
|
|
+ setState(() {});
|
|
|
+ }
|
|
|
+
|
|
|
+ Future<void> editVeterinaryDrug(int index) async {
|
|
|
+ MedicationModel medicationModel =
|
|
|
+ MedicationModel.fromJson(currentValue[index]);
|
|
|
+
|
|
|
+ MedicationModel? result = await VDialogGxyMedication(
|
|
|
+ title: currentFormObject.label,
|
|
|
+ medicationModel: medicationModel,
|
|
|
+ ).show();
|
|
|
+ if (result != null) {
|
|
|
+ currentValue[index] = result.toJson();
|
|
|
+ formValue[currentFormObject.key!] = null;
|
|
|
+ formValue[currentFormObject.key!] = currentValue;
|
|
|
+ setState(() {});
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return FollowUpGxyAndTnbMedication(
|
|
|
+ currentFormObject: currentFormObject,
|
|
|
+ currentValues: currentValue,
|
|
|
+ addVeterinaryDrug: addVeterinaryDrug,
|
|
|
+ deleteVeterinaryDrug: deleteVeterinaryDrug,
|
|
|
+ editVeterinaryDrug: editVeterinaryDrug,
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
///转诊
|
|
|
Widget _buildRadioReferral(FormObject currentFormObject) {
|
|
|
List<Option> options = currentFormObject.options ?? [];
|