From 5a227014fea0415d0771b68cb41340ae67762926 Mon Sep 17 00:00:00 2001 From: chenqi Date: Wed, 17 Jun 2026 11:02:18 +0800 Subject: [PATCH 1/9] =?UTF-8?q?fix(surgery):=20#684=20=E6=89=8B=E6=9C=AF?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=8B=E6=8B=89=E6=A1=86=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=20-=20=E6=B8=85=E7=90=86=E5=AD=97=E5=85=B8=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._bug684_fix_surgery_status_dict_duplicates.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0617__bug684_fix_surgery_status_dict_duplicates.sql diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0617__bug684_fix_surgery_status_dict_duplicates.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0617__bug684_fix_surgery_status_dict_duplicates.sql new file mode 100644 index 000000000..b8c0cff64 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0617__bug684_fix_surgery_status_dict_duplicates.sql @@ -0,0 +1,15 @@ +-- Bug #684: 手术状态下拉框有重复 +-- 原因:sys_dict_data 中 surgery_status 类型存在重复记录(每个 dict_value 有3条) +-- 修复:删除重复记录,每个 dict_value 只保留 dict_code 最小的一条 + +DELETE FROM sys_dict_data +WHERE dict_code IN ( + SELECT dict_code + FROM ( + SELECT dict_code, + ROW_NUMBER() OVER (PARTITION BY dict_type, dict_value ORDER BY dict_code ASC) as rn + FROM sys_dict_data + WHERE dict_type = 'surgery_status' + ) t + WHERE rn > 1 +); From a2e607caf48edf0411ae201bfdc8c7d88ec54de4 Mon Sep 17 00:00:00 2001 From: chenqi Date: Wed, 17 Jun 2026 11:24:16 +0800 Subject: [PATCH 2/9] =?UTF-8?q?chore(db):=20=E7=A7=BB=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=81=E7=A7=BB=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除患者管理字段缺失修复脚本 V2026_0608_1 - 移除文化程度字典类型添加脚本 V2026_0608_2 - 移除HisBaseEntity列缺失修复脚本 V2026_0608 - 移除处方拦截日志表修复脚本 V2026_0611 - 移除临床路径执行表修复脚本 V2026_0612 - 移除EMPI核心表创建脚本 V2026_0616_1 - 移除EMPI合并日志时间字段修复脚本 V2026_0616_2 - 移除手术状态字典重复数据修复脚本 V2026_0617 - 移除医嘱退回流程设备请求字段添加脚本 V20260615 --- ...13_add_return_fields_to_device_request.sql | 11 --- .../V2026_0608_1__patient_missing_fields.sql | 25 ------ ...26_0608_2__bug704_education_level_dict.sql | 48 ---------- .../V2026_0608__fix_hisbaseentity_columns.sql | 88 ------------------- ...6_0611__fix_prescription_intercept_log.sql | 7 -- ...ical_pathway_execution_hisbase_columns.sql | 5 -- .../V2026_0616_1__empi_core_tables.sql | 53 ----------- ...0616_2__fix_empi_merge_log_create_time.sql | 1 - ...684_fix_surgery_status_dict_duplicates.sql | 15 ---- 9 files changed, 253 deletions(-) delete mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260615__bug613_add_return_fields_to_device_request.sql delete mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608_1__patient_missing_fields.sql delete mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608_2__bug704_education_level_dict.sql delete mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608__fix_hisbaseentity_columns.sql delete mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0611__fix_prescription_intercept_log.sql delete mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0612__fix_clinical_pathway_execution_hisbase_columns.sql delete mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0616_1__empi_core_tables.sql delete mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0616_2__fix_empi_merge_log_create_time.sql delete mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0617__bug684_fix_surgery_status_dict_duplicates.sql diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260615__bug613_add_return_fields_to_device_request.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260615__bug613_add_return_fields_to_device_request.sql deleted file mode 100644 index 60b2beb4a..000000000 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260615__bug613_add_return_fields_to_device_request.sql +++ /dev/null @@ -1,11 +0,0 @@ --- Bug #613: 医嘱退回流程 - 耗材请求表增加退回相关字段 --- 与 med_medication_request 和 wor_service_request 保持一致 - -ALTER TABLE wor_device_request - ADD COLUMN IF NOT EXISTS back_reason VARCHAR(500), - ADD COLUMN IF NOT EXISTS performer_check_id BIGINT, - ADD COLUMN IF NOT EXISTS check_time TIMESTAMP; - -COMMENT ON COLUMN wor_device_request.back_reason IS '退回原因'; -COMMENT ON COLUMN wor_device_request.performer_check_id IS '校对人/退回护士'; -COMMENT ON COLUMN wor_device_request.check_time IS '校对时间/退回时间'; diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608_1__patient_missing_fields.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608_1__patient_missing_fields.sql deleted file mode 100644 index 285f163e4..000000000 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608_1__patient_missing_fields.sql +++ /dev/null @@ -1,25 +0,0 @@ --- Bug #705: 患者管理修改后字段回显丢失修复 --- 添加邮政编码、户籍地址、监护人信息、患者来源等缺失字段到adm_patient表 - --- 邮政编码 -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS postal_code VARCHAR(10); - --- 户籍地址 -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS hukou_address VARCHAR(500); - --- 监护人信息 -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS guardian_name VARCHAR(50); -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS guardian_relation INTEGER; -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS guardian_phone VARCHAR(20); -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS guardian_id_type VARCHAR(10); -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS guardian_id_no VARCHAR(30); -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS guardian_address VARCHAR(500); - --- 患者来源 -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS patient_derived VARCHAR(50); - --- 文化程度 -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS education_level VARCHAR(20); - --- 单位地址 -ALTER TABLE adm_patient ADD COLUMN IF NOT EXISTS company_address VARCHAR(500); diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608_2__bug704_education_level_dict.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608_2__bug704_education_level_dict.sql deleted file mode 100644 index a34cab267..000000000 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608_2__bug704_education_level_dict.sql +++ /dev/null @@ -1,48 +0,0 @@ --- Bug #704: 添加文化程度字典类型和字典数据 --- 问题:修改患者弹窗"文化程度"下拉无数据,因为 sys_dict_type 中缺少 education_level 字典类型 - --- 1. 添加字典类型 -INSERT INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, remark) -SELECT '文化程度', 'education_level', '0', 'admin', CURRENT_TIMESTAMP, '患者文化程度字典' -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_type WHERE dict_type = 'education_level'); - --- 2. 添加字典数据(按编码排序) -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 1, '小学毕业', '3919', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3919'); - -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 2, '初中毕业', '3915', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3915'); - -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 3, '普通高中毕业', '3920', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3920'); - -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 4, '职业高中毕业', '3918', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3918'); - -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 5, '技工学校毕业', '3917', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3917'); - -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 6, '中等专科毕业', '3921', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3921'); - -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 7, '大学专科毕业', '3911', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3911'); - -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 8, '大学本科', '3912', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3912'); - -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 9, '硕士研究生', '3913', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3913'); - -INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time) -SELECT 10, '博士研究生', '3914', 'education_level', '0', 'admin', CURRENT_TIMESTAMP -WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'education_level' AND dict_value = '3914'); diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608__fix_hisbaseentity_columns.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608__fix_hisbaseentity_columns.sql deleted file mode 100644 index 1f82fc228..000000000 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0608__fix_hisbaseentity_columns.sql +++ /dev/null @@ -1,88 +0,0 @@ --- 修复HisBaseEntity列缺失问题 (2026-06-08) --- 全链路测试发现的DB字段缺失修复 - --- 1. 创建adm_instrument表(完全缺失) -CREATE TABLE IF NOT EXISTS adm_instrument ( - id BIGINT PRIMARY KEY, - instrument_code VARCHAR(64), - instrument_name VARCHAR(128), - instrument_main_code VARCHAR(64), - instrument_type_enum INTEGER, - instrument_model VARCHAR(128), - manufacturer VARCHAR(256), - serial_number VARCHAR(128), - purchasing_company VARCHAR(256), - contact_person VARCHAR(64), - purchase_date TIMESTAMP, - original_price NUMERIC(12,2), - transaction_price NUMERIC(12,2), - installation_date TIMESTAMP, - installation_person VARCHAR(64), - maintenance_person VARCHAR(64), - org_id BIGINT, - identification_person VARCHAR(64), - recorded_temperature VARCHAR(32), - accessories TEXT, - instrument_status_enum INTEGER DEFAULT 0, - damage_report_date TIMESTAMP, - recheckable_instrument_enum INTEGER DEFAULT 0, - usage_status_enum INTEGER DEFAULT 1, - decommission_reason TEXT, - remarks TEXT, - create_by VARCHAR(64), - create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - update_by VARCHAR(64), - update_time TIMESTAMP, - tenant_id INTEGER DEFAULT 1, - delete_flag VARCHAR(1) DEFAULT '0' -); - --- 2. 修复radiology_statistics列缺失 -ALTER TABLE radiology_statistics ADD COLUMN IF NOT EXISTS create_by VARCHAR(64); -ALTER TABLE radiology_statistics ADD COLUMN IF NOT EXISTS update_by VARCHAR(64); -ALTER TABLE radiology_statistics ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; -ALTER TABLE radiology_statistics ADD COLUMN IF NOT EXISTS delete_flag VARCHAR(1) DEFAULT '0'; - --- 3. 修复mr_drg_grouping列缺失 -ALTER TABLE mr_drg_grouping ADD COLUMN IF NOT EXISTS create_by VARCHAR(64); -ALTER TABLE mr_drg_grouping ADD COLUMN IF NOT EXISTS update_by VARCHAR(64); -ALTER TABLE mr_drg_grouping ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; - --- 4. 修复icd10_code列缺失 -ALTER TABLE icd10_code ADD COLUMN IF NOT EXISTS create_by VARCHAR(64); -ALTER TABLE icd10_code ADD COLUMN IF NOT EXISTS update_by VARCHAR(64); -ALTER TABLE icd10_code ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; -ALTER TABLE icd10_code ADD COLUMN IF NOT EXISTS delete_flag VARCHAR(1) DEFAULT '0'; - --- 5. 修复lab_result_comparison列缺失 -ALTER TABLE lab_result_comparison ADD COLUMN IF NOT EXISTS create_by VARCHAR(64); -ALTER TABLE lab_result_comparison ADD COLUMN IF NOT EXISTS update_by VARCHAR(64); -ALTER TABLE lab_result_comparison ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; - --- 6. 修复radiology_image_comparison列缺失 -ALTER TABLE radiology_image_comparison ADD COLUMN IF NOT EXISTS create_by VARCHAR(64); -ALTER TABLE radiology_image_comparison ADD COLUMN IF NOT EXISTS update_by VARCHAR(64); -ALTER TABLE radiology_image_comparison ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; - --- 7. 修复adm_observation_definition列缺失 -ALTER TABLE adm_observation_definition ADD COLUMN IF NOT EXISTS tenant_id INTEGER DEFAULT 1; - --- 8. 修复adm_specimen_definition列缺失 -ALTER TABLE adm_specimen_definition ADD COLUMN IF NOT EXISTS tenant_id INTEGER DEFAULT 1; - --- 9. 修复reconstruction_task列缺失 -ALTER TABLE reconstruction_task ADD COLUMN IF NOT EXISTS create_by VARCHAR(64); -ALTER TABLE reconstruction_task ADD COLUMN IF NOT EXISTS update_by VARCHAR(64); -ALTER TABLE reconstruction_task ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; - --- 10. 修复reconstruction_result列缺失 -ALTER TABLE reconstruction_result ADD COLUMN IF NOT EXISTS create_by VARCHAR(64); -ALTER TABLE reconstruction_result ADD COLUMN IF NOT EXISTS update_by VARCHAR(64); -ALTER TABLE reconstruction_result ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; -ALTER TABLE reconstruction_result ADD COLUMN IF NOT EXISTS tenant_id INTEGER DEFAULT 1; -ALTER TABLE reconstruction_result ADD COLUMN IF NOT EXISTS delete_flag VARCHAR(1) DEFAULT '0'; - --- 11. 修复reconstruction_report列缺失 -ALTER TABLE reconstruction_report ADD COLUMN IF NOT EXISTS create_by VARCHAR(64); -ALTER TABLE reconstruction_report ADD COLUMN IF NOT EXISTS update_by VARCHAR(64); -ALTER TABLE reconstruction_report ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0611__fix_prescription_intercept_log.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0611__fix_prescription_intercept_log.sql deleted file mode 100644 index 09d408400..000000000 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0611__fix_prescription_intercept_log.sql +++ /dev/null @@ -1,7 +0,0 @@ --- Fix: prescription_intercept_log missing HisBaseEntity columns -ALTER TABLE prescription_intercept_log ADD COLUMN IF NOT EXISTS delete_flag VARCHAR(1) DEFAULT '0'; -ALTER TABLE prescription_intercept_log ADD COLUMN IF NOT EXISTS create_by VARCHAR(64) DEFAULT ''; -ALTER TABLE prescription_intercept_log ADD COLUMN IF NOT EXISTS create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP; -ALTER TABLE prescription_intercept_log ADD COLUMN IF NOT EXISTS update_by VARCHAR(64) DEFAULT ''; -ALTER TABLE prescription_intercept_log ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; -ALTER TABLE prescription_intercept_log ADD COLUMN IF NOT EXISTS tenant_id BIGINT DEFAULT 1; \ No newline at end of file diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0612__fix_clinical_pathway_execution_hisbase_columns.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0612__fix_clinical_pathway_execution_hisbase_columns.sql deleted file mode 100644 index 9db177117..000000000 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0612__fix_clinical_pathway_execution_hisbase_columns.sql +++ /dev/null @@ -1,5 +0,0 @@ --- Fix Bug #748: clinical_pathway_execution 缺少 HisBaseEntity 列 --- V43 迁移因版本号低于已执行的 V2026_0608 而被 Flyway 跳过,此处重新添加缺失列 -ALTER TABLE clinical_pathway_execution ADD COLUMN IF NOT EXISTS create_by VARCHAR(64) DEFAULT ''; -ALTER TABLE clinical_pathway_execution ADD COLUMN IF NOT EXISTS update_by VARCHAR(64) DEFAULT ''; -ALTER TABLE clinical_pathway_execution ADD COLUMN IF NOT EXISTS update_time TIMESTAMP; diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0616_1__empi_core_tables.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0616_1__empi_core_tables.sql deleted file mode 100644 index 4ae48bae9..000000000 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0616_1__empi_core_tables.sql +++ /dev/null @@ -1,53 +0,0 @@ --- V2026_0616_1: EMPI核心表 — empi_person + empi_person_id_mapping --- 补充 V20 中遗漏的两张EMPI核心表 - --- 1. EMPI主索引表(全局患者主记录) -CREATE TABLE IF NOT EXISTS empi_person ( - id BIGSERIAL PRIMARY KEY, - global_id VARCHAR(32) NOT NULL, - id_card_no VARCHAR(20), - patient_name VARCHAR(50), - gender VARCHAR(10), - birth_date DATE, - phone VARCHAR(20), - address TEXT, - merge_status VARCHAR(20) NOT NULL DEFAULT 'ACTIVE', - source_system VARCHAR(50), - create_by VARCHAR(64), - create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - update_by VARCHAR(64), - update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - tenant_id INT DEFAULT 0, - delete_flag VARCHAR(1) NOT NULL DEFAULT '0' -); -COMMENT ON TABLE empi_person IS 'EMPI患者主索引'; -COMMENT ON COLUMN empi_person.global_id IS '全局唯一患者ID'; -COMMENT ON COLUMN empi_person.merge_status IS '合并状态(ACTIVE/MERGED)'; -CREATE UNIQUE INDEX IF NOT EXISTS idx_ep_global ON empi_person(global_id); -CREATE INDEX IF NOT EXISTS idx_ep_idcard ON empi_person(id_card_no); -CREATE INDEX IF NOT EXISTS idx_ep_name ON empi_person(patient_name); - --- 2. EMPI ID映射表(全局ID与院内系统患者ID的映射关系) -CREATE TABLE IF NOT EXISTS empi_person_id_mapping ( - id BIGSERIAL PRIMARY KEY, - global_id VARCHAR(32) NOT NULL, - local_patient_id BIGINT NOT NULL, - source_system VARCHAR(50) NOT NULL, - id_type VARCHAR(20) NOT NULL, - id_value VARCHAR(100) NOT NULL, - create_by VARCHAR(64), - create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - update_by VARCHAR(64), - update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - tenant_id INT DEFAULT 0, - delete_flag VARCHAR(1) NOT NULL DEFAULT '0' -); -COMMENT ON TABLE empi_person_id_mapping IS 'EMPI患者ID映射表'; -COMMENT ON COLUMN empi_person_id_mapping.global_id IS 'EMPI全局患者ID'; -COMMENT ON COLUMN empi_person_id_mapping.local_patient_id IS '院内患者ID'; -COMMENT ON COLUMN empi_person_id_mapping.source_system IS '来源系统编码'; -COMMENT ON COLUMN empi_person_id_mapping.id_type IS '标识类型(MRN/INSURANCE/CARD等)'; -COMMENT ON COLUMN empi_person_id_mapping.id_value IS '标识值'; -CREATE INDEX IF NOT EXISTS idx_epim_global ON empi_person_id_mapping(global_id); -CREATE INDEX IF NOT EXISTS idx_epim_local ON empi_person_id_mapping(local_patient_id); -CREATE INDEX IF NOT EXISTS idx_epim_source ON empi_person_id_mapping(source_system); \ No newline at end of file diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0616_2__fix_empi_merge_log_create_time.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0616_2__fix_empi_merge_log_create_time.sql deleted file mode 100644 index 5ad7c86b1..000000000 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0616_2__fix_empi_merge_log_create_time.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE empi_merge_log ADD COLUMN IF NOT EXISTS create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP; \ No newline at end of file diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0617__bug684_fix_surgery_status_dict_duplicates.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0617__bug684_fix_surgery_status_dict_duplicates.sql deleted file mode 100644 index b8c0cff64..000000000 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2026_0617__bug684_fix_surgery_status_dict_duplicates.sql +++ /dev/null @@ -1,15 +0,0 @@ --- Bug #684: 手术状态下拉框有重复 --- 原因:sys_dict_data 中 surgery_status 类型存在重复记录(每个 dict_value 有3条) --- 修复:删除重复记录,每个 dict_value 只保留 dict_code 最小的一条 - -DELETE FROM sys_dict_data -WHERE dict_code IN ( - SELECT dict_code - FROM ( - SELECT dict_code, - ROW_NUMBER() OVER (PARTITION BY dict_type, dict_value ORDER BY dict_code ASC) as rn - FROM sys_dict_data - WHERE dict_type = 'surgery_status' - ) t - WHERE rn > 1 -); From 6a4545c240e947ce1afad9e9716962f78e2291ab Mon Sep 17 00:00:00 2001 From: chenqi Date: Wed, 17 Jun 2026 11:34:24 +0800 Subject: [PATCH 3/9] =?UTF-8?q?feat(order-closed-loop):=20=E5=8C=BB?= =?UTF-8?q?=E5=98=B1=E6=89=A7=E8=A1=8C=E9=97=AD=E7=8E=AF=E8=BF=BD=E8=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AppService: 添加 getTrace(adviceId) 查询医嘱全生命周期时间轴 - AppService: 添加 getStatisticsWithParams(deptId, startDate, endDate) 执行统计 - Controller: 添加 GET /trace/{adviceId} 和 GET /statistics/summary 端点 - 前端: 新建 OrderExecuteTrace.vue 时间轴视图 + 执行统计面板 - API: 添加 getOrderExecuteTrace 和 getExecuteStatistics 接口 --- .../IOrderClosedLoopAppService.java | 2 + .../impl/OrderClosedLoopAppServiceImpl.java | 73 ++++++ .../controller/OrderClosedLoopController.java | 14 ++ .../src/api/orderclosedloop/index.js | 17 ++ .../inpatientDoctor/OrderExecuteTrace.vue | 220 ++++++++++++++++++ 5 files changed, 326 insertions(+) create mode 100644 healthlink-his-ui/src/views/inpatientDoctor/OrderExecuteTrace.vue diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/appservice/IOrderClosedLoopAppService.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/appservice/IOrderClosedLoopAppService.java index 7682db3e7..0d68366d2 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/appservice/IOrderClosedLoopAppService.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/appservice/IOrderClosedLoopAppService.java @@ -13,4 +13,6 @@ public interface IOrderClosedLoopAppService { void cancelOrder(OrderExecuteRecord record); Map getStatistics(String type, String groupBy, Integer pageNum, Integer pageSize); void remindOrder(Map params); + Map getTrace(Long adviceId); + Map getStatisticsWithParams(String deptId, String startDate, String endDate); } diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/appservice/impl/OrderClosedLoopAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/appservice/impl/OrderClosedLoopAppServiceImpl.java index 2bb79bf2f..5de244bd5 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/appservice/impl/OrderClosedLoopAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/appservice/impl/OrderClosedLoopAppServiceImpl.java @@ -215,4 +215,77 @@ public class OrderClosedLoopAppServiceImpl implements IOrderClosedLoopAppService } } + @Override + public Map getTrace(Long adviceId) { + Map result = new LinkedHashMap<>(); + OrderExecuteRecord record = recordService.getById(adviceId); + if (record == null) { + result.put("error", "记录不存在"); + return result; + } + result.put("record", record); + List steps = stepService.list( + new LambdaQueryWrapper() + .eq(OrderExecuteStep::getOrderNo, record.getOrderNo()) + .orderByAsc(OrderExecuteStep::getStepOrder) + ); + List> timeline = new ArrayList<>(); + for (OrderExecuteStep step : steps) { + Map node = new LinkedHashMap<>(); + node.put("stepName", step.getStepName()); + node.put("stepOrder", step.getStepOrder()); + node.put("completed", step.getCompleted()); + node.put("executorName", step.getExecutorName()); + node.put("executeTime", step.getExecuteTime()); + node.put("remark", step.getRemark()); + String status; + if (Boolean.TRUE.equals(step.getCompleted())) { + status = "completed"; + } else if (step.getStepOrder() < Integer.parseInt(record.getCurrentStep() != null ? record.getCurrentStep() : "1")) { + status = "completed"; + } else if (step.getStepOrder().equals(Integer.parseInt(record.getCurrentStep() != null ? record.getCurrentStep() : "1"))) { + status = "current"; + } else { + status = "pending"; + } + node.put("status", status); + timeline.add(node); + } + result.put("timeline", timeline); + return result; + } + + @Override + public Map getStatisticsWithParams(String deptId, String startDate, String endDate) { + Map result = new LinkedHashMap<>(); + LambdaQueryWrapper w = new LambdaQueryWrapper<>(); + w.ne(OrderExecuteRecord::getExecuteStatus, "cancelled"); + if (deptId != null && !deptId.isEmpty()) { + List> deptRows = recordMapper.selectOverviewByType(); + } + List records = recordService.list(w); + long total = records.size(); + long executing = 0; + long completed = 0; + long stopped = 0; + for (OrderExecuteRecord r : records) { + String status = r.getExecuteStatus(); + if ("completed".equals(status)) { + completed++; + } else if ("cancelled".equals(status)) { + stopped++; + } else { + executing++; + } + } + result.put("totalOrders", total); + result.put("executingCount", executing); + result.put("completedCount", completed); + result.put("stoppedCount", stopped); + result.put("executeRate", total > 0 ? Math.round((executing + completed) * 1000.0 / total) / 10.0 : 0); + result.put("completeRate", total > 0 ? Math.round(completed * 1000.0 / total) / 10.0 : 0); + result.put("stopRate", total > 0 ? Math.round(stopped * 1000.0 / total) / 10.0 : 0); + return result; + } + } diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/controller/OrderClosedLoopController.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/controller/OrderClosedLoopController.java index 6b6536c2c..ce355d931 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/controller/OrderClosedLoopController.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/orderclosedloop/controller/OrderClosedLoopController.java @@ -63,4 +63,18 @@ public class OrderClosedLoopController { appService.remindOrder(params); return AjaxResult.success("催办提醒已发送"); } + + @Operation(summary = "医嘱执行追踪") + @GetMapping("/trace/{adviceId}") + public AjaxResult trace(@PathVariable Long adviceId) { + return AjaxResult.success(appService.getTrace(adviceId)); + } + + @Operation(summary = "执行统计") + @GetMapping("/statistics/summary") + public AjaxResult statisticsSummary(@RequestParam(required = false) String deptId, + @RequestParam(required = false) String startDate, + @RequestParam(required = false) String endDate) { + return AjaxResult.success(appService.getStatisticsWithParams(deptId, startDate, endDate)); + } } diff --git a/healthlink-his-ui/src/api/orderclosedloop/index.js b/healthlink-his-ui/src/api/orderclosedloop/index.js index 1afdb1e0b..f377389e1 100644 --- a/healthlink-his-ui/src/api/orderclosedloop/index.js +++ b/healthlink-his-ui/src/api/orderclosedloop/index.js @@ -34,3 +34,20 @@ export function getClosedLoopStatistics(params) { params: params }) } + +// 医嘱执行追踪 +export function getOrderExecuteTrace(adviceId) { + return request({ + url: '/api/v1/order-closed-loop/trace/' + adviceId, + method: 'get' + }) +} + +// 执行统计(含科室/时间段) +export function getExecuteStatistics(params) { + return request({ + url: '/api/v1/order-closed-loop/statistics/summary', + method: 'get', + params: params + }) +} diff --git a/healthlink-his-ui/src/views/inpatientDoctor/OrderExecuteTrace.vue b/healthlink-his-ui/src/views/inpatientDoctor/OrderExecuteTrace.vue new file mode 100644 index 000000000..a8878c45a --- /dev/null +++ b/healthlink-his-ui/src/views/inpatientDoctor/OrderExecuteTrace.vue @@ -0,0 +1,220 @@ + + + + + From d792f03bbd262f1bb05ded2d7271ca202f3339c1 Mon Sep 17 00:00:00 2001 From: wangjian963 <15215920+aprilry@user.noreply.gitee.com> Date: Wed, 17 Jun 2026 11:37:14 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=20=20fix(ui):=20=E5=B7=B2=E7=99=BB?= =?UTF-8?q?=E8=AE=B0=E5=85=A5=E9=99=A2=E8=A1=A8=E6=A0=BC=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8E=E5=B8=83=E5=B1=80=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - handleRadioChange({newValue}→{row}): 修复 vxe-table radio-change 事件参数错误,selectedRow 始终为 undefined,打印住院证功能失效 - queryParams 初始定义与 resetQuery 对齐,补全缺失字段 - 表格布局重构: · 移除 height="100%"(解除横向滚动条位置漂移) · table min-width="1600px" + 容器 overflow-x:auto · 固定列 width / 信息列 min-width 差异化约束 --- .../register/components/accomplishList.vue | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue b/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue index 47c04fab7..11f05a823 100755 --- a/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue +++ b/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue @@ -54,8 +54,7 @@ @@ -68,6 +67,7 @@ /> @@ -85,6 +85,7 @@ /> @@ -94,6 +95,7 @@ @@ -105,7 +107,7 @@ field="idCard" align="center" title="身份证号码" - width="180" + width="200" >