feat(dataflow): 新增Chain11 手术→病理送检链路

This commit is contained in:
2026-06-20 22:03:20 +08:00
parent da3b466087
commit da6f03961c
2 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package com.healthlink.his.web.dataflow.event;
import org.springframework.context.ApplicationEvent;
import lombok.Getter;
@Getter
public class PathologySpecimenSubmittedEvent extends ApplicationEvent {
private final Long encounterId;
private final Long patientId;
private final Long surgeryId;
private final String specimenType;
private final String specimenSource;
public PathologySpecimenSubmittedEvent(Object source, Long encounterId, Long patientId, Long surgeryId, String specimenType, String specimenSource) {
super(source);
this.encounterId = encounterId;
this.patientId = patientId;
this.surgeryId = surgeryId;
this.specimenType = specimenType;
this.specimenSource = specimenSource;
}
}

View File

@@ -0,0 +1,40 @@
package com.healthlink.his.web.dataflow.handler;
import com.healthlink.his.web.dataflow.event.PathologySpecimenSubmittedEvent;
import com.healthlink.his.web.dataflow.util.EventRetryUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
@Slf4j
@Component
public class PathologySubmissionHandler {
@Async
@EventListener
public void onSpecimenSubmitted(PathologySpecimenSubmittedEvent event) {
log.info("Chain11 Pathology: encounterId={}, surgeryId={}, specimenType={}",
event.getEncounterId(), event.getSurgeryId(), event.getSpecimenType());
EventRetryUtil.executeVoidWithRetry("11-Pathology", () -> {
Map<String, Object> pathologyOrder = new HashMap<>();
pathologyOrder.put("encounterId", event.getEncounterId());
pathologyOrder.put("patientId", event.getPatientId());
pathologyOrder.put("surgeryId", event.getSurgeryId());
pathologyOrder.put("specimenType", event.getSpecimenType());
pathologyOrder.put("specimenSource", event.getSpecimenSource());
pathologyOrder.put("status", "PENDING_COLLECTION");
// TODO: 保存病理申请到数据库
// TODO: 调用条码服务生成唯一标识
// TODO: WebSocket推送通知病理科接收标本
log.info("Chain11 Pathology: order created for surgeryId={}", event.getSurgeryId());
}, 3);
}
}