diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/dataflow/event/ExamReportPublishedEvent.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/dataflow/event/ExamReportPublishedEvent.java new file mode 100644 index 000000000..ea9373702 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/dataflow/event/ExamReportPublishedEvent.java @@ -0,0 +1,27 @@ +package com.healthlink.his.web.dataflow.event; + +import lombok.Getter; +import org.springframework.context.ApplicationEvent; + +/** + * Chain 9: 检查→报告→医嘱联动 — 检查报告发布事件 + */ +@Getter +public class ExamReportPublishedEvent extends ApplicationEvent { + + private final Long encounterId; + private final Long patientId; + private final Long reportId; + private final String examType; + private final String findingSummary; + + public ExamReportPublishedEvent(Object source, Long encounterId, Long patientId, + Long reportId, String examType, String findingSummary) { + super(source); + this.encounterId = encounterId; + this.patientId = patientId; + this.reportId = reportId; + this.examType = examType; + this.findingSummary = findingSummary; + } +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/dataflow/handler/ExamReportFeedbackHandler.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/dataflow/handler/ExamReportFeedbackHandler.java new file mode 100644 index 000000000..cf81fbc5e --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/dataflow/handler/ExamReportFeedbackHandler.java @@ -0,0 +1,33 @@ +package com.healthlink.his.web.dataflow.handler; + +import com.healthlink.his.web.dataflow.event.ExamReportPublishedEvent; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.event.EventListener; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +/** + * Chain 9: 检查→报告→医嘱联动 — 检查报告发布后反馈处理 + */ +@Slf4j +@Component +public class ExamReportFeedbackHandler { + + @Async + @EventListener + public void onExamReportPublished(ExamReportPublishedEvent event) { + log.info("Chain9 ExamFeedback: encounterId={}, examType={}, reportId={}", + event.getEncounterId(), event.getExamType(), event.getReportId()); + try { + // 1. 将检查结果关联到医嘱 + // TODO: 更新医嘱执行状态 + + // 2. 推送通知给开单医生 + // TODO: WebSocket推送 + + log.info("Chain9 ExamFeedback: feedback recorded for reportId={}", event.getReportId()); + } catch (Exception e) { + log.error("Chain9 ExamFeedback failed: reportId={}", event.getReportId(), e); + } + } +}