Forráskód Böngészése

修改主要诊断手术/非手术分值的获取

lighter 3 éve
szülő
commit
b5fbad5931

+ 4 - 2
src/main/java/thyyxxk/webserver/controller/casefrontsheet/CaseFrontSheetController.java

@@ -119,8 +119,10 @@ public class CaseFrontSheetController {
     }
 
     @GetMapping("/fetchSsfz")
-    public ResultVo<PureCodeName> fetchSsfz(@RequestParam("code") String code) {
-        return service.fetchSsfz(code);
+    public ResultVo<String> fetchSsfz(@RequestParam("code") String code,
+                                      @RequestParam("bah") String bah,
+                                      @RequestParam("times") Integer times) {
+        return service.fetchSsfz(code, bah, times);
     }
 
 }

+ 7 - 0
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/CaseFrontSheetDao.java

@@ -718,5 +718,12 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
                           @Param("admissTimes") Integer admissTimes,
                           @Param("status") int status);
 
+    @Select("select top 1 * from t_si_disefamily_diagnose with(nolock) where dise_code=#{code} or disefamily_code=#{code}")
+    DisefamilyGrade selectDisefamilyGrade(@Param("code") String code);
 
+    @Select("select ssbm from batj_ba4 with(nolock) where zyh=#{bah} and zycs=#{times} and isnull(ssbm,'')!='' ")
+    List<String> selectPatientSurgeryCodes(@Param("bah") String bah, @Param("times") Integer times);
+
+    @Select("select * from t_si_operation_disefamily with(nolock) where disefamily_code=#{code}")
+    List<OprnDisefamilyGrade> selectOperationDisefamilies(@Param("code") String code);
 }

+ 41 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/DisefamilyGrade.java

@@ -0,0 +1,41 @@
+package thyyxxk.webserver.entity.casefrontsheet;
+
+import java.io.Serializable;
+import lombok.Data;
+
+@Data
+public class DisefamilyGrade implements Serializable {
+
+	private static final long serialVersionUID =  771832970120191242L;
+
+	/**
+	 * 诊断编码
+	 */
+	private String diseCode;
+
+	/**
+	 * 诊断名称
+	 */
+	private String diseName;
+
+	/**
+	 * 非手术分值
+	 */
+	private Integer noneOprnGrade;
+
+	/**
+	 * 手术分值
+	 */
+	private Integer oprnGrade;
+
+	/**
+	 * 病种编码
+	 */
+	private String disefamilyCode;
+
+	/**
+	 * 病种名称
+	 */
+	private String disefamilyName;
+
+}

+ 36 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/OprnDisefamilyGrade.java

@@ -0,0 +1,36 @@
+package thyyxxk.webserver.entity.casefrontsheet;
+
+import java.io.Serializable;
+import lombok.Data;
+
+@Data
+public class OprnDisefamilyGrade implements Serializable {
+
+	private static final long serialVersionUID =  5169761531682870568L;
+
+	/**
+	 * 手术编码
+	 */
+	private String oprnCode;
+
+	/**
+	 * 手术名称
+	 */
+	private String oprnName;
+
+	/**
+	 * 手术分值
+	 */
+	private Integer oprnGrade;
+
+	/**
+	 * 病种编码
+	 */
+	private String disefamilyCode;
+
+	/**
+	 * 病种名称
+	 */
+	private String disefamilyName;
+
+}

+ 14 - 48
src/main/java/thyyxxk/webserver/service/casefrontsheet/CaseFrontSheetService.java

@@ -18,10 +18,6 @@ import thyyxxk.webserver.service.externalhttp.PowersiSrvc;
 import thyyxxk.webserver.utils.*;
 
 import java.lang.reflect.Field;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -527,7 +523,6 @@ public class CaseFrontSheetService {
 
     @Transactional
     public ResultVo<String> saveYbDiags(SaveYbDiagParam param) {
-        dao.updateOperation(param.getBah(), param.getOperation());
         dao.deleteOldYbDiag(param.getBah(), param.getTimes());
         List<String> diagCodes = new ArrayList<>();
         for (int i = 0; i < param.getYbDiags().size(); i++) {
@@ -609,51 +604,22 @@ public class CaseFrontSheetService {
         return ResultVoUtil.success(new ArrayList<>());
     }
 
-    public ResultVo<PureCodeName> fetchSsfz(String code) {
-        PureCodeName ret = new PureCodeName();
-        Connection conn = null;
-        PreparedStatement stmt = null;
-        ResultSet rs = null;
-        try {
-            String sql = String.format("select FSSFZ, SSFZ from dc_ph_jbfz where ICD='%s'", code);
-            log.info("查询手术分值>>> sql:{}", sql);
-            conn = getConn();
-            stmt = conn.prepareStatement(sql);
-            rs = stmt.executeQuery();
-            if (rs.next()) {
-                String fssfz = rs.getString("FSSFZ");
-                String ssfz = rs.getString("SSFZ");
-                fssfz = fssfz == null ? "" : fssfz;
-                ssfz = ssfz == null ? "" : ssfz;
-                ret.setCode(fssfz);
-                ret.setName(ssfz);
-            }
-        } catch (Exception e) {
-            log.error("查询手术分值出错", e);
-        } finally {
-            try {
-                if (rs != null) {
-                    rs.close();
-                }
-                if (stmt != null) {
-                    stmt.close();
-                }
-                if (conn != null) {
-                    conn.close();
-                }
-            } catch (Exception e) {
-                log.error("释放查询手术分值资源出错", e);
+    public ResultVo<String> fetchSsfz(String code, String bah, Integer times) {
+        DisefamilyGrade disefamilyGrade = dao.selectDisefamilyGrade(code);
+        if (null == disefamilyGrade) {
+            return ResultVoUtil.success("无对照的病种。");
+        }
+        List<String> surgeries = dao.selectPatientSurgeryCodes(bah, times);
+        if (ListUtil.isBlank(surgeries)) {
+            return ResultVoUtil.success("有对照的非手术分值:" + disefamilyGrade.getNoneOprnGrade());
+        }
+        List<OprnDisefamilyGrade> oprnGrades = dao.selectOperationDisefamilies(disefamilyGrade.getDisefamilyCode());
+        for (OprnDisefamilyGrade oprn : oprnGrades) {
+            if (surgeries.contains(oprn.getOprnCode())) {
+                return ResultVoUtil.success("有对照的手术分值:" + oprn.getOprnGrade());
             }
         }
-        return ResultVoUtil.success(ret);
-    }
-
-    private Connection getConn() throws Exception {
-        Class.forName("oracle.jdbc.driver.OracleDriver");
-        String url = "jdbc:oracle:thin:@172.16.32.111:1521:orcl";
-        String user = "yypt_new";
-        String pwd = "powersi";
-        return DriverManager.getConnection(url, user, pwd);
+        return ResultVoUtil.success("有对照的非手术分值:" + disefamilyGrade.getNoneOprnGrade());
     }
 
     private int isLateSubmit(Date dismissDate) {