Browse Source

支持新的人群分类

loki.wu 11 months ago
parent
commit
c0e855814e

+ 316 - 0
assets/hypertension_prescription.json

@@ -0,0 +1,316 @@
+[
+    {
+        "label": "姓名",
+        "defaultValue": null,
+        "span": 12,
+        "key": "Name",
+        "type": "input",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "性别",
+        "defaultValue": null,
+        "span": 24,
+        "key": "Sex",
+        "type": "radio",
+        "border": null,
+        "disabledValue": null,
+        "options": [
+            {
+                "label": "男",
+                "value": "1"
+            },
+            {
+                "label": "女",
+                "value": "2"
+            }
+        ],
+        "children": null,
+        "append": null,
+        "placeholder": null,
+        "required": null,
+        "show-limit": null,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "年龄",
+        "defaultValue": null,
+        "span": 12,
+        "key": "Age",
+        "type": "numberInput",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "诊断",
+        "defaultValue": null,
+        "span": 12,
+        "key": "Diagnosis",
+        "type": "input",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "    高血压是心脑血管疾病最主要的危险因素,容易引发脑卒中、冠心病、心力衰竭、尿毒症等并发症,致残、致死率高。在未使用降压药物的情况下,非同日3次测量收缩压≥140mmHg和/或舒张压≥90mmHg,可诊断为高血压。如目前正在使用降压药物,血压虽然低于140/90mmHg,仍应诊断为高血压。高血压主要表现为头晕、头痛、眼花、胸闷、乏力、夜尿多等症状,但有些患者没有自觉症状,因而高血压也被称为“无声杀手”。中年以上人群一定要知道自己的血压水平,特别是在工作紧张、劳累等感觉不舒服时要及时测量血压。高血压的主要危险因素包括:高盐饮食、超重和肥胖、身体活动不足、高血脂、吸烟、过量饮酒、长期精神紧张,以及高龄、遗传因素等。采取健康生活方式,积极治疗,有助于延缓并发症的发生和发展,减轻心、肾、血管等靶器官的损害,促进身体康复,改善生活质量。",
+        "defaultValue": null,
+        "span": 12,
+        "key": "Hint_Label",
+        "type": "label",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "健康生活方式",
+        "defaultValue": null,
+        "span": 12,
+        "key": "HealthyLifestyle",
+        "type": "checkbox",
+        "border": null,
+        "disabledValue": null,
+        "options": [
+            {
+                "label": "少吃咸菜、腌制食品,每日食盐量不超过5克。",
+                "value": "1"
+            },
+            {
+                "label": "多吃新鲜蔬菜、水果和豆类等富钾食物。",
+                "value": "2"
+            },
+            {
+                "label": "少吃肥肉、动物内脏、油饼、油条等高脂肪食物,炒菜少放油。",
+                "value": "3"
+            },
+            {
+                "label": "保持健康体重,体重指数应控制在18.5~23.9千克/米2[体重指数=体重(千克)/身高(米)2]。",
+                "value": "4"
+            },
+            {
+                "label": "超重或肥胖者要减轻体重。",
+                "value": "5"
+            },
+            {
+                "label": "不吸烟(吸烟者戒烟)。",
+                "value": "6"
+            },
+            {
+                "label": "避免接触二手烟。",
+                "value": "7"
+            },
+            {
+                "label": "不饮酒。",
+                "value": "8"
+            },
+            {
+                "label": "适量运动。病情稳定者可在医生指导下,根据自己的身体情况,选择散步、慢跑、快步走等轻度到中等强度(微微出汗)的活动。建议尽量保持每周5~7次,每次持续30~60分钟。注意运动安全。",
+                "value": "9"
+            },
+            {
+                "label": "监测血压。定期监测血压,感觉不舒服时要及时测量血压。",
+                "value": "10"
+            },
+            {
+                "label": "保证睡眠充足,避免过度劳累。",
+                "value": "11"
+            },
+            {
+                "label": "保持心情舒畅,情绪稳定,减轻精神压力。",
+                "value": "12"
+            }
+        ],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "治疗与康复",
+        "defaultValue": null,
+        "span": 12,
+        "key": "HealthyLifestyle",
+        "type": "checkbox",
+        "border": null,
+        "disabledValue": null,
+        "options": [
+            {
+                "label": "遵医嘱坚持长期药物治疗,不要自行停药或调整药物。",
+                "value": "1"
+            },
+            {
+                "label": "定期复查。在医生指导下定期复查体重、腰围、血压、心率、血糖、血脂等,监测药物不良反应。",
+                "value": "2"
+            },
+            {
+                "label": "靶器官损害及并发症监测。每年到医院进行高血压靶器管损害及并发症的全面检查、及早发现并及时治疗并发症。",
+                "value": "3"
+            },
+            {
+                "label": "相关危险因素的处理。合并糖尿病、高血脂等患者应严格控制血糖、血脂。",
+                "value": "4"
+            }
+        ],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "急症处理",
+        "defaultValue": null,
+        "span": 12,
+        "key": "EmergencyTreatment",
+        "type": "checkbox",
+        "border": null,
+        "disabledValue": "",
+        "options": [
+            {
+                "label": "如病情加重,尤其出现下列情况,应尽快到医院就诊:\r\n (1)收缩压≥180mmHg和/或舒张压≥110mmHg,出现身体不适的症状。\r\n (2)意识改变、剧烈头痛或头晕、恶心呕吐、视物模糊、眼痛、心悸、胸闷、喘憋不能平卧,建议使用急救车转诊。\r\n (3)其他严重情况。",
+                "value": "1"
+            }
+        ],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "其他指导建议",
+        "defaultValue": null,
+        "span": 12,
+        "key": "Other",
+        "type": "textareaInput",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "医生/指导人员签名:",
+        "defaultValue": null,
+        "span": 12,
+        "key": "Signature",
+        "type": "signature",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "咨询电话:",
+        "defaultValue": null,
+        "span": 12,
+        "key": "Phone",
+        "type": "numberInput",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "日期",
+        "defaultValue": null,
+        "span": 12,
+        "key": "DateTime",
+        "type": "dateTime",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    },
+    {
+        "label": "高血压患者健康教育处方使用说明 \r\n ★使用对象:高血压患者。 \r\n ★使用方法 \r\n 1.本处方不能替代医务人员开具的医疗处方,主要用于患者健康生活方式指导。 \r\n 2.医务人员应结合患者的病情、健康危险因素等,提供有针对性的健康指导。",
+        "defaultValue": null,
+        "span": 12,
+        "key": "DescriptionLabel",
+        "type": "label",
+        "border": null,
+        "disabledValue": null,
+        "options": [],
+        "children": null,
+        "append": "",
+        "placeholder": "",
+        "required": null,
+        "show-limit": false,
+        "parentKey": null,
+        "buttonName": null,
+        "childrenKey": null
+    }
+]

+ 12 - 13
lib/components/dialog_label_select.dart

@@ -1,3 +1,4 @@
+import 'package:fis_jsonrpc/rpc.dart';
 import 'package:fis_ui/index.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
@@ -7,15 +8,12 @@ import 'package:vitalapp/managers/interfaces/models/crowd_labels.dart';
 class VDialogLabelSelect extends StatefulWidget {
   final List<String> selectedLabels;
   final String title;
-  final List<String> allCanSelectedLabels;
+  final List<LabelDTO> allLabels;
 
   VDialogLabelSelect({
     this.selectedLabels = const [],
     this.title = "人群分类",
-    this.allCanSelectedLabels = const [
-      CrowdLabels.HYPERTENSION,
-      CrowdLabels.TYPE2_DIABETES,
-    ],
+    this.allLabels = const [],
   });
 
   @override
@@ -52,23 +50,24 @@ class VDialogLabelSelectState extends State<VDialogLabelSelect> {
   Widget _buildContent(BuildContext context) {
     return Wrap(
       children: [
-        ...widget.allCanSelectedLabels.map(
+        ...widget.allLabels.map(
           (e) => _buildLabel(e),
         ),
       ],
     );
   }
 
-  void selectRaidoChange(e) {
-    if (_currentSelectedLabels.contains(e)) {
-      _currentSelectedLabels.remove(e);
+  void selectRaidoChange(LabelDTO e) {
+    var name = e.labelName!;
+    if (_currentSelectedLabels.contains(name)) {
+      _currentSelectedLabels.remove(name);
     } else {
-      _currentSelectedLabels.add(e);
+      _currentSelectedLabels.add(name);
     }
     setState(() {});
   }
 
-  Widget _buildLabel(String e) {
+  Widget _buildLabel(LabelDTO e) {
     return Container(
       padding: const EdgeInsets.all(7),
       child: InkWell(
@@ -77,7 +76,7 @@ class VDialogLabelSelectState extends State<VDialogLabelSelect> {
         child: Ink(
           decoration: BoxDecoration(
             border: Border.all(
-              color: _currentSelectedLabels.contains(e)
+              color: _currentSelectedLabels.contains(e.labelName)
                   ? Colors.blue
                   : Colors.black26,
             ),
@@ -94,7 +93,7 @@ class VDialogLabelSelectState extends State<VDialogLabelSelect> {
             width: 200,
             child: FittedBox(
               child: Text(
-                e,
+                e.labelName ?? '',
                 style: TextStyle(
                   fontSize: 20,
                   color: _currentSelectedLabels.contains(e)

+ 5 - 0
lib/managers/interfaces/label.dart

@@ -14,4 +14,9 @@ abstract class ILabelManager implements IManager {
 
   /// 获取特殊照顾人群标签集合
   Future<List<LabelDTO>> getSpecialCareCrowdLabels();
+
+  ///获取Server目前所有已经开放的标签
+  Future<List<LabelDTO>> getAllLabels();
+
+  String transparent(String e);
 }

+ 45 - 1
lib/managers/interfaces/models/crowd_labels.dart

@@ -9,11 +9,55 @@ class CrowdLabels {
   static const String HYPERTENSION = '高血压';
 
   /// 2型糖尿病
-  static const String TYPE2_DIABETES = '2型糖尿病';
+  static const String TYPE2_DIABETES = '糖尿病';
+
+  ///严重精神病障碍
+  static const String MENTAlDISORDER = '严重精神病障碍';
+
+  ///肺结核
+  static const String TUBERCULOSIS = '肺结核';
 
   /// 疑似高血压
   static const String SUSPECTED_HYPERTENSION = '疑似高血压';
 
   /// 疑似2型糖尿病
   static const String SUSPECTED_TYPE2_DIABETES = '疑似2型糖尿病';
+
+  ///孕妇
+  static const String PREGNAMTWOMAN = "孕妇";
+
+  ///疑似肺结核
+  static const String SUSPECTEDTUBERCULOSIS = '疑似肺结核';
+
+  //疑似严重精神病障碍
+  static const String SUPECTEDPSYCHOSIS = "疑似精神病障碍";
+}
+
+class CrowdLabelKeys {
+  /// 老年人
+  static const String ELDERLY = 'RQFL_LNR';
+
+  /// 儿童
+  static const String CHILDREN = 'RQFL_ET';
+
+  ///孕妇
+  static const String PREGNAMTWOMAN = "RQFL_YF";
+
+  /// 高血压
+  static const String HYPERTENSION = 'CJJB_GXY';
+
+  /// 2型糖尿病
+  static const String TYPE2_DIABETES = 'CJJB_TNB';
+
+  ///严重精神障碍
+  static const String MENTAlDISORDER = 'CJJB_YZJSBZA';
+
+  ///肺结核
+  static const String TUBERCULOSIS = 'CJJB_FJH';
+
+  ///疑似肺结核
+  static const String SUSPECTEDTUBERCULOSIS = 'CJJB_FJH_Suspected';
+
+  //疑似严重精神病障碍
+  static const String SUPECTEDPSYCHOSIS = "CJJB_YZJSBZA_Suspected";
 }

+ 32 - 0
lib/managers/label.dart

@@ -5,6 +5,8 @@ import 'package:vitalapp/store/store.dart';
 import 'interfaces/label.dart';
 import 'package:fis_common/logger/logger.dart';
 
+import 'interfaces/models/crowd_labels.dart';
+
 class LabelManager implements ILabelManager {
   @override
   Future<List<LabelDTO>?> getLabelListByKey(String key) async {
@@ -19,6 +21,15 @@ class LabelManager implements ILabelManager {
     }
   }
 
+  @override
+  Future<List<LabelDTO>> getAllLabels() async {
+    List<LabelDTO> result = [];
+    result = await rpc.vitalLabel.getCrowdLabelsAsync(
+      GetCrowdLabelsRequest(token: Store.user.token),
+    );
+    return result;
+  }
+
   @override
   Future<List<LabelDTO>> getNormalCrowdLabels() async {
     return (await getLabelListByKey("RQFL")) ?? [];
@@ -33,4 +44,25 @@ class LabelManager implements ILabelManager {
   Future<List<LabelDTO>> getSpecialCareCrowdLabels() async {
     return (await getLabelListByKey("TSZG")) ?? [];
   }
+
+  @override
+  String transparent(String e) {
+    switch (e) {
+      case CrowdLabelKeys.CHILDREN:
+        return CrowdLabels.CHILDREN;
+      case CrowdLabelKeys.ELDERLY:
+        return CrowdLabels.ELDERLY;
+      case CrowdLabelKeys.HYPERTENSION:
+        return CrowdLabels.HYPERTENSION;
+      case CrowdLabelKeys.MENTAlDISORDER:
+        return CrowdLabels.MENTAlDISORDER;
+      case CrowdLabelKeys.TYPE2_DIABETES:
+        return CrowdLabels.TYPE2_DIABETES;
+      case CrowdLabelKeys.TUBERCULOSIS:
+        return CrowdLabels.TUBERCULOSIS;
+      case CrowdLabelKeys.PREGNAMTWOMAN:
+        return CrowdLabels.PREGNAMTWOMAN;
+    }
+    return "";
+  }
 }

+ 32 - 2
lib/managers/patient.dart

@@ -529,10 +529,10 @@ class PatientManager implements IPatientManager {
       if (l != CrowdLabels.CHILDREN && l != CrowdLabels.ELDERLY) {
         switch (l) {
           case CrowdLabels.HYPERTENSION:
-            result.add("CJJB_GXY");
+            result.add(CrowdLabelKeys.HYPERTENSION);
             break;
           case CrowdLabels.TYPE2_DIABETES:
-            result.add("CJJB_TNB");
+            result.add(CrowdLabelKeys.TYPE2_DIABETES);
             break;
           case CrowdLabels.SUSPECTED_HYPERTENSION:
             result.add("CJJB_GXY_Suspected");
@@ -540,6 +540,21 @@ class PatientManager implements IPatientManager {
           case CrowdLabels.SUSPECTED_TYPE2_DIABETES:
             result.add("CJJB_TNB_Suspected");
             break;
+          case CrowdLabels.MENTAlDISORDER:
+            result.add(CrowdLabelKeys.MENTAlDISORDER);
+            break;
+          case CrowdLabels.TUBERCULOSIS:
+            result.add(CrowdLabelKeys.TUBERCULOSIS);
+            break;
+          case CrowdLabels.PREGNAMTWOMAN:
+            result.add(CrowdLabelKeys.PREGNAMTWOMAN);
+            break;
+          case CrowdLabels.SUSPECTEDTUBERCULOSIS:
+            result.add(CrowdLabelKeys.SUSPECTEDTUBERCULOSIS);
+            break;
+          case CrowdLabels.SUPECTEDPSYCHOSIS:
+            result.add(CrowdLabelKeys.SUPECTEDPSYCHOSIS);
+            break;
         }
       }
     }
@@ -569,6 +584,21 @@ class PatientManager implements IPatientManager {
         case "CJJB_TNB_Suspected":
           result.add(CrowdLabels.SUSPECTED_TYPE2_DIABETES);
           break;
+        case CrowdLabelKeys.MENTAlDISORDER:
+          result.add(CrowdLabels.MENTAlDISORDER);
+          break;
+        case CrowdLabelKeys.TUBERCULOSIS:
+          result.add(CrowdLabels.TUBERCULOSIS);
+          break;
+        case CrowdLabelKeys.PREGNAMTWOMAN:
+          result.add(CrowdLabels.PREGNAMTWOMAN);
+          break;
+        case CrowdLabelKeys.SUSPECTEDTUBERCULOSIS:
+          result.add(CrowdLabels.SUSPECTEDTUBERCULOSIS);
+          break;
+        case CrowdLabelKeys.SUPECTEDPSYCHOSIS:
+          result.add(CrowdLabels.SUPECTEDPSYCHOSIS);
+          break;
       }
     }
     return result;

+ 4 - 1
lib/pages/patient/detail/widgets/tag_cards.dart

@@ -11,6 +11,7 @@ import 'package:vitalapp/components/selectBox_button.dart';
 import 'package:vitalapp/components/tag_widget.dart';
 import 'package:vitalapp/consts/styles.dart';
 import 'package:vitalapp/managers/contract/index.dart';
+import 'package:vitalapp/managers/interfaces/label.dart';
 import 'package:vitalapp/managers/interfaces/models/crowd_labels.dart';
 import 'package:vitalapp/managers/interfaces/patient.dart';
 import 'package:vitalapp/pages/controllers/crowd_labels.dart';
@@ -35,9 +36,11 @@ class CrowdLabelsCard extends GetView<PatientDetailController> {
           child: IconButton(
             padding: EdgeInsets.zero,
             onPressed: () async {
+              var allLabels = await Get.find<ILabelManager>().getAllLabels();
               final result = await Get.dialog(
                 VDialogLabelSelect(
                   selectedLabels: controller.state.labels,
+                  allLabels: allLabels,
                 ),
               );
               var selectedLabels = result as List<String>;
@@ -76,7 +79,7 @@ class CrowdLabelsCard extends GetView<PatientDetailController> {
                         right: 16,
                         left: 14,
                       ),
-                      width: 130,
+                      width: 132,
                       height: 40,
                     ),
                   )

+ 27 - 21
lib/pages/patient/list/view.dart

@@ -506,29 +506,35 @@ class _PatientCard extends StatelessWidget {
         ConstrainedBox(
           constraints: const BoxConstraints(
             minWidth: double.infinity,
-            maxHeight: 50,
+            maxHeight: 28,
           ),
-          child: Row(
-            children: dto.labelNames!
-                .map(
-                  (e) => TagWidget(
-                    label: e,
-                    borderColor:
-                        (e == CrowdLabels.CHILDREN || e == CrowdLabels.ELDERLY)
-                            ? Colors.blue
-                            : Colors.orange,
-                    backgroundColor: Colors.transparent,
-                    textColor: Colors.black,
-                    padding: EdgeInsets.only(
-                      top: 2,
-                      bottom: 2,
-                      right: 8,
-                      left: 4,
-                    ),
-                  ),
+          child: ListView(
+              controller: ScrollController(),
+              scrollDirection: Axis.horizontal,
+              children: [
+                Row(
+                  children: dto.labelNames!
+                      .map(
+                        (e) => TagWidget(
+                          height: 50,
+                          label: e,
+                          borderColor: (e == CrowdLabels.CHILDREN ||
+                                  e == CrowdLabels.ELDERLY)
+                              ? Colors.blue
+                              : Colors.orange,
+                          backgroundColor: Colors.transparent,
+                          textColor: Colors.black,
+                          padding: EdgeInsets.only(
+                            top: 2,
+                            bottom: 2,
+                            right: 8,
+                            left: 4,
+                          ),
+                        ),
+                      )
+                      .toList(),
                 )
-                .toList(),
-          ),
+              ]),
         ),
       ],
     );

+ 3 - 0
lib/pages/patient_info/view.dart

@@ -15,6 +15,7 @@ import 'package:vitalapp/components/dialog_select.dart';
 import 'package:vitalapp/consts/nations.dart';
 import 'package:vitalapp/consts/rpc_enum_labels.dart';
 import 'package:vitalapp/helper/id_card_helper.dart';
+import 'package:vitalapp/managers/interfaces/label.dart';
 import 'package:vitalapp/pages/patient_info/widgets/health_infos.dart';
 import 'package:vitalapp/store/store.dart';
 
@@ -107,9 +108,11 @@ class PatientInfomationPage extends GetView<PatientInfomationController> {
             label: "人群分类",
             content: controller.state.labels.join("、"),
             onTap: () async {
+              var allLabels = await Get.find<ILabelManager>().getAllLabels();
               final result = await Get.dialog(
                 VDialogLabelSelect(
                   selectedLabels: controller.state.labels,
+                  allLabels: allLabels,
                 ),
               );
               var selectedLabels = result as List<String>;

+ 1 - 0
pubspec.yaml

@@ -237,6 +237,7 @@ flutter:
     - assets/fonts/NotoSansSC-R-fixed.otf
     - assets/data/3-6.json
     - assets/diabetes_prescription.json
+    - assets/hypertension_prescription.json
   #   - images/a_dot_burr.jpeg
   #   - images/a_dot_ham.jpeg