Ver código fonte

修改所有诊断与手术搜索的来源

lighter 3 anos atrás
pai
commit
f8d788fa3a

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>1</version>
+    <version>2</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 8 - 11
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/SheetSearchDao.java

@@ -10,21 +10,21 @@ import java.util.List;
 
 @Mapper
 public interface SheetSearchDao {
-    @Select("select top 10 surgical_operation_code as code, operation_operation_name as name from " +
+    @Select("select top 10 rtrim(code) as code, rtrim(name) as name from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number',  * " +
-            "from t_si_dl_oprtn with(nolock) where ${method} like #{content}) a " +
+            "from zd_icd9_cm3 with(nolock) where ${method} like #{content}) a " +
             "where a.[Number]>10*(#{page}-1)")
     List<PureCodeName> searchSurgery(@Param("method") String method, @Param("content") String content, @Param("page") int page);
 
     @Select("select top 10 rtrim(code) as code, rtrim(name) as name from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number',  * " +
-            "from zd_icd_code with(nolock) where ${method} like #{content} ) a " +
+            "from zd_icd_code_new with(nolock) where ${method} like #{content} ) a " +
             "where a.[Number]>10*(#{page}-1) order by weight desc")
     List<PureCodeName> searchClinicdiag(@Param("method") String method, @Param("content") String content, @Param("page") int page);
 
-    @Select("select top 10 rtrim(CODE) code, rtrim(NAME) name from " +
+    @Select("select top 10 rtrim(code) code, rtrim(name) name from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY CODE) AS 'Number',  * " +
-            "from zd_pathologic_diag_code with(nolock) where ${method} like #{content}) a " +
+            "from zd_icd_m_code with(nolock) where ${method} like #{content}) a " +
             "where a.[Number]>10*(#{page})")
     List<PureCodeName> searchPathologicDiag(@Param("method") String method, @Param("content") String content, @Param("page") int page);
 
@@ -36,7 +36,7 @@ public interface SheetSearchDao {
 
     @Select("select top 10 rtrim(code) code, rtrim(name) name from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number',  * " +
-            "from zd_icd_code with(nolock) where PATINDEX('%[V-Y]%',code)=1 and ${method} like #{content}) a " +
+            "from zd_icd_code_new with(nolock) where PATINDEX('%[V-Y]%',code)=1 and ${method} like #{content}) a " +
             "where a.[Number]>10*(#{page}) order by weight desc")
     List<PureCodeName> searchHurtReason(@Param("method") String method, @Param("content") String content, @Param("page") int page);
 
@@ -46,9 +46,6 @@ public interface SheetSearchDao {
             "where a.[Number]>10*(#{page})")
     List<PureCodeName> searchEmployee(@Param("method") String method, @Param("content") String content, @Param("page") int page);
 
-    @Select("select rtrim(code) code, rtrim(name) name from zd_cm3_new with(nolock)")
-    List<PureCodeName> getAllItem();
-
     @Select("select rtrim(dis_diag) from zy_dis_diag_yb where inpatient_no=#{bah} and admiss_times=#{times} and dis_diag_no=1")
     String selectMainMedinsDiag(@Param("bah") String bah, @Param("times") int times);
 
@@ -87,7 +84,7 @@ public interface SheetSearchDao {
             "inpatient_no=#{patNo} and admiss_times=#{times} and dis_diag_no=1")
     PureCodeName selectMainDisDiag(@Param("patNo") String patNo, @Param("times") String times);
 
-    @Select("select diagnosis_code as code, diagnosis_name as name " +
-            "from t_si_dl_dss_dns where diagnosis_code like '${code}%' ")
+    @Select("select rtrim(yb_code) as code, rtrim(yb_name) as name " +
+            "from zd_icd_code_new where yb_code like '${code}%' ")
     List<PureCodeName> selectMedinsDiags(@Param("code") String code);
 }

+ 6 - 2
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java

@@ -151,11 +151,15 @@ public interface UpIdCollectionDao {
     List<SiSetlinfoTemp> zhuanKeKeShi(@Param("patNos") Set<String> patNos);
 
 
-    @Select("select top 10 surgical_operation_code code,operation_operation_name name from " + "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS Number,  * " + "from t_si_dl_oprtn where (surgical_operation_code like #{content} or operation_operation_name like #{content} or py_code like #{content})) a " + "where Number > (${page}-1) * 10 ")
+    @Select("select top 10 rtrim(code) as code,rtrim(name) as name from " +
+            "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS Number,  * " +
+            "from zd_icd9_cm3 where (code like #{content} or name like #{content} or py_code like #{content})) a " +
+            "where Number > (${page}-1) * 10 ")
     List<GetDropdownBox> searchSurgeryByAlpha(@Param("content") String content, @Param("page") long page);
 
 
-    @Select("select count(1) from t_si_dl_oprtn where (surgical_operation_code like #{content} or operation_operation_name" + " like #{content} or py_code like #{content})")
+    @Select("select count(1) from zd_icd9_cm3 where (code like #{content} or name" +
+            " like #{content} or py_code like #{content})")
     long searchSurgeryTotal(@Param("content") String content);
 
 

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/search/SearchDao.java

@@ -12,7 +12,7 @@ public interface SearchDao {
     @Select("select rtrim(code) as code,rtrim(name) name from a_employee_mi where isnull(del_flag,0)!=1 and ${method} like #{content}")
     IPage<PureCodeName> searchPhysician(IPage<PureCodeName> iPage, @Param("method") String method, @Param("content") String content);
 
-    @Select("select diagnosis_code as code, diagnosis_name as name from t_si_dl_dss_dns where ${method} like #{content}")
+    @Select("select rtrim(yb_code) as code, rtrim(yb_name) as name from zd_icd_code_new where ${method} like #{content}")
     IPage<PureCodeName> searchDiagnose(IPage<PureCodeName> iPage, @Param("method") String method, @Param("content") String content);
 
     @Select("select distinct new_code as code,new_name as name from ${tableName} where new_name like #{content}")

+ 3 - 3
src/main/java/thyyxxk/webserver/dao/his/yibao/DictionaryDao.java

@@ -12,15 +12,15 @@ import java.util.List;
 @Mapper
 public interface DictionaryDao {
 
-    @Select("SELECT RTRIM(code) AS code,rtrim(name) name FROM a_employee_mi WHERE " +
+    @Select("SELECT RTRIM(code) AS code,rtrim(name) name from a_employee_mi WHERE " +
             "isnull(del_flag,0)!=1 and ${method} LIKE #{content} collate Chinese_PRC_CI_AS")
     List<PureCodeName> searchPhysician(@Param("method") String method, @Param("content") String content);
 
-    @Select("select diagnosis_code as code, diagnosis_name as name from t_si_dl_dss_dns " +
+    @Select("select rtrim(yb_code) as code, rtrim(yb_name) as name from zd_icd_code_new " +
             "where ${method} LIKE #{content} collate Chinese_PRC_CI_AS order by weight desc")
     List<PureCodeName> searchDiagnose(@Param("method") String method, @Param("content") String content);
 
-    @Update("update t_si_dl_dss_dns set weight=(weight+1) where diagnosis_code=#{code}")
+    @Update("update zd_icd_code_new set weight=(weight+1) where yb_code=#{code}")
     void increaseWeight(@Param("code") String code);
 
     @Select("select distinct new_code as code,new_name as name from ${tableName} where new_name like #{content} collate Chinese_PRC_CI_AS")

+ 3 - 3
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/JianYanJianChaDao.java

@@ -265,9 +265,9 @@ public interface JianYanJianChaDao {
     void xinZengShouMingMuBan(YshZdYjTemplate param);
 
 
-    @Select("select diagnosis_code as code, diagnosis_name as name " +
-            "from t_si_dl_dss_dns with (NOLOCK) " +
-            "where (diagnosis_code like #{name} or diagnosis_name like #{name} or py_code like #{name})")
+    @Select("select rtrim(yb_code) as code, rtrim(yb_name) as name " +
+            "from zd_icd_code_new with (NOLOCK) " +
+            "where (yb_code like #{name} or yb_name like #{name} or yb_py_code like #{name})")
     List<GetDropdownBox> yiBaoZhenDuan(String name);
 
     @Select("SELECT rtrim(a.code) as code, " +

+ 4 - 43
src/main/java/thyyxxk/webserver/service/casefrontsheet/SheetSearchService.java

@@ -75,11 +75,11 @@ public class SheetSearchService {
 
     private List<PureCodeName> searchPathologicDiag(String method, String content, int page) {
         if (method.equals("alpha")) {
-            method = "PY_CODE";
+            method = "py_code";
         } else if (method.equals("code")) {
-            method = "CODE";
+            method = "code";
         } else {
-            method = "NAME";
+            method = "name";
         }
         return dao.searchPathologicDiag(method, content, page);
     }
@@ -119,7 +119,6 @@ public class SheetSearchService {
         return ResultVoUtil.success(result);
     }
 
-
     /**
      * 1.	报送范围为出院日期在2019年1月1日—2021年12月31日,包括城镇职工、城乡居民基本医疗保险病人的住院数据(排除全自费、异地就医、工伤、生育保险类住院数据);
      * 2.	NO41表以CSV文件格式提取,并按季度上传数据。单个上传文件上限为5万条病例数,如果数据量过大,也可按月度上传数据。(文件命名格式:“医疗机构名称_201901.csv”);
@@ -159,7 +158,7 @@ public class SheetSearchService {
                     double simVal = 0;
                     PureCodeName target = hisDiag;
                     for (PureCodeName diag : medinsDiags) {
-                        double dsm = getSimilarDegree(hisDiag.getName(), diag.getName());
+                        double dsm = StringUtil.getSimilarDegree(hisDiag.getName(), diag.getName());
                         log.info("解析:HIS诊断:【{},{}】, 医保诊断:【{},{}】, 相似度:【{}】",
                                 hisDiag.getCode(), hisDiag.getName(), diag.getCode(), diag.getName(), dsm);
                         if (dsm > simVal) {
@@ -186,42 +185,4 @@ public class SheetSearchService {
         log.info("共有 {} 条数据,已处理 {} 条", content.length, count);
         ExcelUtil.exportExcel(response, title, content);
     }
-
-    /**
-     * 字符串相似度算法
-     * */
-    public static double getSimilarDegree(String source, String target) {
-        Map<Character, int[]> vector = new HashMap<>();
-        int[] charCountArray;
-        for (char sourceChar : source.toCharArray()) {
-            if (vector.containsKey(sourceChar)) {
-                vector.get(sourceChar)[0]++;
-            } else {
-                charCountArray = new int[2];
-                charCountArray[0] = 1;
-                vector.put(sourceChar, charCountArray);
-            }
-        }
-        for (char targetChar : target.toCharArray()) {
-            if (vector.containsKey(targetChar)) {
-                vector.get(targetChar)[1] ++;
-            } else {
-                charCountArray = new int[2];
-                charCountArray[1] = 1;
-                vector.put(targetChar, charCountArray);
-            }
-        }
-        double v1Modulo = 0d;
-        double v2Modulo = 0d;
-        double vProduct = 0d;
-        for (Map.Entry<Character, int[]> entry : vector.entrySet()) {
-            int[] tempArray = entry.getValue();
-            v1Modulo += tempArray[0] * tempArray[0];
-            v2Modulo += tempArray[1] * tempArray[1];
-            vProduct += tempArray[0] * tempArray[1];
-        }
-        v1Modulo = Math.sqrt(v1Modulo);
-        v2Modulo = Math.sqrt(v2Modulo);
-        return vProduct / (v1Modulo * v2Modulo);
-    }
 }

+ 3 - 3
src/main/java/thyyxxk/webserver/service/search/SearchService.java

@@ -70,13 +70,13 @@ public class SearchService {
         String column;
         switch (method) {
             case "alpha":
-                column = "py_code";
+                column = "yb_py_code";
                 break;
             case "code":
-                column = "diagnosis_code";
+                column = "yb_code";
                 break;
             default:
-                column = "diagnosis_name";
+                column = "yb_name";
         }
         return dao.searchDiagnose(iPage, column, content);
     }

+ 3 - 3
src/main/java/thyyxxk/webserver/service/yibao/DictionaryService.java

@@ -60,11 +60,11 @@ public class DictionaryService {
     private List<PureCodeName> deepinDiag(String method, String content, boolean accurateSearch) {
         content = accurateSearch ? content + '%' : '%' + content + '%';
         if (method.equals("alpha")) {
-            method = "py_code";
+            method = "yb_py_code";
         } else if (method.equals("code")) {
-            method = "diagnosis_code";
+            method = "yb_code";
         } else {
-            method = "diagnosis_name";
+            method = "yb_name";
         }
         return dao.searchDiagnose(method, content);
     }