feat: 扫描分支添加封存病案上传

collector-patient-scan
wyb 2 years ago
parent 3c544dae7d
commit e553ed947c

@ -0,0 +1,66 @@
package com.docus.server.collect.entity;
import com.docus.server.collect.service.dto.ReportFileInfoDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2023-05-16
*/
@Data
@ApiModel(value="TSeal对象", description="在院封存")
public class TSeal implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "在院封存病案主键")
private String patientId;
@ApiModelProperty(value = "封存id")
private String sealId;
@ApiModelProperty(value = "住院号")
private String inpatientNo;
@ApiModelProperty(value = "住院就诊号")
private String jzh;
@ApiModelProperty(value = "患者姓名")
private String name;
@ApiModelProperty(value = "住院时间")
private Date admissDate;
@ApiModelProperty(value = "封存时间")
private Date sealDate;
@ApiModelProperty(value = "文件来源")
private Integer fileSource;
@ApiModelProperty(value = "就诊次数")
private Integer admissTimes;
@ApiModelProperty(value = "纸质是否签名 0否 1是")
private Integer signinfo;
@ApiModelProperty(value = "备注")
private String remark;
public TSeal() {
}
public TSeal(ReportFileInfoDTO dto) {
this.patientId=dto.getPatientId();
this.jzh = dto.getJzh();
this.inpatientNo = dto.getInpatientNo();
this.admissTimes = dto.getAdmisstimes();
}
}

@ -18,4 +18,8 @@ public interface DownloadPlatformService {
@ApiOperation("病案上报文件(通用)")
@RequestMapping(value = "/api/downplatform/report",method = RequestMethod.POST)
public CommonResult report(@RequestBody ReportDownDto resources);
@ApiOperation("封存病历上报文件(省中医使用)")
@RequestMapping(value = "/api/downplatform/sealReport",method = RequestMethod.POST)
public CommonResult sealReport(@RequestBody ReportDownDto resources);
}

@ -2,6 +2,7 @@ package com.docus.server.collect.infrastructure.dao;
import com.docus.infrastructure.core.db.dao.IBaseDao;
import com.docus.server.collect.entity.DownloadTask;
import com.docus.server.collect.entity.TSeal;
/**
* -访
@ -39,4 +40,13 @@ public interface DownloadTaskDao extends IBaseDao<DownloadTask> {
* @return idid
*/
Long getDownloadTaskIdFromDownFile(String patientId, String source, String serialNum);
/**
*
* @date 2024/1/10 16:52
* @author YongBin Wen
* @param seal
* @return com.docus.server.collect.entity.TSeal
*/
TSeal findSealByCondition(TSeal seal);
}

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.db.dao.impl.BaseDaoImpl;
import com.docus.server.collect.entity.DownloadTask;
import com.docus.server.collect.entity.TSeal;
import com.docus.server.collect.infrastructure.dao.DownloadTaskDao;
import com.docus.server.collect.infrastructure.mapper.DownloadTaskMapper;
import org.springframework.stereotype.Repository;
@ -44,4 +45,9 @@ public class DownloadTaskDaoImpl extends BaseDaoImpl<DownloadTaskMapper, Downloa
public Long getDownloadTaskIdFromDownFile(String patientId, String source, String serialNum) {
return baseMapper.getDownloadTaskIdFromDownFile(patientId, source, serialNum);
}
@Override
public TSeal findSealByCondition(TSeal seal) {
return baseMapper.findSealByCondition(seal);
}
}

@ -3,6 +3,7 @@ package com.docus.server.collect.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.collect.entity.DownloadTask;
import com.docus.server.collect.entity.TSeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -25,4 +26,14 @@ public interface DownloadTaskMapper extends BaseMapper<DownloadTask> {
* @return idid
*/
Long getDownloadTaskIdFromDownFile(@Param("patientId") String patientId, @Param("source") String source, @Param("serialNum") String serialNum);
/**
*
*
* @param seal
* @return com.docus.server.collect.entity.TSeal
* @date 2024/1/10 16:52
* @author YongBin Wen
*/
TSeal findSealByCondition(@Param("seal") TSeal seal);
}

@ -15,6 +15,14 @@ public interface FileReportService {
*/
void saveDownloadTaskAndReport(ReportFileInfoDTO fileInfoDTO);
/**
*
* | t_seal
* @param fileInfoDTO
*/
void saveDownloadTaskAndSealReport(ReportFileInfoDTO fileInfoDTO);
/**
* idid
* patientIdpatientId

@ -10,6 +10,7 @@ import com.docus.server.collect.converter.FileReportConverter;
import com.docus.server.collect.dto.TBasicQrDto;
import com.docus.server.collect.entity.DownloadTask;
import com.docus.server.collect.entity.TBasic;
import com.docus.server.collect.entity.TSeal;
import com.docus.server.collect.infrastructure.client.DownloadPlatformService;
import com.docus.server.collect.infrastructure.client.dto.ReportDownDto;
import com.docus.server.collect.infrastructure.dao.DownloadTaskDao;
@ -70,6 +71,27 @@ public class FileReportServiceImpl implements FileReportService {
report(downloadTask);
}
@Override
public void saveDownloadTaskAndSealReport(ReportFileInfoDTO fileInfoDTO) {
// TODO 封存病案
TSeal sealCondition = new TSeal(fileInfoDTO);
// 查询基础数据,更新新的病案信息
TSeal seal = downloadTaskDao.findSealByCondition(sealCondition);
// 如果找到患者基础数据并且刚好为1条
fileInfoDTO.setPatientId(seal.getPatientId());
fileInfoDTO.setInpatientNo(seal.getInpatientNo());
fileInfoDTO.setAdmisstimes(seal.getAdmissTimes());
fileInfoDTO.setJzh(seal.getJzh());
// 转换下载任务对象
DownloadTask downloadTask = fileReportConverter.convertDownloadTask(fileInfoDTO, 2);
// 查询旧的下载任务id,更新/保存任务信息
Long downloadTaskId = Optional.ofNullable(getDownloadTaskId(downloadTask)).orElse(idService.getDateSeq());
downloadTask.setId(downloadTaskId);
downloadTaskDao.saveOrUpdate(downloadTask);
reportSeal(downloadTask);
}
private TBasicQrDto convertTbasicQrDto(ReportFileInfoDTO fileInfoDTO) {
String patientId = fileInfoDTO.getPatientId();
String jzh = fileInfoDTO.getJzh();
@ -128,4 +150,26 @@ public class FileReportServiceImpl implements FileReportService {
}
});
}
/**
*
*
* @param downloadTask
*/
private void reportSeal(DownloadTask downloadTask) {
threadPoolExecutor.execute(() -> {
if (downloadTask.getBasicDataType().equals(2)) {
ReportDownDto reportDownDto = fileReportConverter.convertDownloadPlatformParam(downloadTask);
String paramJson = Func.toJson(reportDownDto);
try {
log.info("封存病案上报文件,参数:{}", paramJson);
CommonResult result = downloadPlatformService.sealReport(reportDownDto);
log.info("封存病案上报文件,返回结果:{}", Func.toJson(result));
} catch (Exception ex) {
log.error("封存病案上报文件发生未知错误,参数:" + paramJson, ex);
}
}
});
}
}

@ -25,5 +25,18 @@
order by `create_time` desc limit 1
</select>
<select id="findSealByCondition" resultType="com.docus.server.collect.entity.TSeal">
SELECT *
FROM
`docus_medicalrecord`.`t_seal`
where
1=1
<if test="seal.sealId != null and seal.sealId != ''">
AND seal_id=#{seal.sealId}
</if>
<if test="seal.patientId != null and seal.patientId != ''">
AND patient_id=#{seal.patientId}
</if>
</select>
</mapper>

Loading…
Cancel
Save