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

基于病案首页的优化

lighter 1 éve
szülő
commit
d96da1b1f4

+ 10 - 19
src/main/java/thyyxxk/webserver/dao/his/inpatient/casefrontsheet/CaseFrontSheetDao.java

@@ -258,28 +258,19 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
     @Select("select rtrim(code) as code,rtrim(name) as name from zd_icd_code_new where code=#{code}")
     CaseFrontsheetDisdiag selectDiagInfoByCode(@Param("code") String code);
 
-    @Select("select no=rtrim(ssxh)," +
-            "name=rtrim(ssmc)," +
-            "date=ssrq, " +
-            "op_end_date,anst_start_date,anst_end_date, " +
-            "level=rtrim(ssjb)," +
-            "code=rtrim(ssbm)," +
-            "operator=rtrim(ssys)," +
+    @Select("select no=rtrim(ssxh),name=rtrim(ssmc),date=ssrq, " +
+            "op_end_date,anst_start_date,anst_end_date,anaesthesiaor=rtrim(mzys), " +
+            "level=rtrim(ssjb),code=rtrim(ssbm),operator=rtrim(ssys), " +
             "operatorName=(select rtrim(name) from a_employee_mi with(nolock) where code=ssys)," +
-            "assistantOne=rtrim(sszs1)," +
+            "assistantOne=rtrim(sszs1),assistantTwo=rtrim(sszs2), " +
             "assistantOneName=(select rtrim(name) from a_employee_mi with(nolock) where code=sszs1)," +
-            "assistantTwo=rtrim(sszs2)," +
             "assistantTwoName=(select rtrim(name) from a_employee_mi with(nolock) where code=sszs2)," +
-            "cut=rtrim(qkjb), " +
-            "heal=rtrim(yhqk), " +
-            "anaesthesia=rtrim(mzff)," +
-            "anaesthesiaor=rtrim(mzys)," +
+            "cut=rtrim(qkjb),heal=rtrim(yhqk),anaesthesia=rtrim(mzff)," +
             "anaesthesiaorName=(select rtrim(name) from a_employee_mi with(nolock) where code=mzys) " +
-            "from batj_ba4 with(nolock) " +
-            "where bah=#{bah} and zycs=#{times}")
+            "from batj_ba4 with(nolock) where bah=#{bah} and zycs=#{times}")
     List<CaseFrontsheetSurgery> getSurgeries(@Param("bah") String bah, @Param("times") int times);
 
-    @Select("select rtrim(code) as code,name from zd_icd9_cm3 where code=#{code}")
+    @Select("select top 1 rtrim(yb_code) as code,rtrim(yb_name) as name from zd_icd9_cm3 where code=#{code}")
     CaseFrontsheetSurgery selectSurgeryByCode(@Param("code") String code);
 
     @Update("update a_patient_mi set name=#{name}, " +
@@ -615,8 +606,8 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
     Integer qualityPass(@Param("patNo") String patNo, @Param("times") Integer times);
 
     @Select("<script>" +
-            "select rtrim(code) as code,rtrim(name) as name,charge_code as wjwCode,charge_name as wjwName from zd_icd9_cm3 " +
-            "where code in " +
+            "select rtrim(yb_code) as code,rtrim(yb_name) as name,charge_code as wjwCode," +
+            "charge_name as wjwName from zd_icd9_cm3 where yb_code in " +
             "<foreach collection='surgeries' item='surgery' open='(' separator=',' close=')'>" +
             "#{surgery.code}" +
             "</foreach>" +
@@ -644,7 +635,7 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
     @Select("select top 1 insuplc_admdvs from t_si_setlinfo where pat_no=#{patNo} and times=#{times} and revoked=0")
     String selectSetlInsuplcAdmdvs(@Param("patNo") String patNo, @Param("times") int times);
 
-    @Select("select top 1 isnull(op_type,9) from zd_icd9_cm3 where code=#{code}")
+    @Select("select top 1 isnull(op_type,9) from zd_icd9_cm3 where yb_code=#{code}")
     Integer selectOperationType(@Param("code") String code);
 
     // 病历分型

+ 5 - 3
src/main/java/thyyxxk/webserver/dao/his/inpatient/casefrontsheet/FrontSheetExportDao.java

@@ -21,9 +21,11 @@ public interface FrontSheetExportDao {
     @Select("select no,code,name,admiss_status,dismiss_status from t_case_frontsheet_disdiag where bah=#{bah} and times=#{times}")
     List<CaseFrontsheetDisdiag> fetchDiags(@Param("bah") String bah, @Param("times") int times);
 
-    @Select("select no,code,name,date,level,operator,operator_name,assistant_one,assistant_one_name, " +
+    @Select("select no,date,level,operator,operator_name,assistant_one,assistant_one_name, " +
             "assistant_two,assistant_two_name,cut=isnull(cut,0),heal=isnull(heal,0),anaesthesiaor,anaesthesiaor_name, " +
-            "anaesthesia=(select wjw_code from zd_anaesthesia where code=anaesthesia) " +
-            "from t_case_frontsheet_surgery where bah=#{bah} and times=#{times}")
+            "anaesthesia=(select wjw_code from zd_anaesthesia where code=anaesthesia)," +
+            "code=(select top 1 rtrim(d.code) from zd_icd9_cm3 d where d.yb_code=a.code order by code), " +
+            "name=(select top 1 rtrim(d.name) from zd_icd9_cm3 d where d.yb_code=a.code order by code) " +
+            "from t_case_frontsheet_surgery a where bah=#{bah} and times=#{times}")
     List<CaseFrontsheetSurgery> fetchSurgeries(@Param("bah") String bah, @Param("times") int times);
 }

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

@@ -180,7 +180,7 @@ public interface UpIdCollectionDao extends BaseMapper<SetlinfoUpld> {
     SetlinfoUpld setlinfo3(@Param("patNo") String patNo);
 
 
-    @Select("select clinic_diag_code as wmDiseCode, clinic_diag_str otpWmDise " +
+    @Select("select rtrim(clinic_diag_code) as wmDiseCode, clinic_diag_str otpWmDise " +
             "from t_case_frontsheet_main " +
             "where bah = #{patNo} " +
             "  and admiss_times = #{times}" +
@@ -445,7 +445,7 @@ public interface UpIdCollectionDao extends BaseMapper<SetlinfoUpld> {
     List<SiSetlinfoTemp> zhuanKeKeShi(@Param("patNos") Set<String> patNos);
 
 
-    @Select("select top 10 rtrim(yb_code) as code,rtrim(name) as name," +
+    @Select("select top 10 rtrim(yb_code) as code,rtrim(yb_name) as name," +
             "rtrim(yb_code) as yb_code  from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS Number,  * " +
             "from zd_icd9_cm3 where del_flag=0 and (code like #{content} or name like #{content} or yb_code like #{content})) a " +

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

@@ -17,7 +17,7 @@ public interface SearchDao {
     @Select("select distinct rtrim(yb_code) as code, rtrim(yb_name) as name from zd_icd_code_new where ${method} like #{content} and del_flag=0")
     IPage<CodeName> searchSiDiagnose(IPage<CodeName> iPage, @Param("method") String method, @Param("content") String content);
 
-    @Select("select rtrim(code) as code, rtrim(name) as name from zd_icd9_cm3 where ${method} like #{content} and del_flag=0")
+    @Select("select rtrim(yb_code) as code, rtrim(yb_name) as name from zd_icd9_cm3 where ${method} like #{content} and del_flag=0")
     IPage<CodeName> searchSurgeries(IPage<CodeName> iPage, @Param("method") String method, @Param("content") String content);
 
     @Select("select distinct rtrim(code) as code, rtrim(name) as name from zd_icd_code_new where ${method} like #{content} and del_flag=0")

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/PatientInfoQueryDao.java

@@ -27,7 +27,7 @@ public interface PatientInfoQueryDao {
             "where (code like #{code} or name like #{code})")
     List<GetDropdownBox> selectDiagnsis(String code);
 
-    @Select("select code, name " +
+    @Select("select rtrim(yb_code) as code, rtrim(yb_name) as name " +
             "from zd_icd9_cm3 " +
             "where (code like #{code} or name like #{code})")
     List<GetDropdownBox> selectSurgery(String code);

+ 2 - 2
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/ShouShuShenQingDao.java

@@ -28,8 +28,8 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
 
     @Select("<script>" +
             "select op_type_name = (select name from zd_operation_type where code = op_type), " +
-            "       rtrim(code) as code," +
-            "       rtrim(name) name,op_scale " +
+            "       rtrim(yb_code) as code," +
+            "       rtrim(yb_name) name,op_scale " +
             "from zd_icd9_cm3 " +
             "where (code like #{name} or name like #{name} or py_code like #{name} or d_code like #{name}) " +
             "<if test=\"type !=null and type != 0 \">" +

+ 8 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/CaseFrontsheetMain.java

@@ -904,4 +904,12 @@ public class CaseFrontsheetMain implements Serializable {
     public Boolean isDoctorPrint() {
         return null != isDoctorPrint && isDoctorPrint;
     }
+
+    public String getPathologicDiagStr() {
+        return null == pathologicDiagStr ? "" : pathologicDiagStr;
+    }
+
+    public String getClinicDiagStr() {
+        return null == clinicDiagStr ? "" : clinicDiagStr;
+    }
 }

+ 11 - 1
src/main/java/thyyxxk/webserver/service/inpatient/casefrontsheet/CaseFrontSheetExportService.java

@@ -7,6 +7,7 @@ import thyyxxk.webserver.constants.frntsheet.DismissWay;
 import thyyxxk.webserver.constants.frntsheet.Hbsag;
 import thyyxxk.webserver.constants.frntsheet.Provinces;
 import thyyxxk.webserver.dao.his.inpatient.casefrontsheet.FrontSheetExportDao;
+import thyyxxk.webserver.entity.casefrontsheet.CaseFrontsheetDisdiag;
 import thyyxxk.webserver.entity.casefrontsheet.CaseFrontsheetMain;
 import thyyxxk.webserver.entity.casefrontsheet.CaseFrontsheetSurgery;
 import thyyxxk.webserver.service.redislike.RedisLikeService;
@@ -33,6 +34,8 @@ public class CaseFrontSheetExportService {
         String end = DateUtil.getMonthEndtime(month);
         List<CaseFrontsheetMain> list = dao.fetchSheets(begin, end);
         for (CaseFrontsheetMain sheet : list) {
+            sheet.setPathologicDiagStr(sheet.getPathologicDiagStr().replaceAll(",", ","));
+            sheet.setClinicDiagStr(sheet.getClinicDiagStr().replaceAll(",", ","));
             sheet.setSurgicalFee(DecimalUtil.add(sheet.getAnesthetizeFee(), sheet.getSurgeryFee()));
             sheet.setSurgeryList(selectSurgeries(sheet.getBah(), sheet.getAdmissTimes()));
             sheet.setZyDismissWay(DismissWay.getWjwCodeByHisCode(sheet.getZyDismissWay()));
@@ -46,14 +49,21 @@ public class CaseFrontSheetExportService {
             sheet.setZkWardCode(redis.getWjwDepartment(sheet.getZkWardCode()));
             sheet.setDismissDeptCode(redis.getWjwDepartment(sheet.getDismissDeptCode()));
             sheet.setNation(redis.getWjwNation(sheet.getNation()));
-            sheet.setDisdiagList(dao.fetchDiags(sheet.getBah(), sheet.getAdmissTimes()));
+            sheet.setDisdiagList(selectDiags(sheet.getBah(), sheet.getAdmissTimes()));
         }
         return list;
     }
 
+    private List<CaseFrontsheetDisdiag> selectDiags(String bah, int times) {
+        List<CaseFrontsheetDisdiag> diags = dao.fetchDiags(bah, times);
+        diags.forEach(item -> item.setName(item.getName().replaceAll(",", ",")));
+        return diags;
+    }
+
     private List<CaseFrontsheetSurgery> selectSurgeries(String bah, int times) {
         List<CaseFrontsheetSurgery> surgeries = dao.fetchSurgeries(bah, times);
         surgeries.forEach(s -> {
+            s.setName(s.getName().replaceAll(",", ","));
             int cut = 0;
             if (StringUtil.notBlank(s.getCut())) {
                 cut = Integer.parseInt(s.getCut());

+ 2 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiSettleApplyService.java

@@ -117,6 +117,7 @@ public class SiSettleApplyService {
         List<ZyInYbDiag> inYbDiags = ptntSrvc.getZyInYbDiags(apply.getPatNo(), apply.getTimes()).getData();
         List<ZyDisYbDiag> disYbDiags = ptntSrvc.getZyDisYbDiags(apply.getPatNo(), apply.getTimes()).getData();
         List<ZyDisYbSrgry> disYbSrgries = dao.selectSurgeries(apply.getPatNo(), apply.getTimes());
+
         for (ZyInYbDiag itm : inYbDiags) {
             itm.setOperName(redis.getEmployeeName(itm.getOperId()));
         }
@@ -153,7 +154,7 @@ public class SiSettleApplyService {
         if (disYbDiags.isEmpty()) {
             message += "此患者没有出院诊断。";
         }
-        if (!message.equals("")) {
+        if (!message.isEmpty()) {
             map.put("warning", message);
         }
         return ResultVoUtil.success(map);