急诊留观病历报表:
根据主管医生统计【 留观:主管医生 归档的病历:留观数据、状态(已归档)、去掉作废 迟交病历:留观数据、去掉(作废、已封存、取消入院)、(留观结束日期与留观开始日期之间的工作日,默认超期天数为3) 病案室已质控:留观数据、去掉(作废、已封存、取消入院) 退回急诊室:留观数据、状态(主任退回、复审退回)】master
parent
d68530da21
commit
d7c8d4a3d8
@ -0,0 +1,51 @@
|
||||
package com.emr.controller;
|
||||
|
||||
import com.emr.entity.Archive_Master_Vo;
|
||||
import com.emr.entity.OffsetLimitPage;
|
||||
import com.emr.service.Observation_ReportService;
|
||||
import com.emr.util.ThreadExcelUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/observationReport")
|
||||
public class ObservationReportController {
|
||||
@Autowired
|
||||
private Observation_ReportService observationReportService;
|
||||
|
||||
@RequestMapping(value = "/observationReport")
|
||||
public String inHospitals(Model model) {
|
||||
//return "beHospitaledDir/beHospListNow";
|
||||
return "observationReport/observationReportList";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/getObservationReportPage")
|
||||
public OffsetLimitPage getObservationReportList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
|
||||
OffsetLimitPage result = observationReportService.getObservationReportList(archiveMasterVo, offset, limit);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/exportExcel")
|
||||
public void exportExcel(HttpServletResponse response, Archive_Master_Vo master) throws Exception {
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
String[] header = {"归档病历总数","迟交病历总数","已质控病历总数","退回急诊室总数","主管医生"};
|
||||
String[] fileNames = {"fileNum","delayNum","qualityNum","backNum","doctorInCharge"};
|
||||
//文件名
|
||||
String fileName = "急诊留观病历报表" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
|
||||
//构造excel的数据
|
||||
List<Archive_Master_Vo> list = observationReportService.getObservationReportList(master);
|
||||
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
|
||||
utils.exportExcelToFilePath(response,utils.listConvert(list));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright (C), 2015-2019
|
||||
* Author: HJL
|
||||
* Date: 2019/7/19 15:27
|
||||
* Description:患者住院信息主索引表
|
||||
*/
|
||||
package com.emr.service;
|
||||
|
||||
import com.emr.entity.Archive_Master_Vo;
|
||||
import com.emr.entity.OffsetLimitPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface Observation_ReportService{
|
||||
|
||||
/**
|
||||
* 根据条件查找急诊留观病历报表分页
|
||||
*
|
||||
* @param archiveMasterVo
|
||||
* @return
|
||||
*/
|
||||
OffsetLimitPage getObservationReportList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit);
|
||||
|
||||
/**
|
||||
* 根据条件查找急诊留观病历报表
|
||||
*
|
||||
* @param archiveMasterVo
|
||||
* @return
|
||||
*/
|
||||
List<Archive_Master_Vo> getObservationReportList(Archive_Master_Vo archiveMasterVo);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,68 @@
|
||||
package com.emr.service.ipml;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.emr.dao.Archive_MasterMapper;
|
||||
import com.emr.entity.Archive_Master_Vo;
|
||||
import com.emr.entity.OffsetLimitPage;
|
||||
import com.emr.service.Observation_ReportService;
|
||||
import com.emr.service.PowerUserService;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class Observation_ReportServiceImpl implements Observation_ReportService {
|
||||
@Autowired
|
||||
private Archive_MasterMapper archiveMasterMapper;
|
||||
|
||||
@Autowired
|
||||
private PowerUserService powerUserService;
|
||||
|
||||
@Override
|
||||
public OffsetLimitPage getObservationReportList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
|
||||
PageHelper.offsetPage(offset, limit);
|
||||
List<Archive_Master_Vo> list=selectByCol(archiveMasterVo);
|
||||
return new OffsetLimitPage((Page) list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Archive_Master_Vo> getObservationReportList(Archive_Master_Vo archiveMasterVo) {
|
||||
return selectByCol(archiveMasterVo);
|
||||
}
|
||||
|
||||
public List<Archive_Master_Vo> selectByCol(Archive_Master_Vo archiveMasterVo) {
|
||||
List<Archive_Master_Vo> list=archiveMasterMapper.getObservationReportList(archiveMasterVo);
|
||||
if(list!=null && list.size()>0) {
|
||||
JSONArray powerUsers = powerUserService.getPowerUserList("1");
|
||||
List<JSONObject> powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), JSONObject.class);
|
||||
if (powerUserList != null) {
|
||||
Map<String, JSONObject> mappedMovies = Maps.uniqueIndex(powerUserList, new Function<JSONObject, String>() {
|
||||
@Override
|
||||
public String apply(JSONObject temp) {
|
||||
return temp.getString("userName");
|
||||
}
|
||||
});
|
||||
for (Archive_Master_Vo archiveMaster : list) {
|
||||
//主管医生
|
||||
JSONObject userInfo = mappedMovies.get(archiveMaster.getDoctorInCharge());
|
||||
if (userInfo == null) {
|
||||
archiveMaster.setDoctorInCharge(archiveMaster.getDoctorInCharge());
|
||||
} else {
|
||||
archiveMaster.setDoctorInCharge(userInfo.getString("name"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue