Browse Source

检验数据选项卡展示处理

chengyao 4 năm trước cách đây
mục cha
commit
ff46109439

+ 1 - 1
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -67,7 +67,7 @@ public class ConsoleExportFacade {
     }
 
     /**
-     * 病历稽查统计导出(首页)
+     * 稽查统计导出(首页)
      *
      * @param filterVO
      * @return

+ 1 - 1
src/main/java/com/diagbot/facade/FilterFacade.java

@@ -284,7 +284,7 @@ public class FilterFacade {
     }
 
     /**
-     * 运行病历稽查统计入参拼接
+     * 病历稽查统计入参拼接
      *
      * @param filterVO
      */

+ 2 - 2
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -325,7 +325,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public List<UnModifyMRDetailDTO> unModifyMRStatistics(FilterUnModifyMRVO filterUnModifyMRVO);
 
     /**
-     * 运行病历稽查表
+     * 病历稽查表
      *
      * @param filterVO
      * @return
@@ -333,7 +333,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public IPage<MedicalCheckDTO>  getMedicalCheck(@Param("filterVO")FilterMedicalCheckVO filterVO, @Param("infos")List<Long> infos);
 
     /**
-     * 运行病历稽查表导出
+     * 病历稽查表导出
      *
      * @param filterVO
      * @return

+ 4 - 2
src/main/java/com/diagbot/mapper/MedLisInfoMapper.java

@@ -26,9 +26,11 @@ import java.util.Set;
 public interface MedLisInfoMapper extends BaseMapper<MedLisInfo> {
     Map<String, Object> getTime(@Param("behospitalCode") String behospitalCode);
 
-    IPage<ExamineInfoDTO> getExamineInfo(@Param("examineInfoVO") ExamineInfoVO examineInfoVO, @Param("infos") Set<String> infos);
+    List<String> getBadCheckInfo(@Param("examineInfoVO") ExamineInfoVO examineInfoVO, @Param("infos") Set<String> infos);
+
+    IPage<ExamineInfoDTO> getExamineInfo(@Param("examineInfoVO") ExamineInfoVO examineInfoVO, @Param("infos") Set<String> infos,@Param("badCheckInfo") List<String> badCheckInfo);
 
     List<String> getInfo(@Param("hospitalId") Long hospitalId, @Param("behospitalCode") String behospitalCode);
 
-    IPage<ExamineSonInfoDTO> getExamineSonInfo(@Param("examineSonInfoVO") ExamineSonInfoVO examineSonInfoVO);
+    IPage<ExamineSonInfoDTO> getExamineSonInfo(@Param("examineSonInfoVO") ExamineSonInfoVO examineSonInfoVO, @Param("infos") Set<String> infos);
 }

+ 1 - 0
src/main/java/com/diagbot/mapper/MedPacsInfoMapper.java

@@ -26,6 +26,7 @@ public interface MedPacsInfoMapper extends BaseMapper<MedPacsInfo> {
 
     Map<String,Object> getTime(@Param("behospitalCode") String behospitalCode);
 
+
     IPage<CheckInfoDTO> getCheckInfo(@Param("checkInfoVO") CheckInfoVO checkInfoVO, @Param("infos") Set<String> infos);
 
     List<String> getInfo(@Param("hospitalId") Long hospitalId, @Param("behospitalCode") String behospitalCode);

+ 2 - 2
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -310,13 +310,13 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public List<UnModifyMRDetailDTO> unModifyMRStatistics(FilterUnModifyMRVO filterUnModifyMRVO);
 
     /**
-     * 运行病历稽查表
+     * 病历稽查表
      * @return
      */
     IPage<MedicalCheckDTO>  getMedicalCheck(FilterMedicalCheckVO filterVO,List<Long>casesEntryIds);
 
     /**
-     * 运行病历稽查表导出
+     * 病历稽查表导出
      * @return
      */
     List<MedicalCheckExportDTO>  getMedicalCheckExport(FilterMedicalCheckVO filterVO,List<Long>casesEntryIds);

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

@@ -457,7 +457,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     }
 
     /**
-     * 运行病历稽查表
+     * 病历稽查表
      *
      * @param filterVO
      * @return
@@ -469,7 +469,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     }
 
     /**
-     * 运行病历稽查表导出
+     * 病历稽查表导出
      *
      * @param filterVO
      * @return

+ 26 - 3
src/main/java/com/diagbot/service/impl/MedLisInfoServiceImpl.java

@@ -61,16 +61,39 @@ public class MedLisInfoServiceImpl extends ServiceImpl<MedLisInfoMapper, MedLisI
         }
 
         String behospitalCode = examineInfoVO.getBehospitalCode();
-        if(2l == examineInfoVO.getHospitalId()){
+        if (2l == examineInfoVO.getHospitalId()) {
             examineInfoVO.setBehospitalCode(behospitalCode.split("_")[0]);
         }
 
-        IPage<ExamineInfoDTO> page = this.baseMapper.getExamineInfo(examineInfoVO, infoSet);
+        //获取缺陷检验项目
+        List<String> badCheckInfo = this.baseMapper.getBadCheckInfo(examineInfoVO, infoSet);
+
+        IPage<ExamineInfoDTO> page = this.baseMapper.getExamineInfo(examineInfoVO, infoSet,badCheckInfo);
         return page;
     }
 
     public IPage<ExamineSonInfoDTO> getExamineSonInfo(ExamineSonInfoVO examineSonInfoVO) {
-        IPage<ExamineSonInfoDTO> page = this.baseMapper.getExamineSonInfo(examineSonInfoVO);
+        List<String> infos = this.baseMapper.getInfo(examineSonInfoVO.getHospitalId(), examineSonInfoVO.getBehospitalCode());
+        Set<String> infoSet = new HashSet<>();
+        for (String s : infos) {
+            if (s.contains("化验:")) {
+                String[] split = s.split("_");
+                for (String info : split) {
+                    String[] targetInfos = info.split(":");
+                    for (String targetInfo : targetInfos) {
+                        if (!"化验".equals(targetInfo)) {
+                            infoSet.add(targetInfo);
+                        }
+                    }
+                }
+            }
+        }
+        String behospitalCode = examineSonInfoVO.getBehospitalCode();
+        if (2l == examineSonInfoVO.getHospitalId()) {
+            examineSonInfoVO.setBehospitalCode(behospitalCode.split("_")[0]);
+        }
+
+        IPage<ExamineSonInfoDTO> page = this.baseMapper.getExamineSonInfo(examineSonInfoVO, infoSet);
         return page;
     }
 

+ 5 - 0
src/main/java/com/diagbot/vo/ExamineSonInfoVO.java

@@ -34,5 +34,10 @@ public class ExamineSonInfoVO extends Page {
      */
     private String repNo;
 
+    /**
+     * 检验信息缺陷判别
+     */
+    private String examineType;
+
 
 }

+ 4 - 4
src/main/java/com/diagbot/web/ConsoleController.java

@@ -748,11 +748,11 @@ public class ConsoleController {
 
 
     /**
-     * 运行病历稽查表(首页)
+     * 病历稽查表(首页)
      * @param filterVO
      * @return
      */
-    @ApiOperation(value = "运行病历稽查统计[by:cy]",
+    @ApiOperation(value = "病历稽查统计[by:cy]",
             notes = "name: 科室名称 <br>" +
                     "asc: 排序(升序) <br>" +
                     "desc:排序(降序) <br>" +
@@ -765,11 +765,11 @@ public class ConsoleController {
         return RespDTO.onSuc(consoleFacade.getMedicalCheck(filterVO));
     }
     /**
-     * 运行病历稽查表(title)
+     * 病历稽查表(title)
      * @param
      * @return
      */
-    @ApiOperation(value = "运行病历稽查获取title[by:cy]")
+    @ApiOperation(value = "病历稽查获取title[by:cy]")
     @PostMapping("/medicalCheckTitle")
     @SysLogger("medicalCheckTitle")
     public RespDTO<List<ColumnDTO>> getMedicalCheckTitle() {

+ 2 - 2
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -64,11 +64,11 @@ public class ConsoleExportController {
     }
 
     /**
-     * 运行病历稽查统计(首页)
+     * 病历稽查统计(首页)
      * @param filterVO
      * @return
      */
-    @ApiOperation(value = "运行病历稽查导出[by:cy]",
+    @ApiOperation(value = "病历稽查导出[by:cy]",
             notes =  "name: 科室名称 <br>" +
                     "startDate: 起始时间 <br>" +
                     "endDate: 截止时间 <br>" +

+ 106 - 4
src/main/resources/mapper/MedLisInfoMapper.xml

@@ -36,6 +36,85 @@
             and t.behospital_code = #{behospitalCode}
         </if>
     </select>
+    <!--获取缺陷检验项信息-->
+    <select id="getBadCheckInfo" resultType="java.lang.String">
+        select
+        distinct
+        b.repNo
+        from(
+        SELECT
+        t1.rep_no as repNo,
+        t1.rep_name as examineItemName,
+        t1.rep_type_name as examineItemType,
+        CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %H:%i:%s' ) as rTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %H:%i:%s' ) as cTime,
+        t1.apply_doctor as doctorName,
+        t1.hospital_id as hospitalId,
+        t1.behospital_code as behospitalCode
+        FROM
+        med_lis_info t1,
+        med_lis_result t2,
+        med_behospital_info t3
+        WHERE
+        t1.is_deleted = "N"
+        AND t2.is_deleted = "N"
+        AND t3.is_deleted = "N"
+        AND t1.check_date IS NOT NULL
+        AND t2.item_name IS NOT NULL
+        AND t1.hospital_id = t2.hospital_id
+        and t1.hospital_id = t3.hospital_id
+        AND t1.behospital_code = t2.behospital_code
+        <if test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 1l">
+            and t1.behospital_code = t3.behospital_code
+        </if>
+        <if test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 2l">
+            and t1.behospital_code = t3.file_code
+        </if>
+        AND t1.rep_no = t2.rep_no
+        <if test="examineInfoVO.hospitalId != null">
+            and t1.hospital_id = #{examineInfoVO.hospitalId}
+        </if>
+        <if test="examineInfoVO.behospitalCode != null and examineInfoVO.behospitalCode != ''">
+            and t1.behospital_code = #{examineInfoVO.behospitalCode}
+        </if>
+        <if test="examineInfoVO.examineItemType != null and examineInfoVO.examineItemType != ''">
+            and t1.rep_type_name like CONCAT('%',#{examineInfoVO.examineItemType},'%')
+        </if>
+        <if test="examineInfoVO.examineItemName != null and examineInfoVO.examineItemName != ''">
+            and t1.rep_name like CONCAT('%',#{examineInfoVO.examineItemName},'%')
+        </if>
+        <if test="examineInfoVO.jyDateStart != null">
+            <![CDATA[ AND date_format(t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.jyDateStart}]]>
+        </if>
+        <if test="examineInfoVO.jyDateEnd != null">
+            <![CDATA[ AND date_format(t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.jyDateEnd}]]>
+        </if>
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 1">
+            <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 0">
+            <if test="examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        ) b
+        where 1=1
+            <if test="infos != null and infos.size() > 0">
+                and b.info  in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and b.info in('000000ASDQWEZXC@#$%')
+            </if>
+
+    </select>
+
 
     <!--获取检验信息-->
     <select id="getExamineInfo" resultType="com.diagbot.dto.ExamineInfoDTO">
@@ -123,13 +202,13 @@
             </if>
         </if>
         <if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 2 ">
-            <if test="infos != null and infos.size() > 0">
-                and b.info not in
-                <foreach collection="infos" open="(" separator="," close=")" item="item">
+            <if test="badCheckInfo != null and badCheckInfo.size() > 0">
+                and b.repNo not in
+                <foreach collection="badCheckInfo" open="(" separator="," close=")" item="item">
                     '${item}'
                 </foreach>
             </if>
-            <if test="infos = null || infos.size() == 0">
+            <if test="badCheckInfo = null || badCheckInfo.size() == 0">
                 and 1=1
             </if>
         </if>
@@ -161,6 +240,7 @@
         CONCAT( t2.result, t2.unit ) AS examineItemResult,
         DATE_FORMAT( t1.rep_date, '%Y-%m-%d %h:%i:%s' ) as reptTime,
         DATE_FORMAT( t1.check_date, '%Y-%m-%d %h:%i:%s' ) as checkTime,
+        CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
         t1.apply_doctor AS doctorName
         FROM
         med_lis_info t1,
@@ -181,6 +261,28 @@
         <if test="examineSonInfoVO.repNo != null and examineSonInfoVO.repNo != ''">
             and t1.rep_no = #{examineSonInfoVO.repNo}
         </if>
+        <if test="examineSonInfoVO.examineType != null and examineSonInfoVO.examineType == 1">
+            <if test="infos != null and infos.size() > 0">
+                and info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and info in('000000ASDQWEZXC@#$%')
+            </if>
+        </if>
+        <if test="examineSonInfoVO.examineType != null and examineSonInfoVO.examineType == 2 ">
+            <if test="infos != null and infos.size() > 0">
+                and info not in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1=1
+            </if>
+        </if>
     </select>
 
 </mapper>