From 5d58634d01d3730435e9749f73ccc9a4b887b17f Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Sat, 26 Jul 2025 17:35:03 -0700 Subject: [PATCH] Skip inserting data when creating empty schemas - EHR-related tables --- .../dbscripts/postgresql/hormoneassay-0.00-0.01.sql | 2 ++ .../dbscripts/postgresql/hormoneassay-0.01-0.02.sql | 9 ++++++--- .../dbscripts/postgresql/hormoneassay-0.02-0.03.sql | 4 +++- .../schemas/dbscripts/postgresql/mergesync-0.05-0.06.sql | 3 ++- .../schemas/dbscripts/postgresql/mergesync-0.08-0.09.sql | 4 +++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.00-0.01.sql b/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.00-0.01.sql index e980c39e7..9539a22df 100644 --- a/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.00-0.01.sql +++ b/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.00-0.01.sql @@ -45,6 +45,7 @@ CREATE TABLE hormoneassay.instruments ( CONSTRAINT PK_instruments PRIMARY KEY (instrument) ); +-- @SkipOnEmptySchemasBegin INSERT INTO hormoneassay.rochee411_tests (test,code,sampletype,samplevolume,rangemin,rangemax,units,assaytype,controlmodule,samplediluent,testkey) VALUES ('ACTH', null, 'P(EDTA)', 50, 1, 2000, 'pg/ml', 'sand', 'PCMM', 'MD1', '80'); INSERT INTO hormoneassay.rochee411_tests (test,code,sampletype,samplevolume,rangemin,rangemax,units,assaytype,controlmodule,samplediluent,testkey) VALUES ('Cortisol', null, 'S,P,Sal,U', 20, 0.036, 63.4, 'ug/dl', 'comp', 'PCU', 'DU', '160'); INSERT INTO hormoneassay.rochee411_tests (test,code,sampletype,samplevolume,rangemin,rangemax,units,assaytype,controlmodule,samplediluent,testkey) VALUES ('C-Peptide', null, 'S,P,U', 20, 0.01, 40, 'ng/ml', 'sand', 'MA/MM?', 'MA', '70'); @@ -65,3 +66,4 @@ INSERT INTO hormoneassay.rochee411_tests (test,code,sampletype,samplevolume,rang INSERT INTO hormoneassay.rochee411_tests (test,code,sampletype,samplevolume,rangemin,rangemax,units,assaytype,controlmodule,samplediluent,testkey) VALUES ('Total T4', null, 'S,P', 15, 0.42, 24.9, 'ug/dl', 'comp', 'PCU', 'none', '21'); INSERT INTO hormoneassay.rochee411_tests (test,code,sampletype,samplevolume,rangemin,rangemax,units,assaytype,controlmodule,samplediluent,testkey) VALUES ('Testosterone', 'TESTO', 'S,P', 20, 0.025, 15, 'ng/ml', 'comp', 'PCU', 'MD1', '111'); INSERT INTO hormoneassay.rochee411_tests (test,code,sampletype,samplevolume,rangemin,rangemax,units,assaytype,controlmodule,samplediluent,testkey) VALUES ('TSH', null, 'S,P', 50, 0.005, 100, 'uIU/ml', 'sand', 'PCU', 'MA', '10'); +-- @SkipOnEmptySchemasEnd diff --git a/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.01-0.02.sql b/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.01-0.02.sql index 82ae71add..0b2902e2c 100644 --- a/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.01-0.02.sql +++ b/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.01-0.02.sql @@ -1,5 +1,7 @@ +-- @SkipOnEmptySchemasBegin DELETE FROM hormoneassay.instruments WHERE instrument = 'Roche E411'; INSERT INTO hormoneassay.instruments (instrument) VALUES ('Roche E411'); +-- @SkipOnEmptySchemasEnd CREATE TABLE hormoneassay.assay_tests ( test varchar(100), @@ -9,6 +11,7 @@ CREATE TABLE hormoneassay.assay_tests ( constraint PK_assay_tests PRIMARY KEY (test) ); +-- @SkipOnEmptySchemasBegin INSERT INTO hormoneassay.assay_tests (test, code, units) VALUES ('ACTH', null, 'pg/ml'); INSERT INTO hormoneassay.assay_tests (test, code, units) VALUES ('Cortisol', null, 'ug/dl'); INSERT INTO hormoneassay.assay_tests (test, code, units) VALUES ('C-Peptide', null, 'ng/ml'); @@ -29,7 +32,7 @@ INSERT INTO hormoneassay.assay_tests (test, code, units) VALUES ('Free T4', null INSERT INTO hormoneassay.assay_tests (test, code, units) VALUES ('Total T4', null, 'ug/dl'); INSERT INTO hormoneassay.assay_tests (test, code, units) VALUES ('Testosterone', 'TESTO', 'ng/ml'); INSERT INTO hormoneassay.assay_tests (test, code, units) VALUES ('TSH', null, 'uIU/ml'); - +-- @SkipOnEmptySchemasEnd CREATE TABLE hormoneassay.diluents ( diluent varchar(100), @@ -37,8 +40,8 @@ CREATE TABLE hormoneassay.diluents ( constraint PK_diluents PRIMARY KEY (diluent) ); +-- @SkipOnEmptySchemasBegin INSERT INTO hormoneassay.diluents (diluent) VALUES ('DU'); INSERT INTO hormoneassay.diluents (diluent) VALUES ('MA'); INSERT INTO hormoneassay.diluents (diluent) VALUES ('MD1'); - - +-- @SkipOnEmptySchemasEnd diff --git a/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.02-0.03.sql b/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.02-0.03.sql index 90435eff8..ceb81657c 100644 --- a/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.02-0.03.sql +++ b/HormoneAssay/resources/schemas/dbscripts/postgresql/hormoneassay-0.02-0.03.sql @@ -1,2 +1,4 @@ +-- @SkipOnEmptySchemasBegin DELETE FROM hormoneassay.assay_tests WHERE test = 'Progesterone'; -INSERT INTO hormoneassay.assay_tests (test, code, units) VALUES ('Progesterone', 'P4', 'ng/ml'); \ No newline at end of file +INSERT INTO hormoneassay.assay_tests (test, code, units) VALUES ('Progesterone', 'P4', 'ng/ml'); +-- @SkipOnEmptySchemasEnd diff --git a/mergesync/resources/schemas/dbscripts/postgresql/mergesync-0.05-0.06.sql b/mergesync/resources/schemas/dbscripts/postgresql/mergesync-0.05-0.06.sql index 3f47f414c..45ac40c63 100644 --- a/mergesync/resources/schemas/dbscripts/postgresql/mergesync-0.05-0.06.sql +++ b/mergesync/resources/schemas/dbscripts/postgresql/mergesync-0.05-0.06.sql @@ -29,6 +29,7 @@ CREATE TABLE mergesync.mergetolkmapping ( CONSTRAINT PK_mergetolkmapping PRIMARY KEY (mergetestname) ); +-- @SkipOnEmptySchemasBegin INSERT INTO mergesync.testnamemapping (servicename, mergetestname, automaticresults) VALUES ('Albumin', 'ALB', true); INSERT INTO mergesync.testnamemapping (servicename, mergetestname, automaticresults) VALUES ('Amylase', 'AMYL', true); INSERT INTO mergesync.testnamemapping (servicename, mergetestname, automaticresults) VALUES ('Anaerobic Culture', 'ANCULT', false); @@ -77,7 +78,6 @@ INSERT INTO mergesync.testnamemapping (servicename, mergetestname, automaticresu INSERT INTO mergesync.testnamemapping (servicename, mergetestname, automaticresults) VALUES ('Urinalysis', 'URINE', false); INSERT INTO mergesync.testnamemapping (servicename, mergetestname, automaticresults) VALUES ('Yersinia culture', 'YERSNA', false); -TRUNCATE TABLE mergesync.mergetolkmapping; INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('ALB', 'Albumin'); INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('AMYL', 'Amylase'); INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('ANCULT', 'Anaerobic Culture'); @@ -118,3 +118,4 @@ INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('SEN INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('SENSI', 'Antibiotic Sensitivity'); INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('URINE', 'Urinalysis'); INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('YERSNA', 'Yersinia culture'); +-- @SkipOnEmptySchemasEnd diff --git a/mergesync/resources/schemas/dbscripts/postgresql/mergesync-0.08-0.09.sql b/mergesync/resources/schemas/dbscripts/postgresql/mergesync-0.08-0.09.sql index 228cfa7a0..4e8593ca9 100644 --- a/mergesync/resources/schemas/dbscripts/postgresql/mergesync-0.08-0.09.sql +++ b/mergesync/resources/schemas/dbscripts/postgresql/mergesync-0.08-0.09.sql @@ -14,8 +14,10 @@ * limitations under the License. */ +-- @SkipOnEmptySchemasBegin DELETE FROM mergesync.mergetolkmapping WHERE mergetestname = 'SENSI2'; INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('SENSI2', 'Antibiotic Sensitivity'); DELETE FROM mergesync.mergetolkmapping WHERE mergetestname = 'SENSI3'; -INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('SENSI3', 'Antibiotic Sensitivity'); \ No newline at end of file +INSERT INTO mergesync.mergetolkmapping (mergetestname, servicename) VALUES ('SENSI3', 'Antibiotic Sensitivity'); +-- @SkipOnEmptySchemasEnd