导出国标病历

master
linjj 1 year ago
parent 132d6bbbbe
commit e0b1e07b67

@ -93,6 +93,12 @@
<version>${pagehelper.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>kernel</artifactId>
<version>7.1.11</version>
</dependency>
<!-- 连接池 -->
<dependency>
<groupId>com.alibaba</groupId>

@ -6,6 +6,7 @@ import com.emr.dao.TPrintinfoMapper;
import com.emr.entity.*;
import com.emr.service.Archive_DetailService;
import com.emr.service.Archive_MasterService;
import com.emr.service.BatchExportService;
import com.emr.service.ipml.*;
import com.emr.util.DateUtil;
import com.emr.util.ExceptionPrintUtil;
@ -64,6 +65,8 @@ public class FontController {
private ArchiveOtherExtService archiveOtherExtService;
@Autowired
private TPrintinfoMapper tPrintinfoMapper;
@Autowired
private BatchExportService batchExportService;
@RequestMapping("selectIsPrintByPatienId")
@ResponseBody
@ -693,4 +696,19 @@ public class FontController {
archiveOtherExtService.updateOtherDomForStatusFlag(jzh,detailIds);
return Msg.success();
}
/**
* @description:
* @params: taskid
* @return: String
* @author linjj
* @date: 2024/4/12 13:55
*/
@ResponseBody
@RequestMapping(value = "BatchExportPdf")
public String batchExportPdf(int taskid) throws Exception {
return batchExportService.batchExportPdf(taskid);
}
}

@ -60,6 +60,21 @@ public class VCountController {
}
}
// @ResponseBody
// @RequestMapping(value = "/vCountNumList")
// public List<V_Count> medicalCountDayList(V_CountVo vCount){
// try {
// //统计列表
// return v_countService.selectByCol(vCount);
// } catch (Exception e) {
// ExceptionPrintUtil.printException(e);
// e.printStackTrace();
// return null;
// }
// }
@ResponseBody
@RequestMapping(value = "/vCountNumList")
public List<V_Count> medicalCountDayList(V_CountVo vCount){

@ -0,0 +1,18 @@
package com.emr.dao;
import com.emr.vo.ExportTaskVo;
import java.util.List;
/**
* @InterfaceName BatchExportMapper
* @Description
* @Author linjj
* @Date 2024/4/12 11:44
* @Version 1.0
*/
public interface BatchExportMapper {
//查询所有任务
List<ExportTaskVo> selectAll(int taskState);
}

@ -0,0 +1,22 @@
package com.emr.dao;
import com.emr.vo.ExportTaskDetailsVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @InterfaceName ExportTaskDetailsMapper
* @Description
* @Author linjj
* @Date 2024/4/12 14:03
* @Version 1.0
*/
public interface ExportTaskDetailsMapper {
List<ExportTaskDetailsVo> selectAllByTaskId(int taskId);
List<String> getMasterId(@Param("inpNo") String inpNo, @Param("dischargeDateTime") String dischargeDateTime);
int upStatc(@Param("state") int state,@Param("id") int id);
}

@ -0,0 +1,14 @@
package com.emr.dao;
import com.emr.vo.ExportPdfVo;
import com.emr.vo.ExportZdAssortVo;
import java.util.List;
public interface ExportZdAssortMapper {
List<ExportPdfVo>getPdfPath(String masterId);
List<ExportZdAssortVo>selectAll();
}

@ -9,6 +9,16 @@ import java.util.List;
public interface V_CountMapper {
List<V_Count> selectByCol(V_CountVo record);
List<V_Count> selectByColCount(V_CountVo record);
List<V_Count> getFileNum(V_CountVo record);
List<V_Count> getDeathNum(V_CountVo record);
List<V_Count> getDay2Rate(V_CountVo record);
List<V_Count> getDay3Rate(V_CountVo record);
// /**
// * 根据条件查找统计列表分页
// *

@ -0,0 +1,20 @@
package com.emr.service;
import com.emr.vo.ExportTaskVo;
import java.util.List;
/**
* @InterfaceName BatchExportService
* @Description
* @Author linjj
* @Date 2024/4/12 11:40
* @Version 1.0
*/
public interface BatchExportService {
//查询所有任务
List<ExportTaskVo> selectAll(int taskState);
//批量导出
String batchExportPdf(int taskid)throws Exception;
}

@ -0,0 +1,207 @@
package com.emr.service.ipml;
import com.emr.dao.BatchExportMapper;
import com.emr.dao.ExportTaskDetailsMapper;
import com.emr.dao.ExportZdAssortMapper;
import com.emr.service.BatchExportService;
import com.emr.util.Logger;
import com.emr.vo.ExportPdfVo;
import com.emr.vo.ExportTaskDetailsVo;
import com.emr.vo.ExportTaskVo;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.text.Document;
import com.itextpdf.text.pdf.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @ClassName BatchExportServiceImpl
* @Description
* @Author linjj
* @Date 2024/4/12 11:41
* @Version 1.0
*/
@Service
public class BatchExportServiceImpl implements BatchExportService {
private static Logger logger = new Logger();
@Autowired
BatchExportMapper batchExportMapper;
@Autowired
ExportTaskDetailsMapper exportTaskDetailsMapper;
@Autowired
private ExportZdAssortMapper exportZdAssortMapper;
@Value("${export_pdf_hospital_info}")
private String flieName;
@Value("${export_pdf_path}")
private String exportPdfPath;
@Override
public List<ExportTaskVo> selectAll(int taskState) {
return batchExportMapper.selectAll(taskState);
}
@Override
public String batchExportPdf(int taskid) throws Exception {
//是否存在目录不存在创建
File file = new File (exportPdfPath);
if(!file.isDirectory ()){
file.mkdirs ();
}
//导出文件名
String fileName=null;
//根据taskid查询所有需要导出病历的住院号出院日期
List<ExportTaskDetailsVo> taskList = exportTaskDetailsMapper.selectAllByTaskId(taskid);
if (taskList==null) {
return "没有任务";
}
for (ExportTaskDetailsVo list : taskList) {
//根据住院号出院日期查询需要导出病历路径
List<String> masterIds = exportTaskDetailsMapper.getMasterId(list.getInpNo(), list.getDischargeDateTime());
if (masterIds==null) {
logger.log("病案号为:" + list.getInpNo() + "出院时间为:" + list.getDischargeDateTime() + "的病历找不到。");
continue;
}
for (String masterId : masterIds) {
List<ExportPdfVo> pdfPathList = exportZdAssortMapper.getPdfPath(masterId);
if (pdfPathList==null){
logger.log("病案号为:" + list.getInpNo() + "出院时间为:" + list.getDischargeDateTime() + "的病历查询不到影像");
continue;
}
try {
//组织导出文件名
fileName = exportFlieName(list);
} catch (ParseException e) {
throw new RuntimeException(e);
}
// downPdfResponse(fileName,response);
Boolean aBoolean = exportPdf(pdfPathList,fileName,exportPdfPath);
//为true时修改任务状态1完成2失败
if (aBoolean){
exportTaskDetailsMapper.upStatc(1,list.getId());
}else {
exportTaskDetailsMapper.upStatc(2,list.getId());
}
}
}
return "下载完成";
}
private void downPdfResponse(String pdfName, HttpServletResponse response) {
try {
pdfName = java.net.URLEncoder.encode(pdfName, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
response.reset();
response.setContentType("application/pdf");
response.setHeader("content-disposition", "attachment; filename=" + pdfName + ".pdf");
}
private static Boolean exportPdf(List<ExportPdfVo> pdfPathList,String fileName,String exportPdfPath) {
//上一个目录名称
String lastOutline = null;
//是否增加标签
boolean outFlag = true;
//标签顺序
Integer outNum = 1;
Integer pageNum=1;
Document document = new Document();
PdfCopy writer = null;
try {
FileOutputStream fileOutputStream = new FileOutputStream(exportPdfPath+fileName+".pdf");
writer = new PdfCopy(document,fileOutputStream);
document.open();
PdfContentByte cb = writer.getDirectContent();
cb.setFontAndSize(BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED), 12);
cb.beginText();
cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "目录", 300, 780, 0);
cb.endText();
// 创建目录
PdfOutline root = cb.getRootOutline();
for (int i = 0; i < pdfPathList.size(); i++) {
try {
String assortName = pdfPathList.get(i).getAssortName();
if (StringUtils.isNotBlank(lastOutline) && lastOutline.equals(assortName)) {
outFlag = false;
}
if (StringUtils.isBlank(lastOutline)) {
lastOutline = assortName;
outFlag=true;
}
if (!lastOutline.equals(assortName)){
lastOutline = assortName;
outFlag=true;
}
PdfReader reader = new PdfReader(pdfPathList.get(i).getPdfPath());
int n = reader.getNumberOfPages();
for (int s = 1; s <= n; s++) {
PdfImportedPage page = writer.getImportedPage(reader, s);
writer.addPage(page);
}
if (outFlag) {
//目录跳转页面内容设置。
PdfAction action = PdfAction.gotoLocalPage(pageNum, new PdfDestination(PdfDestination.FIT), writer);
//标题目录
String title = outNum+"."+pdfPathList.get(i).getAssortName();
new PdfOutline(root, action, title, false);
outNum++;
}
pageNum =pageNum+getPageNum(pdfPathList.get(i));
} catch (Exception e) {
return false;
}
}
return true;
} catch (Exception e) {
e.printStackTrace();
} finally {
if (document != null) {
document.close();
}
}
return true;
}
//获取pdf页码
private static int getPageNum(ExportPdfVo obj) {
FileInputStream is;
com.itextpdf.kernel.pdf.PdfReader pdfReader = null;
int pages = 0;
//创建File类
File file = new File(obj.getPdfPath());
//判断文件是否存在
if (file.exists()) {
try {
is = new FileInputStream(file);
pdfReader = new com.itextpdf.kernel.pdf.PdfReader(is);
com.itextpdf.kernel.pdf.PdfDocument redDocument = new com.itextpdf.kernel.pdf.PdfDocument(pdfReader);
pages = redDocument.getNumberOfPages();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return pages;
}
//生成文件名
private String exportFlieName(ExportTaskDetailsVo dto) throws ParseException {
SimpleDateFormat originalFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat targetFormat = new SimpleDateFormat("yyyyMMdd");
Date date = originalFormat.parse(dto.getDischargeDateTime());
String formattedDate = targetFormat.format(date);
return flieName + "_" + dto.getInpNo() + "_" + formattedDate;
}
}

@ -8,38 +8,183 @@ package com.emr.service.ipml;
import com.emr.dao.V_CountMapper;
import com.emr.entity.*;
import com.emr.service.Emr_DictionaryService;
import com.emr.service.V_CountService;
import com.emr.util.ListUtil;
import com.emr.util.Setters;
import com.emr.vo.V_CountVo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Map;
@Service
public class V_CountServiceImpl implements V_CountService {
@Autowired
private V_CountMapper vCountMapper;
@Autowired
private Emr_DictionaryService emrDictionaryService;
// @Override
// public List<V_Count> selectByCol(V_CountVo 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
public List<V_Count> selectByCol(V_CountVo record) {
List<V_Count> counts = vCountMapper.selectByCol(record);
if(!CollectionUtils.isEmpty(counts)){
for(V_Count count :counts){
count.setUnfileNum(count.getOutNum() - count.getFileNum());
List<V_Count> counts = vCountMapper.selectByColCount(record);
//转换科室方法
conversion(counts);
//计算各个科室归档数量
deptFileNum(record, counts);
//计算死亡人数
deptDeathNum(record, counts);
//2日归档率%
deptDay2Rate(record, counts);
//3日归档率%
deptDay3Rate(record, counts);
//计算未归档、归档率、2日归档率%、3日归档率%
for (V_Count list : counts) {
//归档数、2日归档数、3日归档数为null填充0
fillNum(list);
list.setUnfileNum(list.getOutNum() - list.getFileNum());
DecimalFormat df = new DecimalFormat("0.00");
//归档率百分比
if (list.getFileNum() == 0) {
list.setFileRate(0 + "%");
} else {
double fileRate = (double) list.getFileNum() / (double) list.getOutNum();
list.setFileRate(df.format(fileRate * 100) + "%");
}
//2日归档率百分比
if (list.getDay2Rate().equals("0")) {
list.setDay2Rate(0 + "%");
} else {
double day2Rate = (double) Integer.parseInt(list.getDay2Rate()) / (double) list.getFileNum();
list.setDay2Rate(df.format(day2Rate * 100) + "%");
}
//3日归档率百分比
if (list.getDay3Rate().equals("0")) {
list.setDay3Rate(0 + "%");
} else {
double day3Rate = (double) Integer.parseInt(list.getDay3Rate()) / (double) list.getFileNum();
list.setDay3Rate(df.format(day3Rate * 100) + "%");
}
}
return counts;
}
private static void fillNum(V_Count list) {
if (StringUtils.isBlank(String.valueOf(list.getOutNum()))) {
list.setOutNum(0);
}
if (String.valueOf(list.getFileNum()).equals("null")) {
list.setFileNum(0);
}
if (StringUtils.isBlank(list.getDay2Rate())) {
list.setDay2Rate("0");
}
if (StringUtils.isBlank(list.getDay3Rate())) {
list.setDay3Rate("0");
}
}
private void deptDay2Rate(V_CountVo record, List<V_Count> counts) {
List<V_Count> list = vCountMapper.getDay2Rate(record);
//根据科室遍历出院数量
Map<String, V_Count> codeMap = ListUtil.toMap(list, V_Count::getDeptCode);
Setters.<V_Count>instance().list(counts).cycleSetProperties(p -> {
String deptCode = p.getDeptCode();
if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) {
String day2Rate = codeMap.get(deptCode).getDay2Rate();
p.setDay2Rate(day2Rate);
}
});
}
private void deptDay3Rate(V_CountVo record, List<V_Count> counts) {
List<V_Count> list = vCountMapper.getDay3Rate(record);
//根据科室遍历出院数量
Map<String, V_Count> codeMap = ListUtil.toMap(list, V_Count::getDeptCode);
Setters.<V_Count>instance().list(counts).cycleSetProperties(p -> {
String deptCode = p.getDeptCode();
if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) {
String day3Rate = codeMap.get(deptCode).getDay3Rate();
p.setDay3Rate(day3Rate);
}
});
}
@Override
public OffsetLimitPage selectPageByClo(V_CountVo record, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<V_Count> list = selectByCol(record);
return new OffsetLimitPage((Page) list);
}
//转换科室
private void conversion(List<V_Count> vCounts) {
//科室名称转换
Emr_Dictionary dic = new Emr_Dictionary();
dic.setEffective(1);
dic.setTypecode("dept_code");
List<Emr_Dictionary> dicList = emrDictionaryService.dicByTypeCode(dic);
//转换科室
Map<String, Emr_Dictionary> codeMap = ListUtil.toMap(dicList, Emr_Dictionary::getCode);
Setters.<V_Count>instance().list(vCounts).cycleSetProperties(p -> {
String deptCode = p.getDeptCode();
if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) {
String deptName = codeMap.get(deptCode).getName();
p.setDeptName(deptName);
}
});
}
//计算回档数量
private void deptFileNum(V_CountVo record, List<V_Count> counts) {
List<V_Count> fileNumList = vCountMapper.getFileNum(record);
//根据科室遍历出院数量
Map<String, V_Count> codeMap = ListUtil.toMap(fileNumList, V_Count::getDeptCode);
Setters.<V_Count>instance().list(counts).cycleSetProperties(p -> {
String deptCode = p.getDeptCode();
if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) {
Integer fileNum = codeMap.get(deptCode).getFileNum();
p.setFileNum(fileNum);
}
});
}
//计算死亡数量
private void deptDeathNum(V_CountVo record, List<V_Count> counts) {
List<V_Count> fileNumList = vCountMapper.getDeathNum(record);
//根据科室遍历出院数量
Map<String, V_Count> codeMap = ListUtil.toMap(fileNumList, V_Count::getDeptCode);
Setters.<V_Count>instance().list(counts).cycleSetProperties(p -> {
String deptCode = p.getDeptCode();
if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) {
Integer deathNum = codeMap.get(deptCode).getDeathNum();
p.setDeathNum(deathNum);
}
});
}
}

@ -0,0 +1,12 @@
package com.emr.util;
/**
* @InterfaceName FieldSelector
* @Description
* @Author linjj
* @Date 2023/6/29 16:41
* @Version 1.0
*/
public interface FieldSelector<Type, FieldType> {
FieldType select(Type type);
}

@ -0,0 +1,22 @@
package com.emr.util;
import java.util.List;
public class ListPropertySetter<T> {
private final List<T> values;
public ListPropertySetter(List<T> values) {
this.values = values;
}
public List<T> cycleSetProperties(PropertySetter<T> setter) {
if (null == values) return values;
for (T value : values) {
setter.apply(value);
}
return values;
}
}

@ -0,0 +1,73 @@
package com.emr.util;
import org.springframework.util.CollectionUtils;
import java.util.*;
public final class ListUtil {
public static <T, K> Map<K, T> toMap(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyMap();
Map<K, T> map = new HashMap<>(list.size());
for (T t : list) {
K key = selector.select(t);
if (key != null) map.put(key, t);
}
return map;
}
public static <T, K> Map<K, List<T>> groupBy(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyMap();
Map<K, List<T>> map = new HashMap<>();
for (T t : list) {
K key = selector.select(t);
if (key == null) continue;
if (!map.containsKey(key)) {
map.put(key, new ArrayList<T>());
}
map.get(key).add(t);
}
return map;
}
public static <T, K> List<K> select(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
List<K> filedList = new ArrayList<>(list.size());
for (T t : list) {
K key = selector.select(t);
if (key != null) filedList.add(key);
}
return filedList;
}
public static <T, K> List<K> distinctSelect(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
Set<K> filedSet = new HashSet<>();
for (T t : list) {
K key = selector.select(t);
if (key != null) filedSet.add(key);
}
return new ArrayList<>(filedSet);
}
@SafeVarargs
public static <T> List<T> unionWithoutDuplicate(List<T>... values) {
if (null == values || values.length <= 0) return Collections.emptyList();
Set<T> unionFiledSet = new HashSet<>();
for (List<T> value : values) {
if (!CollectionUtils.isEmpty(value)) {
unionFiledSet.addAll(value);
}
}
return new ArrayList<>(unionFiledSet);
}
public static <T, K> List<T> skipDuplicateKey(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
List<T> filedList = new ArrayList<>(list.size());
Map<K, T> map = toMap(list, selector);
for (K key : map.keySet()) {
filedList.add(map.get(key));
}
return filedList;
}
}

@ -0,0 +1,44 @@
package com.emr.util;
import org.springframework.beans.factory.annotation.Value;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Logger {
@Value("${export_pdf_path}")
private String exportPdfPath;
public void log(String info) {
SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd");
String format = dateFormat.format (new Date());
File file = new File (exportPdfPath+format);
if(!file.isDirectory ()){
file.mkdirs ();
}
OutputStream out = null;
try {
out = getOutputStream(file.getAbsolutePath ()+"\\log.log");
out.write(info.getBytes("utf-8"));
out.write("\r\n".getBytes());
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public OutputStream getOutputStream(String localpath) throws IOException {
File file = new File(localpath);
if (!file.exists()) {
file.createNewFile();
return new FileOutputStream(file);
} else {
return new FileOutputStream(file, true);
}
}
}

@ -0,0 +1,7 @@
package com.emr.util;
public interface PropertySetter<T> {
void apply(T t);
}

@ -0,0 +1,14 @@
package com.emr.util;
import java.util.List;
public class Setters<T> {
public static <T> Setters<T> instance() {
return new Setters<>();
}
public ListPropertySetter<T> list(List<T> values) {
return new ListPropertySetter<>(values);
}
}

@ -0,0 +1,19 @@
package com.emr.vo;
import lombok.Data;
/**
* @ClassName ExportPdfVo
* @Description pdf
* @Author linjj
* @Date 2024/4/11 8:47
* @Version 1.0
*/
@Data
public class ExportPdfVo {
private String pdfPath;
private String assortID;
private String assortSort;
private String assortName;
}

@ -0,0 +1,24 @@
package com.emr.vo;
import lombok.Data;
/**
* @ClassName ExportTaskDetailsVo
* @Description
* @Author linjj
* @Date 2024/4/12 14:01
* @Version 1.0
*/
@Data
public class ExportTaskDetailsVo {
private int id;
//任务id
private int taskId;
//住院号
private String inpNo;
//出院日期
private String dischargeDateTime;
}

@ -0,0 +1,26 @@
package com.emr.vo;
import lombok.Data;
/**
* @ClassName ExportTaskVo
* @Description
* @Author linjj
* @Date 2024/4/12 11:37
* @Version 1.0
*/
@Data
public class ExportTaskVo {
//批次id
private int id;
//开始时间
private String startTime;
//结束时间
private String endTime;
//0未开始1正在下载2下载完成
private int taskState;
//完成数量
private int completeNum;
//需求数量
private int needNum;
}

@ -0,0 +1,19 @@
package com.emr.vo;
import lombok.Data;
/**
* @ClassName ExportZdAssortVo
* @Description
* @Author linjj
* @Date 2024/4/10 16:52
* @Version 1.0
*/
@Data
public class ExportZdAssortVo {
private String assortId;
private String assortName;
private String assortSort;
private String exportFlag;
}

@ -1,9 +1,9 @@
#power\u6743\u9650\u7CFB\u7EDFIP\u548C\u7AEF\u53E3
#POWER_IP = localhost
#POWER_PORT = 8081
power\u6743\u9650\u7CFB\u7EDFIP\u548C\u7AEF\u53E3
POWER_IP = localhost
POWER_PORT = 8081
POWER_PORT = 8085
#POWER_IP = 172.16.11.90
#POWER_PORT = 8081
#power\u6743\u9650\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934
POWER_URLHEAD = http://${POWER_IP}:${POWER_PORT}/power
@ -57,3 +57,11 @@ overDateSet = 2021-05-01
#\u5404\u5BA1\u6838\u89D2\u8272\u7528\u6237id 1\uFF1A\u533B\u751F\uFF1B2\uFF1A\u62A4\u58EB\uFF1B3\uFF1A\u75C5\u6848\u5BA4\u4EBA\u5458\uFF1B5\uFF1A\u533B\u751F\u8D28\u63A7\u5458\uFF1B6\uFF1A\u79D1\u4E3B\u4EFB\uFF1B7\uFF1A\u62A4\u58EB\u957F\uFF1B8\uFF1A\u62A4\u58EB\u8D28\u63A7\u5458
export_pdf_path=D://export//
#\u5bfc\u51fa\u4fe1\u606f\u683c\u5f0f\u9700\u8981\u4e3aunicode\u683c\u5f0f\u4e0d\u7136\u4f1a\u4e71\u7801
export_pdf_hospital_info = \u5e7f\u4e1c\u7701_\u5e7f\u4e1c\u533b\u79d1\u5927\u5b66\u9644\u5c5e\u533b\u9662

@ -1,17 +1,17 @@
#\u6570\u636E\u5E93IP
##\u6570\u636E\u5E93IP
#dataBaseIp=172.16.11.90
##\u6570\u636E\u5E93\u540D\u79F0
#dataBaseName=emr_record
##\u6570\u636E\u5E93\u5BC6\u7801
#dataBasePassword=docus@702
\u6570\u636E\u5E93IP
dataBaseIp=localhost
#\u6570\u636E\u5E93\u540D\u79F0
dataBaseName=gm_record
#\u6570\u636E\u5E93\u5BC6\u7801
dataBasePassword=admin123
#\u6570\u636E\u5E93IP
#dataBaseIp=200.100.104.40
##\u6570\u636E\u5E93\u540D\u79F0
#dataBaseName=emr_record
##\u6570\u636E\u5E93\u5BC6\u7801
#dataBasePassword=AbcXyz123
jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc\:sqlserver\://${dataBaseIp}:1433;databaseName=${dataBaseName}
jdbc.username=sa

@ -0,0 +1,14 @@
<?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.BatchExportMapper">
<select id="selectAll" resultType="com.emr.vo.ExportTaskVo">
select * from Export_Task
<where>1=1
<if test="taskState != null">
taskState=#{taskState}
</if>
</where>
</select>
</mapper>

@ -0,0 +1,21 @@
<?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.ExportTaskDetailsMapper">
<update id="upStatc">
update Export_Task_Details set state=#{state} where id=#{id}
</update>
<select id="selectAllByTaskId" resultType="com.emr.vo.ExportTaskDetailsVo">
SELECT id,
taskId,
inpNo,
CONVERT(VARCHAR (100), dischargeDateTime, 23) as dischargeDateTime
FROM Export_Task_Details
WHERE taskId = #{taskId}
AND state = 0
</select>
<select id="getMasterId" resultType="java.lang.String">
select id from Archive_Master where inp_no=#{inpNo} AND CONVERT(VARCHAR (100), discharge_date_time, 23) = #{dischargeDateTime}
</select>
</mapper>

@ -0,0 +1,22 @@
<?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.ExportZdAssortMapper">
<select id="getPdfPath" resultType="com.emr.vo.ExportPdfVo">
SELECT
a.PDF_PATH,
a.AssortID ,
e.assort_sort,
e.gj_assort_name as assortName
FROM
export_zd_assort e
INNER JOIN Archive_Detail a ON a.AssortID= e.assort_id
WHERE
a.MasterID= #{masterID}
AND e.export_flag='1'
ORDER BY e.assort_sort
</select>
<select id="selectAll" resultType="com.emr.vo.ExportZdAssortVo">
select * from export_zd_assort where export_flag='1'
</select>
</mapper>

@ -184,10 +184,56 @@
</if>
</otherwise>
</choose>
<!--<if test="deptName != null and deptName!=''">-->
<!--and deptName = #{deptName,jdbcType=NVARCHAR}-->
<!--</if>-->
order by deptCode
</select>
<select id="selectByColCount" resultType="com.emr.entity.V_Count">
SELECT ISNULL(COUNT(id),0) outNum, dept_name as deptCode
from archive_master
WHERE YEAR (discharge_date_time) != '1801'
GROUP BY dept_name
</select>
<select id="getFileNum" resultType="com.emr.entity.V_Count">
SELECT ISNULL(COUNT(id),0) fileNum,dept_name as deptCode from archive_master WHERE ArchiveState='128' AND YEAR(discharge_date_time) != '1801'
GROUP BY dept_name
</select>
<select id="getDeathNum" resultType="com.emr.entity.V_Count">
SELECT
ISNULL( COUNT ( id ), 0 ) deathNum,
dept_name AS deptCode
FROM
archive_master
WHERE
YEAR ( discharge_date_time ) != '1801'
AND DISCHARGE_DISPOSITION=5
GROUP BY
dept_name
</select>
<select id="getDay2Rate" resultType="com.emr.entity.V_Count">
SELECT
ISNULL( COUNT ( id ), 0 ) day2Rate,
dept_name AS deptCode
FROM
archive_master
WHERE
YEAR ( discharge_date_time ) != '1801'
AND ArchiveState='128'
and ( datediff( d, T1, archive_master.checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), T1, 120 ) AND checked_datetime AND flag = 2 )) &lt;= 2
GROUP BY
dept_name
</select>
<select id="getDay3Rate" resultType="com.emr.entity.V_Count">
SELECT
ISNULL( COUNT ( id ), 0 ) day3Rate,
dept_name AS deptCode
FROM
archive_master
WHERE
YEAR ( discharge_date_time ) != '1801'
AND ArchiveState='128'
and ( datediff( d, T1, archive_master.checked_datetime ) - ( SELECT COUNT(1) FROM emr_holiday_set WHERE date BETWEEN CONVERT ( VARCHAR (10), T1, 120 ) AND checked_datetime AND flag = 2 )) &lt;= 3
GROUP BY
dept_name
</select>
</mapper>

@ -661,13 +661,6 @@ function initTable() {
field: 'fileRate',
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
var val;
if (row.fileRate != null && row.fileRate != '') {
val = Math.round(row.fileRate * 100) + "%";
}
return val;
}
},
{
@ -675,26 +668,12 @@ function initTable() {
field: 'day3Rate',
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
var val;
if (row.day3Rate != null && row.day3Rate != '') {
val = Math.round(row.day3Rate * 100) + "%";
}
return val;
}
},
{
title: '3日归档率%',
field: 'day2Rate',
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
var val;
if (row.day2Rate != null && row.day2Rate != '') {
val = Math.round(row.day2Rate * 100) + "%";
}
return val;
}
},
// {
// title: '5日归档率%',

Loading…
Cancel
Save