feat(empi): 添加EMPI合并日志记录功能

- 引入EmpiMergeLog实体类和IEmpiMergeLogService服务接口
- 在EmpiAppServiceImpl中注入mergeLogService依赖
- 实现合并操作时自动创建合并日志记录
- 记录合并的源患者ID、目标患者ID和合并类型
- 添加合并原因、操作人和合并时间等关键信息
- 确保每次患者合并操作都有完整的审计日志
This commit is contained in:
2026-06-16 14:10:37 +08:00
parent 9a5d772c72
commit 954462272e
2 changed files with 35 additions and 0 deletions

View File

@@ -5,6 +5,8 @@ import com.healthlink.his.administration.domain.Patient;
import com.healthlink.his.administration.service.IPatientService;
import com.healthlink.his.empi.domain.EmpiPerson;
import com.healthlink.his.empi.domain.EmpiPersonIdMapping;
import com.healthlink.his.empi.domain.EmpiMergeLog;
import com.healthlink.his.empi.service.IEmpiMergeLogService;
import com.healthlink.his.empi.service.IEmpiPersonIdMappingService;
import com.healthlink.his.empi.service.IEmpiPersonService;
import com.healthlink.his.web.empi.appservice.IEmpiAppService;
@@ -19,6 +21,7 @@ public class EmpiAppServiceImpl implements IEmpiAppService {
@Autowired private IEmpiPersonService personService;
@Autowired private IEmpiPersonIdMappingService mappingService;
@Autowired private IPatientService patientService;
@Autowired private IEmpiMergeLogService mergeLogService;
@Override
public EmpiPerson registerPerson(EmpiPerson p) {
@@ -42,6 +45,16 @@ public class EmpiAppServiceImpl implements IEmpiAppService {
}
sec.setMergeStatus("MERGED");
personService.updateById(sec);
EmpiMergeLog logRecord = new EmpiMergeLog();
logRecord.setSourcePatientId(primaryId);
logRecord.setTargetPatientId(secId);
logRecord.setMergeType("MERGE");
logRecord.setMergeReason("EMPI合并");
logRecord.setMergeBy("system");
logRecord.setMergeTime(new java.util.Date());
logRecord.setStatus("MERGED");
mergeLogService.save(logRecord);
}
}

View File

@@ -0,0 +1,22 @@
-- V45: Create lab_activity_def_device_def table
-- 检验活动定义与耗材/设备定义关联表
CREATE TABLE IF NOT EXISTS lab_activity_def_device_def (
id BIGINT PRIMARY KEY,
activity_definition_id BIGINT,
device_definition_id BIGINT,
device_definition_name VARCHAR(255),
instrument_id BIGINT,
instrument_name VARCHAR(255),
device_quantity INTEGER DEFAULT 0,
delete_flag VARCHAR(1) DEFAULT '0',
activity_definition_name VARCHAR(255),
create_by VARCHAR(64),
create_time TIMESTAMP,
update_by VARCHAR(64),
update_time TIMESTAMP,
tenant_id INTEGER
);
CREATE INDEX IF NOT EXISTS idx_lab_act_dev_act_def_id ON lab_activity_def_device_def(activity_definition_id);
CREATE INDEX IF NOT EXISTS idx_lab_act_dev_tenant ON lab_activity_def_device_def(tenant_id);