Addressing review comments.
This commit is contained in:
parent
ffda92514a
commit
78842164fd
|
@ -35,8 +35,12 @@ import java.util.List;
|
||||||
import static org.apache.commons.lang3.StringUtils.left;
|
import static org.apache.commons.lang3.StringUtils.left;
|
||||||
import static org.apache.commons.lang3.StringUtils.length;
|
import static org.apache.commons.lang3.StringUtils.length;
|
||||||
|
|
||||||
@Table(name = "TRM_VALUESET_CONCEPT", indexes = {
|
/*
|
||||||
@Index(name = "IDX_VALUESET_CONCEPT_CS_CD", columnList = "SYSTEM_URL, CODEVAL")
|
* DM 2019-08-01 - Do not use IDX_VALUESET_CONCEPT_CS_CD; this was previously used as an index so reusing the name will
|
||||||
|
* bork up migration tasks.
|
||||||
|
*/
|
||||||
|
@Table(name = "TRM_VALUESET_CONCEPT", uniqueConstraints = {
|
||||||
|
@UniqueConstraint(name = "IDX_VS_CONCEPT_CS_CD", columnNames = {"VALUESET_PID", "SYSTEM_URL", "CODEVAL"})
|
||||||
})
|
})
|
||||||
@Entity()
|
@Entity()
|
||||||
public class TermValueSetConcept implements Serializable {
|
public class TermValueSetConcept implements Serializable {
|
||||||
|
|
|
@ -20,10 +20,23 @@ package ca.uhn.fhir.jpa.entity;
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This enum is used to indicate the expansion status of a given ValueSet in the terminology tables. In this context,
|
||||||
|
* an expanded ValueSet has its included concepts stored in the terminology tables as well.
|
||||||
|
*/
|
||||||
public enum TermValueSetExpansionStatusEnum {
|
public enum TermValueSetExpansionStatusEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This status indicates the ValueSet is waiting to be picked up and expanded by a scheduled task.
|
||||||
|
*/
|
||||||
NOT_EXPANDED,
|
NOT_EXPANDED,
|
||||||
|
/**
|
||||||
|
* This status indicates the ValueSet has been picked up by a scheduled task and is mid-expansion.
|
||||||
|
*/
|
||||||
EXPANSION_IN_PROGRESS,
|
EXPANSION_IN_PROGRESS,
|
||||||
|
/**
|
||||||
|
* This status indicates the ValueSet has been picked up by a scheduled task and expansion is complete.
|
||||||
|
*/
|
||||||
EXPANDED
|
EXPANDED
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1496,7 +1496,6 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Scheduled(fixedDelay = 600000) // 10 minutes.
|
@Scheduled(fixedDelay = 600000) // 10 minutes.
|
||||||
@Transactional
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void preExpandValueSetToTerminologyTables() {
|
public synchronized void preExpandValueSetToTerminologyTables() {
|
||||||
new TransactionTemplate(myTxManager).execute(new TransactionCallbackWithoutResult() {
|
new TransactionTemplate(myTxManager).execute(new TransactionCallbackWithoutResult() {
|
||||||
|
|
|
@ -133,15 +133,18 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
||||||
.references("TRM_VALUESET", "PID");
|
.references("TRM_VALUESET", "PID");
|
||||||
termValueSetConceptTable.addColumn("SYSTEM_URL").nonNullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, TermCodeSystem.MAX_URL_LENGTH);
|
termValueSetConceptTable.addColumn("SYSTEM_URL").nonNullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, TermCodeSystem.MAX_URL_LENGTH);
|
||||||
termValueSetConceptTable.addColumn("CODEVAL").nonNullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, TermConcept.MAX_CODE_LENGTH);
|
termValueSetConceptTable.addColumn("CODEVAL").nonNullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, TermConcept.MAX_CODE_LENGTH);
|
||||||
termValueSetConceptTable
|
|
||||||
.addIndex("IDX_VALUESET_CONCEPT_CS_CD")
|
|
||||||
.unique(false)
|
|
||||||
.withColumns("SYSTEM_URL", "CODEVAL");
|
|
||||||
termValueSetConceptTable.addColumn("DISPLAY").nullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, TermConcept.MAX_DESC_LENGTH);
|
termValueSetConceptTable.addColumn("DISPLAY").nullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, TermConcept.MAX_DESC_LENGTH);
|
||||||
version.onTable("TRM_VALUESET_CONCEPT")
|
version.onTable("TRM_VALUESET_CONCEPT")
|
||||||
.renameColumn("CODE", "CODEVAL", true, true)
|
.renameColumn("CODE", "CODEVAL", true, true)
|
||||||
.renameColumn("SYSTEM", "SYSTEM_URL", true, true);
|
.renameColumn("SYSTEM", "SYSTEM_URL", true, true);
|
||||||
|
|
||||||
|
version.startSectionWithMessage("Processing table: TRM_VALUESET_CONCEPT, swapping index for unique constraint");
|
||||||
|
termValueSetConceptTable.dropIndex("IDX_VALUESET_CONCEPT_CS_CD");
|
||||||
|
termValueSetConceptTable
|
||||||
|
.addIndex("IDX_VS_CONCEPT_CS_CD")
|
||||||
|
.unique(true)
|
||||||
|
.withColumns("VALUESET_PID", "SYSTEM_URL", "CODEVAL");
|
||||||
|
|
||||||
// TermValueSetConceptDesignation
|
// TermValueSetConceptDesignation
|
||||||
version.startSectionWithMessage("Processing table: TRM_VALUESET_C_DESIGNATION");
|
version.startSectionWithMessage("Processing table: TRM_VALUESET_C_DESIGNATION");
|
||||||
version.addIdGenerator("SEQ_VALUESET_C_DSGNTN_PID");
|
version.addIdGenerator("SEQ_VALUESET_C_DSGNTN_PID");
|
||||||
|
|
Loading…
Reference in New Issue