Prechádzať zdrojové kódy

冲突收费可以查看对应医嘱

lighter 4 rokov pred
rodič
commit
676208d346

+ 8 - 0
src/main/java/thyyxxk/webserver/controller/reports/IllegalChargesAnalysisController.java

@@ -3,12 +3,14 @@ package thyyxxk.webserver.controller.reports;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.datamodify.YzActOrder;
 import thyyxxk.webserver.entity.dictionary.PureCodeName;
 import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeData;
 import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeTemplate;
 import thyyxxk.webserver.entity.reports.illegalchargesanalysis.SearchChargeItem;
 import thyyxxk.webserver.service.reports.IllegalChargesAnalysisService;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -56,6 +58,12 @@ public class IllegalChargesAnalysisController {
         return service.analyzeTargetData(template);
     }
 
+    @GetMapping("/selectOrderPair")
+    public ResultVo<List<YzActOrder>> selectOrderPair(@RequestParam("orderNo") BigDecimal orderNo,
+                                                      @RequestParam("conflictOrderNo") BigDecimal conflictOrderNo) {
+        return service.selectOrderPair(orderNo, conflictOrderNo);
+    }
+
     @PostMapping("/queryHuanZheLiangCiRuYuanRiQi")
     public ResultVo<List<IllegalChargeData>> queryHuanZheLiangCiRuYuanRiQi(@RequestBody IllegalChargeTemplate param) {
         return service.queryHuanZheLiangCiRuYuanRiQi(param);

+ 14 - 2
src/main/java/thyyxxk/webserver/dao/his/reports/IllegalChargesAnalysisDao.java

@@ -1,10 +1,12 @@
 package thyyxxk.webserver.dao.his.reports;
 
 import org.apache.ibatis.annotations.*;
+import thyyxxk.webserver.entity.datamodify.YzActOrder;
 import thyyxxk.webserver.entity.dictionary.PureCodeName;
 import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeData;
 import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeTemplate;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -13,6 +15,16 @@ import java.util.List;
 @Mapper
 public interface IllegalChargesAnalysisDao {
 
+    @Select("select *, physicianName=(select rtrim(name) from a_employee_mi where code=physician) " +
+            "from yz_act_order where act_order_no in (#{orderNo}, #{orderNo2})")
+    List<YzActOrder> selectYzActOrder(@Param("orderNo") BigDecimal orderNo,
+                                      @Param("orderNo2") BigDecimal orderNo2);
+
+    @Select("select *, physicianName=(select rtrim(name) from a_employee_mi where code=physician) " +
+            "from yz_inact_order where act_order_no in (#{orderNo}, #{orderNo2})")
+    List<YzActOrder> selectYzInActOrder(@Param("orderNo") BigDecimal orderNo,
+                                        @Param("orderNo2") BigDecimal orderNo2);
+
     @Select("select * from t_illegal_charge_template where id like #{code} or id like 'admin%' order by id")
     List<IllegalChargeTemplate> selectMyTemplates(@Param("code") String code);
 
@@ -38,7 +50,7 @@ public interface IllegalChargesAnalysisDao {
     @Update("update t_illegal_charge_template set label=#{label}, value=#{value},attribute=#{attribute} where id=#{id}")
     void updateTemplate(IllegalChargeTemplate template);
 
-    @Select("select rtrim(inpatient_no) as inpatientNo,admiss_times, " +
+    @Select("select rtrim(inpatient_no) as inpatientNo,admiss_times, order_no," +
             "name=(select rtrim(name) from a_patient_mi where a_patient_mi.inpatient_no=a.inpatient_no), " +
             "responceType=(select rtrim(responce_type) from yb_zy_review_record where yb_zy_review_record.inpatient_no=" +
             "a.inpatient_no and yb_zy_review_record.admiss_times=a.admiss_times), " +
@@ -108,7 +120,7 @@ public interface IllegalChargesAnalysisDao {
             "<foreach collection='inpatientNoList' item='item' index='index' open='(' close=')' separator=','>" +
             "#{item.inpatientNo}" +
             "</foreach>" +
-            "and dis_diag_no = 1" +
+            " and dis_diag_no = 1" +
             "</script>")
     List<IllegalChargeData> queryZhenDuan(@Param("inpatientNoList") List<IllegalChargeData> inpatientNoList);
 }

+ 6 - 2
src/main/java/thyyxxk/webserver/entity/datamodify/YzActOrder.java

@@ -1,13 +1,13 @@
 package thyyxxk.webserver.entity.datamodify;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -23,7 +23,7 @@ import lombok.experimental.Accessors;
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
-@ApiModel(value = "YzActOrder对象", description = "")
+@ApiModel(value = "YzActOrder对象")
 @Accessors(chain = true)
 public class YzActOrder implements Serializable {
 
@@ -37,6 +37,7 @@ public class YzActOrder implements Serializable {
     /**
      * 病人的姓名
      * */
+    @TableField(exist = false)
     private String patientName;
 
 
@@ -58,6 +59,7 @@ public class YzActOrder implements Serializable {
 
     private String modifier;
 
+    @TableField(exist = false)
     private String modifierName;
 
     private String infantFlag;
@@ -66,12 +68,14 @@ public class YzActOrder implements Serializable {
 
     private String supplyCode;
 
+    @TableField(exist = false)
     private String supplyCodeName;
 
     private Date performanceTime;
 
     private String physician;
 
+    @TableField(exist = false)
     private String physicianName;
 
     private Date confirmTime;

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/reports/illegalchargesanalysis/IllegalChargeData.java

@@ -20,6 +20,7 @@ public class IllegalChargeData {
     private String deptName;
     private String wardName;
     private String diag;
+    private Float orderNo;
     private Integer detailSn;
     private String chargeCode;
     private String chargeName;
@@ -27,6 +28,7 @@ public class IllegalChargeData {
     private Date chargeDate;
     private String chargeFee;
     private String chargeAmount;
+    private Float conflictOrderNo;
     private Integer conflictDetailSn;
     private String conflictChargeCode;
     private String conflictChargeName;

+ 50 - 29
src/main/java/thyyxxk/webserver/service/reports/IllegalChargesAnalysisService.java

@@ -8,6 +8,7 @@ import thyyxxk.webserver.constants.Capacity;
 import thyyxxk.webserver.constants.ResponceType;
 import thyyxxk.webserver.dao.his.reports.IllegalChargesAnalysisDao;
 import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.datamodify.YzActOrder;
 import thyyxxk.webserver.entity.dictionary.PureCodeName;
 import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeData;
 import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeTemplate;
@@ -17,6 +18,7 @@ import thyyxxk.webserver.utils.ResultVoUtil;
 import thyyxxk.webserver.utils.StringUtil;
 import thyyxxk.webserver.utils.TokenUtil;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -178,35 +180,35 @@ public class IllegalChargesAnalysisService {
     }
 
     private ResultVo<List<IllegalChargeData>> sameTimeCharge(IllegalChargeTemplate template) {
-        List<IllegalChargeData> mainList = new ArrayList<>();
-        for (PureCodeName mainCharge : template.getMainCharges()) {
-            List<IllegalChargeData> temp = dao.selectChargeDataForSameTime(template.getStart(), template.getEnd(), mainCharge.getCode());
-            temp.removeIf(item -> !template.getResponces().contains(item.getResponceType()));
-            mainList.addAll(temp);
-        }
-        List<IllegalChargeData> conflictList = new ArrayList<>();
-        for (PureCodeName conflictCharge : template.getConflictCharges()) {
-            List<IllegalChargeData> temp = dao.selectChargeDataForSameTime(template.getStart(), template.getEnd(), conflictCharge.getCode());
-            temp.removeIf(item -> !template.getResponces().contains(item.getResponceType()));
-            conflictList.addAll(temp);
-        }
-        Map<String, IllegalChargeData> map = new HashMap<>(mainList.size());
-        for (IllegalChargeData item : mainList) {
-            String key = item.getInpatientNo() + "_" + item.getChargeDay();
-            map.put(key, item);
-        }
         List<IllegalChargeData> resultList = new ArrayList<>();
-        for (IllegalChargeData item : conflictList) {
-            String key = item.getInpatientNo() + "_" + item.getChargeDay();
-            if (map.containsKey(key)) {
-                IllegalChargeData data = map.get(key);
-                data.setConflictChargeCode(item.getChargeCode());
-                data.setConflictChargeAmount(item.getChargeAmount());
-                data.setConflictChargeDate(item.getChargeDate());
-                data.setConflictChargeFee(item.getChargeFee());
-                data.setConflictChargeName(item.getChargeName());
-                data.setConflictDetailSn(item.getDetailSn());
-                resultList.add(data);
+        for (PureCodeName main : template.getMainCharges()) {
+            List<IllegalChargeData> mainList = dao.selectChargeDataForSameTime(template.getStart(),
+                    template.getEnd(), main.getCode());
+            mainList.removeIf(item -> !template.getResponces().contains(item.getResponceType()));
+            for (PureCodeName cflct : template.getConflictCharges()) {
+                List<IllegalChargeData> cflctList = dao.selectChargeDataForSameTime(template.getStart(),
+                        template.getEnd(), cflct.getCode());
+                cflctList.removeIf(item -> !template.getResponces().contains(item.getResponceType()));
+                Map<String, IllegalChargeData> map = new HashMap<>(mainList.size());
+                for (IllegalChargeData item : mainList) {
+                    String key = item.getInpatientNo() + "_" + item.getChargeDay();
+                    map.put(key, item);
+                }
+                for (IllegalChargeData item : cflctList) {
+                    String key = item.getInpatientNo() + "_" + item.getChargeDay();
+                    if (map.containsKey(key)) {
+                        IllegalChargeData data = map.get(key);
+                        data.setConflictChargeCode(item.getChargeCode());
+                        data.setConflictChargeAmount(item.getChargeAmount());
+                        data.setConflictChargeDate(item.getChargeDate());
+                        data.setConflictChargeFee(item.getChargeFee());
+                        data.setConflictChargeName(item.getChargeName());
+                        data.setConflictDetailSn(item.getDetailSn());
+                        data.setConflictOrderNo(item.getOrderNo());
+                        resultList.add(data);
+                    }
+                }
+
             }
         }
         return ResultVoUtil.success(resultList);
@@ -237,9 +239,29 @@ public class IllegalChargesAnalysisService {
         return ResultVoUtil.success(resultList);
     }
 
+    public ResultVo<List<YzActOrder>> selectOrderPair(BigDecimal orderNo, BigDecimal conflictOrderNo) {
+        List<YzActOrder> list = dao.selectYzActOrder(orderNo, conflictOrderNo);
+        if (list.isEmpty()) {
+            list = dao.selectYzInActOrder(orderNo, conflictOrderNo);
+        }
+        if (list.isEmpty()) {
+            return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+        }
+        if (list.size() == 1 || list.get(0).getActOrderNo().equals(orderNo)) {
+            return ResultVoUtil.success(list);
+        }
+        List<YzActOrder> tmp = new ArrayList<>();
+        tmp.add(list.get(1));
+        tmp.add(list.get(0));
+        return ResultVoUtil.success(tmp);
+    }
+
 
     public ResultVo<List<IllegalChargeData>> queryHuanZheLiangCiRuYuanRiQi(IllegalChargeTemplate param) {
         List<IllegalChargeData> list = dao.queryHuanZheLiangCiRuYuanRiQi(param.getStart(), param.getEnd(), param.getResponces());
+        if (list.isEmpty()) {
+            return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+        }
         List<IllegalChargeData> illegalChargeData = dao.queryZhenDuan(list);
         for (IllegalChargeData chargeData : list) {
             for (IllegalChargeData illegalChargeDatum : illegalChargeData) {
@@ -250,7 +272,6 @@ public class IllegalChargesAnalysisService {
                 }
             }
         }
-
         return ResultVoUtil.success(list);
     }
 }