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);