瀏覽代碼

诊断不合理

wangsy 8 月之前
父節點
當前提交
6d087e0409

+ 2 - 2
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -63,10 +63,10 @@ public class ConsoleFacade {
     @Autowired
     private ResultStatisticsAggregate resultStatisticsAggregate;
     @Autowired
-    private QcresultInfoFacade qcresultInfoFacade;
-    @Autowired
     private HomePageFacade homePageFacade;
     @Autowired
+    private QcresultInfoFacade qcresultInfoFacade;
+    @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
     @Autowired
     private SysHospitalSetFacade sysHospitalSetFacade;

+ 7 - 1
src/main/java/com/diagbot/vo/FilterPageVO.java

@@ -6,7 +6,7 @@ import lombok.Getter;
 import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
+import java.util.List;
 
 /**
  * @Description:
@@ -106,4 +106,10 @@ public class FilterPageVO extends Page {
      */
     private String organizationName;
 
+    /**
+     *  目标条目id列表
+     */
+    private List<Long> targetEntryIds;
+
+    private Boolean enableTargetEntryId = false;
 }

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

@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.*;
 import com.diagbot.facade.ConsoleFacade;
+import com.diagbot.util.RedisUtils;
 import com.diagbot.vo.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -31,6 +33,8 @@ public class ConsoleController {
 
     @Autowired
     private ConsoleFacade consoleFacade;
+    @Autowired
+    private RedisUtils redisUtils;
 
     //region-----------------------聚合接口开始-------------------------------
     @ApiOperation(value = "病历相关统计[by:zhaops]",
@@ -431,6 +435,13 @@ public class ConsoleController {
     @PostMapping("/entryGroupByEntryInnerPage")
     @SysLogger("entryGroupByEntryInnerPage")
     public RespDTO<IPage<EntryNumDTO>> entryGroupByEntryInnerPage(@RequestBody @Valid FilterPageVO filterPageVO) {
+        if(filterPageVO.getEnableTargetEntryId()) {
+            String key = "console:entryGroup4UnreasonableDiagnosis:targetEntryIds";
+            List<Long> targetEntryIds = (List<Long>) redisUtils.get(key);
+            if (!CollectionUtils.isEmpty(targetEntryIds)) {
+                filterPageVO.setTargetEntryIds(targetEntryIds);
+            }
+        }
         return RespDTO.onSuc(consoleFacade.entryGroupByEntryInnerPage(filterPageVO));
     }
     //endregion-----------------------分页接口结束-------------------------------

+ 82 - 0
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -487,6 +487,88 @@
         qc_cases_entry tt2
         WHERE
         tt2.is_deleted = 'N'
+        <if test="filterPageVO.targetEntryIds != null">
+            AND tt2.id in
+            <foreach collection="filterPageVO.targetEntryIds" item="targetEntryId" separator="," open="(" close=")">
+                #{targetEntryId}
+            </foreach>
+        </if>
+        AND tt1.cases_id = tt2.cases_id
+        AND tt1.cases_entry_id = tt2.id
+        <if test="filterPageVO.name != null and filterPageVO.name != ''">
+            AND tt2.name like CONCAT('%', #{filterPageVO.name},'%')
+        </if>
+        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
+            AND tt2.cases_name like CONCAT('%', #{filterPageVO.casesName},'%')
+        </if>
+
+    </select>
+
+    <!-- 条目缺陷占比(内页) -->
+    <select id="entryGroup4UnreasonableDiagnosis" resultType="com.diagbot.dto.EntryNumDTO">
+        SELECT
+        tt2.id as id,
+        tt2.name as name,
+        tt2.cases_id as casesId,
+        tt2.cases_name as casesName,
+        tt1.num as num,
+        tt1.is_reject as isReject
+        FROM
+        (
+        SELECT
+        a.hospital_id,
+        d.cases_entry_id,
+        d.cases_id,
+        count(*) as num,
+        d.is_reject
+        FROM
+        med_behospital_info a,
+        med_qcresult_detail d
+        WHERE
+        a.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND a.hospital_id = d.hospital_id
+        AND a.behospital_code = d.behospital_code
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            AND a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
+            AND a.hospital_id = #{filterPageVO.hospitalId}
+        </if>
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
+            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
+            </if>
+            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
+            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
+            </if>
+            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterPageVO.isReject != null">
+            AND d.is_reject = #{filterPageVO.isReject}
+        </if>
+        GROUP BY
+        d.cases_entry_id,
+        d.is_reject,
+        d.cases_id
+        ) tt1,
+        qc_cases_entry tt2
+        WHERE
+        tt2.is_deleted = 'N'
+        <if test="filterPageVO.targetEntryIds != null">
+            AND tt2.id in
+            <foreach collection="filterPageVO.targetEntryIds" item="targetEntryId" separator="," open="(" close=")">
+                #{targetEntryId}
+            </foreach>
+        </if>
         AND tt1.cases_id = tt2.cases_id
         AND tt1.cases_entry_id = tt2.id
         <if test="filterPageVO.name != null and filterPageVO.name != ''">