From 8475aa4cc8af762ec33468deb8ad70a0c01fec76 Mon Sep 17 00:00:00 2001 From: Diederik Muylwyk Date: Thu, 1 Aug 2019 14:44:03 -0400 Subject: [PATCH] Add TRM_CODESYSTEM_VER.CS_DISPLAY to migration tool. --- .../ca/uhn/fhir/jpa/entity/TermCodeSystemVersion.java | 2 +- .../jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermCodeSystemVersion.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermCodeSystemVersion.java index e77a935059e..0006487dc7a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermCodeSystemVersion.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/TermCodeSystemVersion.java @@ -40,7 +40,7 @@ import static org.apache.commons.lang3.StringUtils.length; public class TermCodeSystemVersion implements Serializable { private static final long serialVersionUID = 1L; - static final int MAX_VERSION_LENGTH = 200; + public static final int MAX_VERSION_LENGTH = 200; @OneToMany(fetch = FetchType.LAZY, mappedBy = "myCodeSystem") private Collection myConcepts; diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java index fbc526bda52..ec37c36bbfb 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java @@ -20,10 +20,7 @@ package ca.uhn.fhir.jpa.migrate.tasks; * #L% */ -import ca.uhn.fhir.jpa.entity.TermCodeSystem; -import ca.uhn.fhir.jpa.entity.TermConcept; -import ca.uhn.fhir.jpa.entity.TermValueSet; -import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation; +import ca.uhn.fhir.jpa.entity.*; import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.taskdef.AddColumnTask; import ca.uhn.fhir.jpa.migrate.taskdef.ArbitrarySqlTask; @@ -164,6 +161,11 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks { .addIndex("IDX_VALUESET_C_DSGNTN_VAL") .unique(false) .withColumns("VAL"); + + // TermCodeSystemVersion + version.startSectionWithMessage("Processing table: TRM_CODESYSTEM_VER"); + Builder.BuilderWithTableName termCodeSystemVersionTable = version.onTable("TRM_CODESYSTEM_VER"); + termCodeSystemVersionTable.addColumn("CS_DISPLAY").nullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, TermCodeSystemVersion.MAX_VERSION_LENGTH); }