修改归档计算方式

gaoming_branch
zengwh 4 years ago
parent 393d4b6da5
commit 7b7c30e338

@ -70,7 +70,7 @@ public class RecordController {
}
}
offsetLimitPage.setRows(list);
request.getSession().removeAttribute("unSubmitRecords");
//request.getSession().removeAttribute("unSubmitRecords");
return offsetLimitPage;
}

@ -64,7 +64,7 @@ public class RecordService {
//填充各个角色数据、主要填充已提交的
selectList(unSubmitRecords);
}
request.getSession().setAttribute("unSubmitRecords",unSubmitRecords);
//request.getSession().setAttribute("unSubmitRecords",unSubmitRecords);
return unSubmitRecords;
}

@ -12,6 +12,7 @@ import com.emr.service.V_CountService;
import com.emr.vo.V_CountVo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -24,7 +25,13 @@ public class V_CountServiceImpl implements V_CountService {
@Override
public List<V_Count> selectByCol(V_CountVo record) {
return vCountMapper.selectByCol(record);
List<V_Count> counts = vCountMapper.selectByCol(record);
if(!CollectionUtils.isEmpty(counts)){
for(V_Count count :counts){
count.setUnfileNum(count.getOutNum() - count.getFileNum());
}
}
return counts;
}
@Override

@ -11,6 +11,7 @@ import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@ -137,6 +138,8 @@ public class WorkHomeService {
int admissCount = 0;
//定义归档数量
int recordCount = 0;
//定义出科数量
int sumbitCount = 0;
if(!CollectionUtils.isEmpty(list)){
for(Archive_Master archiveMaster : list){
if(StringUtils.isNotBlank(archiveMaster.getDeptName()) && archiveMaster.getDeptName().equals(deptName)){
@ -147,21 +150,23 @@ public class WorkHomeService {
}else{
admissCount++;
}
//判断出科
String archivestate = archiveMaster.getArchivestate();
//判断归档
if ("128".equals(archivestate)) {
String t1 = archiveMaster.getT1();
//判断归档 待终审且已签收+已终审
if ("128".equals(archivestate) || ("64".equals(archivestate) && StringUtils.isNotBlank(t1) && !"1801-02-03".equals(t1.substring(0,10)))) {
recordCount++;
}
//判断出科
if ("128".equals(archivestate) || "64".equals(archivestate)) {
sumbitCount++;
}
}
}
}
vo.setDisCount(disCount);
vo.setRecordCount(recordCount);
vo.setAdmissCount(admissCount);
if(disCount != 0) {
vo.setRecordRate((recordCount * 100 / disCount) + "%");
}
vo.setSumbitCount(sumbitCount);
//转换科室
for (Emr_Dictionary dictionaryTemp : dictionaries) {
String name = dictionaryTemp.getName();
@ -246,8 +251,6 @@ public class WorkHomeService {
int signCount = 0;
//已扫描数量
int isScanCount = 0;
//未扫描数量
int notScanCount = 0;
//超期病历
int overTimeCount = 0;
//预超期病历
@ -265,8 +268,6 @@ public class WorkHomeService {
recordCount = list.get(2) + list.get(5);
signCount = list.get(3);
isScanCount = list.get(4);
//待终审未扫描数量 = 待终审总数 - 已扫描
notScanCount = headNurseCount - list.get(5);
//查询超期参数
EmrOvertimeSet overtimeSet = overtimeSetService.selectByPrimaryKey(1);
//获取未超期列表
@ -281,7 +282,7 @@ public class WorkHomeService {
String reDeadDate = unHolidays.get(overtimeSet.getDeadDays() - overtimeSet.getSurplusDays()).getDate();
//查询超期与预超期数量集合 1.超期数量 2.预超期数量
List<Integer> overTimeAndReOverTimeCountList = archiveMasterMapper.overTimeAndReOverTimeCount(date,deadDate,reDate,reDeadDate,startDateTo, endDateTo);
overTimeCount = overTimeAndReOverTimeCountList.get(0);
overTimeCount = getOverTimeCount(startDateTo,endDateTo);
reOverTimeCount = overTimeAndReOverTimeCountList.get(1);
}
//归档率 归档数量/出院人数
@ -313,12 +314,66 @@ public class WorkHomeService {
//未扫描数量 已签收-已扫描
map.put("notScanCount",(signCount - isScanCount) + "");
//扫描率
if(disCount != 0){
if(disCount != 0 && signCount != 0){
scanRate = (isScanCount * 100 / signCount);
}
map.put("scanRate",scanRate + "%");
return map;
}
private int getOverTimeCount(String startDateTo, String endDateTo) throws Exception{
RecordSearch recordSearch = new RecordSearch();
recordSearch.setStartDate(startDateTo);
recordSearch.setEndDate(endDateTo);
int count = 0;
List<SubmitRecord> unSubmitRecords = recordMapper.selectUnCountGroupDept(recordSearch);
if (!CollectionUtils.isEmpty(unSubmitRecords)) {
unSubmitRecords = selectOvertimeRecord(unSubmitRecords);
if(!CollectionUtils.isEmpty(unSubmitRecords)){
count = unSubmitRecords.size();
}
}
return count;
}
/**
*
* @param unSubmitRecords
* @return
*/
private List<SubmitRecord> selectOvertimeRecord(List<SubmitRecord> unSubmitRecords) throws Exception{
//查询超期参数
EmrOvertimeSet overtimeSet = overtimeSetService.selectByPrimaryKey(1);
//获取未超期列表
List<EmrHolidaySet> unHolidays = holidaySetMapper.selectNotHolidayList();
Iterator<SubmitRecord> iterator = unSubmitRecords.iterator();
//获取非死亡工作日
String date = unHolidays.get(overtimeSet.getDays()).getDate();
//获取非死亡工作日
String deadDate = unHolidays.get(overtimeSet.getDeadDays()).getDate();
//定义格式化日期
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
while (iterator.hasNext()) {
SubmitRecord record = (SubmitRecord) iterator.next();
//获取是否死亡
String dischargeDisposition = record.getDischargeDisposition();
String dischargeDateTime = record.getDischargeDateTime();
long time = fmt.parse(dischargeDateTime).getTime();
if(StringUtils.isNotBlank(dischargeDisposition) && "5".equals(dischargeDisposition)){
//死亡
if(time >= fmt.parse(deadDate).getTime()){
iterator.remove();
}
}else{
//非死亡
if(time >= fmt.parse(date).getTime()){
iterator.remove();
}
}
}
return unSubmitRecords;
}
/*
public Map<String,String> medicalRoomManageData(String startDateTo, String endDateTo) throws Exception{
//查询总数据

@ -1424,18 +1424,37 @@
<!--查询科室按提交率排名-->
<select id="recordDataTwoTable" resultType="com.emr.vo.RecordStatisticsHome">
SELECT
SELECT
temp1.dept_name,
isnull( temp2.sumbitCount, 0 ) sumbitCount
CASE
WHEN temp3.count = 0 THEN
0
WHEN temp3.count IS NULL THEN
0
WHEN temp2.recordCount IS NULL THEN
0 ELSE ROUND( CAST( temp2.recordCount AS FLOAT ) / temp3.count, 2 ) * 100
END recordRate
FROM
( SELECT DISTINCT dept_name FROM archive_master
<where><include refid="disDateRangeWhereSql"></include></where>
) temp1
LEFT JOIN ( SELECT dept_name, COUNT ( id ) sumbitCount FROM archive_master WHERE (ArchiveState = '64' OR ArchiveState = '128')
<include refid="disDateRangeWhereSql"></include>
GROUP BY dept_name ) temp2 ON temp1.dept_name = temp2.dept_name
( SELECT DISTINCT dept_name FROM archive_master
<where><include refid="disDateRangeWhereSql"></include></where>
) temp1
LEFT JOIN (
SELECT
dept_name,
COUNT( id ) recordCount
FROM
archive_master
WHERE
( ( ArchiveState = '64' AND T1 IS NOT NULL AND T1 != '' AND T1 >= '1801-02-04' ) OR ArchiveState = '128' )
<include refid="disDateRangeWhereSql"></include>
GROUP BY
dept_name
) temp2 ON temp1.dept_name = temp2.dept_name
LEFT JOIN ( SELECT dept_name, COUNT( id ) count FROM archive_master WHERE discharge_date_time IS NOT NULL AND discharge_date_time != '' AND discharge_date_time >= '1801-02-04'
<include refid="disDateRangeWhereSql"></include>
GROUP BY dept_name ) temp3 ON temp1.dept_name = temp3.dept_name
ORDER BY
sumbitCount DESC
recordRate DESC
</select>
<!--统计退召回数量-->

@ -18,12 +18,12 @@
<result column="endDate" jdbcType="NVARCHAR" property="endDate"/>
</resultMap>
<sql id="Base_Column_List">
deptCode, deptName, inNum, outNum, fileNum, unfileNum, deathNum, fileRate,
deptCode, deptName, inNum, outNum, fileNum, deathNum, fileRate,
day2Rate, day3Rate, day7Rate
</sql>
<select id="selectByCol" parameterType="com.emr.entity.V_Count" resultMap="BaseResultMap">
<![CDATA[
SELECT deptCode, deptName,ISNULL(outNum, 0) outNum, ISNULL(fileNum, 0) fileNum, ISNULL(unfileNum, 0) unfileNum, ISNULL(deathNum, 0) deathNum, ISNULL(fileRate, '0') fileRate, ISNULL(day2Rate, '0') day2Rate, ISNULL(day3Rate, '0') day3Rate, ISNULL(day7Rate, '0') day7Rate FROM (select DISTINCT c.dept_name as deptCode,t8.Name as deptName,t1.outNum ,t2.fileNum , t3.unfileNum ,t4.deathNum,
SELECT deptCode, deptName,ISNULL(outNum, 0) outNum, ISNULL(fileNum, 0) fileNum,ISNULL(deathNum, 0) deathNum, ISNULL(fileRate, '0') fileRate, ISNULL(day2Rate, '0') day2Rate, ISNULL(day3Rate, '0') day3Rate, ISNULL(day7Rate, '0') day7Rate FROM (select DISTINCT c.dept_name as deptCode,t8.Name as deptName,t1.outNum ,t2.fileNum ,t4.deathNum,
CASE
WHEN t1.outNum = 0 THEN
0
@ -88,7 +88,7 @@
</when>
</choose>
group by dept_name) as t1 on c.dept_name= t1.dept_name
left join (select dept_name,COUNT(*) AS fileNum from archive_master as s where s.ArchiveState = '128' and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D'
left join (select dept_name,COUNT(*) AS fileNum from archive_master as s where (s.ArchiveState = '128' OR (s.ArchiveState = '64' and s.T1 is not null and s.T1 != '' and s.T1 >= '1801-02-04 00:00:00')) and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D'
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
@ -102,20 +102,6 @@
</when>
</choose>
group by dept_name) as t2 on c.dept_name= t2.dept_name
left join (select dept_name,COUNT(*) AS unfileNum from archive_master as s where s.ArchiveState != '128' and YEAR(s.discharge_date_time) != '1801' and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D'
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and 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 discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</when>
<when test="endDate != null and endDate != ''">
and discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
group by dept_name) as t3 on c.dept_name= t3.dept_name
left join (select dept_name,COUNT(*) AS deathNum from archive_master as s where s.DISCHARGE_DISPOSITION=5 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D'
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
@ -144,7 +130,7 @@
</when>
</choose>
group by dept_name) as t5 on c.dept_name= t5.dept_name
left join (select dept_name,COUNT(*) AS Num from archive_master as s where s.ArchiveState = '128' and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) &lt;= 3 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D'
left join (select dept_name,COUNT(*) AS Num from archive_master as s where (s.ArchiveState = '128' OR (s.ArchiveState = '64' and s.T1 is not null and s.T1 != '' and s.T1 >= '1801-02-04 00:00:00')) and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) &lt;= 3 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D'
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
@ -158,7 +144,7 @@
</when>
</choose>
group by dept_name) as t6 on c.dept_name= t6.dept_name
left join (select dept_name,COUNT(*) AS Num from archive_master as s where s.ArchiveState = '128' and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) &lt;= 7 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D'
left join (select dept_name,COUNT(*) AS Num from archive_master as s where (s.ArchiveState = '128' OR (s.ArchiveState = '64' and s.T1 is not null and s.T1 != '' and s.T1 >= '1801-02-04 00:00:00')) and ( datediff( d, discharge_date_time, checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), discharge_date_time, 120 ) AND checked_datetime AND flag = 2 )) &lt;= 7 and s.inp_no NOT like '%B' and s.inp_no NOT like '%C' and s.inp_no NOT like '%D'
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and

@ -200,7 +200,14 @@
{
title: '归档率',
field: 'recordRate',
align: 'center'
align: 'center',
formatter: function (value, row, index) {
var val;
if (row.recordRate != null && row.recordRate != '') {
val = Math.round(row.recordRate) + "%";
}
return val;
}
},
],
onLoadSuccess: function (result) { //加载成功时执行

Loading…
Cancel
Save