feat: 新增封存病案 手麻 病历采集

docus-active-query-service_1.3
wyb 2 years ago
parent d3bee3e3e7
commit 15c550a924

@ -104,4 +104,22 @@ public class SealReportCollectController {
}
@ApiOperation("手麻采集接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "sealId", value = "t_seal 的seal_id,封存id", required = true, dataTypeClass = String.class)
})
@GetMapping("/surgicalAnesthesia")
public CommonResult<String> collectSealSurgicalAnesthesia(@RequestParam("sealId") String sealId) {
log.info("封存病案采集 手麻 病历,封存id为{}", sealId);
try {
bgtsService.collectSealSurgicalAnesthesia(sealId);
log.info("封存病案采集 手麻 病历,封存id:{} 采集完成", sealId);
return CommonResult.success("采集完成");
} catch (Exception e) {
log.error("封存id" + sealId + " 封存病案采集 手麻 病历,出现异常!", e);
return CommonResult.failed(e.getMessage());
}
}
}

@ -8,6 +8,14 @@ public interface IBgtsService {
*/
void collectSealIcu(String sealId) throws Exception;
/**
* id
* @date 2024/1/11 10:27
* @author YongBin Wen
* @param sealId id
*/
void collectSealSurgicalAnesthesia(String sealId) throws Exception;
/**
*
* @param empId

@ -147,6 +147,78 @@ public class BgtsServiceImpl implements IBgtsService {
}
}
@Override
public void collectSealSurgicalAnesthesia(String sealId) throws Exception {
TSeal seal = getSealAndCheckBySealId(sealId);
String jzh = seal.getJzh();
String assortid = String.valueOf(FileUtils.getJsonByName("assortid"));
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
int filesource = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource")));
int filestoragetype = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype")));
SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);
String indexFlag = String.valueOf(FileUtils.getJsonByName("indexFlag"));
String serialnum = String.valueOf(FileUtils.getJsonByName("serialnum"));
String filetitle = String.valueOf(FileUtils.getJsonByName("filetitle"));
String downurl = String.valueOf(FileUtils.getJsonByName("downurl"));
List<String> fieldArr = new ArrayList<>();
fieldArr.add(indexFlag);
fieldArr.add(serialnum);
if (StringUtils.isNotBlank(filetitle)) {
fieldArr.add(filetitle);
}
fieldArr.add(downurl);
String namespace = String.valueOf(FileUtils.getJsonByName("namespace"));
String tableName = String.valueOf(FileUtils.getJsonByName("tableName"));
// String collectTimeName = String.valueOf(FileUtils.getJsonByName("collectTimeName"));
// 获取过滤报告单
String[] filterReports = String.valueOf(FileUtils.getJsonByName("filterReport")).split(",");
HashSet<String> filterReportSet = new HashSet<>();
Collections.addAll(filterReportSet, filterReports);
List<Map> viewDataList = vDocumentPdfMapper.collectByJzh(indexFlag, jzh, namespace, tableName, fieldArr);
if (CollUtil.isEmpty(viewDataList)) {
logger.info("封存id{} ,根据记账号:{},采集手麻视图:{},没有采集到数据!", sealId, jzh, namespace + "." + tableName);
return;
}
logger.info("封存id{} ,根据记账号:{},采集手麻视图:{},数据为:{}", sealId, jzh, namespace + "." + tableName, JSON.toJSON(viewDataList));
for (Map map : viewDataList) {
String reportFileTitle = String.valueOf(map.get(filetitle));
// 如果存在过滤报告单名单,不采集;
if (filterReportSet.contains(reportFileTitle)) {
continue;
}
ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto();
reportDownPatientDto.setPatientid(seal.getPatientId());
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(String.valueOf(map.get(downurl)));
reportDownScanFileDto.setFilestoragetype(filestoragetype);
reportDownScanFileDto.setFilesource(filesource);
reportDownScanFileDto.setFiletitle(map.get(filetitle) == null ? "重症" + (System.currentTimeMillis()) : reportFileTitle);
reportDownScanFileDto.setSerialnum(StringUtils.isNotBlank(String.valueOf(map.get(serialnum))) ? String.valueOf(map.get(serialnum)) : String.valueOf(idWorker.nextId()));
List<ReportDownScanFileDto> reportDownScanFileDtos = Collections.singletonList(reportDownScanFileDto);
ReportDownDto reportDownDto = new ReportDownDto();
reportDownDto.setCollectorid(collectorid);
reportDownDto.setAssortid(assortid);
reportDownDto.setPatient(reportDownPatientDto);
reportDownDto.setScanfiles(reportDownScanFileDtos);
afCollectTaskService.insert(reportDownDto);
//String uploadConnector = String.valueOf(FileUtils.getJsonByName("uploadConnector"));
// 调用封存病案上报接口
downloadPlatformRpc.sealReport(reportDownDto);
}
}
@Override
public void collect(String empId) throws Exception {
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));

Loading…
Cancel
Save