From 954462272e2cde4d73ad13d07d849ee7d1f9ba71 Mon Sep 17 00:00:00 2001 From: chenqi Date: Tue, 16 Jun 2026 14:10:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(empi):=20=E6=B7=BB=E5=8A=A0EMPI=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入EmpiMergeLog实体类和IEmpiMergeLogService服务接口 - 在EmpiAppServiceImpl中注入mergeLogService依赖 - 实现合并操作时自动创建合并日志记录 - 记录合并的源患者ID、目标患者ID和合并类型 - 添加合并原因、操作人和合并时间等关键信息 - 确保每次患者合并操作都有完整的审计日志 --- .../appservice/impl/EmpiAppServiceImpl.java | 13 +++++++++++ .../V46__lab_activity_def_device_def.sql | 22 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V46__lab_activity_def_device_def.sql diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/empi/appservice/impl/EmpiAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/empi/appservice/impl/EmpiAppServiceImpl.java index fe7320c4f..7f165320e 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/empi/appservice/impl/EmpiAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/empi/appservice/impl/EmpiAppServiceImpl.java @@ -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); } } diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V46__lab_activity_def_device_def.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V46__lab_activity_def_device_def.sql new file mode 100644 index 000000000..da3a0d80c --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V46__lab_activity_def_device_def.sql @@ -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);