master
parent
a76ee93ced
commit
c15ad8a99a
@ -0,0 +1,22 @@
|
||||
package com.emr.dao;
|
||||
|
||||
import com.emr.vo.RecordStatistics;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RecordStatisticsMapper {
|
||||
//统计总病历数
|
||||
int getRecordCount(RecordStatistics record);
|
||||
//统计总文件数
|
||||
List<RecordStatistics> getFileCount(RecordStatistics record);
|
||||
//按科室分组统计病案
|
||||
List<RecordStatistics> getRecordStatisticsGroupDept(RecordStatistics recordStatistics);
|
||||
//按科室和来源分组统计文件
|
||||
List<RecordStatistics> getFileStatisticsGroupDept(RecordStatistics recordStatistics);
|
||||
|
||||
List<RecordStatistics> getRecordStatisticsByDeptName(RecordStatistics recordStatistics);
|
||||
|
||||
List<RecordStatistics> getFileCountByMasterIds(@Param("masterIds") String masterIds);
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.emr.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ProjectName:病案统计对象
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2020/8/7 10:29
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2020/8/7 10:29
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class RecordStatistics {
|
||||
private String inpNo;//住院号
|
||||
private String visitId;//住院次数
|
||||
private String name;//患者姓名
|
||||
private String deptName;//出院科室
|
||||
private String dischargeDateTime;//出院日期
|
||||
private Integer allRecordCount; //总病历数
|
||||
private Integer allFileCount;//总文件数
|
||||
private Integer allPageCount;//总页数
|
||||
private Integer autoCollectionFileCount;//自动采集总文件数
|
||||
private Integer autoCollectionPageCount;//自动采集总页数
|
||||
private Integer manualScanFileCount;//扫描上传总文件数
|
||||
private Integer manualScanPageCount;//扫描上传总页数
|
||||
private String startDate;//出院开始日期
|
||||
private String endDate;//出院结束日期
|
||||
private String deptNameCn;//出院科室转换中文
|
||||
private String source;//文件来源
|
||||
private String masterId;//病案主键
|
||||
private Integer timeInterval;//出院时段
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.emr.dao.RecordStatisticsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.emr.vo.RecordStatistics">
|
||||
</resultMap>
|
||||
<!--公共查询方法-->
|
||||
<sql id="commomSearch">
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND archive_master.dept_name IN
|
||||
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<choose>
|
||||
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
|
||||
AND archive_master.discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
|
||||
#{endDate,jdbcType=NCHAR}+ ' 23:59:59'
|
||||
</when>
|
||||
<when test="startDate != null and startDate != ''">
|
||||
AND archive_master.discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
|
||||
</when>
|
||||
<when test="endDate != null and endDate != ''">
|
||||
AND archive_master.discharge_date_time <= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
|
||||
</when>
|
||||
</choose>
|
||||
<if test="inpNo != null and inpNo != ''">
|
||||
AND archive_master.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and archive_master.name like '%'+#{name,jdbcType=NCHAR}+'%'
|
||||
</if>
|
||||
</sql>
|
||||
<!--总病历数-->
|
||||
<select id="getRecordCount" resultType="java.lang.Integer" parameterType="com.emr.vo.RecordStatistics">
|
||||
SELECT COUNT(archive_master.id) allRecordCount FROM archive_master
|
||||
<where>
|
||||
<include refid="commomSearch"/>
|
||||
</where>
|
||||
</select>
|
||||
<!--总文件数-->
|
||||
<select id="getFileCount" resultMap="BaseResultMap" parameterType="com.emr.vo.RecordStatistics">
|
||||
SELECT COUNT(archive_detail.id) allFileCount,Source source FROM archive_detail
|
||||
<if test="(deptName != null and deptName != '')
|
||||
or (startDate != null and startDate != '' and endDate != null and endDate != '')
|
||||
or (inpNo != null and inpNo != '')
|
||||
or (name != null and name != '')">
|
||||
INNER JOIN archive_master
|
||||
ON archive_detail.MasterID = archive_master.id
|
||||
</if>
|
||||
WHERE flag = 0
|
||||
<include refid="commomSearch"/>
|
||||
GROUP BY source
|
||||
</select>
|
||||
<!--按科室分组统计病案数-->
|
||||
<select id="getRecordStatisticsGroupDept" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
emr_dictionary.CODE deptName,
|
||||
emr_dictionary.NAME deptNameCn,
|
||||
COUNT( dept_name ) allRecordCount
|
||||
FROM
|
||||
archive_master
|
||||
INNER JOIN emr_dictionary ON archive_master.dept_name = emr_dictionary.CODE
|
||||
AND emr_dictionary.parent_id = 'dept_code'
|
||||
AND emr_dictionary.effective = 1
|
||||
<where>
|
||||
<include refid="commomSearch"/>
|
||||
</where>
|
||||
GROUP BY
|
||||
emr_dictionary.NAME,
|
||||
emr_dictionary.CODE
|
||||
ORDER BY
|
||||
emr_dictionary.CODE
|
||||
</select>
|
||||
<!--按科室分组统计文件数-->
|
||||
<select id="getFileStatisticsGroupDept" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
dept_name deptName,
|
||||
COUNT( archive_detail.id ) allFileCount,
|
||||
archive_detail.Source source
|
||||
FROM
|
||||
archive_master
|
||||
INNER JOIN archive_detail ON archive_master.id = archive_detail.MasterID
|
||||
AND flag = 0
|
||||
<where>
|
||||
<include refid="commomSearch"/>
|
||||
</where>
|
||||
GROUP BY
|
||||
dept_name,
|
||||
Source
|
||||
</select>
|
||||
<select id="getRecordStatisticsByDeptName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
archive_master.id masterId,
|
||||
emr_dictionary.NAME deptNameCn,
|
||||
inp_no,
|
||||
archive_master.NAME,
|
||||
visit_id,
|
||||
discharge_date_time
|
||||
FROM
|
||||
archive_master
|
||||
INNER JOIN emr_dictionary ON archive_master.dept_name = emr_dictionary.CODE
|
||||
AND emr_dictionary.parent_id = 'dept_code'
|
||||
AND effective = 1
|
||||
<where>
|
||||
<include refid="commomSearch"/>
|
||||
</where>
|
||||
ORDER BY discharge_date_time DESC
|
||||
</select>
|
||||
<select id="getFileCountByMasterIds" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
MasterID masterId,
|
||||
COUNT( id ) allFileCount,
|
||||
Source
|
||||
FROM
|
||||
archive_detail
|
||||
WHERE
|
||||
MasterID IN (${masterIds})
|
||||
AND flag = 0
|
||||
GROUP BY
|
||||
MasterID,
|
||||
Source
|
||||
</select>
|
||||
</mapper>
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"code": 1,
|
||||
"name": "3天内"
|
||||
},
|
||||
{
|
||||
"code": 2,
|
||||
"name": "7天内"
|
||||
},
|
||||
{
|
||||
"code": 3,
|
||||
"name": "1个月内"
|
||||
},
|
||||
{
|
||||
"code": 4,
|
||||
"name": "3个月内"
|
||||
}
|
||||
]
|
||||
Loading…
Reference in New Issue