Sfoglia il codice sorgente

添加手术与收费项目的匹配

lighter 2 anni fa
parent
commit
569e07647a

+ 5 - 5
src/main/java/thyyxxk/webserver/controller/dictionary/HisWjwMatchController.java

@@ -49,20 +49,20 @@ public class HisWjwMatchController {
         }
         switch (entity.getLabel()) {
             case "anaesthesia":
-                entity.setLabel("zd_anaesthesia");
+                entity.setTable("zd_anaesthesia");
                 break;
             case "department":
-                entity.setLabel("zd_unit_code");
+                entity.setTable("zd_unit_code");
                 break;
             case "diagnose":
-                entity.setLabel("zd_icd_code_new");
+                entity.setTable("zd_icd_code_new");
                 break;
             case "surgery":
+            case "surgery_chargeCode":
             default:
-                entity.setLabel("zd_icd9_cm3");
+                entity.setTable("zd_icd9_cm3");
                 break;
         }
-
         return ResultVoUtil.success(service.executeMatchAction(entity));
     }
 

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

@@ -32,12 +32,22 @@ public interface HisWjwMatchDao {
                                              @Param("nameColumn") String nameColumn,
                                              @Param("key") String key);
 
+    @Select("select rtrim(code) as code,name,charge_code as wjwCode, " +
+            "rtrim(py_code) as pyCode from zd_icd9_cm3 where del_flag=0")
+    List<HisWjwMatchEntity> selectSurgeries();
+
+    @Select("select code,name,py_code from zd_charge_item where del_flag=0")
+    List<HisWjwMatchEntity> selectChargeCodes();
+
     @Update("<script>" +
-            "update ${label} set ${targetCodeColumn}=#{wjwCode} " +
+            "update ${table} set ${targetCodeColumn}=#{wjwCode} " +
             "<if test=\"targetNameColumn != null and targetNameColumn != '' \">" +
             ", ${targetNameColumn}=#{wjwName} " +
             "</if>" +
             "where code=#{code} " +
             "</script>")
     void executeMatchAction(HisWjwMatchEntity entity);
+
+    @Update("update zd_icd9_cm3 set match_datetime=getdate(),match_oper=#{oper} where code=#{code}")
+    void updateDateAndOper(String code, String oper);
 }

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

@@ -11,6 +11,7 @@ public class HisWjwMatchEntity {
     private String pyCode;
     private Double similarity;
     private String label;
+    private String table;
     private String targetCodeColumn;
     private String targetNameColumn;
 }

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

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
 import thyyxxk.webserver.dao.his.dictionary.HisWjwMatchDao;
 import thyyxxk.webserver.entity.dictionary.HisWjwMatchEntity;
 import thyyxxk.webserver.utils.StringUtil;
+import thyyxxk.webserver.utils.TokenUtil;
 
 import java.util.*;
 
@@ -40,17 +41,25 @@ public class HisWjwMatchService {
                 type = 2;
                 break;
             case "surgery":
-            default:
                 histable = "zd_icd9_cm3";
                 wjwtable = "t_si_dl_oprtn";
                 type = 3;
                 break;
+            case "surgery_chargeCode":
+            default:
+                histable = "zd_icd9_cm3";
+                wjwtable = "zd_charge_item";
+                type = 4;
+                break;
         }
         List<HisWjwMatchEntity> hisList;
         List<HisWjwMatchEntity> wjwList;
         if (type == 1) {
             hisList = dao.selectHisData(histable);
             wjwList = dao.selectWjwData(wjwtable);
+        } else if (type == 4) {
+            hisList = dao.selectSurgeries();
+            wjwList = dao.selectChargeCodes();
         } else {
             hisList = dao.selectNationTempData(histable);
             wjwList = new ArrayList<>();
@@ -83,6 +92,9 @@ public class HisWjwMatchService {
     public String executeMatchAction(HisWjwMatchEntity entity) {
         log.info("匹配卫健委/国临字典:{}", JSONObject.toJSONString(entity));
         dao.executeMatchAction(entity);
+        if (entity.getLabel().equals("surgery_chargeCode")) {
+            dao.updateDateAndOper(entity.getCode(), TokenUtil.getTokenUserId());
+        }
         return StringUtil.isBlank(entity.getWjwCode()) ? "撤销匹配成功" : "匹配成功";
     }