Kaynağa Gözat

添加查看转科的情况

xiaochan 3 yıl önce
ebeveyn
işleme
4add6f8fa8

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

@@ -225,7 +225,7 @@ public interface UpIdCollectionDao {
             "       a.med_type,medfee_sumamt,fund_pay_sumamt, " +
             "       acct_pay,psn_cash_pay,clr_optins,clr_optins_name = (select name from t_region where code=clr_optins), " +
             "       outDeptName=(select rtrim(name) from zd_unit_code where code=small_dept)," +
-            "       small_dept as out_dept, " +
+            "       rtrim(small_dept) as out_dept, " +
             "       setl_list_id,datediff(day ,b.admiss_date ,b.dis_date) as act_ipt_days,b.operation,b.dec_type," +
             "       id,req_op_id,rtrim(req_op_name) req_op_name,req_op_date,req_remark," +
             "audit_staff,audit_name,audit_date,audit_remark,audit_flag," +
@@ -428,6 +428,18 @@ public interface UpIdCollectionDao {
     List<ZyDisDiagYb> zhuZhenDuan(@Param("patNos") Set<String> patNos);
 
 
+    @Select("<script>" +
+            "select ward_code,ward_code_name = (select rtrim(name) from zd_unit_code where code = ward_code), " +
+            "       rtrim(inpatient_no) patNo " +
+            "from zy_detail_charge where inpatient_no in " +
+            "<foreach collection='patNos' item='item' index='index' open='(' close=')' separator=','>" +
+            "#{item}" +
+            "</foreach>" +
+            "group by ward_code,inpatient_no" +
+            "</script>")
+    List<SiSetlinfoTemp> zhuanKeKeShi(@Param("patNos") Set<String> patNos);
+
+
     @Select("select top 10 rtrim(code) code, rtrim(name) name from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number',  * " +
             "from zd_cm3 where (code like #{content} or name like #{content} or py_code like #{content})) a " +

+ 6 - 0
src/main/java/thyyxxk/webserver/entity/querydata/SiSetlinfoTemp.java

@@ -354,6 +354,12 @@ public class SiSetlinfoTemp implements Serializable {
      */
     private Integer auditFlag;
 
+    private StringBuilder zhuanKeName;
+    private Integer zhuanKeAmount;
+
+    private String wardCode;
+    private String wardCodeName;
+
 
     public String getDecTypeName() {
         if (decType != null) {

+ 26 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -412,13 +412,34 @@ public class SetlListUpldService {
         Map<String, ZyDisDiagYb> zhuZhenDuan = dao.zhuZhenDuan(inpatientNos).stream().collect(
                 Collectors.toMap(item -> item.getInpatientNo() + item.getAdmissTimes(), a -> a, (k1, k2) -> k1)
         );
+        Map<String, List<SiSetlinfoTemp>> zhuanKeMap = dao.zhuanKeKeShi(inpatientNos).stream().collect(
+                Collectors.groupingBy(SiSetlinfoTemp::getPatNo)
+        );
+
         for (SiSetlinfoTemp item : page.getRecords()) {
             String key = item.getPatNo() + item.getTimes();
+            String zhuanKeKey = item.getPatNo();
             ZyDisDiagYb dis = zhuZhenDuan.get(key);
+            List<SiSetlinfoTemp> temp = zhuanKeMap.get(zhuanKeKey);
             if (dis != null) {
                 item.setDisDiag(dis.getDisDiag());
                 item.setDisDiagComment(dis.getDisDiagComment());
             }
+            if (ListUtil.notBlank(temp)) {
+                item.setZhuanKeAmount(temp.size());
+                if (temp.size() > 1) {
+                    StringBuilder keShi = new StringBuilder();
+                    for (SiSetlinfoTemp items : temp) {
+                        if (!item.getPatNo().equals(items.getPatNo())) {
+                            keShi = new StringBuilder();
+                        }
+                        if (keShi.length() != 0) {
+                            keShi.append("--->");
+                        }
+                        item.setZhuanKeName(keShi.append(items.getWardCodeName()));
+                    }
+                }
+            }
         }
         if (param.getTotal() == 0) {
             page.setTotal(dao.huoQuJieSuanRenYuanTotal(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
@@ -455,7 +476,8 @@ public class SetlListUpldService {
         param.setCurrentPage(1);
         log.info("医保结算单: {}", JSON.toJSONStringWithDateFormat(param, GetDateFormat.DATE));
         List<SiSetlinfoTemp> list = huoQuJieSuanRenYuan(param).getData().getRecords();
-        String[] title = {"姓名", "审核状态", "申报类型", "出院科室", "住院号/门诊号", "性别", "住院天数", "诊断编码", "诊断名称", "治疗方式", "总费用", "报销金额", "险种类型", "人员类别", "结算时间", "医疗类别", "清算机构", "管床医生"};
+        String[] title = {"姓名", "审核状态", "申报类型", "出院科室", "住院号/门诊号", "性别", "住院天数", "诊断编码", "诊断名称", "治疗方式", "总费用",
+                "报销金额", "险种类型", "人员类别", "结算时间", "医疗类别", "清算机构", "管床医生", "转科室", "转科次数"};
         String[][] content = new String[list.size()][];
         for (int i = 0; i < list.size(); i++) {
             content[i] = new String[title.length];
@@ -478,6 +500,8 @@ public class SetlListUpldService {
             content[i][15] = pojo.getMedTypeName();
             content[i][16] = pojo.getClrOptinsName();
             content[i][17] = pojo.getReferPhysicianName();
+            content[i][18] = pojo.getZhuanKeName() == null ? "" : pojo.getZhuanKeName().toString();
+            content[i][19] = pojo.getZhuanKeAmount() == null ? "" : pojo.getZhuanKeAmount().toString();
         }
         //传三个参数 一个是 固定的 response ,excel的头部信息,excel的内容
         ExcelUtil.exportExcel(response, title, content);
@@ -648,6 +672,7 @@ public class SetlListUpldService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "管床医生不能设置为空。");
         }
         dao.xiuGaiGuanChaungYiShen(patNo, times, code);
+        log.info("修改管床医生 ==》 修改人{},住院号:{},次数:{},管床医生:{}", TokenUtil.getTokenUserId(), patNo, times, code);
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "管床医生修改成功。");
     }