feat(dataflow): 新增Chain8 手术→术后恢复链路

This commit is contained in:
2026-06-20 21:25:27 +08:00
parent d53448fcfb
commit 5cfe484015
2 changed files with 57 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,37 @@
package com.healthlink.his.web.dataflow.handler;
import com.healthlink.his.web.dataflow.event.SurgeryCompletedEvent;
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 PostSurgeryRecoveryHandler {
@Async
@EventListener
public void onSurgeryCompleted(SurgeryCompletedEvent event) {
log.info("Chain8 PostSurgery: encounterId={}, surgeryId={}, type={}",
event.getEncounterId(), event.getSurgeryId(), event.getSurgeryType());
try {
Map<String, Object> recoveryPlan = new HashMap<>();
recoveryPlan.put("encounterId", event.getEncounterId());
recoveryPlan.put("surgeryId", event.getSurgeryId());
recoveryPlan.put("planType", "POST_SURGERY");
recoveryPlan.put("status", "ACTIVE");
// TODO: 保存术后护理计划到数据库
// TODO: 根据手术类型生成术后医嘱
log.info("Chain8 PostSurgery: recovery plan created for encounterId={}", event.getEncounterId());
} catch (Exception e) {
log.error("Chain8 PostSurgery failed: surgeryId={}", event.getSurgeryId(), e);
}
}
}