| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import java.io.FileOutputStream; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.BaseTagMapper; |
| | | import com.smartor.mapper.PatArchiveMapper; |
| | | import com.smartor.mapper.PatArchivetagMapper; |
| | | import com.smartor.service.IPatArchiveService; |
| | | import com.smartor.service.IPatMedInhospService; |
| | | import com.smartor.service.IPatMedOuthospService; |
| | | import com.smartor.service.IPatMedPhysicalService; |
| | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.poi.hssf.usermodel.HSSFDateUtil; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.ss.usermodel.DataFormatter; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.smartor.mapper.PatArchiveMapper; |
| | | import com.smartor.service.IPatArchiveService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.FileOutputStream; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 患者档案Service业务层处理 |
| | |
| | | @Override |
| | | public Integer insertPatArchive(PatArchive patArchive) { |
| | | patArchive.setCreateTime(DateUtils.getNowDate()); |
| | | List<PatArchive> patArchives = new ArrayList<>(); |
| | | patArchives.add(patArchive); |
| | | patArchiveMapper.insertPatArchive(patArchives); |
| | | if (CollectionUtils.isNotEmpty(patArchives)) { |
| | | patArchives.get(0).getId(); |
| | | log.info("患者id为: {}", patArchives.get(0).getId()); |
| | | return patArchives.get(0).getId().intValue(); |
| | | patArchiveMapper.insertPatArchiveSingle(patArchive); |
| | | return patArchive.getId().intValue(); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean update(PatArchive patArchive) { |
| | | int i = patArchiveMapper.updatePatArchive(patArchive); |
| | | if (i != 1) { |
| | | return false; |
| | | } |
| | | return null; |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | return patArchiveMapper.deletePatArchiveByPatid(patid); |
| | | } |
| | | |
| | | /** |
| | | * 获取患者信息 |
| | | * |
| | | * @param patArchiveReq |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ServiceSubtask> getPatientInfo(PatArchiveReq patArchiveReq) { |
| | | List<ServiceSubtask> serviceSubtaskList = new ArrayList<>(); |
| | | |
| | | List<PatArchive> patArchiveList = new ArrayList<>(); |
| | | if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 1) { |
| | | // 查看住院 1 查看门诊 2 查看体检 3 |
| | | List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhosp(patArchiveReq); |
| | | if (CollectionUtils.isNotEmpty(patArchives1)) { |
| | | patArchiveList.addAll(patArchives1); |
| | | } |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 2) { |
| | | // 查看住院 1 查看门诊 2 查看体检 3 |
| | | List<PatArchive> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthosp(patArchiveReq); |
| | | if (CollectionUtils.isNotEmpty(patArchives2)) { |
| | | patArchiveList.addAll(patArchives2); |
| | | } |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 3) { |
| | | // 查看住院 1 查看门诊 2 查看体检 3 |
| | | List<PatArchive> patArchives3 = patArchiveMapper.selectPatArchiveInfoByPhysical(patArchiveReq); |
| | | if (CollectionUtils.isNotEmpty(patArchives3)) { |
| | | patArchiveList.addAll(patArchives3); |
| | | } |
| | | } |
| | | for (PatArchive patArchive : patArchiveList) { |
| | | ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(patArchive, ServiceSubtask.class); |
| | | serviceSubtask.setCreateTime(patArchive.getCreateTime()); |
| | | serviceSubtask.setCreateBy(patArchive.getCreateBy()); |
| | | serviceSubtask.setDeptname(patArchive.getDept()); |
| | | serviceSubtask.setPhone(patArchive.getTelcode()); |
| | | serviceSubtaskList.add(serviceSubtask); |
| | | } |
| | | |
| | | return serviceSubtaskList; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public PatUpInfoVO importFilehandle(SysUser user, String tags, MultipartFile file) { |