Browse Source

评分列表页面显示列相关接口、获取患者列表接口相关功能提交

songxinlu 3 years ago
parent
commit
e00f48b5b4

+ 2 - 2
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/DeptMapper.java

@@ -5,9 +5,9 @@ import com.lantone.common.dto.GetDataAuthDeptDTO;
 import com.lantone.common.dto.GetDataAuthDoctorDTO;
 import com.lantone.common.dto.GetDeptInfoDTO;
 import com.lantone.common.dto.GetDeptTreeDTO;
-import com.lantone.common.dto.report.BasDeptInfoDTO;
+import com.lantone.common.dto.analyze.BasDeptInfoDTO;
 import com.lantone.common.vo.GetHospitalListInfoVO;
-import com.lantone.common.vo.report.BasDeptInfoVO;
+import com.lantone.common.vo.analyze.BasDeptInfoVO;
 import com.lantone.dblayermbg.entity.Dept;
 import org.apache.ibatis.annotations.Param;
 

+ 4 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/analyze/MedBehospitalInfoMapper.java

@@ -1,6 +1,9 @@
 package com.lantone.dblayermbg.mapper.analyze;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.analyze.BehospitalInfoDTO;
+import com.lantone.common.vo.analyze.BehospitalPageVO;
 import com.lantone.dblayermbg.entity.analyze.MedBehospitalInfo;
 
 /**
@@ -10,4 +13,5 @@ import com.lantone.dblayermbg.entity.analyze.MedBehospitalInfo;
  */
 public interface MedBehospitalInfoMapper extends BaseMapper<MedBehospitalInfo> {
 
+    IPage<BehospitalInfoDTO> getPage(BehospitalPageVO behospitalPageVO);
 }

+ 2 - 2
dblayer-mbg/src/main/java/com/lantone/dblayermbg/service/impl/DeptServiceImpl.java

@@ -1,8 +1,8 @@
 package com.lantone.dblayermbg.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.lantone.common.dto.report.BasDeptInfoDTO;
-import com.lantone.common.vo.report.BasDeptInfoVO;
+import com.lantone.common.dto.analyze.BasDeptInfoDTO;
+import com.lantone.common.vo.analyze.BasDeptInfoVO;
 import com.lantone.dblayermbg.entity.Dept;
 import com.lantone.dblayermbg.mapper.DeptMapper;
 import com.lantone.dblayermbg.service.DeptService;

+ 6 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/service/impl/analyze/MedBehospitalInfoServiceImpl.java

@@ -1,6 +1,9 @@
 package com.lantone.dblayermbg.service.impl.analyze;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.lantone.common.dto.analyze.BehospitalInfoDTO;
+import com.lantone.common.vo.analyze.BehospitalPageVO;
 import com.lantone.dblayermbg.entity.analyze.MedBehospitalInfo;
 import com.lantone.dblayermbg.mapper.analyze.MedBehospitalInfoMapper;
 import com.lantone.dblayermbg.service.analyze.MedBehospitalInfoService;
@@ -14,4 +17,7 @@ import org.springframework.stereotype.Service;
 @Service
 public class MedBehospitalInfoServiceImpl extends ServiceImpl<MedBehospitalInfoMapper, MedBehospitalInfo> implements MedBehospitalInfoService {
 
+    public IPage<BehospitalInfoDTO> getPage(BehospitalPageVO behospitalPageVO) {
+        return baseMapper.getPage(behospitalPageVO);
+    }
 }

+ 1 - 1
dblayer-mbg/src/main/resources/mapper/DeptMapper.xml

@@ -84,7 +84,7 @@
             </foreach>
         </if>
     </select>
-    <select id="getList" resultType="com.lantone.common.dto.report.BasDeptInfoDTO">
+    <select id="getList" resultType="com.lantone.common.dto.analyze.BasDeptInfoDTO">
         SELECT DISTINCT
         t.id AS deptId,
         t.`name` AS deptName

+ 103 - 0
dblayer-mbg/src/main/resources/mapper/analyze/MedBehospitalInfoMapper.xml

@@ -2,4 +2,107 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.lantone.dblayermbg.mapper.analyze.MedBehospitalInfoMapper">
 
+    <select id="getPage" resultType="com.lantone.common.dto.analyze.BehospitalInfoDTO">
+        SELECT * FROM (
+        select   t.*,
+        CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
+        CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
+        g.check_type AS ch_type,
+        h.check_type AS mr_type,
+        g.check_name AS ch_name,
+        h.check_name AS mr_name,
+        g.check_time AS ch_time,
+        h.check_time AS mr_time
+        from (
+        select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
+        grade_time,IF(c.age is null, null,CONCAT( ifnull(c.age,'') ,ifnull(c.age_unit,'') ))as age,e.score_res as score_bn from med_behospital_info a
+        LEFT JOIN med_qcresult_info b
+        on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
+        left join med_home_page c
+        on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
+        LEFT JOIN med_qcresult_cases e
+        on  a.behospital_code = e.behospital_code
+        AND e.is_deleted = 'N'
+        and e.cases_id = 243
+        ) t
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
+        ON t.behospital_code = g.behospital_code
+        AND t.hospital_id = g.hospital_id
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
+        ON t.behospital_code = h.behospital_code
+        AND t.hospital_id = h.hospital_id
+        where t.is_deleted = 'N'
+        <if test="diagnose != null and diagnose != ''">
+            AND t.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
+        </if>
+        <if test="deptName != null and deptName != ''">
+            and t.beh_dept_name= #{deptName}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            and CONCAT(
+            IFNULL(t.doctor_name,''),IFNULL(t.beh_doctor_name,''),IFNULL(t.director_doctor_name,''))
+            like CONCAT('%',#{doctorName},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t.name like CONCAT('%',#{name},'%')
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            and (t.doctor_id = #{doctorCode}
+            or t.beh_doctor_id = #{doctorCode}
+            or t.director_doctor_id = #{doctorCode})
+        </if>
+        <if test="fileCode != null and fileCode != ''">
+            and t.file_code like CONCAT('%',#{fileCode},'%')
+        </if>
+        <if test="hospitalId != null">
+            and t.hospital_id = #{hospitalId}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and t.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="behosDateStart != null">
+            <![CDATA[ and t.behospital_date >= #{behosDateStart}]]>
+        </if>
+        <if test="behosDateEnd != null">
+            <![CDATA[ and t.behospital_date < #{behosDateEnd}]]>
+        </if>
+        <if test="leaveHosDateStart != null">
+            <![CDATA[ and t.leave_hospital_date >= #{leaveHosDateStart}]]>
+        </if>
+        <if test="leaveHosDateEnd != null">
+            <![CDATA[ and t.leave_hospital_date < #{leaveHosDateEnd}]]>
+        </if>
+        <if test="level != null and level != ''">
+            and t.level = #{level}
+        </if>
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and t.is_placefile = #{isPlacefile}
+        </if>
+        and t.qc_type_id != 0) p
+        where p.is_deleted="N"
+        <if test="checkStatus != null ">
+            and p.check_status = #{checkStatus}
+        </if>
+        <if test="mrStatus != null ">
+            AND p.mr_status = #{mrStatus}
+        </if>
+        <if test="chName != null and chName !=''">
+            AND p.ch_name like CONCAT('%',#{chName},'%')
+        </if>
+        <if test="mrName != null and mrName !=''">
+            AND p.mr_name like CONCAT('%',#{mrName},'%')
+        </if>
+        <if test="chTimeStart != null">
+            <![CDATA[ and p.ch_time >= #{chTimeStart}]]>
+        </if>
+        <if test="chTimeEnd != null">
+            <![CDATA[ and p.ch_time < #{chTimeEnd}]]>
+        </if>
+        <if test="mrTimeStart != null">
+            <![CDATA[ and p.mr_time >= #{mrTimeStart}]]>
+        </if>
+        <if test="mrTimeEnd != null">
+            <![CDATA[ and p.mr_time < #{mrTimeEnd}]]>
+        </if>
+    </select>
 </mapper>

+ 46 - 3
security-center/src/main/java/com/lantone/security/facade/analyze/BehospitalInfoManagementFacade.java

@@ -1,9 +1,11 @@
 package com.lantone.security.facade.analyze;
 
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.lantone.common.dto.analyze.RePlaceData;
 import com.lantone.common.dto.analyze.Response;
-import com.lantone.common.dto.report.BasDeptInfoDTO;
+import com.lantone.common.dto.analyze.BehospitalInfoDTO;
+import com.lantone.common.dto.analyze.BasDeptInfoDTO;
 import com.lantone.common.util.BeanUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
@@ -38,7 +40,8 @@ import com.lantone.common.vo.analyze.QcResultAlgQueryVO;
 import com.lantone.common.vo.analyze.QcResultAlgVO;
 import com.lantone.common.vo.analyze.QueryVo;
 import com.lantone.common.vo.analyze.RecordContentVO;
-import com.lantone.common.vo.report.BasDeptInfoVO;
+import com.lantone.common.vo.analyze.BasDeptInfoVO;
+import com.lantone.common.vo.analyze.BehospitalPageVO;
 import com.lantone.dblayermbg.entity.Hospital;
 import com.lantone.dblayermbg.entity.analyze.MedBehospitalInfo;
 import com.lantone.dblayermbg.entity.analyze.MedCheckInfo;
@@ -118,7 +121,6 @@ import com.lantone.dblayermbg.facade.analyze.StrRescueNoteFacade;
 import com.lantone.dblayermbg.facade.analyze.StrTransferInNoteFacade;
 import com.lantone.dblayermbg.facade.analyze.StrTransferOutNoteFacade;
 import com.lantone.dblayermbg.facade.analyze.StrWardRecordFacade;
-import com.lantone.dblayermbg.facade.analyze.MedQcresultInfoFacade;
 import com.lantone.dblayermbg.service.impl.analyze.MedQcresultCasesServiceImpl;
 import com.lantone.dblayermbg.service.impl.analyze.MedQcresultDetailServiceImpl;
 import com.lantone.dblayermbg.service.impl.analyze.StrInformedConsentServiceImpl;
@@ -1771,4 +1773,45 @@ public class BehospitalInfoManagementFacade {
         }
         return now;
     }
+
+    /**
+     * 分页
+     *
+     * @param behospitalPageVO
+     * @return
+     */
+    public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
+        behospitalPageSet(behospitalPageVO);
+        IPage<BehospitalInfoDTO> res = medBehospitalInfoFacade.getPage(behospitalPageVO);
+        return res;
+    }
+
+    private void behospitalPageSet(BehospitalPageVO behospitalPageVO) {
+        //入参验证
+        //入院时间
+        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart()) {
+            behospitalPageVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getBehosDateStart()));
+        }
+        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateEnd()) {
+            behospitalPageVO.setBehosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(behospitalPageVO.getBehosDateEnd(), 1)));
+        }
+        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
+            if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
+                Asserts.fail("入院时间的开始时间必须小于结束时间");
+            }
+        }
+        //出院时间
+        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart()) {
+            behospitalPageVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getLeaveHosDateStart()));
+        }
+        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateEnd()) {
+            behospitalPageVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(behospitalPageVO.getLeaveHosDateEnd(), 1)));
+        }
+        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
+            if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
+                Asserts.fail("出院时间的开始时间必须小于结束时间");
+            }
+        }
+        behospitalPageVO.setHospitalId(SysUserUtils.getCurrentHospitalId());
+    }
 }

+ 25 - 3
security-center/src/main/java/com/lantone/security/web/BehospitalInfoController.java

@@ -1,10 +1,13 @@
 package com.lantone.security.web;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.lantone.common.api.CommonResult;
 import com.lantone.common.dto.analyze.AnalyzeDTO;
-import com.lantone.common.dto.report.BasDeptInfoDTO;
+import com.lantone.common.dto.analyze.BasDeptInfoDTO;
+import com.lantone.common.dto.analyze.BehospitalInfoDTO;
 import com.lantone.common.vo.analyze.AnalyzeVO;
-import com.lantone.common.vo.report.BasDeptInfoVO;
+import com.lantone.common.vo.analyze.BasDeptInfoVO;
+import com.lantone.common.vo.analyze.BehospitalPageVO;
 import com.lantone.security.facade.analyze.BehospitalInfoManagementFacade;
 import com.lantone.security.facade.analyze.compute.BehospitalInfoManagementFacade_New;
 import io.swagger.annotations.Api;
@@ -26,7 +29,7 @@ import java.util.List;
 @RestController
 @RequestMapping("/beHosInfoManage")
 @Api(value = "病历API", tags = { "病历API" })
-public class BehospitalInfoController {
+public class BehospitalInfoManagementController {
     @Autowired
     private BehospitalInfoManagementFacade behospitalInfoManagementFacade;
     @Autowired
@@ -53,4 +56,23 @@ public class BehospitalInfoController {
     public CommonResult<List<BasDeptInfoDTO>> getList(@RequestBody BasDeptInfoVO basDeptInfoVO) {
         return CommonResult.success(behospitalInfoManagementFacade.listForUser(basDeptInfoVO));
     }
+
+    @ApiOperation(value = "病历分页列表[by:zhoutg]",
+            notes = "behospitalCode:病人住院序号<br>" +
+                    "name:病人姓名<br>" +
+                    "fileCode:档案号<br>" +
+                    "statisticsType: 统计维度 1-本月,2-本年<br>" +
+                    "behosDateStart:入院时间开始时间<br>" +
+                    "behosDateEnd:入院时间结束时间<br>" +
+                    "leaveHosDateStart:出院时间开始时间<br>" +
+                    "leaveHosDateEnd:出院时间结束时间<br>" +
+                    "doctorName:医生姓名<br>" +
+                    "doctorCode:医生工号<br>" +
+                    "level:等级<br>" +
+                    "deptId:科室id<br>")
+    @PostMapping("/page")
+    public CommonResult<IPage<BehospitalInfoDTO>> page(@RequestBody BehospitalPageVO behospitalPageVO) {
+        IPage<BehospitalInfoDTO> data = behospitalInfoManagementFacade.pageFac(behospitalPageVO);
+        return CommonResult.success(data);
+    }
 }