소스 검색

详情页诊断取病案首页的诊断

lihong 2 년 전
부모
커밋
87535405be

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

@@ -1023,4 +1023,36 @@ public interface UpIdCollectionDao extends BaseMapper<SetlinfoUpld> {
     Integer existCaseFrontsheetMain(@Param("patNo") String patNo, @Param("times") Integer times);
     @Select("select si_code from zd_country_code where code = #{code} ")
     String getCountrySiCode(String code);
+    @Select("select top 1 1 from t_case_frontsheet_disdiag where bah=#{patNo} and times =#{times}")
+    Integer exisCaseSheetDis(@Param("patNo") String patNo, @Param("times") Integer times);
+    @Select("select" +
+            "    rtrim(bah) inpatient_no," +
+            "    times admiss_times," +
+            "    dis_diag_no=no," +
+            "    case  when yb_code is null then rtrim(t1.code) else rtrim(yb_code) end dis_diag," +
+            "    case  when yb_name is null then rtrim(t1.name) else rtrim(yb_name) end dis_diag_comment," +
+            "    rtrim(op_id_code) op_id_code," +
+            "       '1'  si_diag_type," +
+            "     case when  admiss_status is not null  then admiss_status else 1 end admiss_cond" +
+            "    from t_case_frontsheet_disdiag t1 left join zd_icd_code_new t2 on (t1.code = t2.code)" +
+            "    where bah=#{patNo} and times =#{times}" +
+            "  order by  dis_diag_no")
+    List<YbZyDisDiag> getCaseSheetDis(@Param("patNo") String patNo, @Param("times") Integer times);
+    @Select("select          rtrim(inpatient_no)                                                            inpatient_no,\n" +
+            "                admiss_times,\n" +
+            "                dis_diag_no,\n" +
+            "                case when yb_code is null then rtrim(dis_diag) else rtrim(yb_code) end         dis_diag,\n" +
+            "                case when yb_name is null then rtrim(dis_diag_comment) else rtrim(yb_name) end dis_diag_comment,\n" +
+            "                rtrim(op_id_code)                                                              op_id_code,\n" +
+            "                dis_diag_date                                                                  op_diag_date,\n" +
+            "                dis_diag_status,\n" +
+            "                dis_diag_type,\n" +
+            "                '1' si_diag_type ,\n" +
+            "    case when  admiss_status is not null and admiss_status <>'' then cast(admiss_status as int) else 1 end admiss_cond\n" +
+            " from ba_first_page1 with (nolock)\n" +
+            "         left join zd_icd_code_new on (dis_diag = code)\n" +
+            " where inpatient_no = #{patNo}" +
+            "  and admiss_times = #{times}" +
+            "  order by dis_diag_no ")
+    List<YbZyDisDiag> getBafirstPage1(@Param("patNo") String patNo, @Param("times") Integer times);
 }

+ 23 - 2
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -1486,8 +1486,8 @@ public class SetlListUpldService {
         // 新老一起查
         zy.setBatjBa4(dao.shouShuXinXi(patNo, times, "batj_ba4"));
         zy.setNewBatjBa4(dao.shouShuXinXi(patNo, times, "batj_ba4_modify"));
-        // 诊断编码
-        zy.setYbZyDisDiag(dao.zhenDuanXinXi(patNo, times, "zy_dis_diag_yb"));
+        // 诊断取病案首页的诊断
+        zy.setYbZyDisDiag(getPatienYbZyDisDiag(patNo, times));
         zy.setNewYbZyDisDiag(dao.zhenDuanXinXi(patNo, times, "zy_dis_diag_yb_modify"));
 
         zy.setPatientBldInfos(dao.shuXueXinXi(patNo, times));
@@ -1502,6 +1502,27 @@ public class SetlListUpldService {
 
         return ResultVoUtil.success(zy);
     }
+    /**
+     * @description:取病案首页的诊断
+     * @author: lihong
+     * @date: 2023/3/9 10:07
+     * @param: patNo
+     * @param: times
+     **/
+    private List<YbZyDisDiag> getPatienYbZyDisDiag(String patNo, Integer times) {
+        //判断签收诊断是否有诊断信息
+       Integer exist =  dao.exisCaseSheetDis(patNo,times);
+        List<YbZyDisDiag> ybZyDisDiags;
+       if(exist == null){
+           ybZyDisDiags = dao.getBafirstPage1(patNo,times);
+       }else {
+           ybZyDisDiags = dao.getCaseSheetDis(patNo,times);
+       }
+       if(CollUtil.isEmpty(ybZyDisDiags)){
+           ybZyDisDiags = dao.zhenDuanXinXi(patNo, times, "zy_dis_diag_yb");
+       }
+       return ybZyDisDiags;
+    }
 
     public ResultVo<IPage<GetDropdownBox>> shouShuBianMa(String content, long currentPage) {
         IPage<GetDropdownBox> page = new Page<>();