feat: 新增封存病案 内镜 病历采集

docus-active-query-service_1.3
wyb 2 years ago
parent a3964beaf8
commit bb5a4a552e

@ -76,9 +76,7 @@ public class SealReportCollectController {
public CommonResult<String> collectSealEndoscopy(@RequestParam("sealId") String sealId) {
log.info("封存病案采集 内镜 病历,封存id为{}", sealId);
try {
// todo 内镜
// bgtsService.collect(empId);
// bgtsService.collectSealEndoscopy(sealId);
bgtsService.collectSealEndoscopy(sealId);
log.info("封存病案采集 内镜 病历,封存id:{} 采集完成", sealId);
return CommonResult.success("采集完成");
} catch (Exception e) {

@ -6,6 +6,14 @@ public interface IBgtsService {
*/
void collect(String empId) throws Exception;
/**
* id
* @date 2024/1/11 10:27
* @author YongBin Wen
* @param sealId id
*/
void collectSealEndoscopy(String sealId) throws Exception;
void collectPacs(String empId,String admissDate,String disDate,String times) throws Exception;
/**

@ -33,6 +33,7 @@ import org.dom4j.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayInputStream;
import java.text.ParseException;
@ -84,11 +85,15 @@ public class BgtsServiceImpl implements IBgtsService {
public void collect(String empId) throws Exception {
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
List<String[]> exams = new ArrayList<>();
Map<String, Date> map = afCollectAddMapper.selectDate(empId);
SimpleDateFormat sdf = new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString());
String beginDate = sdf.format(map.get("admiss_date"));
String endDate = sdf.format(map.get("dis_date"));
//通过empId获取报告单号集合
if (collectorid.equals("14")){
exams = getExamNoNj(empId);
exams = getExamNoNj(empId,beginDate,endDate);
}else {
exams = getExamNo(empId);
exams = getExamNo(empId,beginDate,endDate);
}
@ -100,6 +105,36 @@ public class BgtsServiceImpl implements IBgtsService {
collectExams(exams, empId, reportDownDto);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void collectSealEndoscopy(String sealId) throws Exception {
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
TSeal seal = getSealAndCheckBySealId(sealId);
String jzh = seal.getJzh();
Date admissDate = seal.getAdmissDate();
Date disDate = getDisDateByJzh(jzh);
disDate = Objects.isNull(disDate) ? new Date() : disDate;
SimpleDateFormat sdf = new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString());
String beginDate = sdf.format(admissDate);
String endDate = sdf.format(disDate);
List<String[]> exams;
//通过empId获取报告单号集合
if (collectorid.equals("14")) {
exams = getExamNoNj(jzh, beginDate, endDate);
} else {
exams = getExamNo(jzh, beginDate, endDate);
}
//获取插入表数据
ReportDownDto reportDownDto = sealGetUrlCreateReportDto(exams, seal.getPatientId());
//插入文件af_collect_task表数据
afCollectTaskService.insert(reportDownDto);
//文件上报
downloadPlatformRpc.sealReport(reportDownDto);
}
@Override
public void collectPacs(String empId, String admissDate, String disDate, String times) throws Exception {
SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
@ -123,6 +158,7 @@ public class BgtsServiceImpl implements IBgtsService {
}
@Override
@Transactional(rollbackFor = Exception.class)
public void collectSealPacs(String sealId) throws Exception{
TSeal seal = getSealAndCheckBySealId(sealId);
@ -144,7 +180,7 @@ public class BgtsServiceImpl implements IBgtsService {
ReportDownDto reportDownDto = sealGetUrlCreateReportDto(exams, seal.getPatientId());
//插入文件af_collect_task表数据
afCollectTaskService.insert(reportDownDto);
//通过报告单号集合采集
//文件上报
downloadPlatformRpc.sealReport(reportDownDto);
}
@ -167,6 +203,7 @@ public class BgtsServiceImpl implements IBgtsService {
}
@Override
@Transactional(rollbackFor = Exception.class)
public void collectSealEcg(String sealId) throws Exception{
TSeal seal = getSealAndCheckBySealId(sealId);
String jzh = seal.getJzh();
@ -186,7 +223,7 @@ public class BgtsServiceImpl implements IBgtsService {
ReportDownDto reportDownDto = sealGetUrlCreateReportDto(exams, seal.getPatientId());
//插入文件af_collect_task表数据
afCollectTaskService.insert(reportDownDto);
//通过报告单号集合采集
//文件上报
downloadPlatformRpc.sealReport(reportDownDto);
}
@ -768,17 +805,17 @@ public class BgtsServiceImpl implements IBgtsService {
/**
* empId
*
* @param empId
* @param jzh
* @return
*/
private List<String[]> getExamNo(String empId) throws Exception {
private List<String[]> getExamNo(String jzh,String beginDate,String endDate) throws Exception {
List<String[]> exams = new ArrayList<>();
XmlUtils reqXmlUtils = new XmlUtils(FileUtils.getXmlPath());
Element reqElement = reqXmlUtils.getMsgElement();
Map<String, Date> map = afCollectAddMapper.selectDate(empId);
reqElement.element("INHOSP_NO").setText(empId);
reqElement.element("BEGIN_DATE").setText(new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString()).format(map.get("admiss_date")));
reqElement.element("END_DATE").setText(new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString()).format(map.get("dis_date")));
reqElement.element("INHOSP_NO").setText(jzh);
reqElement.element("BEGIN_DATE").setText(beginDate);
reqElement.element("END_DATE").setText(endDate);
logger.info("-------根据患者主索引号查询多个报告单号,地址:" + wsUrl + ",方法:" + wsLocalMethod + "---------");
String xml = reqXmlUtils.getDocument().asXML();
logger.info("---------------------------");
@ -820,17 +857,17 @@ public class BgtsServiceImpl implements IBgtsService {
/**
* empId
*
* @param empId
* @param jzh
* @return
*/
private List<String[]> getExamNoNj(String empId) throws Exception {
private List<String[]> getExamNoNj(String jzh,String beginDate,String endDate) throws Exception {
List<String[]> exams = new ArrayList<>();
XmlUtils reqXmlUtils = new XmlUtils(FileUtils.getXmlPath());
Element reqElement = reqXmlUtils.getMsgElement();
Map<String, Date> map = afCollectAddMapper.selectDate(empId);
reqElement.element("INHOSP_NO").setText(empId);
reqElement.element("BEGIN_DATE").setText(new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString()).format(map.get("admiss_date")));
reqElement.element("END_DATE").setText(new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString()).format(map.get("dis_date")));
reqElement.element("INHOSP_NO").setText(jzh);
reqElement.element("BEGIN_DATE").setText(beginDate);
reqElement.element("END_DATE").setText(endDate);
logger.info("-------根据患者主索引号查询多个报告单号,地址:" + wsUrl + ",方法:" + wsLocalMethod + "---------");
String xml = reqXmlUtils.getDocument().asXML();
logger.info("---------------------------");

Loading…
Cancel
Save