diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V59__fix_clinical_pathway_variance_delete_flag.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V59__fix_clinical_pathway_variance_delete_flag.sql index 52432ae42..88283ddae 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V59__fix_clinical_pathway_variance_delete_flag.sql +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V59__fix_clinical_pathway_variance_delete_flag.sql @@ -1,2 +1,6 @@ -ALTER TABLE clinical_pathway_variance RENAME COLUMN del_flag TO delete_flag; +DO $$ BEGIN + ALTER TABLE clinical_pathway_variance RENAME COLUMN del_flag TO delete_flag; +EXCEPTION WHEN undefined_column THEN + RAISE NOTICE 'column del_flag does not exist, skipping rename'; +END $$; ALTER TABLE clinical_pathway_variance ALTER COLUMN tenant_id SET DATA TYPE BIGINT; diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V83__fix_duplicate_table_schemas.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V83__fix_duplicate_table_schemas.sql new file mode 100644 index 000000000..f893232f3 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V83__fix_duplicate_table_schemas.sql @@ -0,0 +1,32 @@ +DO $$ BEGIN + ALTER TABLE emr_quality_score ADD COLUMN total_score DECIMAL(5,2); + ALTER TABLE emr_quality_score ADD COLUMN completeness_score DECIMAL(5,2); + ALTER TABLE emr_quality_score ADD COLUMN timeliness_score DECIMAL(5,2); + ALTER TABLE emr_quality_score ADD COLUMN accuracy_score DECIMAL(5,2); +EXCEPTION WHEN duplicate_column THEN + RAISE NOTICE 'emr_quality_score columns already exist'; +END $$; + +DO $$ BEGIN + ALTER TABLE emr_quality_score ALTER COLUMN tenant_id TYPE BIGINT USING tenant_id::BIGINT; +EXCEPTION WHEN undefined_column THEN + RAISE NOTICE 'emr_quality_score.tenant_id does not exist'; +END $$; + +DO $$ BEGIN + ALTER TABLE sys_esb_message ADD COLUMN delete_flag CHAR(1) DEFAULT '0'; +EXCEPTION WHEN duplicate_column THEN + RAISE NOTICE 'sys_esb_message.delete_flag already exists'; +END $$; + +DO $$ BEGIN + ALTER TABLE sys_esb_service_registry ADD COLUMN delete_flag CHAR(1) DEFAULT '0'; +EXCEPTION WHEN duplicate_column THEN + RAISE NOTICE 'sys_esb_service_registry.delete_flag already exists'; +END $$; + +DO $$ BEGIN + ALTER TABLE sys_esb_service_registry ADD COLUMN tenant_id INTEGER DEFAULT 0; +EXCEPTION WHEN duplicate_column THEN + RAISE NOTICE 'sys_esb_service_registry.tenant_id already exists'; +END $$; diff --git a/healthlink-his-ui/src/views/doctorstation/components/eprescriptiondialog.vue b/healthlink-his-ui/src/views/doctorstation/components/eprescriptiondialog.vue index f13f0469c..2a4646a0a 100755 --- a/healthlink-his-ui/src/views/doctorstation/components/eprescriptiondialog.vue +++ b/healthlink-his-ui/src/views/doctorstation/components/eprescriptiondialog.vue @@ -1,4 +1,4 @@ -