From a0b38a8f502006c68d96fe3db9f3c65ecc12fef4 Mon Sep 17 00:00:00 2001 From: m-goggins Date: Fri, 18 Oct 2024 09:09:03 -0400 Subject: [PATCH] add 6th migration to add dibbsConceptType to valuesets --- .../flyway/sql/V01_06__add_dibbsConceptType.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 query-connector/flyway/sql/V01_06__add_dibbsConceptType.sql diff --git a/query-connector/flyway/sql/V01_06__add_dibbsConceptType.sql b/query-connector/flyway/sql/V01_06__add_dibbsConceptType.sql new file mode 100644 index 000000000..2c123b5ae --- /dev/null +++ b/query-connector/flyway/sql/V01_06__add_dibbsConceptType.sql @@ -0,0 +1,8 @@ +ALTER TABLE valuesets +ADD COLUMN dibbsConceptType text GENERATED ALWAYS AS ( + CASE + WHEN type IN ('lotc', 'lrtc', 'ostc') THEN 'labs' + WHEN type = 'mrtc' THEN 'medications' + ELSE 'conditions' + END +) STORED; \ No newline at end of file