|
@@ -1,26 +1,5 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-import java.net.URLEncoder;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Optional;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import javax.servlet.ServletOutputStream;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
-import com.diagbot.util.IntegerUtil;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -58,6 +37,7 @@ import com.diagbot.service.InquiryScaleService;
|
|
|
import com.diagbot.service.impl.InquiryInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.IntegerUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.RespDTOUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
@@ -75,6 +55,24 @@ import com.diagbot.vo.PatientInfoVO;
|
|
|
import com.diagbot.vo.ReadInquiryVO;
|
|
|
import com.diagbot.vo.SaveInquiryToHisVO;
|
|
|
import com.diagbot.vo.SaveInquiryVO;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import javax.servlet.ServletOutputStream;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
+import java.net.URLEncoder;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Optional;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author rengb
|
|
@@ -134,8 +132,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
InquiryInfo inquiryInfo = getOne(inquiryInfoQe, false);
|
|
|
|
|
|
if (inquiryInfo == null) {
|
|
|
- inquiryInfo = new InquiryInfo();
|
|
|
- inquiryInfo.setGmtCreate(now);
|
|
|
+ inquiryInfo = new InquiryInfo();
|
|
|
+ inquiryInfo.setGmtCreate(now);
|
|
|
} else {
|
|
|
inquiryDetailFacade.removeByInquiryId(inquiryInfo.getId());
|
|
|
inquiryDrugFacade.removeByInquiryId(inquiryInfo.getId());
|
|
@@ -148,9 +146,10 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
|
|
|
Long inquiryId = inquiryInfo.getId();
|
|
|
if (ListUtil.isNotEmpty(saveInquiryVO.getDetailList())) {
|
|
|
- List<InquiryDetail> inquiryDetailList = BeanUtil.listCopyTo(saveInquiryVO.getDetailList(), InquiryDetail.class);
|
|
|
- inquiryDetailList.forEach(i->{
|
|
|
- i.setInquiryId(inquiryId);
|
|
|
+ List<InquiryDetail> inquiryDetailList = BeanUtil.listCopyTo(saveInquiryVO.getDetailList(),
|
|
|
+ InquiryDetail.class);
|
|
|
+ inquiryDetailList.forEach(i -> {
|
|
|
+ i.setInquiryId(inquiryId);
|
|
|
i.setGmtCreate(now);
|
|
|
i.setGmtModified(now);
|
|
|
});
|
|
@@ -176,7 +175,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
inquiryEvaluationFacade.save(inquiryEvaluation);
|
|
|
|
|
|
if (ListUtil.isNotEmpty(saveInquiryVO.getInquiryEvaluation().getScaleList())) {
|
|
|
- List<InquiryScale> inquiryScaleList = BeanUtil.listCopyTo(saveInquiryVO.getInquiryEvaluation().getScaleList(), InquiryScale.class);
|
|
|
+ List<InquiryScale> inquiryScaleList = BeanUtil.listCopyTo(
|
|
|
+ saveInquiryVO.getInquiryEvaluation().getScaleList(), InquiryScale.class);
|
|
|
inquiryScaleList.forEach(i -> {
|
|
|
i.setInquiryId(inquiryId);
|
|
|
i.setInquiryEvaluationId(inquiryEvaluation.getId());
|
|
@@ -199,7 +199,7 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
RespDTOUtil.respNGDeal(tranServiceClient.saveInquiryToHis(saveInquiryToHisVO), "问诊记录插入tran层失败");
|
|
|
|
|
|
saveInquiryDTO.setInquiryId(inquiryId);
|
|
|
-
|
|
|
+
|
|
|
return saveInquiryDTO;
|
|
|
}
|
|
|
|
|
@@ -226,7 +226,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
|
|
|
QueryWrapper<InquiryDetail> inquiryDetailQe = new QueryWrapper<>();
|
|
|
inquiryDetailQe.eq("inquiry_id", inquiryInfo.getId());
|
|
|
- readInquiryDTO.setDetailList(inquiryDetailFacade.list(inquiryDetailQe).stream().sorted((a, b) -> a.getType() - b.getType()).collect(Collectors.toList()));
|
|
|
+ readInquiryDTO.setDetailList(inquiryDetailFacade.list(inquiryDetailQe).stream()
|
|
|
+ .sorted((a, b) -> a.getType() - b.getType()).collect(Collectors.toList()));
|
|
|
|
|
|
List<InquiryDrug> inquiryDrugList = inquiryDrugFacade.getInquiryDrugs(inquiryInfo.getId());
|
|
|
|
|
@@ -264,7 +265,7 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("hospitalId", hospitalInfoDTO.getId());
|
|
|
map.put("patientId", patientInfoDTO.getId());
|
|
|
- if (!IntegerUtil.isNull(getLastOtherVO.getSign())){
|
|
|
+ if (!IntegerUtil.isNull(getLastOtherVO.getSign())) {
|
|
|
map.put("sign", getLastOtherVO.getSign());
|
|
|
}
|
|
|
InquiryInfo inquiryInfo = baseMapper.getPatientLast(map);
|
|
@@ -290,21 +291,28 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public IPage<HisInquiryDTO> hisInquirys(HisInquirysVO hisInquirysVO) {
|
|
|
- Page<HisInquiryDTO> hisInquiryDTOPage = new Page<>();
|
|
|
-
|
|
|
+ Page<HisInquiryDTO> hisInquiryDTOPage = new Page<>();
|
|
|
+
|
|
|
QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<>();
|
|
|
inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
inquiryInfoQe.eq("hospital_id", hisInquirysVO.getHospitalId());
|
|
|
- inquiryInfoQe.eq(hisInquirysVO.getHospitalDeptId() != null, "hospital_dept_id", hisInquirysVO.getHospitalDeptId());
|
|
|
- inquiryInfoQe.eq(hisInquirysVO.getDoctorId() != null, "doctor_id", hisInquirysVO.getDoctorId());
|
|
|
- inquiryInfoQe.eq(hisInquirysVO.getPatientId() != null, "patient_id", hisInquirysVO.getPatientId());
|
|
|
- inquiryInfoQe.eq(hisInquirysVO.getType() != null, "type", hisInquirysVO.getType());
|
|
|
- inquiryInfoQe.eq(hisInquirysVO.getSign() != null, "sign", hisInquirysVO.getSign());
|
|
|
- inquiryInfoQe.ge(hisInquirysVO.getStartDate() != null, "gmt_create", hisInquirysVO.getStartDate());
|
|
|
- inquiryInfoQe.le(hisInquirysVO.getEndDate() != null, "gmt_create", hisInquirysVO.getEndDate());
|
|
|
- inquiryInfoQe.orderByDesc(hisInquirysVO.getOrderType() == 1,"gmt_modified");
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getHospitalDeptId() != null,
|
|
|
+ "hospital_dept_id", hisInquirysVO.getHospitalDeptId());
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getDoctorId() != null,
|
|
|
+ "doctor_id", hisInquirysVO.getDoctorId());
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getPatientId() != null,
|
|
|
+ "patient_id", hisInquirysVO.getPatientId());
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getType() != null,
|
|
|
+ "type", hisInquirysVO.getType());
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getSign() != null,
|
|
|
+ "sign", hisInquirysVO.getSign());
|
|
|
+ inquiryInfoQe.ge(hisInquirysVO.getStartDate() != null,
|
|
|
+ "gmt_create", hisInquirysVO.getStartDate());
|
|
|
+ inquiryInfoQe.le(hisInquirysVO.getEndDate() != null,
|
|
|
+ "gmt_create", hisInquirysVO.getEndDate());
|
|
|
+ inquiryInfoQe.orderByDesc(hisInquirysVO.getOrderType() == 1, "gmt_modified");
|
|
|
inquiryInfoQe.orderByAsc(hisInquirysVO.getOrderType() == 2, "gmt_modified");
|
|
|
-
|
|
|
+
|
|
|
if (hisInquirysVO.getDisType() == 1) {
|
|
|
Date nowDate = DateUtil.now();
|
|
|
Date lastDate = DateUtil.addMonth(nowDate, -6);
|
|
@@ -313,19 +321,23 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
inquiryInfoQe.likeRight("diagnose", hisInquirysVO.getDisName());
|
|
|
}
|
|
|
|
|
|
- Page<InquiryInfo> inquiryInfoPage = new Page<>(hisInquirysVO.getCurrent(),hisInquirysVO.getSize());
|
|
|
+ Page<InquiryInfo> inquiryInfoPage = new Page<>(hisInquirysVO.getCurrent(), hisInquirysVO.getSize());
|
|
|
IPage<InquiryInfo> iPage = this.page(inquiryInfoPage, inquiryInfoQe);
|
|
|
- BeanUtil.copyProperties(iPage, hisInquiryDTOPage);
|
|
|
-
|
|
|
+ BeanUtil.copyProperties(iPage, hisInquiryDTOPage);
|
|
|
+
|
|
|
List<InquiryInfo> inquiryInfoList = iPage.getRecords();
|
|
|
if (inquiryInfoList.size() == 0) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- List<Long> hospitalDeptIdList = inquiryInfoList.stream().map(i -> i.getHospitalDeptId()).distinct().collect(Collectors.toList());
|
|
|
- List<Long> doctorIdList = inquiryInfoList.stream().map(i -> i.getDoctorId()).distinct().collect(Collectors.toList());
|
|
|
- List<Long> patientIdList = inquiryInfoList.stream().map(i -> i.getPatientId()).distinct().collect(Collectors.toList());
|
|
|
- List<Long> inquiryIdList = inquiryInfoList.stream().map(i -> i.getId()).distinct().collect(Collectors.toList());
|
|
|
+ List<Long> hospitalDeptIdList = inquiryInfoList.stream()
|
|
|
+ .map(i -> i.getHospitalDeptId()).distinct().collect(Collectors.toList());
|
|
|
+ List<Long> doctorIdList = inquiryInfoList.stream()
|
|
|
+ .map(i -> i.getDoctorId()).distinct().collect(Collectors.toList());
|
|
|
+ List<Long> patientIdList = inquiryInfoList.stream()
|
|
|
+ .map(i -> i.getPatientId()).distinct().collect(Collectors.toList());
|
|
|
+ List<Long> inquiryIdList = inquiryInfoList.stream()
|
|
|
+ .map(i -> i.getId()).distinct().collect(Collectors.toList());
|
|
|
|
|
|
Map<Long, HospitalDept> hospitalDeptMap = hospitalDeptFacade.hospitalDeptInfoMapByIds(hospitalDeptIdList);
|
|
|
Map<Long, DoctorInfo> doctorInfoMap = doctorInfoFacade.doctorInfoMapByIds(doctorIdList);
|
|
@@ -338,8 +350,13 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
BeanUtil.copyProperties(i, hisInquiryDTO);
|
|
|
hisInquiryDTO.setInquiryDate(i.getGmtModified());
|
|
|
hisInquiryDTO.setInquiryTime(i.getGmtModified());
|
|
|
- hisInquiryDTO.setHospitalDeptName(Optional.ofNullable(hospitalDeptMap.get(i.getHospitalDeptId())).map(t -> t.getName()).orElse(null));
|
|
|
- hisInquiryDTO.setDoctorName(Optional.ofNullable(doctorInfoMap.get(i.getDoctorId())).map(t -> t.getName()).orElse(null));
|
|
|
+ hisInquiryDTO.setHospitalDeptName(
|
|
|
+ Optional.ofNullable(hospitalDeptMap.get(i.getHospitalDeptId()))
|
|
|
+ .map(t -> t.getName()).orElse(null)
|
|
|
+ );
|
|
|
+ hisInquiryDTO.setDoctorName(
|
|
|
+ Optional.ofNullable(doctorInfoMap.get(i.getDoctorId())).map(t -> t.getName()).orElse(null)
|
|
|
+ );
|
|
|
PatientInfo patientInfo = patientInfoMap.get(i.getPatientId());
|
|
|
if (patientInfo != null) {
|
|
|
hisInquiryDTO.setPatientName(patientInfo.getName());
|
|
@@ -355,22 +372,22 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
hisInquiryDTOPage.setRecords(hisInquiryDTOList);
|
|
|
return hisInquiryDTOPage;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 急诊-历史病历列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param hisInquirysForJzVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public HisInquirysForJzDTO hisInquirysForJz(HisInquirysForJzVO hisInquirysForJzVO){
|
|
|
- RespDTO<HisInquirysForJzDTO> res = tranServiceClient.hisInquirysForJz(hisInquirysForJzVO);
|
|
|
- RespDTOUtil.respNGDeal(res, "获取急诊历史病历列表失败");
|
|
|
- return res.data;
|
|
|
+ public HisInquirysForJzDTO hisInquirysForJz(HisInquirysForJzVO hisInquirysForJzVO) {
|
|
|
+ RespDTO<HisInquirysForJzDTO> res = tranServiceClient.hisInquirysForJz(hisInquirysForJzVO);
|
|
|
+ RespDTOUtil.respNGDeal(res, "获取急诊历史病历列表失败");
|
|
|
+ return res.data;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 对接-历史病历列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param hisInquirysForDjVO
|
|
|
* @return
|
|
|
*/
|
|
@@ -412,11 +429,14 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- Map<Long, List<InquiryDetail>> inquiryDetailMap = inquiryDetailFacade.getDetailsByInquryIds(inquiryInfoList.stream().map(i -> i.getId()).collect(Collectors.toList()));
|
|
|
- List<HisInquirysForDjDTO> hisInquirysForDjDTOList = BeanUtil.listCopyTo(inquiryInfoList, HisInquirysForDjDTO.class);
|
|
|
+ Map<Long, List<InquiryDetail>> inquiryDetailMap = inquiryDetailFacade.getDetailsByInquryIds(
|
|
|
+ inquiryInfoList.stream().map(i -> i.getId()).collect(Collectors.toList()));
|
|
|
+ List<HisInquirysForDjDTO> hisInquirysForDjDTOList = BeanUtil.listCopyTo(
|
|
|
+ inquiryInfoList, HisInquirysForDjDTO.class);
|
|
|
|
|
|
hisInquirysForDjDTOList.forEach(i -> {
|
|
|
- i.setContentList(inquiryDetailMap.get(i.getId()).stream().map(k -> k.getContentValue()).collect(Collectors.toList()));
|
|
|
+ i.setContentList(inquiryDetailMap.get(i.getId()).stream()
|
|
|
+ .map(k -> k.getContentValue()).collect(Collectors.toList()));
|
|
|
});
|
|
|
|
|
|
return hisInquirysForDjDTOList;
|
|
@@ -431,10 +451,10 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
*/
|
|
|
public GetInquiryDetailDTO getInquiryDetail(GetInquiryDetailVO getInquiryDetailVO) {
|
|
|
GetInquiryDetailDTO getInquiryDetailDTO = new GetInquiryDetailDTO();
|
|
|
-
|
|
|
+
|
|
|
InquiryInfo inquiryInfo = this.getById(getInquiryDetailVO.getInquiryId());
|
|
|
List<InquiryDetail> inquiryDetailList = inquiryDetailFacade.getListByInquryId(getInquiryDetailVO.getInquiryId());
|
|
|
-
|
|
|
+
|
|
|
getInquiryDetailDTO.setDataJson(inquiryInfo.getDataJson());
|
|
|
getInquiryDetailDTO.setDetailList(inquiryDetailList);
|
|
|
|
|
@@ -448,7 +468,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<GetEvaluationsDTO> getEvaluations(GetEvaluationsVO getEvaluationsVO) {
|
|
|
- List<InquiryEvaluation> inquiryEvaluationList = inquiryEvaluationFacade.getEvaluationsByInquiryId(getEvaluationsVO.getInquiryId());
|
|
|
+ List<InquiryEvaluation> inquiryEvaluationList =
|
|
|
+ inquiryEvaluationFacade.getEvaluationsByInquiryId(getEvaluationsVO.getInquiryId());
|
|
|
return BeanUtil.listCopyTo(inquiryEvaluationList, GetEvaluationsDTO.class);
|
|
|
}
|
|
|
|
|
@@ -465,65 +486,67 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
List<InquiryScale> inquiryScaleList = inquiryScaleFacade.list(queryWrapper);
|
|
|
return BeanUtil.listCopyTo(inquiryScaleList, GetEvaluationScalesDTO.class);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 急诊-添加二次诊断
|
|
|
- *
|
|
|
+ *
|
|
|
* @param addDiagnoseSecondVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public Boolean addDiagnoseSecond(AddDiagnoseSecondVO addDiagnoseSecondVO){
|
|
|
- RespDTO<Boolean> res = tranServiceClient.addDiagnoseSecond(addDiagnoseSecondVO);
|
|
|
- RespDTOUtil.respNGDeal(res, "添加二次诊断失败");
|
|
|
- return res.data;
|
|
|
+ public Boolean addDiagnoseSecond(AddDiagnoseSecondVO addDiagnoseSecondVO) {
|
|
|
+ RespDTO<Boolean> res = tranServiceClient.addDiagnoseSecond(addDiagnoseSecondVO);
|
|
|
+ RespDTOUtil.respNGDeal(res, "添加二次诊断失败");
|
|
|
+ return res.data;
|
|
|
}
|
|
|
-
|
|
|
- public void exportInquirys(HttpServletResponse response,ExportInquirysVO exportInquirysVO){
|
|
|
- RespDTO<List<GetExportInquirysDTO>> res = tranServiceClient.getExportInquirys(exportInquirysVO.getInquiryIds());
|
|
|
- RespDTOUtil.respNGDeal(res, "导出病历失败");
|
|
|
- List<GetExportInquirysDTO> getExportInquirysDTOList = res.data;
|
|
|
- HSSFWorkbook workbook = null;
|
|
|
- ServletOutputStream outputStream = null;
|
|
|
- try{
|
|
|
- workbook = new HSSFWorkbook();
|
|
|
- HSSFSheet sheet = workbook.createSheet("统计表");
|
|
|
-
|
|
|
- String[] headers={"序号","性别","年龄","主诉","现病史","其他史","查体","化验","辅检","医嘱","诊断","二次诊断*"};
|
|
|
- HSSFRow headRow = sheet.createRow(0);
|
|
|
- for (int i =0;i <headers.length;i++){
|
|
|
- headRow.createCell(i).setCellValue(headers[i]);
|
|
|
- }
|
|
|
-
|
|
|
- int rowNum=1;
|
|
|
- for(GetExportInquirysDTO getExportInquirysDTO : getExportInquirysDTOList){
|
|
|
- HSSFRow row=sheet.createRow(rowNum);
|
|
|
- row.createCell(0).setCellValue(getExportInquirysDTO.getLineNum());
|
|
|
- row.createCell(1).setCellValue(getExportInquirysDTO.getPatientSex());
|
|
|
- row.createCell(2).setCellValue(getExportInquirysDTO.getPatientAge());
|
|
|
- for(int type=1;type<=9;type++){
|
|
|
- row.createCell(type+2).setCellValue(getExportInquirysDTO.getDetailMap().get(type));
|
|
|
- }
|
|
|
- rowNum++;
|
|
|
- }
|
|
|
-
|
|
|
- String fileName = "data.xls";
|
|
|
+
|
|
|
+ public void exportInquirys(HttpServletResponse response, ExportInquirysVO exportInquirysVO) {
|
|
|
+ RespDTO<List<GetExportInquirysDTO>> res = tranServiceClient.getExportInquirys(exportInquirysVO.getInquiryIds());
|
|
|
+ RespDTOUtil.respNGDeal(res, "导出病历失败");
|
|
|
+ List<GetExportInquirysDTO> getExportInquirysDTOList = res.data;
|
|
|
+ HSSFWorkbook workbook = null;
|
|
|
+ ServletOutputStream outputStream = null;
|
|
|
+ try {
|
|
|
+ workbook = new HSSFWorkbook();
|
|
|
+ HSSFSheet sheet = workbook.createSheet("统计表");
|
|
|
+
|
|
|
+ String[] headers = { "序号", "性别", "年龄", "主诉", "现病史", "其他史",
|
|
|
+ "查体", "化验", "辅检", "医嘱", "诊断", "二次诊断*" };
|
|
|
+ HSSFRow headRow = sheet.createRow(0);
|
|
|
+ for (int i = 0; i < headers.length; i++) {
|
|
|
+ headRow.createCell(i).setCellValue(headers[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ int rowNum = 1;
|
|
|
+ for (GetExportInquirysDTO getExportInquirysDTO : getExportInquirysDTOList) {
|
|
|
+ HSSFRow row = sheet.createRow(rowNum);
|
|
|
+ row.createCell(0).setCellValue(getExportInquirysDTO.getLineNum());
|
|
|
+ row.createCell(1).setCellValue(getExportInquirysDTO.getPatientSex());
|
|
|
+ row.createCell(2).setCellValue(getExportInquirysDTO.getPatientAge());
|
|
|
+ for (int type = 1; type <= 9; type++) {
|
|
|
+ row.createCell(type + 2).setCellValue(getExportInquirysDTO.getDetailMap().get(type));
|
|
|
+ }
|
|
|
+ rowNum++;
|
|
|
+ }
|
|
|
+
|
|
|
+ String fileName = "data.xls";
|
|
|
response.setContentType("application/vnd.ms-excel");
|
|
|
- response.setHeader("Content-Disposition", "attachment;filename="+URLEncoder.encode(fileName, "utf-8"));
|
|
|
+ response.setHeader("Content-Disposition",
|
|
|
+ "attachment;filename=" + URLEncoder.encode(fileName, "utf-8"));
|
|
|
outputStream = response.getOutputStream();
|
|
|
workbook.write(outputStream);
|
|
|
outputStream.close();
|
|
|
- } catch (Exception e){
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
|
|
|
} finally {
|
|
|
- try {
|
|
|
- if(workbook!=null){
|
|
|
- workbook.close();
|
|
|
- }
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
+ try {
|
|
|
+ if (workbook != null) {
|
|
|
+ workbook.close();
|
|
|
+ }
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}
|