diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V100__sync_existing_emr_data.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V100__sync_existing_emr_data.sql index 4a0faef2d..db39aa853 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V100__sync_existing_emr_data.sql +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V100__sync_existing_emr_data.sql @@ -28,11 +28,11 @@ WHERE e.id IS NOT NULL SELECT 1 FROM emr_revision r WHERE r.emr_id = e.id ); --- 3. 从doc_emr同步搜索索引 +-- 3. 从doc_emr同步搜索索引(不包含update_time列,因为V103才添加) INSERT INTO emr_search_index ( id, emr_id, encounter_id, patient_id, patient_name, emr_type, emr_title, diagnosis_text, - doctor_name, department_name, create_time, update_time + doctor_name, department_name, create_time ) SELECT nextval('emr_search_index_id_seq'), @@ -65,8 +65,7 @@ SELECT ), COALESCE(u.name, '医生' || e.record_id), COALESCE(o.name, '未知科室'), - COALESCE(e.create_time, NOW()), - COALESCE(e.update_time, NOW()) + COALESCE(e.create_time, NOW()) FROM doc_emr e LEFT JOIN patient p ON e.patient_id = p.id LEFT JOIN sys_user u ON e.record_id = u.user_id