feat(dataflow): 新增Chain10 入院评估→护理计划自动生成
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
package com.healthlink.his.web.dataflow.event;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chain 10: 入院评估→护理计划自动生成 — 入院评估完成事件
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public class AdmissionAssessmentCompletedEvent extends ApplicationEvent {
|
||||||
|
|
||||||
|
private final Long encounterId;
|
||||||
|
private final Long patientId;
|
||||||
|
private final Long assessmentId;
|
||||||
|
private final String riskLevel;
|
||||||
|
|
||||||
|
public AdmissionAssessmentCompletedEvent(Object source, Long encounterId, Long patientId, Long assessmentId, String riskLevel) {
|
||||||
|
super(source);
|
||||||
|
this.encounterId = encounterId;
|
||||||
|
this.patientId = patientId;
|
||||||
|
this.assessmentId = assessmentId;
|
||||||
|
this.riskLevel = riskLevel;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.healthlink.his.web.dataflow.handler;
|
||||||
|
|
||||||
|
import com.healthlink.his.web.dataflow.event.AdmissionAssessmentCompletedEvent;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chain 10: 入院评估→护理计划自动生成 — 根据风险等级自动生成护理计划
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class NursingPlanAutoGenerateHandler {
|
||||||
|
|
||||||
|
@Async
|
||||||
|
@EventListener
|
||||||
|
public void onAssessmentCompleted(AdmissionAssessmentCompletedEvent event) {
|
||||||
|
log.info("Chain10 NursingPlan: encounterId={}, riskLevel={}",
|
||||||
|
event.getEncounterId(), event.getRiskLevel());
|
||||||
|
try {
|
||||||
|
Map<String, Object> nursingPlan = new HashMap<>();
|
||||||
|
nursingPlan.put("encounterId", event.getEncounterId());
|
||||||
|
nursingPlan.put("patientId", event.getPatientId());
|
||||||
|
nursingPlan.put("assessmentId", event.getAssessmentId());
|
||||||
|
nursingPlan.put("riskLevel", event.getRiskLevel());
|
||||||
|
nursingPlan.put("status", "ACTIVE");
|
||||||
|
|
||||||
|
// TODO: 根据风险等级生成具体护理措施
|
||||||
|
|
||||||
|
log.info("Chain10 NursingPlan: plan generated for encounterId={}", event.getEncounterId());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Chain10 NursingPlan failed: encounterId={}", event.getEncounterId(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user