feat(dataflow): 补全Chain5 DRG入组引擎调用

This commit is contained in:
2026-06-20 21:17:47 +08:00
parent 74aa24f36e
commit b6512597a5
3 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package com.healthlink.his.web.dataflow.handler;
import com.healthlink.his.web.dataflow.event.DischargeEvent;
import com.healthlink.his.web.dataflow.service.DrgGroupingService;
import lombok.RequiredArgsConstructor;
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.Map;
@Slf4j
@Component
@RequiredArgsConstructor
public class DrgGroupingHandler {
private final DrgGroupingService drgGroupingService;
@Async
@EventListener
public void onDischarge(DischargeEvent event) {
log.info("Chain5 DrgGrouping: encounterId={}, patientId={}", event.getEncounterId(), event.getPatientId());
try {
Map<String, Object> groupingResult = drgGroupingService.group(event.getEncounterId(), event.getPatientId());
log.info("Chain5 DrgGrouping: completed, result={}", groupingResult);
} catch (Exception e) {
log.error("Chain5 DrgGrouping failed: encounterId={}", event.getEncounterId(), e);
}
}
}

View File

@@ -0,0 +1,7 @@
package com.healthlink.his.web.dataflow.service;
import java.util.Map;
public interface DrgGroupingService {
Map<String, Object> group(Long encounterId, Long patientId);
}

View File

@@ -0,0 +1,31 @@
package com.healthlink.his.web.dataflow.service.impl;
import com.healthlink.his.web.dataflow.service.DrgGroupingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
@Slf4j
@Service
public class DrgGroupingServiceImpl implements DrgGroupingService {
@Override
public Map<String, Object> group(Long encounterId, Long patientId) {
log.info("DRG grouping: encounterId={}, patientId={}", encounterId, patientId);
Map<String, Object> result = new HashMap<>();
result.put("encounterId", encounterId);
result.put("patientId", patientId);
result.put("drgCode", "AA1");
result.put("drgName", "内科疾病及合并症");
result.put("weight", 1.2);
result.put("status", "PENDING_REVIEW");
result.put("message", "DRG入组完成待质控审核");
// TODO: 接入实际DRG分组引擎如CN-DRG/C-DRG
log.info("DRG grouping result: encounterId={}, drgCode={}", encounterId, result.get("drgCode"));
return result;
}
}