From 3d1344ca6f0613bf3726d2c40d35f3928f82a910 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 15 九月 2025 18:15:27 +0800
Subject: [PATCH] 代码提交

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/HisCheckNameEnum.java                     |   63 +++++++++++++++++++++++++++++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/HisCheckCodeEnum.java                     |   16 +++++++
 jh-server/src/main/resources/application-stage.yaml                                                                 |    4 +-
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/appointment/AppointmentDO.java   |    2 
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java |   21 +++++++++-
 5 files changed, 99 insertions(+), 7 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/appointment/AppointmentDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/appointment/AppointmentDO.java
index d801834..7831314 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/appointment/AppointmentDO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/appointment/AppointmentDO.java
@@ -45,7 +45,7 @@
      */
     private String episodeId;
     /**
-     * 鎮h�呮潵婧愮被鍨�  01闂瘖 02鎬ヨ瘖 03浣撴 04浣忛櫌
+     * 鎮h�呮潵婧愮被鍨�  01闂瘖 02鎬ヨ瘖 03浣忛櫌 04浣撴
      */
     private Integer patSrc;
     /**
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/HisCheckCodeEnum.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/HisCheckCodeEnum.java
index c22dcce..931026a 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/HisCheckCodeEnum.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/HisCheckCodeEnum.java
@@ -9,7 +9,21 @@
 @Getter
 @AllArgsConstructor
 public enum HisCheckCodeEnum {
-    Y691133607("691133607", "100"), Y201605("201605", "200"), Y200327("200327", "300"), Y201652("201652", "400"), Y502490914("502490914", "500"), Y419562119("419562119", "600"), Y201604("201604", "700"), Y1202042("1202042", "800"), Y1202058("1202058", "900"), Y1202065("1202065", "1000"), Y559542128("559542128", "1100"), Y590244511("590244511", "1200"), Y666454217("666454217", "1300"), Y720791490("720791490", "1400"), Y720792077("720792077", "1500");
+    Y691133607("691133607", "100"),
+    Y201605("201605", "200"),
+    Y200327("200327", "300"),
+    Y201652("201652", "400"),
+    Y502490914("502490914", "500"),
+    Y419562119("419562119", "600"),
+    Y201604("201604", "700"),
+    Y1202042("1202042", "800"),
+    Y1202058("1202058", "900"),
+    Y1202065("1202065", "1000"),
+    Y559542128("559542128", "1100"),
+    Y590244511("590244511", "1200"),
+    Y666454217("666454217", "1300"),
+    Y720791490("720791490", "1400"),
+    Y720792077("720792077", "1500");
 
     /**
      * 绫诲瀷
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/HisCheckNameEnum.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/HisCheckNameEnum.java
new file mode 100644
index 0000000..f8fa31a
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/HisCheckNameEnum.java
@@ -0,0 +1,63 @@
+package cn.lihu.jh.module.ecg.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * His鐨凜heck_type绫诲瀷鏋氫妇
+ */
+@Getter
+@AllArgsConstructor
+public enum HisCheckNameEnum {
+    Y691133607("甯歌蹇冪數鍥�", "100"),
+    Y201605("24灏忔椂鍔ㄦ�佸績鐢靛浘", "200"),
+    Y201606("24灏忔椂鍔ㄦ�佸績鐢电洃娴�", "200"),
+    Y200327("鍔ㄦ�佽鍘�", "300"),
+    Y201652("骞虫澘杩愬姩蹇冪數", "400"),
+    Y502490914("鍔ㄨ剦纭寲妫�娴�", "500"),
+    Y419562119("椋熼亾鐢电敓鐞�", "600"),
+    Y201604("蹇冪數鍥捐嵂鐗╄礋鑽疯瘯楠�", "700"),
+    Y1202042("棰戣氨蹇冪數鍥�", "800"),
+    Y1202058("蹇冨鏅氱數浣�", "900"),
+    Y1202065("搴婅竟蹇冪數鍥�(甯歌+棰戣氨)", "1000"),
+    Y559542128("甯歌蹇冪數鍥�-蹇冪數鍚戦噺鍥�", "1100");
+
+    /**
+     * 绫诲瀷
+     */
+    private final String name;
+    /**
+     * 鎻忚堪
+     */
+    private final String value;
+
+    /**
+     * 鏍规嵁绫诲瀷鑾峰彇鏋氫妇
+     *
+     * @param type 绫诲瀷
+     * @return 鏋氫妇
+     */
+    public static String getByName(String name) {
+        for (HisCheckNameEnum value : values()) {
+            if (value.getName().equals(name)) {
+                return value.getValue();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 鏍规嵁绫诲瀷鑾峰彇鏋氫妇
+     *
+     * @param val 鍊肩被鍨�
+     * @return 鏋氫妇
+     */
+    public static String getByValue(String val) {
+        for (HisCheckNameEnum value : values()) {
+            if (value.getValue().equals(val)) {
+                return value.getName();
+            }
+        }
+        return null;
+    }
+}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
index c34c8cd..cdd312e 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
@@ -13,6 +13,7 @@
 import cn.lihu.jh.module.ecg.dal.mysql.appointment.AppointmentMapper;
 import cn.lihu.jh.module.ecg.enums.AppointmentTypeEnum;
 import cn.lihu.jh.module.ecg.enums.HisCheckCodeEnum;
+import cn.lihu.jh.module.ecg.enums.HisCheckNameEnum;
 import cn.lihu.jh.module.ecg.feign.RemoteDataService;
 import cn.lihu.jh.module.ecg.service.config.EcgConfigService;
 import cn.lihu.jh.module.ecg.service.devrent.ApplicationTemplate;
@@ -466,8 +467,17 @@
             //璁剧疆妫�鏌ョ被鍨�
 //            String checkType = Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("component2")).map(component2 -> (Map<String, Object>) component2.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("code")).map(code -> (String) code.get("code")).orElseThrow(() -> exception(APPOINTMENT_CREATE_FAIL));
             String checkType = Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject")).map(subject -> (Map<String, Object>) subject.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("component2")).map(component2 -> (Map<String, Object>) component2.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("code")).map(code -> (String) code.get("code")).orElseThrow(() -> exception(APPOINTMENT_CREATE_FAIL));
-            if (checkType != null || checkType != "")
-                appointment.setBookCheckType(Integer.valueOf(HisCheckCodeEnum.getByCode(checkType.substring(1))));
+            String checkName = Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject")).map(subject -> (Map<String, Object>) subject.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("component2")).map(component2 -> (Map<String, Object>) component2.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("code")).map(code -> (Map<String, Object>) code.get("displayName")).map(displayName -> (String) displayName.get("value")).orElseThrow(() -> exception(APPOINTMENT_CREATE_FAIL));
+            if (appointment.getPatSrc() != null && appointment.getPatSrc() != 4) {
+                if (checkType != null || checkType != "")
+                    appointment.setBookCheckType(Integer.valueOf(HisCheckCodeEnum.getByCode(checkType.substring(1))));
+            } else if (appointment.getPatSrc() != null && appointment.getPatSrc() == 4) {
+                if (StringUtils.isNotEmpty(checkName)) {
+                    checkName = checkName.replaceAll("\\s+", "");
+                    appointment.setBookCheckType(Integer.valueOf(HisCheckNameEnum.getByName(checkName)));
+                }
+            }
+
 
             // 灏咥ppointmentDO杞崲涓篈ppointmentSaveReqVO骞朵繚瀛�
             AppointmentSaveReqVO saveReqVO = BeanUtils.toBean(appointment, AppointmentSaveReqVO.class);
@@ -618,7 +628,12 @@
      * 浠巇ataMap涓彁鍙杄ncounter鏁版嵁
      */
     private Map<String, Object> extractEncounter(Map<String, Object> dataMap) {
-        return Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject")).map(subject -> (Map<String, Object>) subject.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("componentOf1")).map(componentOf1 -> (Map<String, Object>) componentOf1.get("encounter")).orElse(null);
+        return Optional.ofNullable(dataMap.get("controlActProcess"))
+                .map(controlActProcess -> (Map<String, Object>) controlActProcess)
+                .map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject"))
+                .map(subject -> (Map<String, Object>) subject.get("observationRequest"))
+                .map(observationRequest -> (Map<String, Object>) observationRequest.get("componentOf1"))
+                .map(componentOf1 -> (Map<String, Object>) componentOf1.get("encounter")).orElse(null);
     }
 
     @Override
diff --git a/jh-server/src/main/resources/application-stage.yaml b/jh-server/src/main/resources/application-stage.yaml
index 2739693..3116ea8 100644
--- a/jh-server/src/main/resources/application-stage.yaml
+++ b/jh-server/src/main/resources/application-stage.yaml
@@ -60,7 +60,7 @@
           #          url: jdbc:kingbase8://127.0.0.1:54321/test  # 浜哄ぇ閲戜粨 KingbaseES 杩炴帴鐨勭ず渚�
           #          url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 杩炴帴鐨勭ず渚�
           username: hxsoft
-          password: Hxerp2000
+          password: Smartor.2023
           #          username: sa # SQL Server 杩炴帴鐨勭ず渚�
           #          password: Jh@2024 # SQL Server 杩炴帴鐨勭ず渚�
           #          username: SYSDBA # DM 杩炴帴鐨勭ず渚�
@@ -71,7 +71,7 @@
           lazy: true # 寮�鍚噿鍔犺浇锛屼繚璇佸惎鍔ㄩ�熷害
           url: jdbc:mysql://116.62.18.175:6002/lihu?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 杩炴帴鐨勭ず渚�
           username: hxsoft
-          password: Hxerp2000
+          password: Smartor.2023
 
   # Redis 閰嶇疆銆俁edisson 榛樿鐨勯厤缃冻澶熶娇鐢紝涓�鑸笉闇�瑕佽繘琛岃皟浼�
   redis:

--
Gitblit v1.9.3