소스 검색

手术与收费编码可以多对多匹配

lighter 2 년 전
부모
커밋
d616a3a46b

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/dictionary/HisWjwMatchDao.java

@@ -32,7 +32,7 @@ public interface HisWjwMatchDao {
                                              @Param("nameColumn") String nameColumn,
                                              @Param("key") String key);
 
-    @Select("select rtrim(code) as code,name,charge_code as wjwCode, " +
+    @Select("select rtrim(code) as code,name,charge_code as wjwCode,charge_name as wjwName, " +
             "rtrim(py_code) as pyCode from zd_icd9_cm3 where del_flag=0")
     List<HisWjwMatchEntity> selectSurgeries();
 

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/dictionary/HisWjwMatchEntity.java

@@ -8,6 +8,8 @@ public class HisWjwMatchEntity {
     private String name;
     private String wjwCode;
     private String wjwName;
+    private String[] chargeCode;
+    private String[] chargeName;
     private String pyCode;
     private Double similarity;
     private String label;

+ 27 - 1
src/main/java/thyyxxk/webserver/service/dictionary/HisWjwMatchService.java

@@ -60,6 +60,16 @@ public class HisWjwMatchService {
         } else if (type == 4) {
             hisList = dao.selectSurgeries();
             wjwList = dao.selectChargeCodes();
+            for (HisWjwMatchEntity entity : hisList) {
+                if (null != entity.getWjwCode()) {
+                    entity.setChargeCode(entity.getWjwCode().split("\\^"));
+                    entity.setWjwCode(null);
+                }
+                if (null != entity.getWjwName()) {
+                    entity.setChargeName(entity.getWjwName().split("\\^"));
+                    entity.setWjwName(null);
+                }
+            }
         } else {
             hisList = dao.selectNationTempData(histable);
             wjwList = new ArrayList<>();
@@ -91,10 +101,26 @@ public class HisWjwMatchService {
 
     public String executeMatchAction(HisWjwMatchEntity entity) {
         log.info("匹配卫健委/国临字典:{}", JSONObject.toJSONString(entity));
-        dao.executeMatchAction(entity);
         if (entity.getLabel().equals("surgery_chargeCode")) {
+            if (null != entity.getChargeCode()) {
+                StringBuilder codeBuilder = new StringBuilder();
+                StringBuilder nameBuilder = new StringBuilder();
+                for (String code : entity.getChargeCode()) {
+                    codeBuilder.append(code).append('^');
+                }
+                if (codeBuilder.length() > 1) {
+                    entity.setWjwCode(codeBuilder.substring(0, codeBuilder.length() - 1));
+                }
+                for (String name : entity.getChargeName()) {
+                    nameBuilder.append(name).append('^');
+                }
+                if (nameBuilder.length() > 1) {
+                    entity.setWjwName(nameBuilder.substring(0, nameBuilder.length() - 1));
+                }
+            }
             dao.updateDateAndOper(entity.getCode(), TokenUtil.getTokenUserId());
         }
+        dao.executeMatchAction(entity);
         return StringUtil.isBlank(entity.getWjwCode()) ? "撤销匹配成功" : "匹配成功";
     }