|
|
|
@ -16,6 +16,7 @@ import com.docus.server.util.TableJsonRead;
|
|
|
|
|
import com.docus.server.ydzyy.dto.YdZyyPacsViewCondition;
|
|
|
|
|
import com.docus.server.ydzyy.entity.YdZyyPacsView;
|
|
|
|
|
import com.docus.server.ydzyy.mapper.YdZyyPacsViewMapper;
|
|
|
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
@ -52,6 +53,32 @@ public class PacsCollectJob {
|
|
|
|
|
private YdZyyPacsService ydZyyPacsService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@XxlJob("Ydzyy-CollectPacsByDisDateNotCollected")
|
|
|
|
|
public void collectPacsByDisDateNotCollected(){
|
|
|
|
|
String collectorId = "3";
|
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>英德中医院pacs视图采集,根据出院时间和未采集job,开始任务!");
|
|
|
|
|
int days;
|
|
|
|
|
try {
|
|
|
|
|
String daysStr = XxlJobHelper.getJobParam();
|
|
|
|
|
days=Integer.parseInt(daysStr);
|
|
|
|
|
}catch (Exception ex){
|
|
|
|
|
days=31;
|
|
|
|
|
}
|
|
|
|
|
LocalDate startDate = LocalDate.now().plusDays(-days);
|
|
|
|
|
String startDateTime = startDate.toString()+" 00:00:00";
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
List<TBasic> basicList = tBasicMapper.getNoTaskPatientByDisDate(startDateTime,collectorId);
|
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>英德中医院pacs视图采集,根据出院时间:{} 采集未采集的患者,{} 个",startDateTime,basicList.size());
|
|
|
|
|
for (TBasic basic : basicList) {
|
|
|
|
|
collectPacs(basic);
|
|
|
|
|
}
|
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>英德中医院pacs视图采集,根据出院时间和未采集job,任务结束!");
|
|
|
|
|
}catch (Exception ex){
|
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>英德中医院pacs视图采集,根据出院时间和未采集job,任务异常!"+ex.getMessage(),ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@XxlJob("Ydzyy-CollectPacsByModifyTime")
|
|
|
|
|
public void collectPacsByModifyTime() {
|
|
|
|
|
LocalDateTime jobRunTime = LocalDateTime.now();
|
|
|
|
@ -95,9 +122,25 @@ public class PacsCollectJob {
|
|
|
|
|
log.warn(">>>>>>>>>>>>>>>>>>>>>>>>>>>英德中医院pacs视图采集job,pacs视图数据,未匹配到患者基础数据,请检查!数据:{}", JSON.toJSONString(ydZyyPacsView));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 如果有住院号,住院号一定要匹配,并且根据住院日期倒序取第一个(最大的出院日期)
|
|
|
|
|
tBasicListByPacsCondition = tBasicListByPacsCondition.stream()
|
|
|
|
|
.filter(p -> {
|
|
|
|
|
if (Func.isNotBlank(inpatientNo)) {
|
|
|
|
|
return inpatientNo.equalsIgnoreCase(p.getInpatientNo());
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
if (Func.isEmpty(tBasicListByPacsCondition)) {
|
|
|
|
|
log.warn(">>>>>>>>>>>>>>>>>>>>>>>>>>>英德中医院pacs视图采集job,pacs视图数据,未匹配到患者基础数据,请检查!数据:{}", JSON.toJSONString(ydZyyPacsView));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tBasicListByPacsCondition.size() > 1) {
|
|
|
|
|
log.warn(">>>>>>>>>>>>>>>>>>>>>>>>>>>英德中医院pacs视图采集job,pacs视图数据,匹配到多个患者基础数据,请检查!数据:{}", JSON.toJSONString(ydZyyPacsView));
|
|
|
|
|
return;
|
|
|
|
|
tBasicListByPacsCondition = tBasicListByPacsCondition.stream()
|
|
|
|
|
.sorted(Comparator.comparing(TBasic::getAdmissDate).reversed())
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
TBasic basic = tBasicListByPacsCondition.get(0);
|
|
|
|
|
String patientId = basic.getPatientId();
|
|
|
|
|