Browse Source

Merge branch 'master' of https://172.16.32.165/lighter/web-server

DESKTOP-0GD05B0\Administrator 3 years ago
parent
commit
8771fcd1ba

+ 2 - 2
src/main/java/thyyxxk/webserver/controller/ybkf/YbCssTjController.java

@@ -59,7 +59,7 @@ public class YbCssTjController {
      * @return
      */
     @PostMapping("/selectBrJsTj")
-    public ResultVo<List<Map<String, Object>>> selectBrJsTj(@RequestBody @Validated YbkfShareDto dto){
+    public ResultVo<Map<String, Object>> selectBrJsTj(@RequestBody @Validated YbkfShareDto dto){
         return service.selectBrJsTj(dto);
     }
 
@@ -109,7 +109,7 @@ public class YbCssTjController {
     }
 
     @PostMapping("/selectCssYbCsTj")
-    public ResultVo<List<Map<String, Object>>> selectCssYbCsTj(@RequestBody @Validated YbkfShareDto dto){
+    public ResultVo<Map<String, Object>> selectCssYbCsTj(@RequestBody @Validated YbkfShareDto dto){
         return service.selectCssYbCsTj(dto);
     }
 

+ 2 - 1
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/SheetSearchDao.java

@@ -40,7 +40,8 @@ public interface SheetSearchDao {
             "where a.[Number]>10*(#{page}) order by weight desc")
     List<CodeName> searchHurtReason(@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, rtrim(yb_code) ybCode, " +
+            "deptName=(select rtrim(t.name) from zd_unit_code t where t.code=dept_code) from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS 'Number',  * " +
             "from a_employee_mi with(nolock) where isnull(del_flag,0)=0 and ${method} like #{content}) a " +
             "where a.[Number]>10*(#{page})")

+ 16 - 0
src/main/java/thyyxxk/webserver/dao/his/ybkf/YbUtilDao.java

@@ -44,4 +44,20 @@ public interface YbUtilDao {
     List<ZyDetailCharge> selectInterventionalProject(@Param("patNo") String patNo, @Param("times") Integer times,
         @Param("ledgerSn") Integer ledgerSn, @Param("item") String item);
 
+    /**
+     * @description: 查询病人使用抗肿瘤药物(做化疗时用到的药,但不包括抗肿瘤辅助用药)
+     * @author: hsh
+     * @date: 2022/11/8 15:50
+     * @param: [patNo, times]
+     * @return: List<Map<String,Object>>
+     **/
+    @Select(" select top 10 * from yp_zy_patient" +
+            " where rtrim(inpatient_no) = #{patNo} and admiss_times = #{times} " +
+            " and charge_code in " +
+            " (select charge_code from yp_base " +
+            "  where class_code in " +
+            "  (select code from yp_zd_class where code like '09%' and code <> '090900' ) " +
+            " ) ")
+    List<Map<String, Object>> selectChemotherapyDigan(@Param("patNo") String patNo, @Param("times") Integer times);
+
 }

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/dictionary/CodeName.java

@@ -11,6 +11,8 @@ public class CodeName {
     private String name;
     private String pyCode;
     private String ssfz;
+    private String deptName;
+    private String ybCode;
     private boolean disabled;
 
     public CodeName() {

+ 2 - 2
src/main/java/thyyxxk/webserver/entity/medicalinsurance/query/BaseSetlStatistics.java

@@ -29,11 +29,11 @@ public class BaseSetlStatistics {
      */
     private String hifpPay;
     /**
-     * 居民大病保险金支出
+     * 居民大病保险金支出
      */
     private String hifmiPay;
     /**
-     * 公务员医疗补助金支出
+     * 公务员医疗补助金支出
      */
     private String cvlservPay;
     /**

+ 50 - 61
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -1583,37 +1583,7 @@ public class SiQueryService {
     }
 
     public ResultVo<List<SetlStatisticResult>> selectSetlinfoStatistics(SetlCondition condition) {
-        String begntime = condition.getMonth() + "-01 00:00:00.000";
-        String endtime = DateUtil.getMonthEndtime(condition.getMonth());
-        String insutype = condition.getInsutype();
-        if (StringUtil.isBlank(insutype)) {
-            insutype = "%%";
-        }
-        List<BaseSetlStatistics> baseStatistics;
-        switch (condition.getAdmdvsType()) {
-            case 1:
-                baseStatistics = dao.selectBaseSetlStatisticsInProvinceLevel(begntime, endtime, insutype, condition.getSetlType());
-                break;
-            case 2:
-                baseStatistics = dao.selectBaseSetlStatisticsInChangshaCity(begntime, endtime, insutype, condition.getSetlType());
-                break;
-            case 3:
-                baseStatistics = dao.selectBaseSetlStatisticsInProvinceOtherCities(begntime, endtime, insutype, condition.getSetlType());
-                break;
-            case 4:
-                baseStatistics = dao.selectBaseSetlStatisticsOutProvince(begntime, endtime, insutype, condition.getSetlType());
-                break;
-            case 5:
-                baseStatistics = dao.selectBaseSetlStatisticsInChangshaCounty(begntime, endtime, insutype, condition.getSetlType());
-                break;
-            case 6:
-                baseStatistics = dao.selectBaseSetlStatisticsInLiuYangCity(begntime, endtime, insutype, condition.getSetlType());
-                break;
-            default:
-                baseStatistics = dao.selectBaseSetlStatisticsInAllPlaces(begntime, endtime, insutype, condition.getSetlType());
-                break;
-        }
-
+        List<BaseSetlStatistics> baseStatistics = getBaseStatistics(condition);
         if (null == baseStatistics || baseStatistics.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
         }
@@ -1621,7 +1591,7 @@ public class SiQueryService {
         Map<String, String> regionMap = new HashMap<>();
         Map<String, List<BaseSetlStatistics>> admdvsSetldataMap = new HashMap<>();
 
-        List<BaseSetlStatistics> shangChuanJieSuanDan = new ArrayList<>();
+        List<BaseSetlStatistics> setlListUpload = new ArrayList<>();
 
         baseStatistics.forEach(itm -> {
             itm.setInsutypeName(Insutype.getName(itm.getInsutype()));
@@ -1653,7 +1623,7 @@ public class SiQueryService {
                 admdvsSetldataMap.put(admdvsName, tempList);
             }
             itm.setMedTypeName(MedType.getName(itm.getMedType()));
-            shangChuanJieSuanDan.add(itm);
+            setlListUpload.add(itm);
         });
 
         List<SetlStatisticResult> resultList = new ArrayList<>();
@@ -1709,10 +1679,35 @@ public class SiQueryService {
                 resultItem.setChildren(children);
             }
         }
-        resultList.get(0).setShangChuanJieSuanDan(shangChuanJieSuanDan);
+        resultList.get(0).setShangChuanJieSuanDan(setlListUpload);
         return ResultVoUtil.success(resultList);
     }
 
+    private List<BaseSetlStatistics> getBaseStatistics(SetlCondition condition) {
+        String begntime = condition.getMonth() + "-01 00:00:00.000";
+        String endtime = DateUtil.getMonthEndtime(condition.getMonth());
+        String insutype = condition.getInsutype();
+        if (StringUtil.isBlank(insutype)) {
+            insutype = "%%";
+        }
+        switch (condition.getAdmdvsType()) {
+            case 1:
+                return dao.selectBaseSetlStatisticsInProvinceLevel(begntime, endtime, insutype, condition.getSetlType());
+            case 2:
+                return dao.selectBaseSetlStatisticsInChangshaCity(begntime, endtime, insutype, condition.getSetlType());
+            case 3:
+                return dao.selectBaseSetlStatisticsInProvinceOtherCities(begntime, endtime, insutype, condition.getSetlType());
+            case 4:
+                return dao.selectBaseSetlStatisticsOutProvince(begntime, endtime, insutype, condition.getSetlType());
+            case 5:
+                return dao.selectBaseSetlStatisticsInChangshaCounty(begntime, endtime, insutype, condition.getSetlType());
+            case 6:
+                return dao.selectBaseSetlStatisticsInLiuYangCity(begntime, endtime, insutype, condition.getSetlType());
+            default:
+                return dao.selectBaseSetlStatisticsInAllPlaces(begntime, endtime, insutype, condition.getSetlType());
+        }
+    }
+
     private void fillSetlStatisticResult(List<SetlStatisticResult> resultList, List<BaseSetlStatistics> admdvsSetldataList, SetlStatisticResult resultItem) {
         String medfeeSumamt = "0";
         String baseMedFundpaySumamt = "0";
@@ -1744,37 +1739,12 @@ public class SiQueryService {
     public ResultVo<List<SiSetlinfo>> selectSetldetailStatistics(SetlCondition condition) {
         String begntime = condition.getMonth() + "-01 00:00:00.000";
         String endtime = DateUtil.getMonthEndtime(condition.getMonth());
-        String admdvsCondition;
-
-        switch (condition.getAdmdvsType()) {
-            case 1:
-                admdvsCondition = " and insuplc_admdvs='439900' ";
-                break;
-            case 2:
-                admdvsCondition = " and insuplc_admdvs like '4301%' and  insuplc_admdvs not in ('430121','430181') ";
-                break;
-            case 3:
-                admdvsCondition = " and insuplc_admdvs like '43%' and insuplc_admdvs not like '4301%' ";
-                break;
-            case 4:
-                admdvsCondition = " and insuplc_admdvs not like '43%' ";
-                break;
-            case 5:
-                admdvsCondition = " and insuplc_admdvs='430121' ";
-                break;
-            case 6:
-                admdvsCondition = " and insuplc_admdvs='430181' ";
-                break;
-            default:
-                admdvsCondition = "";
-                break;
-        }
-
+        String admdvsStatement = getAdmdvsStatement(condition.getAdmdvsType());
         String insutype = condition.getInsutype();
         if (StringUtil.isBlank(insutype)) {
             insutype = "%%";
         }
-        List<SiSetlinfo> list = setlinfoDao.selectMyList(condition.getSetlType(), insutype, admdvsCondition, begntime, endtime);
+        List<SiSetlinfo> list = setlinfoDao.selectMyList(condition.getSetlType(), insutype, admdvsStatement, begntime, endtime);
         list.forEach(item -> {
             if (null != item.getHospPartAmt()) {
                 item.setFundPaySumamt(DecimalUtil.minusDouble(item.getFundPaySumamt(), item.getHospPartAmt()));
@@ -1785,6 +1755,25 @@ public class SiQueryService {
         return ResultVoUtil.success(list);
     }
 
+    private String getAdmdvsStatement(int admdvstype) {
+        switch (admdvstype) {
+            case 1:
+                return " and insuplc_admdvs='439900' ";
+            case 2:
+                return " and insuplc_admdvs like '4301%' and  insuplc_admdvs not in ('430121','430181') ";
+            case 3:
+                return " and insuplc_admdvs like '43%' and insuplc_admdvs not like '4301%' ";
+            case 4:
+                return " and insuplc_admdvs not like '43%' ";
+            case 5:
+                return " and insuplc_admdvs='430121' ";
+            case 6:
+                return " and insuplc_admdvs='430181' ";
+            default:
+                return "";
+        }
+    }
+
     public ResultVo<List<ZyActpatient>> weiJieSuanZaiYuanHuanZhe(String patNo, String startTime, String endTime, String name, String certno) {
         List<ZyActpatient> actpatients = dao.zaiYuanHuanZheXinXi(patNo, startTime, endTime, StringUtil.isContainChinese(name), certno);
         Map<String, String> insuplcAdmdvs = new HashMap<>();

+ 11 - 7
src/main/java/thyyxxk/webserver/service/ybkf/YbClnTimesAvgService.java

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.service.ybkf;
 
+import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
@@ -27,6 +28,7 @@ import java.util.stream.Collectors;
  * @Version: 1.0
  */
 @Service
+@Log4j2
 public class YbClnTimesAvgService {
 
     private final YbClnTimesAvgDao dao;
@@ -92,7 +94,7 @@ public class YbClnTimesAvgService {
                 // 长沙县城职/居普通住院病人做了介入手术且手术+化疗同时进行病人也纳入单列
                 if("长沙县城职普通住院".equals(insurName) || "长沙县城居普通住院".equals(insurName)){
                     // 是否用了介入手术材料并且是否同时做了化疗
-                    if(isInterventionalProject(info.getPatNo(), info.getTimes(), info.getLedgerSn()) && isChemotherapy(info.getPatNo(), info.getTimes(), info.getLedgerSn())){
+                    if(isInterventionalProject(info.getPatNo(), info.getTimes(), info.getLedgerSn()) && isChemotherapy(info.getPatNo(), info.getTimes())){
                         flag = false;
                     }
                 }
@@ -128,10 +130,12 @@ public class YbClnTimesAvgService {
         return ResultVoUtil.success(resultMap);
     }
 
-    private boolean isChemotherapy(String patNo, Integer times, Integer ledgerSn) {
-        // 待定
-        System.out.println("------------------" + patNo + "||" + times + "||" + ledgerSn + "------------------");
-        return false;
+    private boolean isChemotherapy(String patNo, Integer times) {
+        List<Map<String, Object>> feeList = utilDao.selectChemotherapyDigan(patNo, times);
+        if(feeList.size() > 0){
+            log.info("住院号:{}, 住院次数:{}", patNo, times);
+        }
+        return feeList.size() != 0;
     }
 
     private boolean isInterventionalProject(String patNo, Integer times, Integer ledgerSn) {
@@ -209,7 +213,7 @@ public class YbClnTimesAvgService {
                 // 长沙县城职/居普通住院病人做了介入手术且手术+化疗同时进行病人也纳入单列
                 if("长沙县城职普通住院".equals(insurName) || "长沙县城居普通住院".equals(insurName)){
                     // 是否用了介入手术材料并且是否同时做了化疗
-                    if(isInterventionalProject(info.getPatNo(), info.getTimes(), info.getLedgerSn()) && isChemotherapy(info.getPatNo(), info.getTimes(), info.getLedgerSn())){
+                    if(isInterventionalProject(info.getPatNo(), info.getTimes(), info.getLedgerSn()) && isChemotherapy(info.getPatNo(), info.getTimes())){
                         flag = false;
                     }
                 }
@@ -284,7 +288,7 @@ public class YbClnTimesAvgService {
             // 长沙县城职/居普通住院病人做了介入手术且手术+化疗同时进行病人也纳入单列
             if("长沙县城职普通住院".equals(insurName) || "长沙县城居普通住院".equals(insurName)){
                 // 是否用了介入手术材料并且是否同时做了化疗
-                if(isInterventionalProject(info.getPatNo(), info.getTimes(), info.getLedgerSn()) && isChemotherapy(info.getPatNo(), info.getTimes(), info.getLedgerSn())){
+                if(isInterventionalProject(info.getPatNo(), info.getTimes(), info.getLedgerSn()) && isChemotherapy(info.getPatNo(), info.getTimes())){
                     flag = false;
                 }
             }

+ 36 - 13
src/main/java/thyyxxk/webserver/service/ybkf/YbCssTjService.java

@@ -107,14 +107,18 @@ public class YbCssTjService {
      * @param dto
      * @return
      */
-    public ResultVo<List<Map<String, Object>>> selectBrJsTj(YbkfShareDto dto){
+    public ResultVo<Map<String, Object>> selectBrJsTj(YbkfShareDto dto){
         String beginTime = dto.getStartTime();
         String endTime = dto.getEndTime();
         String deptId = dto.getDeptId();
         String doctorId = dto.getDoctorId() == null ? "" : dto.getDoctorId();
         String insurName = dto.getInsurName();
         List<Map<String, Object>> result = dao.selectBrJsTj(beginTime, endTime, deptId, doctorId, insurName);
-        return ResultVoUtil.success(result);
+        Map<String, Object> m_total = dao.selectBrJsTjTotal(beginTime, endTime, deptId, doctorId, insurName);
+        Map<String, Object> m = new HashMap<>();
+        m.put("data", result);
+        m.put("total", m_total);
+        return ResultVoUtil.success(m);
     }
 
     /**
@@ -1038,18 +1042,14 @@ public class YbCssTjService {
      * @return
      */
     public void exportBrYbSetlExcel(HttpServletResponse response, YbkfShareDto dto){
-        String beginTime = dto.getStartTime();
-        String endTime = dto.getEndTime();
-        String deptId = dto.getDeptId();
-        String doctorId = dto.getDoctorId() == null ? "" : dto.getDoctorId();
-        String insurName = dto.getInsurName();
-        ResultVo<List<Map<String, Object>>> rs =  selectBrJsTj(dto);
-        List<Map<String, Object>> list = rs.getData();
+        ResultVo<Map<String, Object>> rs =  selectBrJsTj(dto);
+        Map<String, Object> mapData = rs.getData();
 
-        if(null == list){
+        if(null == mapData){
             return;
         }
 
+        List<Map<String, Object>> list = (List<Map<String, Object>>) mapData.get("data");
         // 主要诊断和主要手术需要重新组合一下编码和名称
         for(Map<String, Object> map : list){
             String zdmc = String.valueOf(map.get("zdmc"));
@@ -1065,7 +1065,7 @@ public class YbCssTjService {
         }
 
         // 查询合计
-        Map<String, Object> m_total = dao.selectBrJsTjTotal(beginTime, endTime, deptId, doctorId, insurName);
+        Map<String, Object> m_total = (Map<String, Object>) mapData.get("total");
         list.add(m_total);
 
         // 导出标题
@@ -1321,7 +1321,7 @@ public class YbCssTjService {
      * @param: [dto]
      * @return: ResultVo<List<Map<String,Object>>>
      **/
-    public ResultVo<List<Map<String, Object>>> selectCssYbCsTj(YbkfShareDto dto){
+    public ResultVo<Map<String, Object>> selectCssYbCsTj(YbkfShareDto dto){
         String beginTime = dto.getStartTime();
         String endTime = dto.getEndTime();
         String dept = dto.getDept();
@@ -1338,7 +1338,30 @@ public class YbCssTjService {
         for(Map<String, Object> map : result){
             AddDaginAndBal(testParams, setlParams, map);
         }
-        return ResultVoUtil.success(result);
+        // 计算合计
+        Map<String, Object> hjMap = new HashMap<>();
+        String zfy = "0";
+        String yjzf = "0";
+        String tczf = "0";
+        String bal = "0";
+        String score = "0";
+        String bxbl = "0";
+        for(Map<String, Object> map : result){
+            zfy = DecimalUtil.add(zfy, String.valueOf(map.get("zfy")));
+            yjzf = DecimalUtil.add(yjzf, String.valueOf(map.get("yjzf")));
+            tczf = DecimalUtil.add(tczf, String.valueOf(map.get("tczf")));
+            bal = DecimalUtil.add(bal, String.valueOf(map.get("bal")));
+            score = DecimalUtil.add(score, String.valueOf(map.get("score")));
+            bxbl = String.valueOf(DecimalUtil.multiply(new BigDecimal(DecimalUtil.divide(tczf, zfy, 4)), new BigDecimal("100")));
+        }
+        hjMap.put("zfy", zfy);
+        hjMap.put("yjzf", yjzf);
+        hjMap.put("tczf", tczf);
+        hjMap.put("bal", bal);
+        hjMap.put("score", score);
+        hjMap.put("bxbl", bxbl);
+        hjMap.put("data", result);
+        return ResultVoUtil.success(hjMap);
     }
 
     /**