feat(dataflow): 补全Chain5 DRG入组引擎调用
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user