Ver código fonte

现有指标更新

chengyao 4 anos atrás
pai
commit
4c09770c2a

+ 8 - 122
src/main/java/com/diagbot/entity/MedManagementInfo.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+
 import java.io.Serializable;
 
 /**
@@ -14,6 +16,7 @@ import java.io.Serializable;
  * @author zhoutg
  * @since 2021-04-06
  */
+@Data
 public class MedManagementInfo implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -26,33 +29,26 @@ public class MedManagementInfo implements Serializable {
      */
     private Long hospitalId;
 
-    /**
-     * 0:门诊  1:住院  2:住院+门诊
-     */
-    private Integer department;
 
-    /**
-     * 职务id
-     */
-    private Integer positionId;
 
     /**
      * 0:门诊病案管理人员  1:住院病案管理人员 2:病案编码人员
      */
-    private Integer position;
+    private Integer positionId;
+
 
     /**
-     * 数据接入开始时间
+     * 单位时间数据接入开始时间
      */
     private LocalDateTime startDate;
 
     /**
-     * 数据接入结束时间
+     * 单位时间数据接入结束时间
      */
     private LocalDateTime endDate;
 
     /**
-     * 同期管理人员实际工作总月数
+     * 单位时间管理人员实际工作总月数
      */
     @TableField("workMouth")
     private Double workMouth;
@@ -82,114 +78,4 @@ public class MedManagementInfo implements Serializable {
      */
     private String modifier;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-    public Long getHospitalId() {
-        return hospitalId;
-    }
-
-    public void setHospitalId(Long hospitalId) {
-        this.hospitalId = hospitalId;
-    }
-    public Integer getDepartment() {
-        return department;
-    }
-
-    public void setDepartment(Integer department) {
-        this.department = department;
-    }
-    public Integer getPositionId() {
-        return positionId;
-    }
-
-    public void setPositionId(Integer positionId) {
-        this.positionId = positionId;
-    }
-    public Integer getPosition() {
-        return position;
-    }
-
-    public void setPosition(Integer position) {
-        this.position = position;
-    }
-    public LocalDateTime getStartDate() {
-        return startDate;
-    }
-
-    public void setStartDate(LocalDateTime startDate) {
-        this.startDate = startDate;
-    }
-    public LocalDateTime getEndDate() {
-        return endDate;
-    }
-
-    public void setEndDate(LocalDateTime endDate) {
-        this.endDate = endDate;
-    }
-    public Double getWorkMouth() {
-        return workMouth;
-    }
-
-    public void setWorkMouth(Double workMouth) {
-        this.workMouth = workMouth;
-    }
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-    public LocalDateTime getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(LocalDateTime gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-    public LocalDateTime getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(LocalDateTime gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    @Override
-    public String toString() {
-        return "MedManagementInfo{" +
-            "id=" + id +
-            ", hospitalId=" + hospitalId +
-            ", department=" + department +
-            ", positionId=" + positionId +
-            ", position=" + position +
-            ", startDate=" + startDate +
-            ", endDate=" + endDate +
-            ", workMouth=" + workMouth +
-            ", isDeleted=" + isDeleted +
-            ", gmtCreate=" + gmtCreate +
-            ", gmtModified=" + gmtModified +
-            ", creator=" + creator +
-            ", modifier=" + modifier +
-        "}";
-    }
 }

+ 47 - 55
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -2475,70 +2475,62 @@ public MedQualityControlDTO medicalRecordIndicator(FilterRecordVO filterRecordVO
 
     /**
      * 病案管理指标(内页)
-     *
      * @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));
-            }
-        }
+        //指标一、二、三、二十七
+        medQualityControlDTO = ManageIndexMethod(medQualityControlDTO, baseIndex, filterVO);
         return medQualityControlDTO;
     }
 
+     private MedQualityControlDTO ManageIndexMethod(MedQualityControlDTO medQualityControlDTO, Map<String, Object> baseIndex,FilterVO filterVO){
+         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")
+                 .ge("start_date",filterVO.getStartDate())
+                 .le("end_date",filterVO.getEndDate());
+
+         List<MedManagementInfo> list = medManagementInfoService.list(query);
+         //单位时间同期门诊病案管理人员实际工作总月数
+         Double firMouth  = list.stream().filter(obj->obj.getPositionId()==0).map(MedManagementInfo::getWorkMouth).reduce(Double::sum).get();
+         //单位时间同期住院病案管理人员实际工作总月数
+         Double secMouth = list.stream().filter(obj->obj.getPositionId()==1).map(MedManagementInfo::getWorkMouth).reduce(Double::sum).get();
+         //单位时间同期病案编码管理人员实际工作总月数
+         Double thrMouth = list.stream().filter(obj->obj.getPositionId()==2).map(MedManagementInfo::getWorkMouth).reduce(Double::sum).get();
+         Double firRecord = 0d;
+
+         //指标一
+         if(secMouth != 0d && secMouth != null && StringUtils.isNotEmpty( baseIndex.get("firMouthNum").toString())){
+             medQualityControlDTO.setManagerMouthNum(Math.ceil(Double.parseDouble(baseIndex.get("firMouthNum").toString())/secMouth));
+         }
+         //指标三
+         if(thrMouth != 0d && thrMouth != null && StringUtils.isNotEmpty( baseIndex.get("firMouthNum").toString())){
+             medQualityControlDTO.setCoderMouthNum(Math.ceil(Double.parseDouble(baseIndex.get("firMouthNum").toString())/thrMouth));
+         }
+
+         if(firMouth != 0d && firMouth != null  && StringUtils.isNotEmpty( baseIndex.get("secMouthNum").toString())){
+         //指标二
+             medQualityControlDTO.setSecManagerMouthNum(Math.ceil(Double.parseDouble(baseIndex.get("secMouthNum").toString())/firMouth));
+         }
+
+         //指标二十七 -甲级病历率
+         if(StringUtils.isNotEmpty( baseIndex.get("forMouthNum").toString())){
+             firRecord =Double.parseDouble(baseIndex.get("forMouthNum").toString());
+         }
+         if( firRecord != 0d && StringUtils.isNotEmpty( baseIndex.get("sixMouthNum").toString()) ){
+             medQualityControlDTO.setFirGradeNum(Math.ceil(Double.parseDouble(baseIndex.get("sixMouthNum").toString())/ firRecord));
+         }
+
+         return medQualityControlDTO;
+     };
+
     /**
      * 质控核查质控评分页(内页)
      *

+ 2 - 4
src/main/resources/mapper/MedManagementInfoMapper.xml

@@ -6,12 +6,10 @@
     <resultMap id="BaseResultMap" type="com.diagbot.entity.MedManagementInfo">
         <id column="id" property="id"/>
         <result column="hospital_id" property="hospitalId"/>
-        <result column="department" property="department"/>
         <result column="position_id" property="positionId"/>
-        <result column="position" property="position"/>
         <result column="name" property="name"/>
-        <result column="hire_date" property="hireDate"/>
-        <result column="resignation_time" property="resignationTime"/>
+        <result column="start_date" property="startDate"/>
+        <result column="end_date" property="endDate"/>
         <result column="is_deleted" property="isDeleted"/>
         <result column="gmt_create" property="gmtCreate"/>
         <result column="gmt_modified" property="gmtModified"/>