Parcourir la source

新增产后 42 天健康检查记录表

loki.wu il y a 11 mois
Parent
commit
332f33df23

+ 259 - 229
assets/PrenatalFollowupServiceRecord.json → assets/PostpartumHealthCheckup42Days.json

@@ -1,6 +1,6 @@
 [
     {
-        "label": "(随访/督促)日期",
+        "label": "随访日期",
         "defaultValue": null,
         "span": 24,
         "key": "Form_Date",
@@ -18,16 +18,16 @@
         "childrenKey": null
     },
     {
-        "label": "孕周",
+        "label": "分娩日期",
         "defaultValue": null,
-        "span": 12,
-        "key": "Gestational_Week",
-        "type": "numberInput",
+        "span": 24,
+        "key": "Delivery_Date",
+        "type": "dateTime",
         "border": null,
         "disabledValue": null,
         "options": [],
         "children": null,
-        "append": "",
+        "append": "",
         "placeholder": "",
         "required": null,
         "show-limit": false,
@@ -36,11 +36,11 @@
         "childrenKey": null
     },
     {
-        "label": "主诉",
+        "label": "出院日期",
         "defaultValue": null,
-        "span": 12,
-        "key": "Chief_Complaint",
-        "type": "input",
+        "span": 24,
+        "key": "Discharge_Date",
+        "type": "dateTime",
         "border": null,
         "disabledValue": null,
         "options": [],
@@ -54,16 +54,34 @@
         "childrenKey": null
     },
     {
-        "label": "体重",
+        "label": "一般健康状况",
         "defaultValue": null,
-        "span": 12,
-        "key": "Weight",
-        "type": "numberInput",
+        "span": 24,
+        "key": "GeneralHealthCondition",
+        "type": "input",
         "border": null,
         "disabledValue": null,
-        "options": [],
+        "options": null,
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "一般心理状况",
+        "defaultValue": null,
+        "span": 24,
+        "key": "MentalHealthStatus",
+        "type": "input",
+        "border": null,
+        "disabledValue": null,
+        "options": null,
         "children": null,
-        "append": "kg",
+        "append": "",
         "placeholder": "",
         "required": null,
         "show-limit": false,
@@ -72,159 +90,242 @@
         "childrenKey": null
     },
     {
-        "label": "产科检查",
+        "label": "血压",
         "defaultValue": null,
         "span": 24,
-        "key": "ObstetricExamination",
+        "key": "BloodPressure",
+        "type": "bloodPressure",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "mmHg",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null
+    },
+    {
+        "label": "乳房",
+        "defaultValue": null,
+        "span": 24,
+        "key": "Breasts",
         "type": "virtualTitle",
         "border": null,
         "disabledValue": null,
         "options": null,
         "children": [
             {
-                "label": "宫底高度",
-                "defaultValue": [],
-                "span": 24,
-                "key": "Fundal_Height",
-                "type": "numberInput",
-                "border": false,
-                "disabledValue": "1",
-                "maxItems": 10,
-                "options": null,
+                "label": "未见异常",
+                "defaultValue": null,
+                "span": 12,
+                "key": "Breasts_1",
+                "type": "option",
+                "border": null,
+                "disabledValue": null,
+                "options": [],
                 "children": null,
-                "append": "cm",
-                "placeholder": null,
+                "append": "",
+                "placeholder": "",
                 "required": null,
-                "show-limit": null,
-                "parentKey": "ObstetricExamination",
+                "show-limit": false,
+                "parentKey": "Breasts",
                 "buttonName": null,
                 "childrenKey": null
             },
             {
-                "label": "腹围",
-                "defaultValue": [],
-                "span": 24,
-                "key": "Abdominal_Circumference",
-                "type": "numberInput",
-                "border": false,
-                "disabledValue": "1",
-                "maxItems": 10,
-                "options": null,
+                "label": "异常",
+                "defaultValue": null,
+                "span": 12,
+                "key": "Breasts_2",
+                "type": "input",
+                "border": null,
+                "disabledValue": null,
+                "options": [],
                 "children": null,
-                "append": "cm",
-                "placeholder": null,
+                "append": "",
+                "placeholder": "",
                 "required": null,
-                "show-limit": null,
-                "parentKey": "ObstetricExamination",
+                "show-limit": false,
+                "parentKey": "Breasts",
                 "buttonName": null,
                 "childrenKey": null
-            },
+            }
+        ],
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null
+    },
+    {
+        "label": "恶露",
+        "defaultValue": null,
+        "span": 24,
+        "key": "Lochia",
+        "type": "virtualTitle",
+        "border": null,
+        "disabledValue": null,
+        "options": null,
+        "children": [
             {
-                "label": "胎位",
-                "defaultValue": [],
-                "span": 24,
-                "key": "Fetal_Position",
-                "type": "input",
-                "border": false,
-                "disabledValue": "1",
-                "maxItems": 10,
-                "options": null,
+                "label": "未见异常",
+                "defaultValue": null,
+                "span": 12,
+                "key": "Lochia_1",
+                "type": "option",
+                "border": null,
+                "disabledValue": null,
+                "options": [],
                 "children": null,
-                "append": "cm",
-                "placeholder": null,
+                "append": "",
+                "placeholder": "",
                 "required": null,
-                "show-limit": null,
-                "parentKey": "ObstetricExamination",
+                "show-limit": false,
+                "parentKey": "Lochia",
                 "buttonName": null,
                 "childrenKey": null
             },
             {
-                "label": "胎心率",
-                "defaultValue": [],
-                "span": 24,
-                "key": "Fetal_HeartRate",
-                "type": "numberInput",
-                "border": false,
-                "disabledValue": "1",
-                "maxItems": 10,
-                "options": null,
+                "label": "异常",
+                "defaultValue": null,
+                "span": 12,
+                "key": "Lochia_2",
+                "type": "input",
+                "border": null,
+                "disabledValue": null,
+                "options": [],
                 "children": null,
-                "append": "次/分钟",
-                "placeholder": null,
+                "append": "",
+                "placeholder": "",
                 "required": null,
-                "show-limit": null,
-                "parentKey": "ObstetricExamination",
+                "show-limit": false,
+                "parentKey": "Lochia",
                 "buttonName": null,
                 "childrenKey": null
             }
         ],
-        "append": "mmHg",
+        "append": "",
         "placeholder": "",
         "required": null,
         "show-limit": false,
         "parentKey": null
     },
     {
-        "label": "血压",
+        "label": "子宫",
         "defaultValue": null,
         "span": 24,
-        "key": "BloodPressure",
-        "type": "bloodPressure",
-        "border": null,
-        "disabledValue": null,
-        "options": [],
-        "children": null,
-        "append": "mmHg",
-        "placeholder": "",
-        "required": null,
-        "show-limit": false,
-        "parentKey": null
-    },
-    {
-        "label": "血红蛋白值",
-        "defaultValue": null,
-        "span": 12,
-        "key": "Hemoglobin",
-        "type": "input",
+        "key": "Uterus",
+        "type": "virtualTitle",
         "border": null,
         "disabledValue": null,
         "options": null,
-        "children": null,
-        "append": "g/L",
+        "children": [
+            {
+                "label": "未见异常",
+                "defaultValue": null,
+                "span": 12,
+                "key": "Uterus_1",
+                "type": "option",
+                "border": null,
+                "disabledValue": null,
+                "options": [],
+                "children": null,
+                "append": "",
+                "placeholder": "",
+                "required": null,
+                "show-limit": false,
+                "parentKey": "Uterus",
+                "buttonName": null,
+                "childrenKey": null
+            },
+            {
+                "label": "异常",
+                "defaultValue": null,
+                "span": 12,
+                "key": "Uterus_2",
+                "type": "input",
+                "border": null,
+                "disabledValue": null,
+                "options": [],
+                "children": null,
+                "append": "",
+                "placeholder": "",
+                "required": null,
+                "show-limit": false,
+                "parentKey": "Uterus",
+                "buttonName": null,
+                "childrenKey": null
+            }
+        ],
+        "append": "",
         "placeholder": "",
         "required": null,
         "show-limit": false,
-        "parentKey": null,
-        "buttonName": null,
-        "childrenKey": null
+        "parentKey": null
     },
     {
-        "label": "尿蛋白",
+        "label": "伤口",
         "defaultValue": null,
-        "span": 12,
-        "key": "Urine_Protein",
-        "type": "input",
+        "span": 24,
+        "key": "Wound",
+        "type": "virtualTitle",
         "border": null,
         "disabledValue": null,
         "options": null,
-        "children": null,
+        "children": [
+            {
+                "label": "未见异常",
+                "defaultValue": null,
+                "span": 12,
+                "key": "Wound_1",
+                "type": "option",
+                "border": null,
+                "disabledValue": null,
+                "options": [],
+                "children": null,
+                "append": "",
+                "placeholder": "",
+                "required": null,
+                "show-limit": false,
+                "parentKey": "Wound",
+                "buttonName": null,
+                "childrenKey": null
+            },
+            {
+                "label": "异常",
+                "defaultValue": null,
+                "span": 12,
+                "key": "Wound_2",
+                "type": "input",
+                "border": null,
+                "disabledValue": null,
+                "options": [],
+                "children": null,
+                "append": "",
+                "placeholder": "",
+                "required": null,
+                "show-limit": false,
+                "parentKey": "Wound",
+                "buttonName": null,
+                "childrenKey": null
+            }
+        ],
         "append": "",
         "placeholder": "",
         "required": null,
         "show-limit": false,
-        "parentKey": null,
-        "buttonName": null,
-        "childrenKey": null
+        "parentKey": null
     },
     {
-        "label": "其他辅助检查",
+        "label": "其他",
         "defaultValue": null,
         "span": 12,
-        "key": "Auxiliary_Examinations",
+        "key": "Other",
         "type": "input",
         "border": null,
         "disabledValue": null,
-        "options": null,
+        "options": [],
         "children": null,
         "append": "",
         "placeholder": "",
@@ -300,7 +401,7 @@
         "options": null,
         "children": [
             {
-                "label": "生活方式",
+                "label": "心理保健",
                 "defaultValue": null,
                 "span": 12,
                 "key": "Guidance_1",
@@ -318,7 +419,7 @@
                 "childrenKey": null
             },
             {
-                "label": "营养",
+                "label": "性保健与避孕",
                 "defaultValue": null,
                 "span": 12,
                 "key": "Guidance_2",
@@ -336,7 +437,7 @@
                 "childrenKey": null
             },
             {
-                "label": "心理",
+                "label": "婴儿喂养",
                 "defaultValue": null,
                 "span": 12,
                 "key": "Guidance_3",
@@ -354,7 +455,7 @@
                 "childrenKey": null
             },
             {
-                "label": "运动",
+                "label": "产妇营养",
                 "defaultValue": null,
                 "span": 12,
                 "key": "Guidance_4",
@@ -371,60 +472,6 @@
                 "buttonName": null,
                 "childrenKey": null
             },
-            {
-                "label": "自我监测",
-                "defaultValue": null,
-                "span": 12,
-                "key": "Guidance_5",
-                "type": "option",
-                "border": null,
-                "disabledValue": null,
-                "options": null,
-                "children": null,
-                "append": "",
-                "placeholder": "",
-                "required": false,
-                "show-limit": false,
-                "parentKey": "Guidance",
-                "buttonName": null,
-                "childrenKey": null
-            },
-            {
-                "label": "分娩准备",
-                "defaultValue": null,
-                "span": 12,
-                "key": "Guidance_Delivery_Preparation",
-                "type": "option",
-                "border": null,
-                "disabledValue": null,
-                "options": null,
-                "children": null,
-                "append": "",
-                "placeholder": "",
-                "required": false,
-                "show-limit": false,
-                "parentKey": "Guidance",
-                "buttonName": null,
-                "childrenKey": null
-            },
-            {
-                "label": "母乳喂养",
-                "defaultValue": null,
-                "span": 12,
-                "key": "Guidance_Breast_Feeding",
-                "type": "option",
-                "border": null,
-                "disabledValue": null,
-                "options": null,
-                "children": null,
-                "append": "",
-                "placeholder": "",
-                "required": false,
-                "show-limit": false,
-                "parentKey": "Guidance",
-                "buttonName": null,
-                "childrenKey": null
-            },
             {
                 "label": "其他",
                 "defaultValue": null,
@@ -451,38 +498,20 @@
         "parentKey": null
     },
     {
-        "label": "转诊",
+        "label": "处理",
         "defaultValue": null,
         "span": 12,
-        "key": "Referral",
+        "key": "Processing",
         "type": "virtualTitle",
         "border": null,
         "disabledValue": null,
         "options": null,
         "children": [
             {
-                "label": "无",
-                "defaultValue": null,
-                "span": 12,
-                "key": "referral_1",
-                "type": "option",
-                "border": null,
-                "disabledValue": null,
-                "options": null,
-                "children": null,
-                "append": "",
-                "placeholder": "",
-                "required": false,
-                "show-limit": false,
-                "parentKey": "Referral",
-                "buttonName": null,
-                "childrenKey": null
-            },
-            {
-                "label": "有",
+                "label": "结案",
                 "defaultValue": null,
                 "span": 12,
-                "key": "referral_2",
+                "key": "Processing_1",
                 "type": "option",
                 "border": null,
                 "disabledValue": null,
@@ -492,43 +521,62 @@
                 "placeholder": "",
                 "required": false,
                 "show-limit": false,
-                "parentKey": "Referral",
+                "parentKey": "Processing",
                 "buttonName": null,
                 "childrenKey": null
             },
             {
-                "label": "原因",
+                "label": "转诊",
                 "defaultValue": null,
                 "span": 12,
-                "key": "Reason_For_Referral",
-                "type": "input",
+                "key": "Referral",
+                "type": "virtualTitle",
                 "border": null,
                 "disabledValue": null,
                 "options": null,
-                "children": null,
+                "children": [
+                    {
+                        "label": "原因",
+                        "defaultValue": null,
+                        "span": 12,
+                        "key": "Reason_For_Referral",
+                        "type": "input",
+                        "border": null,
+                        "disabledValue": null,
+                        "options": null,
+                        "children": null,
+                        "append": "",
+                        "placeholder": "",
+                        "required": false,
+                        "show-limit": false,
+                        "parentKey": "Referral",
+                        "buttonName": null,
+                        "childrenKey": null
+                    },
+                    {
+                        "label": "机构及科室",
+                        "defaultValue": null,
+                        "span": 12,
+                        "key": "Institution_And_Department",
+                        "type": "input",
+                        "border": null,
+                        "disabledValue": null,
+                        "options": null,
+                        "children": null,
+                        "append": "",
+                        "placeholder": "",
+                        "required": false,
+                        "show-limit": false,
+                        "parentKey": "Referral",
+                        "buttonName": null,
+                        "childrenKey": null
+                    }
+                ],
                 "append": "",
                 "placeholder": "",
                 "required": false,
                 "show-limit": false,
-                "parentKey": "referral_Input",
-                "buttonName": null,
-                "childrenKey": null
-            },
-            {
-                "label": "机构及科室",
-                "defaultValue": null,
-                "span": 12,
-                "key": "Institution_And_Department",
-                "type": "input",
-                "border": null,
-                "disabledValue": null,
-                "options": null,
-                "children": null,
-                "append": "",
-                "placeholder": "",
-                "required": false,
-                "show-limit": false,
-                "parentKey": "referral_Input",
+                "parentKey": "Processing",
                 "buttonName": null,
                 "childrenKey": null
             }
@@ -541,24 +589,6 @@
         "buttonName": null,
         "childrenKey": null
     },
-    {
-        "label": "下次随访日期",
-        "defaultValue": null,
-        "span": 12,
-        "key": "Next_Follow_Up_Date",
-        "type": "dateTime",
-        "border": null,
-        "disabledValue": null,
-        "options": null,
-        "children": null,
-        "append": "",
-        "placeholder": "",
-        "required": false,
-        "show-limit": false,
-        "parentKey": null,
-        "buttonName": null,
-        "childrenKey": null
-    },
     {
         "label": "随访医生签名",
         "defaultValue": null,

+ 85 - 0
lib/pages/check/maternal_health_management/checkup_42_days.dart

@@ -0,0 +1,85 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter/widgets.dart';
+import 'package:get/get.dart';
+import 'package:vitalapp/components/appbar.dart';
+import 'package:vitalapp/pages/form/form_view.dart';
+import 'package:vitalapp/pages/form/postpartum_form.dart';
+
+import 'maternal_health_management_controller.dart';
+
+class PostpartumHealthCheckup42DaysForm extends StatefulWidget {
+  @override
+  State<StatefulWidget> createState() {
+    return PostpartumHealthCheckup42DaysFormState();
+  }
+}
+
+class PostpartumHealthCheckup42DaysFormState
+    extends State<PostpartumHealthCheckup42DaysForm> {
+  String? _template;
+
+  @override
+  void initState() {
+    PostpartumForm.instance.initListener();
+    var _path = "assets/PostpartumHealthCheckup42Days.json";
+    rootBundle.loadString(_path).then((value) {
+      setState(() {
+        _template = value;
+      });
+    });
+    // Get.find<MaternalHealthManagementController>()
+    //     .getTemplate("PostpartumHealthCheckup42Days")
+    //     .then((value) {
+    //   setState(() {
+    //     _template = value;
+    //   });
+    // });
+    super.initState();
+  }
+
+  @override
+  void dispose() {
+    PostpartumForm.instance.dispose();
+    super.dispose();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      backgroundColor: const Color.fromRGBO(238, 238, 238, 1),
+      appBar: VAppBar(
+        titleWidget: Text("产后 42 天健康检查"),
+        actions: [
+          ElevatedButton(
+            onPressed: () async {
+              bool result = await Get.find<MaternalHealthManagementController>()
+                  .save("PostpartumHealthCheckup42Days");
+              if (result) {
+                Get.back();
+              }
+            },
+            child: Container(
+              child: Row(
+                mainAxisAlignment: MainAxisAlignment.center,
+                children: const [
+                  Icon(Icons.save, size: 24),
+                  SizedBox(
+                    width: 8,
+                  ),
+                  Text("保存", style: TextStyle(fontSize: 20)),
+                ],
+              ),
+              margin: EdgeInsets.symmetric(horizontal: 10),
+            ),
+          ),
+        ],
+      ),
+      body: _template == null
+          ? Center(
+              child: CircularProgressIndicator(),
+            )
+          : FormView(_template!),
+    );
+  }
+}

+ 41 - 15
lib/pages/check/maternal_health_management/form_select_dialog.dart

@@ -4,7 +4,7 @@ import 'package:get/get.dart';
 import 'package:vitalapp/components/alert_dialog.dart';
 
 class FormSelectDialog extends StatefulWidget {
-  final void Function(int, FollowUpModeEnum, bool) onConfirm;
+  final void Function(int, FollowUpModeEnum, bool, bool) onConfirm;
 
   FormSelectDialog({required this.onConfirm});
 
@@ -18,6 +18,7 @@ class FormSelectDialogState extends State<FormSelectDialog> {
   int _times = 1;
   FollowUpModeEnum _followUpMode = FollowUpModeEnum.Outpatient;
   bool _isAfter = false;
+  bool _isAfterFirst = true;
 
   @override
   Widget build(BuildContext context) {
@@ -27,7 +28,7 @@ class FormSelectDialogState extends State<FormSelectDialog> {
       contentPadding: EdgeInsets.symmetric(horizontal: 24),
       showCancel: false,
       onConfirm: () {
-        widget.onConfirm.call(_times, _followUpMode, _isAfter);
+        widget.onConfirm.call(_times, _followUpMode, _isAfter, _isAfterFirst);
       },
       content: SizedBox(
         height: 200,
@@ -36,10 +37,8 @@ class FormSelectDialogState extends State<FormSelectDialog> {
             SizedBox(height: 10),
             _buildFirstLine(),
             SizedBox(height: 10),
-            if (!_isAfter) ...[
-              _buildSecondLine(),
-              SizedBox(height: 10),
-            ],
+            _buildSecondLine(),
+            SizedBox(height: 10),
             _buildThirdLine(),
           ],
         ),
@@ -51,15 +50,42 @@ class FormSelectDialogState extends State<FormSelectDialog> {
   Widget _buildSecondLine() {
     return Row(
       children: [
-        Text(
-          "随访次数:",
-          style: TextStyle(fontSize: 18),
-        ),
-        ..._buildTimes(1),
-        ..._buildTimes(2),
-        ..._buildTimes(3),
-        ..._buildTimes(4),
-        ..._buildTimes(5),
+        if (_isAfter) ...[
+          Text(
+            "随访次数:",
+            style: TextStyle(fontSize: 18),
+          ),
+          Radio(
+            onChanged: (v) {
+              setState(() {
+                _isAfterFirst = v ?? false;
+              });
+            },
+            value: true,
+            groupValue: _isAfterFirst,
+          ),
+          Text("产后访视"),
+          Radio(
+            onChanged: (v) {
+              setState(() {
+                _isAfterFirst = v ?? false;
+              });
+            },
+            value: false,
+            groupValue: _isAfterFirst,
+          ),
+          Text("产后 42 天健康检查"),
+        ] else ...[
+          Text(
+            "随访次数:",
+            style: TextStyle(fontSize: 18),
+          ),
+          ..._buildTimes(1),
+          ..._buildTimes(2),
+          ..._buildTimes(3),
+          ..._buildTimes(4),
+          ..._buildTimes(5),
+        ]
       ],
     );
   }

+ 24 - 3
lib/pages/check/maternal_health_management/maternal_health_management_controller.dart

@@ -14,7 +14,9 @@ import 'package:vitalapp/pages/form/form_info.dart';
 import 'package:vitalapp/store/store.dart';
 
 import 'antenatal_visit.dart';
+import 'checkup_42_days.dart';
 import 'first_form.dart';
+import 'postpartum_follow_up.dart';
 import 'state.dart';
 
 class MaternalHealthManagementController extends GetxController {
@@ -24,6 +26,11 @@ class MaternalHealthManagementController extends GetxController {
 
   final String prenatalFollowupKey = "PrenatalFollowupServiceRecord";
 
+  final String postnatalVisitKey = "PostnatalVisitRecord";
+
+  final String postpartumHealthCheckup42DaysKey =
+      "PostpartumHealthCheckup42Days";
+
   final _followUpManager = Get.find<IFollowUpManager>();
   final _templateManager = Get.find<ITemplateManager>();
 
@@ -110,7 +117,12 @@ class MaternalHealthManagementController extends GetxController {
     try {
       var patientCode = Store.user.currentSelectPatientInfo?.code ?? '';
       var result = await _followUpManager.getFollowUpRecordList(
-        [firstFollowUpkey, prenatalFollowupKey],
+        [
+          firstFollowUpkey,
+          prenatalFollowupKey,
+          postnatalVisitKey,
+          postpartumHealthCheckup42DaysKey,
+        ],
         patientCode,
       );
       List<FollowUpRecordDTO> followUpDTOList = [];
@@ -132,6 +144,10 @@ class MaternalHealthManagementController extends GetxController {
         return "第 ${times} 次产前随访";
       }
       return "第 2~5 次产前随访";
+    } else if (key == postnatalVisitKey) {
+      return "产后访视";
+    } else if (key == postpartumHealthCheckup42DaysKey) {
+      return "产后 42 天健康检查";
     }
     return "";
   }
@@ -144,11 +160,16 @@ class MaternalHealthManagementController extends GetxController {
     var datas = jsonDecode(dataDto.followUpData ?? '');
     if (datas is Map<String, dynamic>) {
       FormInfo.instance.formValue = datas;
-      if (dataDto.key == firstFollowUpkey) {
+      var key = dataDto.key;
+      if (key == firstFollowUpkey) {
         Get.to(FirstMaternalHealthManagementForm());
-      } else if (dataDto.key == prenatalFollowupKey) {
+      } else if (key == prenatalFollowupKey) {
         int times = FormInfo.instance.formValue["times"] ?? 2;
         Get.to(AntenatalVisitForm(times));
+      } else if (key == postnatalVisitKey) {
+        Get.to(PostpartumFormView());
+      } else if (key == postpartumHealthCheckup42DaysKey) {
+        Get.to(PostpartumHealthCheckup42DaysForm());
       }
     }
   }

+ 82 - 0
lib/pages/check/maternal_health_management/postpartum_follow_up.dart

@@ -0,0 +1,82 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:get/get.dart';
+import 'package:vitalapp/components/appbar.dart';
+import 'package:vitalapp/pages/form/form_info.dart';
+import 'package:vitalapp/pages/form/form_view.dart';
+import 'package:vitalapp/pages/form/maternal_health_form.dart';
+import 'package:vitalapp/pages/form/postpartum_form.dart';
+import 'package:vitalapp/pages/form/prenatal_followup_form.dart';
+
+import 'maternal_health_management_controller.dart';
+
+class PostpartumFormView extends StatefulWidget {
+  PostpartumFormView();
+
+  @override
+  State<StatefulWidget> createState() {
+    return PostpartumFormViewState();
+  }
+}
+
+class PostpartumFormViewState extends State<PostpartumFormView> {
+  String? _template;
+
+  @override
+  void initState() {
+    PostpartumForm.instance.initListener();
+    Get.find<MaternalHealthManagementController>()
+        .getTemplate("PostnatalVisitRecord")
+        .then((value) {
+      setState(() {
+        _template = value;
+      });
+    });
+    super.initState();
+  }
+
+  @override
+  void dispose() {
+    PostpartumForm.instance.dispose();
+    super.dispose();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      backgroundColor: const Color.fromRGBO(238, 238, 238, 1),
+      appBar: VAppBar(
+        titleWidget: Text("产后访视"),
+        actions: [
+          ElevatedButton(
+            onPressed: () async {
+              bool result = await Get.find<MaternalHealthManagementController>()
+                  .save("PostnatalVisitRecord");
+              if (result) {
+                Get.back();
+              }
+            },
+            child: Container(
+              child: Row(
+                mainAxisAlignment: MainAxisAlignment.center,
+                children: const [
+                  Icon(Icons.save, size: 24),
+                  SizedBox(
+                    width: 8,
+                  ),
+                  Text("保存", style: TextStyle(fontSize: 20)),
+                ],
+              ),
+              margin: EdgeInsets.symmetric(horizontal: 10),
+            ),
+          ),
+        ],
+      ),
+      body: _template == null
+          ? Center(
+              child: CircularProgressIndicator(),
+            )
+          : FormView(_template!),
+    );
+  }
+}

+ 8 - 1
lib/pages/check/maternal_health_management/view.dart

@@ -14,9 +14,11 @@ import 'package:vitalapp/pages/form/form_info.dart';
 import 'package:vitalapp/pages/patient/list/widgets/status.dart';
 import 'package:vitalapp/pages/widgets/record_common_item.dart';
 
+import 'checkup_42_days.dart';
 import 'form_select_dialog.dart';
 import 'maternal_health_management_controller.dart';
 import 'first_form.dart';
+import 'postpartum_follow_up.dart';
 
 class MaternalHealthManagement
     extends GetView<MaternalHealthManagementController> {
@@ -40,10 +42,15 @@ class MaternalHealthManagement
                   FormInfo.instance.formValue.clear();
                   controller.isEdit = false;
                   Get.dialog(FormSelectDialog(
-                    onConfirm: (time, mode, isAfter) {
+                    onConfirm: (time, mode, isAfter, isAfterFirst) {
                       Get.back();
                       controller.followUpMode = mode;
                       if (isAfter) {
+                        if (isAfterFirst) {
+                          Get.to(PostpartumFormView());
+                        } else {
+                          Get.to(PostpartumHealthCheckup42DaysForm());
+                        }
                         return;
                       }
                       if (time == 1) {

+ 19 - 0
lib/pages/form/base_form_value.dart

@@ -75,4 +75,23 @@ abstract class BaseFormValueChange {
       );
     }
   }
+
+  void onValueChange(UpdateFormArgs e, String sourceValue, String targetKey) {
+    UpdateFormType type = e.type;
+    bool isDisabledValue = false;
+    if (type == UpdateFormType.Add && e.sourceValue == sourceValue) {
+      ///选中了无,则禁用其他选项
+      isDisabledValue = true;
+    } else if (type == UpdateFormType.Remove && e.sourceValue == sourceValue) {
+      ///取消选中无,则取消禁用其他选项
+      isDisabledValue = false;
+    }
+    FormInfo.instance.onChangeTargetValue.emit(
+      this,
+      TargetFormArgs(
+        targetKey,
+        isDisabledValue: isDisabledValue,
+      ),
+    );
+  }
 }

+ 1 - 18
lib/pages/form/maternal_health_form.dart

@@ -268,24 +268,7 @@ class MaternalHealthFormValue extends BaseFormValueChange {
     );
   }
 
-  void onValueChange(UpdateFormArgs e, String sourceValue, String targetKey) {
-    UpdateFormType type = e.type;
-    bool isDisabledValue = false;
-    if (type == UpdateFormType.Add && e.sourceValue == sourceValue) {
-      ///选中了无,则禁用其他选项
-      isDisabledValue = true;
-    } else if (type == UpdateFormType.Remove && e.sourceValue == sourceValue) {
-      ///取消选中无,则取消禁用其他选项
-      isDisabledValue = false;
-    }
-    FormInfo.instance.onChangeTargetValue.emit(
-      this,
-      TargetFormArgs(
-        targetKey,
-        isDisabledValue: isDisabledValue,
-      ),
-    );
-  }
+
 
   void onLastPeriodDateChange(UpdateFormArgs e) {
     var targetValue = calculateDueDateString(e.sourceValue);

+ 50 - 0
lib/pages/form/postpartum_form.dart

@@ -0,0 +1,50 @@
+import 'base_form_value.dart';
+import 'form_info.dart';
+
+class PostpartumForm extends BaseFormValueChange {
+  static PostpartumForm? _postpartumForm;
+
+  PostpartumForm._internal();
+
+  ///第 1 次产前检查服务记录表的值
+  static PostpartumForm get instance {
+    _postpartumForm ??= PostpartumForm._internal();
+    return _postpartumForm!;
+  }
+
+  void initListener() {
+    FormInfo.instance.onValueChange.addListener(_onValueChange);
+  }
+
+  void dispose() {
+    FormInfo.instance.onValueChange.removeListener(_onValueChange);
+  }
+
+  void _onValueChange(Object sender, UpdateFormArgs e) {
+    String sourceKey = e.sourceKey;
+    switch (sourceKey) {
+      case "Breasts":
+        onValueChange(e, "Breasts_1", "Breasts_2");
+        break;
+      case "Lochia":
+        onValueChange(e, "Lochia_1", "Lochia_2");
+        break;
+      case "Uterus":
+        onValueChange(e, "Uterus_1", "Uterus_2");
+        break;
+      case "Wound":
+        onValueChange(e, "Wound_1", "Wound_2");
+        break;
+      case "Classification":
+        onValueChange(e, "Classification_1", "Classification_2");
+        break;
+      case "Referral":
+        onReferralChange(e);
+        break;
+      case "Processing":
+        onValueChange(e, "Processing_1", "Reason_For_Referral");
+        onValueChange(e, "Processing_1", "Institution_And_Department");
+        break;
+    }
+  }
+}

+ 1 - 1
pubspec.yaml

@@ -236,7 +236,7 @@ flutter:
     - assets/valid_models/ppocr_keys_v1.txt
     - assets/fonts/NotoSansSC-R-fixed.otf
     - assets/data/3-6.json
-    - assets/PrenatalFollowupServiceRecord.json
+    - assets/PostpartumHealthCheckup42Days.json
   #   - images/a_dot_burr.jpeg
   #   - images/a_dot_ham.jpeg