Prechádzať zdrojové kódy

病案管理指标1、2、3、27

chengyao 4 rokov pred
rodič
commit
fd6efe9718

+ 4 - 4
src/main/java/com/diagbot/dto/MedQualityControlDTO.java

@@ -18,19 +18,19 @@ public class MedQualityControlDTO {
      * 住院病案管理人员月均负担出院患者病历数
      */
     @Excel(name = "住院病案管理人员月均负担出院患者病历数", width = 12, orderNum = "1")
-    private String managerMouthNum;
+    private Double managerMouthNum = 0d;
 
     /**
      * 病案编码管理人员月均负担出院患者病历数
      */
     @Excel(name = "病案编码管理人员月均负担出院患者病历数", width = 12, orderNum = "2")
-    private String coderMouthNum;
+    private Double coderMouthNum= 0d;
 
     /**
      * 门诊病案管理人员月均负担出院患者病历数
      */
     @Excel(name = "门诊病案管理人员月均负担出院患者病历数", width = 12, orderNum = "3")
-    private String secManagerMouthNum;
+    private Double secManagerMouthNum= 0d;
 
     /**
      * 入院记录24小时内完成量
@@ -156,7 +156,7 @@ public class MedQualityControlDTO {
     /**
      * 甲级病历量
      */
-    private Double firGradeNum;
+    private Double firGradeNum= 0d;
 
     /**
      * 甲级病历率

+ 25 - 23
src/main/java/com/diagbot/entity/MedManagementInfo.java

@@ -3,6 +3,7 @@ package com.diagbot.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
 
 /**
@@ -10,8 +11,8 @@ import java.io.Serializable;
  * 病案管理人员表
  * </p>
  *
- * @author zhanghang
- * @since 2021-03-25
+ * @author zhoutg
+ * @since 2021-04-06
  */
 public class MedManagementInfo implements Serializable {
 
@@ -41,19 +42,20 @@ public class MedManagementInfo implements Serializable {
     private Integer position;
 
     /**
-     * 人员姓名
+     * 数据接入开始时间
      */
-    private String name;
+    private LocalDateTime startDate;
 
     /**
-     * 人员工作开始时间
+     * 数据接入结束时间
      */
-    private LocalDateTime hireDate;
+    private LocalDateTime endDate;
 
     /**
-     * 工作离职时间
+     * 同期管理人员实际工作总月数
      */
-    private LocalDateTime resignationTime;
+    @TableField("workMouth")
+    private Double workMouth;
 
     /**
      * 是否删除,N:未删除,Y:删除
@@ -115,26 +117,26 @@ public class MedManagementInfo implements Serializable {
     public void setPosition(Integer position) {
         this.position = position;
     }
-    public String getName() {
-        return name;
+    public LocalDateTime getStartDate() {
+        return startDate;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setStartDate(LocalDateTime startDate) {
+        this.startDate = startDate;
     }
-    public LocalDateTime getHireDate() {
-        return hireDate;
+    public LocalDateTime getEndDate() {
+        return endDate;
     }
 
-    public void setHireDate(LocalDateTime hireDate) {
-        this.hireDate = hireDate;
+    public void setEndDate(LocalDateTime endDate) {
+        this.endDate = endDate;
     }
-    public LocalDateTime getResignationTime() {
-        return resignationTime;
+    public Double getWorkMouth() {
+        return workMouth;
     }
 
-    public void setResignationTime(LocalDateTime resignationTime) {
-        this.resignationTime = resignationTime;
+    public void setWorkMouth(Double workMouth) {
+        this.workMouth = workMouth;
     }
     public String getIsDeleted() {
         return isDeleted;
@@ -180,9 +182,9 @@ public class MedManagementInfo implements Serializable {
             ", department=" + department +
             ", positionId=" + positionId +
             ", position=" + position +
-            ", name=" + name +
-            ", hireDate=" + hireDate +
-            ", resignationTime=" + resignationTime +
+            ", startDate=" + startDate +
+            ", endDate=" + endDate +
+            ", workMouth=" + workMouth +
             ", isDeleted=" + isDeleted +
             ", gmtCreate=" + gmtCreate +
             ", gmtModified=" + gmtModified +

+ 73 - 6
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.aggregate.MrStatisticsAggregate;
 import com.diagbot.aggregate.ResultStatisticsAggregate;
 import com.diagbot.dto.*;
 import com.diagbot.entity.*;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.MedManagementInfoService;
@@ -396,12 +397,12 @@ public class ConsoleFacade {
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LocalDateTime sta = LocalDateTime.parse(startDate, df);
         LocalDateTime end = LocalDateTime.parse(endDate, df);
-        HashMap<String, Long> longHashMap = getTimeCount(list, sta, end);
+ /*       HashMap<String, Long> longHashMap = getTimeCount(list, sta, end);
         Long timeCount = longHashMap.get("病案管理");
         Long codingCount = longHashMap.get("编码管理");
         double monthlyDou = 0;
-        double monthlyCoding = 0;
-        try {
+        double monthlyCoding = 0;*/
+      /*  try {
             double timeMonth = timeCount / 30;
             // 住院病案管理人员月均负担出院患者病历
             monthlyDou = (totleCount.intValue() / timeMonth);
@@ -416,7 +417,7 @@ public class ConsoleFacade {
         } catch (Exception e) {
             e.printStackTrace();
             //throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历无关联的质控条目!");
-        }
+        }*/
         //入院记录24小时完成率
         try {
             HashMap<String,Double> finishingRate = admissionStr(filterVO);
@@ -528,7 +529,7 @@ public MedQualityControlDTO medicalRecordIndicator(FilterRecordVO filterRecordVO
         }
     }
 
-    public HashMap<String, Long> getTimeCount(List<MedManagementInfo> list, LocalDateTime sta, LocalDateTime end) {
+   /* public HashMap<String, Long> getTimeCount(List<MedManagementInfo> list, LocalDateTime sta, LocalDateTime end) {
         HashMap<String, Long> longHashMap = new HashMap<>();
         long timeCount = 0;
         long codingCount = 0;
@@ -644,7 +645,7 @@ public MedQualityControlDTO medicalRecordIndicator(FilterRecordVO filterRecordVO
             longHashMap.put("编码管理", codingCount);
         }
         return longHashMap;
-    }
+    }*/
 
 
     /**
@@ -2472,6 +2473,72 @@ public MedQualityControlDTO medicalRecordIndicator(FilterRecordVO filterRecordVO
         return behospitalInfoFacade.hmImproveMRPage(qcResultShortPageVO);
     }
 
+    /**
+     * 病案管理指标(内页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public MedQualityControlDTO getMedManageIndex(FilterVO filterVO) {
+        Map<String, Object> baseIndex = behospitalInfoFacade.getBaseIndex(filterVO);
+        MedQualityControlDTO medQualityControlDTO = new MedQualityControlDTO();
+        QueryWrapper<MedManagementInfo> query = new QueryWrapper<>();
+        query.eq("hospital_id", filterVO.getHospitalId())
+                .eq("is_deleted", IsDeleteEnum.N)
+                //指标1、2、3与是否归档没有直接关系 出院时间在单位时间内即可
+               // .eq("is_placefile", filterVO.getIsPlacefile())
+                .isNotNull("start_date")
+                .isNotNull("end_date")
+                .eq("start_date",filterVO.getStartDate())
+                .eq("end_date",filterVO.getEndDate());
+
+        List<MedManagementInfo> list = medManagementInfoService.list(query);
+        //单位时间同期门诊病案管理人员实际工作总月数
+        Double firMouth = 0d;
+        //单位时间同期住院病案管理人员实际工作总月数
+        Double secMouth = 0d;
+        //单位时间同期病案编码管理人员实际工作总月数
+        Double thrMouth = 0d;
+        for (MedManagementInfo medManagementInfo : list) {
+            if(medManagementInfo.getDepartment()==0){
+                firMouth += medManagementInfo.getWorkMouth();
+            }
+            if(medManagementInfo.getDepartment()==1){
+                secMouth += medManagementInfo.getWorkMouth();
+            }
+
+        }
+        thrMouth = list.stream().filter(obj -> obj.getPosition() == 2).map(MedManagementInfo::getWorkMouth).reduce(Double::sum).get();
+        Double firRecord = 0d;
+        for (String str : baseIndex.keySet()) {
+           if(str.equals("firMouthNum")){
+               //指标一
+               if(secMouth != 0d){
+                   medQualityControlDTO.setManagerMouthNum(Math.ceil(Double.parseDouble(baseIndex.get(str).toString())/secMouth));
+               }
+               //指标三
+               if(thrMouth != 0d){
+                   medQualityControlDTO.setCoderMouthNum(Math.ceil(Double.parseDouble(baseIndex.get(str).toString())/thrMouth));
+               }
+           }
+
+            if(str.equals("secMouthNum") && firMouth != 0d){
+                //指标二
+                medQualityControlDTO.setSecManagerMouthNum(Math.ceil(Double.parseDouble(baseIndex.get(str).toString())/firMouth));
+            }
+
+            //指标二十七 -甲级病历率
+
+            if(str.equals("forMouthNum")){
+                firRecord =Double.parseDouble(baseIndex.get(str).toString());
+            }
+            if(str.equals("sixMouthNum") &&  firRecord != 0d ){
+                medQualityControlDTO.setFirGradeNum(Math.ceil(Double.parseDouble(baseIndex.get(str).toString())/ firRecord));
+            }
+        }
+        return medQualityControlDTO;
+    }
+
     /**
      * 质控核查质控评分页(内页)
      *

+ 8 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -626,6 +626,14 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<ExportExcelDTO> hmImproveMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案管理指标获取基础数据
+     *
+     * @param filterVO
+     * @return
+     */
+    public Map<String,Object> getBaseIndex( FilterVO filterVO);
+
     /**
      * 质控核查质控评分页(内页)
      *

+ 8 - 1
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -8,6 +8,7 @@ import com.diagbot.vo.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -81,7 +82,13 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public int operationCount(FilterVO filterVO);
-
+    /**
+     * 病案管理指标(内页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public Map<String,Object> getBaseIndex( FilterVO filterVO);
     /**
      * 出院总人数统计-科室-首页
      *

+ 11 - 0
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -1013,6 +1013,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.improveMRExportByDept(qcResultShortPageVO);
     }
+
+    /**
+     * 病案管理指标获取基础数据
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public Map<String,Object> getBaseIndex( FilterVO filterVO) {
+        return baseMapper.getBaseIndex(filterVO);
+    }
     /**
      * 质控核查质控评分页(内页)
      *

+ 4 - 5
src/main/java/com/diagbot/service/impl/MedManagementInfoServiceImpl.java

@@ -43,7 +43,7 @@ public class MedManagementInfoServiceImpl extends ServiceImpl<MedManagementInfoM
         Object countNumSta = medicalRecordIndicatorStaList.get(0).get("countNum");
         int totleCountSta = Integer.parseInt(countNumSta.toString());
         //获取病案管理人员工作
-        HashMap<String, Long> longHashMap = getTimeCount(list, sta, end);
+     /*   HashMap<String, Long> longHashMap = getTimeCount(list, sta, end);
         Long timeCount = longHashMap.get("病案管理");
         Long codingCount = longHashMap.get("编码管理");
         double monthlyDou = 0;
@@ -69,7 +69,7 @@ public class MedManagementInfoServiceImpl extends ServiceImpl<MedManagementInfoM
         } catch (Exception e) {
             e.printStackTrace();
             //throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历无关联的质控条目!");
-        }
+        }*/
         //type=2   时间为住院对比
         filterRecordVO.setType(2);
         List<Map<String, Object>> medicalRecordIndicatorOutList = baseMapper.medicalRecordIndicator(filterRecordVO,sta,end);
@@ -214,8 +214,7 @@ public class MedManagementInfoServiceImpl extends ServiceImpl<MedManagementInfoM
     }*/
 
 
-
-    public HashMap<String, Long> getTimeCount(List<MedManagementInfo> list, LocalDateTime sta, LocalDateTime end) {
+/*    public HashMap<String, Long> getTimeCount(List<MedManagementInfo> list, LocalDateTime sta, LocalDateTime end) {
         HashMap<String, Long> longHashMap = new HashMap<>();
         long timeCount = 0;
         long codingCount = 0;
@@ -346,5 +345,5 @@ public class MedManagementInfoServiceImpl extends ServiceImpl<MedManagementInfoM
             longHashMap.put("编码管理", codingCount);
         }
         return longHashMap;
-    }
+    }*/
 }

+ 12 - 0
src/main/java/com/diagbot/web/ConsoleController.java

@@ -859,4 +859,16 @@ public class ConsoleController {
     public RespDTO<List<ColumnDTO>> getMedicalCheckTitle() {
         return RespDTO.onSuc(consoleFacade.getMedicalCheckTitle());
     }
+
+    /**
+     * 病案管理指标
+     * @param
+     * @return
+     */
+    @ApiOperation(value = "病案管理指标[by:cy]")
+    @PostMapping("/getMedManageIndex")
+    @SysLogger("getMedManageIndex")
+    public RespDTO<MedQualityControlDTO> getMedManageIndex(@RequestBody FilterVO filterVO) {
+        return RespDTO.onSuc(consoleFacade.getMedManageIndex(filterVO));
+    }
 }

+ 61 - 24
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -715,30 +715,67 @@
     </select>
 
     <!--获取同期管理人员实际工作月数明细-->
-    <select id="getManageMouth"  parameterType="com.diagbot.vo.FilterVO" resultType="java.util.Map">
-       select
-    sum(case when b.department = 1 or b.department = 2 then IFNULL(firDate,0)+ IFNULL(secDate,0)+ IFNULL(thrcDate,0)+
-    IFNULL(fouDate,0) end)/30 as firNum,
-    sum(case when b.department = 0 or b.department = 2 then IFNULL(firDate,0)+ IFNULL(secDate,0)+ IFNULL(thrcDate,0)+
-    IFNULL(fouDate,0) end)/30 as secNum,
-    sum(case when b.position = 2 then IFNULL(firDate,0)+ IFNULL(secDate,0)+ IFNULL(thrcDate,0)+ IFNULL(fouDate,0) end)
-    /30 as thrNum
-    from (
-       SELECT
-       a.department,
-       a.position,
-        sum(case when <![CDATA[a.hire_date>#{startDate}]]> and  <![CDATA[a.resignation_time<#{endDate}]]>
-        THEN TIMESTAMPDIFF(day,a.hire_date,a.resignation_time) END) as firDate,
-         sum( case when <![CDATA[a.hire_date<#{startDate}]]> and  <![CDATA[a.resignation_time<#{endDate}]]>
-        THEN TIMESTAMPDIFF(day,#{startDate},a.resignation_time) END) as secDate,
-          sum(case when <![CDATA[a.hire_date>#{startDate}]]> and  <![CDATA[a.resignation_time>#{endDate}]]>
-        THEN TIMESTAMPDIFF(day,a.hire_date,#{endDate}) END) as thrcDate,
-        sum(case when <![CDATA[a.hire_date<#{startDate}]]> and  <![CDATA[a.resignation_time>#{endDate}]]>
-        THEN TIMESTAMPDIFF(day,#{startDate},#{endDate}) END) as fouDate
-        FROM `med_management_info` a
-        where a.is_deleted = 'N'
-        group by a.department,a.position
-        )b
+    <select id="getBaseIndex"  parameterType="com.diagbot.vo.FilterVO" resultType="java.util.Map">
+        select
+        f1.firMouthNum,
+        f2.secMouthNum,
+        f3.thrMouthNum,
+        f3.forMouthNum,
+        f3.fivMouthNum,
+        f3.sixMouthNum
+        from (
+        SELECT  count(*)  as firMouthNum
+        FROM
+        med_behospital_info a
+        WHERE
+        a.is_deleted = 'N'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+        </if>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+        </if>)f1,
+            ( SELECT count(*) AS secMouthNum
+        FROM
+        med_behospital_info a
+        WHERE
+        a.is_deleted = 'N'
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.gmt_create >= #{startDate}]]>
+        </if>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.gmt_create <= #{endDate}]]>
+        </if>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>)f2,(
+           select
+        count(case when  <![CDATA[m.behospital_date >= #{startDate}]]>  and  <![CDATA[m.behospital_date <= #{endDate}]]> then m.behospital_code else null end) as thrMouthNum,
+        count(case when  <![CDATA[m.leave_hospital_date >= #{startDate}]]>  and  <![CDATA[m.leave_hospital_date <= #{endDate}]]> then m.behospital_code else null end) as forMouthNum,
+        count(case when  <![CDATA[m.behospital_date >= #{startDate}]]> and <![CDATA[m.leave_hospital_date <= #{endDate}]]> and m.is_placefile = 1 then m.behospital_code else null end) as fivMouthNum,
+        count(case when  <![CDATA[m.behospital_date >= #{startDate}]]> and <![CDATA[m.leave_hospital_date <= #{endDate}]]> and m.level = '甲' then m.behospital_code else null end) as sixMouthNum
+           from(
+           SELECT DISTINCT a.*,b.level
+            FROM
+            med_behospital_info a,
+            med_qcresult_info b,
+            med_qcresult_detail c
+            WHERE
+            a.is_deleted = 'N'
+            AND b.is_deleted = 'N'
+            AND c.is_deleted = 'N'
+            AND a.hospital_id = b.hospital_id
+            AND a.hospital_id = c.hospital_id
+            AND a.behospital_code = b.behospital_code
+            AND a.behospital_code = c.behospital_code
+            <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>)m
+            )f3
     </select>
 
     <!-- 各科室缺陷占比-全院-首页 -->