Revised approach for versioning of ValueSet.
This commit is contained in:
parent
d00db11586
commit
cd104ad635
|
@ -29,18 +29,27 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.data.repository.query.Param;
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public interface ITermValueSetDao extends JpaRepository<TermValueSet, Long> {
|
public interface ITermValueSetDao extends JpaRepository<TermValueSet, Long> {
|
||||||
|
|
||||||
@Query("SELECT vs FROM TermValueSet vs WHERE vs.myResourcePid = :resource_pid")
|
@Query("SELECT vs FROM TermValueSet vs WHERE vs.myResourcePid = :resource_pid")
|
||||||
Optional<TermValueSet> findByResourcePid(@Param("resource_pid") Long theResourcePid);
|
Optional<TermValueSet> findByResourcePid(@Param("resource_pid") Long theResourcePid);
|
||||||
|
|
||||||
@Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url")
|
@Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url")
|
||||||
Optional<TermValueSet> findByUrl(@Param("url") String theUrl);
|
Optional<TermValueSet> findByUrl(@Param("url") String theUrl);
|
||||||
|
|
||||||
@Query("SELECT vs FROM TermValueSet vs WHERE vs.myCurrentVersion.myId = :vsv_pid")
|
@Query("SELECT vs FROM TermValueSet vs WHERE vs.myExpansionStatus = :expansion_status")
|
||||||
Optional<TermValueSet> findWithCodeSystemVersionAsCurrentVersion(@Param("vsv_pid") Long theValueSetVersionPid);
|
Slice<TermValueSet> findByExpansionStatus(Pageable pageable, @Param("expansion_status") TermValueSetPreExpansionStatusEnum theExpansionStatus);
|
||||||
|
|
||||||
|
@Query(value="SELECT vs FROM TermValueSet vs INNER JOIN ResourceTable r ON r.myId = vs.myResourcePid WHERE vs.myUrl = :url ORDER BY r.myUpdated DESC")
|
||||||
|
List<TermValueSet> findTermValueSetByUrl(Pageable thePage, @Param("url") String theUrl);
|
||||||
|
|
||||||
|
@Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url AND vs.myVersion IS NULL")
|
||||||
|
Optional<TermValueSet> findTermValueSetByUrlAndNullVersion(@Param("url") String theUrl);
|
||||||
|
|
||||||
|
@Query("SELECT vs FROM TermValueSet vs WHERE vs.myUrl = :url AND vs.myVersion = :version")
|
||||||
|
Optional<TermValueSet> findTermValueSetByUrlAndVersion(@Param("url") String theUrl, @Param("version") String theVersion);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
package ca.uhn.fhir.jpa.dao.data;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* #%L
|
|
||||||
* HAPI FHIR JPA Server
|
|
||||||
* %%
|
|
||||||
* Copyright (C) 2014 - 2020 University Health Network
|
|
||||||
* %%
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* #L%
|
|
||||||
*/
|
|
||||||
|
|
||||||
import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion;
|
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.data.domain.Slice;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.data.repository.query.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public interface ITermValueSetVersionDao extends JpaRepository<TermValueSetVersion, Long> {
|
|
||||||
|
|
||||||
@Query("SELECT vsv FROM TermValueSetVersion vsv WHERE vsv.myResourcePid = :resource_pid")
|
|
||||||
Optional<TermValueSetVersion> findByResourcePid(@Param("resource_pid") Long theResourcePid);
|
|
||||||
|
|
||||||
@Query("SELECT vsv FROM TermValueSetVersion vsv WHERE vsv.myValueSetPid = :valueset_pid AND vsv.myValueSetVersionId = :version" )
|
|
||||||
TermValueSetVersion findByValueSetPidAndVersion(@Param("valueset_pid") Long theValueSetPid, @Param("version") String theVersion);
|
|
||||||
|
|
||||||
@Query("SELECT vsv FROM TermValueSetVersion vsv WHERE vsv.myValueSetPid = :valueset_pid AND vsv.myValueSetVersionId IS NULL" )
|
|
||||||
TermValueSetVersion findByValueSetPidAndNullVersion(@Param("valueset_pid") Long theValueSetPid);
|
|
||||||
|
|
||||||
@Query("SELECT vsv FROM TermValueSetVersion vsv WHERE vsv.myExpansionStatus = :expansion_status")
|
|
||||||
Slice<TermValueSetVersion> findByExpansionStatus(Pageable pageable, @Param("expansion_status") TermValueSetPreExpansionStatusEnum theExpansionStatus);
|
|
||||||
|
|
||||||
@Query("SELECT vsv FROM TermValueSetVersion vsv WHERE vsv.myValueSetPid = :valueset_pid")
|
|
||||||
List<TermValueSetVersion> findByValueSetPid(@Param("valueset_pid") Long theValueSetPid);
|
|
||||||
|
|
||||||
}
|
|
|
@ -65,9 +65,6 @@ import static org.hl7.fhir.convertors.conv30_40.ValueSet30_40.convertValueSet;
|
||||||
public class FhirResourceDaoValueSetDstu3 extends BaseHapiFhirResourceDao<ValueSet> implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
public class FhirResourceDaoValueSetDstu3 extends BaseHapiFhirResourceDao<ValueSet> implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
||||||
private static final Logger ourLog = LoggerFactory.getLogger(FhirResourceDaoValueSetDstu3.class);
|
private static final Logger ourLog = LoggerFactory.getLogger(FhirResourceDaoValueSetDstu3.class);
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ITermReadSvc myHapiTerminologySvc;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DefaultProfileValidationSupport myDefaultProfileValidationSupport;
|
private DefaultProfileValidationSupport myDefaultProfileValidationSupport;
|
||||||
|
|
||||||
|
@ -283,12 +280,12 @@ public class FhirResourceDaoValueSetDstu3 extends BaseHapiFhirResourceDao<ValueS
|
||||||
try {
|
try {
|
||||||
ValueSet valueSet = (ValueSet) theResource;
|
ValueSet valueSet = (ValueSet) theResource;
|
||||||
org.hl7.fhir.r4.model.ValueSet converted = convertValueSet(valueSet);
|
org.hl7.fhir.r4.model.ValueSet converted = convertValueSet(valueSet);
|
||||||
myHapiTerminologySvc.storeTermValueSet(retVal, converted);
|
myTerminologySvc.storeTermValueSet(retVal, converted);
|
||||||
} catch (FHIRException fe) {
|
} catch (FHIRException fe) {
|
||||||
throw new InternalErrorException(fe);
|
throw new InternalErrorException(fe);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
myHapiTerminologySvc.deleteValueSetAndChildren(retVal);
|
myTerminologySvc.deleteValueSetAndChildren(retVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ import ca.uhn.fhir.jpa.entity.TermConceptProperty;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import ca.uhn.fhir.jpa.model.entity.ForcedId;
|
import ca.uhn.fhir.jpa.model.entity.ForcedId;
|
||||||
import ca.uhn.fhir.jpa.model.entity.NpmPackageEntity;
|
import ca.uhn.fhir.jpa.model.entity.NpmPackageEntity;
|
||||||
import ca.uhn.fhir.jpa.model.entity.NpmPackageVersionEntity;
|
import ca.uhn.fhir.jpa.model.entity.NpmPackageVersionEntity;
|
||||||
|
@ -118,10 +117,10 @@ public class ExpungeEverythingService {
|
||||||
counter.addAndGet(doExpungeEverythingQuery("UPDATE " + TermCodeSystem.class.getSimpleName() + " d SET d.myCurrentVersion = null"));
|
counter.addAndGet(doExpungeEverythingQuery("UPDATE " + TermCodeSystem.class.getSimpleName() + " d SET d.myCurrentVersion = null"));
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
myTxTemplate.execute(t -> {
|
// myTxTemplate.execute(t -> {
|
||||||
counter.addAndGet(doExpungeEverythingQuery("UPDATE " + TermValueSet.class.getSimpleName() + " d SET d.myCurrentVersion = null"));
|
// counter.addAndGet(doExpungeEverythingQuery("UPDATE " + TermValueSet.class.getSimpleName() + " d SET d.myCurrentVersion = null"));
|
||||||
return null;
|
// return null;
|
||||||
});
|
// });
|
||||||
counter.addAndGet(expungeEverythingByType(NpmPackageVersionResourceEntity.class));
|
counter.addAndGet(expungeEverythingByType(NpmPackageVersionResourceEntity.class));
|
||||||
counter.addAndGet(expungeEverythingByType(NpmPackageVersionEntity.class));
|
counter.addAndGet(expungeEverythingByType(NpmPackageVersionEntity.class));
|
||||||
counter.addAndGet(expungeEverythingByType(NpmPackageEntity.class));
|
counter.addAndGet(expungeEverythingByType(NpmPackageEntity.class));
|
||||||
|
@ -140,7 +139,7 @@ public class ExpungeEverythingService {
|
||||||
counter.addAndGet(expungeEverythingByType(SearchInclude.class));
|
counter.addAndGet(expungeEverythingByType(SearchInclude.class));
|
||||||
counter.addAndGet(expungeEverythingByType(TermValueSetConceptDesignation.class));
|
counter.addAndGet(expungeEverythingByType(TermValueSetConceptDesignation.class));
|
||||||
counter.addAndGet(expungeEverythingByType(TermValueSetConcept.class));
|
counter.addAndGet(expungeEverythingByType(TermValueSetConcept.class));
|
||||||
counter.addAndGet(expungeEverythingByType(TermValueSetVersion.class));
|
// counter.addAndGet(expungeEverythingByType(TermValueSetVersion.class));
|
||||||
counter.addAndGet(expungeEverythingByType(TermValueSet.class));
|
counter.addAndGet(expungeEverythingByType(TermValueSet.class));
|
||||||
counter.addAndGet(expungeEverythingByType(TermConceptParentChildLink.class));
|
counter.addAndGet(expungeEverythingByType(TermConceptParentChildLink.class));
|
||||||
counter.addAndGet(expungeEverythingByType(TermConceptMapGroupElementTarget.class));
|
counter.addAndGet(expungeEverythingByType(TermConceptMapGroupElementTarget.class));
|
||||||
|
|
|
@ -60,9 +60,6 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||||
|
|
||||||
public class FhirResourceDaoValueSetR4 extends BaseHapiFhirResourceDao<ValueSet> implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
public class FhirResourceDaoValueSetR4 extends BaseHapiFhirResourceDao<ValueSet> implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ITermReadSvc myHapiTerminologySvc;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DefaultProfileValidationSupport myDefaultProfileValidationSupport;
|
private DefaultProfileValidationSupport myDefaultProfileValidationSupport;
|
||||||
|
|
||||||
|
@ -113,17 +110,14 @@ public class FhirResourceDaoValueSetR4 extends BaseHapiFhirResourceDao<ValueSet>
|
||||||
ValueSet source = new ValueSet();
|
ValueSet source = new ValueSet();
|
||||||
source.setUrl(theUri);
|
source.setUrl(theUri);
|
||||||
|
|
||||||
// source.getCompose().addInclude().addValueSet(theUri);
|
source.getCompose().addInclude().addValueSet(theUri);
|
||||||
|
|
||||||
if (isNotBlank(theFilter)) {
|
if (isNotBlank(theFilter)) {
|
||||||
// ConceptSetComponent include = source.getCompose().addInclude();
|
ConceptSetComponent include = source.getCompose().addInclude();
|
||||||
// ConceptSetFilterComponent filter = include.addFilter();
|
ConceptSetFilterComponent filter = include.addFilter();
|
||||||
ConceptSetFilterComponent filter = source.getCompose().addInclude().addValueSet(theUri).addFilter();
|
|
||||||
filter.setProperty("display");
|
filter.setProperty("display");
|
||||||
filter.setOp(FilterOperator.EQUAL);
|
filter.setOp(FilterOperator.EQUAL);
|
||||||
filter.setValue(theFilter);
|
filter.setValue(theFilter);
|
||||||
} else {
|
|
||||||
source.getCompose().addInclude().addValueSet(theUri);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueSet retVal = doExpand(source);
|
ValueSet retVal = doExpand(source);
|
||||||
|
@ -151,17 +145,14 @@ public class FhirResourceDaoValueSetR4 extends BaseHapiFhirResourceDao<ValueSet>
|
||||||
ValueSet source = new ValueSet();
|
ValueSet source = new ValueSet();
|
||||||
source.setUrl(theUri);
|
source.setUrl(theUri);
|
||||||
|
|
||||||
// source.getCompose().addInclude().addValueSet(theUri);
|
source.getCompose().addInclude().addValueSet(theUri);
|
||||||
|
|
||||||
if (isNotBlank(theFilter)) {
|
if (isNotBlank(theFilter)) {
|
||||||
// ConceptSetComponent include = source.getCompose().addInclude();
|
ConceptSetComponent include = source.getCompose().addInclude();
|
||||||
// ConceptSetFilterComponent filter = include.addFilter();
|
ConceptSetFilterComponent filter = include.addFilter();
|
||||||
ConceptSetFilterComponent filter = source.getCompose().addInclude().addValueSet(theUri).addFilter();
|
|
||||||
filter.setProperty("display");
|
filter.setProperty("display");
|
||||||
filter.setOp(FilterOperator.EQUAL);
|
filter.setOp(FilterOperator.EQUAL);
|
||||||
filter.setValue(theFilter);
|
filter.setValue(theFilter);
|
||||||
} else {
|
|
||||||
source.getCompose().addInclude().addValueSet(theUri);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueSet retVal = doExpand(source, theOffset, theCount);
|
ValueSet retVal = doExpand(source, theOffset, theCount);
|
||||||
|
@ -268,9 +259,9 @@ public class FhirResourceDaoValueSetR4 extends BaseHapiFhirResourceDao<ValueSet>
|
||||||
if (myDaoConfig.isPreExpandValueSets() && !retVal.isUnchangedInCurrentOperation()) {
|
if (myDaoConfig.isPreExpandValueSets() && !retVal.isUnchangedInCurrentOperation()) {
|
||||||
if (retVal.getDeleted() == null) {
|
if (retVal.getDeleted() == null) {
|
||||||
ValueSet valueSet = (ValueSet) theResource;
|
ValueSet valueSet = (ValueSet) theResource;
|
||||||
myHapiTerminologySvc.storeTermValueSet(retVal, valueSet);
|
myTerminologySvc.storeTermValueSet(retVal, valueSet);
|
||||||
} else {
|
} else {
|
||||||
myHapiTerminologySvc.deleteValueSetAndChildren(retVal);
|
myTerminologySvc.deleteValueSetAndChildren(retVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,9 +64,6 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||||
|
|
||||||
public class FhirResourceDaoValueSetR5 extends BaseHapiFhirResourceDao<ValueSet> implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
public class FhirResourceDaoValueSetR5 extends BaseHapiFhirResourceDao<ValueSet> implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ITermReadSvc myHapiTerminologySvc;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Qualifier("myDefaultProfileValidationSupport")
|
@Qualifier("myDefaultProfileValidationSupport")
|
||||||
private IValidationSupport myDefaultProfileValidationSupport;
|
private IValidationSupport myDefaultProfileValidationSupport;
|
||||||
|
@ -267,9 +264,9 @@ public class FhirResourceDaoValueSetR5 extends BaseHapiFhirResourceDao<ValueSet>
|
||||||
if (myDaoConfig.isPreExpandValueSets() && !retVal.isUnchangedInCurrentOperation()) {
|
if (myDaoConfig.isPreExpandValueSets() && !retVal.isUnchangedInCurrentOperation()) {
|
||||||
if (retVal.getDeleted() == null) {
|
if (retVal.getDeleted() == null) {
|
||||||
ValueSet valueSet = (ValueSet) theResource;
|
ValueSet valueSet = (ValueSet) theResource;
|
||||||
myHapiTerminologySvc.storeTermValueSet(retVal, org.hl7.fhir.convertors.conv40_50.ValueSet40_50.convertValueSet(valueSet));
|
myTerminologySvc.storeTermValueSet(retVal, org.hl7.fhir.convertors.conv40_50.ValueSet40_50.convertValueSet(valueSet));
|
||||||
} else {
|
} else {
|
||||||
myHapiTerminologySvc.deleteValueSetAndChildren(retVal);
|
myTerminologySvc.deleteValueSetAndChildren(retVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,16 +25,19 @@ import ca.uhn.fhir.util.ValidateUtil;
|
||||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
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", uniqueConstraints = {
|
@Table(name = "TRM_VALUESET", uniqueConstraints = {
|
||||||
@UniqueConstraint(name = "IDX_VALUESET_URL", columnNames = {"URL"})
|
@UniqueConstraint(name = "IDX_VALUESET_URL", columnNames = {"URL", "VER"})
|
||||||
})
|
})
|
||||||
@Entity()
|
@Entity()
|
||||||
public class TermValueSet implements Serializable {
|
public class TermValueSet implements Serializable {
|
||||||
|
@ -43,12 +46,7 @@ public class TermValueSet implements Serializable {
|
||||||
public static final int MAX_EXPANSION_STATUS_LENGTH = 50;
|
public static final int MAX_EXPANSION_STATUS_LENGTH = 50;
|
||||||
public static final int MAX_NAME_LENGTH = 200;
|
public static final int MAX_NAME_LENGTH = 200;
|
||||||
public static final int MAX_URL_LENGTH = 200;
|
public static final int MAX_URL_LENGTH = 200;
|
||||||
|
static final int MAX_VER_LENGTH = 200;
|
||||||
@OneToOne(fetch = FetchType.LAZY)
|
|
||||||
@JoinColumn(name = "CURRENT_VERSION_PID", referencedColumnName = "PID", nullable = true, foreignKey = @ForeignKey(name = "FK_TRMVALUESET_CURVER"))
|
|
||||||
private TermValueSetVersion myCurrentVersion;
|
|
||||||
@Column(name = "CURRENT_VERSION_PID", nullable = true, insertable = false, updatable = false)
|
|
||||||
private Long myCurrentVersionPid;
|
|
||||||
|
|
||||||
@Id()
|
@Id()
|
||||||
@SequenceGenerator(name = "SEQ_VALUESET_PID", sequenceName = "SEQ_VALUESET_PID")
|
@SequenceGenerator(name = "SEQ_VALUESET_PID", sequenceName = "SEQ_VALUESET_PID")
|
||||||
|
@ -59,6 +57,9 @@ public class TermValueSet implements Serializable {
|
||||||
@Column(name = "URL", nullable = false, length = MAX_URL_LENGTH)
|
@Column(name = "URL", nullable = false, length = MAX_URL_LENGTH)
|
||||||
private String myUrl;
|
private String myUrl;
|
||||||
|
|
||||||
|
@Column(name = "VER", nullable = true, length = MAX_VER_LENGTH)
|
||||||
|
private String myVersion;
|
||||||
|
|
||||||
@OneToOne()
|
@OneToOne()
|
||||||
@JoinColumn(name = "RES_ID", referencedColumnName = "RES_ID", nullable = false, updatable = false, foreignKey = @ForeignKey(name = "FK_TRMVALUESET_RES"))
|
@JoinColumn(name = "RES_ID", referencedColumnName = "RES_ID", nullable = false, updatable = false, foreignKey = @ForeignKey(name = "FK_TRMVALUESET_RES"))
|
||||||
private ResourceTable myResource;
|
private ResourceTable myResource;
|
||||||
|
@ -69,11 +70,29 @@ public class TermValueSet implements Serializable {
|
||||||
@Column(name = "VSNAME", nullable = true, length = MAX_NAME_LENGTH)
|
@Column(name = "VSNAME", nullable = true, length = MAX_NAME_LENGTH)
|
||||||
private String myName;
|
private String myName;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "myValueSet", fetch = FetchType.LAZY)
|
||||||
|
private List<TermValueSetConcept> myConcepts;
|
||||||
|
|
||||||
|
@Column(name = "TOTAL_CONCEPTS", nullable = false)
|
||||||
|
@ColumnDefault("0")
|
||||||
|
private Long myTotalConcepts;
|
||||||
|
|
||||||
|
@Column(name = "TOTAL_CONCEPT_DESIGNATIONS", nullable = false)
|
||||||
|
@ColumnDefault("0")
|
||||||
|
private Long myTotalConceptDesignations;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "EXPANSION_STATUS", nullable = false, length = MAX_EXPANSION_STATUS_LENGTH)
|
||||||
|
private TermValueSetPreExpansionStatusEnum myExpansionStatus;
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
private transient Integer myHashCode;
|
private transient Integer myHashCode;
|
||||||
|
|
||||||
public TermValueSet() {
|
public TermValueSet() {
|
||||||
super();
|
super();
|
||||||
|
myExpansionStatus = TermValueSetPreExpansionStatusEnum.NOT_EXPANDED;
|
||||||
|
myTotalConcepts = 0L;
|
||||||
|
myTotalConceptDesignations = 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
|
@ -110,12 +129,72 @@ public class TermValueSet implements Serializable {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TermValueSetVersion getCurrentVersion() {
|
public List<TermValueSetConcept> getConcepts() {
|
||||||
return myCurrentVersion;
|
if (myConcepts == null) {
|
||||||
|
myConcepts = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
return myConcepts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TermValueSet setCurrentVersion(TermValueSetVersion theCurrentVersion) {
|
public Long getTotalConcepts() {
|
||||||
myCurrentVersion = theCurrentVersion;
|
return myTotalConcepts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TermValueSet setTotalConcepts(Long theTotalConcepts) {
|
||||||
|
myTotalConcepts = theTotalConcepts;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TermValueSet decrementTotalConcepts() {
|
||||||
|
if (myTotalConcepts > 0) {
|
||||||
|
myTotalConcepts--;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TermValueSet incrementTotalConcepts() {
|
||||||
|
myTotalConcepts++;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotalConceptDesignations() {
|
||||||
|
return myTotalConceptDesignations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TermValueSet setTotalConceptDesignations(Long theTotalConceptDesignations) {
|
||||||
|
myTotalConceptDesignations = theTotalConceptDesignations;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TermValueSet decrementTotalConceptDesignations() {
|
||||||
|
if (myTotalConceptDesignations > 0) {
|
||||||
|
myTotalConceptDesignations--;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TermValueSet incrementTotalConceptDesignations() {
|
||||||
|
myTotalConceptDesignations++;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TermValueSetPreExpansionStatusEnum getExpansionStatus() {
|
||||||
|
return myExpansionStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpansionStatus(TermValueSetPreExpansionStatusEnum theExpansionStatus) {
|
||||||
|
myExpansionStatus = theExpansionStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return myVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TermValueSet setVersion(String theVersion) {
|
||||||
|
ValidateUtil.isNotTooLongOrThrowIllegalArgument(theVersion, MAX_VER_LENGTH,
|
||||||
|
"Version exceeds maximum length (" + MAX_VER_LENGTH + "): " + length(theVersion));
|
||||||
|
myVersion = theVersion;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,6 +227,10 @@ public class TermValueSet implements Serializable {
|
||||||
.append(myResource != null ? ("myResource=" + myResource.toString()) : ("myResource=(null)"))
|
.append(myResource != null ? ("myResource=" + myResource.toString()) : ("myResource=(null)"))
|
||||||
.append("myResourcePid", myResourcePid)
|
.append("myResourcePid", myResourcePid)
|
||||||
.append("myName", myName)
|
.append("myName", myName)
|
||||||
|
.append(myConcepts != null ? ("myConcepts - size=" + myConcepts.size()) : ("myConcepts=(null)"))
|
||||||
|
.append("myTotalConcepts", myTotalConcepts)
|
||||||
|
.append("myTotalConceptDesignations", myTotalConceptDesignations)
|
||||||
|
.append("myExpansionStatus", myExpansionStatus)
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,249 +0,0 @@
|
||||||
package ca.uhn.fhir.jpa.entity;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* #%L
|
|
||||||
* HAPI FHIR JPA Server
|
|
||||||
* %%
|
|
||||||
* Copyright (C) 2014 - 2020 University Health Network
|
|
||||||
* %%
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* #L%
|
|
||||||
*/
|
|
||||||
|
|
||||||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
|
||||||
import ca.uhn.fhir.util.ValidateUtil;
|
|
||||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.EnumType;
|
|
||||||
import javax.persistence.Enumerated;
|
|
||||||
import javax.persistence.FetchType;
|
|
||||||
import javax.persistence.ForeignKey;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.GenerationType;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.ManyToOne;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.OneToOne;
|
|
||||||
import javax.persistence.SequenceGenerator;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
import javax.persistence.UniqueConstraint;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static org.apache.commons.lang3.StringUtils.length;
|
|
||||||
|
|
||||||
@Table(name = "TRM_VALUESET_VER", uniqueConstraints = {
|
|
||||||
@UniqueConstraint(name = "IDX_VALUESET_URL_AND_VER", columnNames = {"VALUESET_PID", "VS_VERSION_ID"})
|
|
||||||
})
|
|
||||||
@Entity()
|
|
||||||
public class TermValueSetVersion implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public static final int MAX_EXPANSION_STATUS_LENGTH = 50;
|
|
||||||
public static final int MAX_NAME_LENGTH = 200;
|
|
||||||
public static final int MAX_VERSION_LENGTH = 200;
|
|
||||||
|
|
||||||
@Id()
|
|
||||||
@SequenceGenerator(name = "SEQ_VALUESETVER_PID", sequenceName = "SEQ_VALUESETVER_PID")
|
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_VALUESETVER_PID")
|
|
||||||
@Column(name = "PID")
|
|
||||||
private Long myId;
|
|
||||||
|
|
||||||
@OneToOne()
|
|
||||||
@JoinColumn(name = "RES_ID", referencedColumnName = "RES_ID", nullable = false, updatable = false, foreignKey = @ForeignKey(name = "FK_TRMVALUESETVER_RES"))
|
|
||||||
private ResourceTable myResource;
|
|
||||||
|
|
||||||
@Column(name = "RES_ID", insertable = false, updatable = false)
|
|
||||||
private Long myResourcePid;
|
|
||||||
|
|
||||||
@OneToMany(mappedBy = "myValueSet", fetch = FetchType.LAZY)
|
|
||||||
private List<TermValueSetConcept> myConcepts;
|
|
||||||
|
|
||||||
@Column(name = "TOTAL_CONCEPTS", nullable = false)
|
|
||||||
@ColumnDefault("0")
|
|
||||||
private Long myTotalConcepts;
|
|
||||||
|
|
||||||
@Column(name = "TOTAL_CONCEPT_DESIGNATIONS", nullable = false)
|
|
||||||
@ColumnDefault("0")
|
|
||||||
private Long myTotalConceptDesignations;
|
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
@Column(name = "EXPANSION_STATUS", nullable = false, length = MAX_EXPANSION_STATUS_LENGTH)
|
|
||||||
private TermValueSetPreExpansionStatusEnum myExpansionStatus;
|
|
||||||
|
|
||||||
@Column(name = "VS_VERSION_ID", nullable = true, updatable = false, length = MAX_VERSION_LENGTH)
|
|
||||||
private String myValueSetVersionId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This was added in HAPI FHIR 3.3.0 and is nullable just to avoid migration
|
|
||||||
* issued. It should be made non-nullable at some point.
|
|
||||||
*/
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
|
||||||
@JoinColumn(name = "VALUESET_PID", referencedColumnName = "PID", nullable = true, foreignKey = @ForeignKey(name = "FK_VALSETVER_VS_ID"))
|
|
||||||
private TermValueSet myValueSet;
|
|
||||||
|
|
||||||
@Column(name = "VALUESET_PID", insertable = false, updatable = false)
|
|
||||||
private Long myValueSetPid;
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
@OneToOne(mappedBy = "myCurrentVersion", optional = true, fetch = FetchType.LAZY)
|
|
||||||
private TermValueSet myValueSetHavingThisVersionAsCurrentVersionIfAny;
|
|
||||||
|
|
||||||
public TermValueSetVersion() {
|
|
||||||
super();
|
|
||||||
myExpansionStatus = TermValueSetPreExpansionStatusEnum.NOT_EXPANDED;
|
|
||||||
myTotalConcepts = 0L;
|
|
||||||
myTotalConceptDesignations = 0L;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return myId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResourceTable getResource() {
|
|
||||||
return myResource;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetVersion setResource(ResourceTable theResource) {
|
|
||||||
myResource = theResource;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<TermValueSetConcept> getConcepts() {
|
|
||||||
if (myConcepts == null) {
|
|
||||||
myConcepts = new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
return myConcepts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getTotalConcepts() {
|
|
||||||
return myTotalConcepts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetVersion setTotalConcepts(Long theTotalConcepts) {
|
|
||||||
myTotalConcepts = theTotalConcepts;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetVersion decrementTotalConcepts() {
|
|
||||||
if (myTotalConcepts > 0) {
|
|
||||||
myTotalConcepts--;
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetVersion incrementTotalConcepts() {
|
|
||||||
myTotalConcepts++;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getTotalConceptDesignations() {
|
|
||||||
return myTotalConceptDesignations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetVersion setTotalConceptDesignations(Long theTotalConceptDesignations) {
|
|
||||||
myTotalConceptDesignations = theTotalConceptDesignations;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetVersion decrementTotalConceptDesignations() {
|
|
||||||
if (myTotalConceptDesignations > 0) {
|
|
||||||
myTotalConceptDesignations--;
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetVersion incrementTotalConceptDesignations() {
|
|
||||||
myTotalConceptDesignations++;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetPreExpansionStatusEnum getExpansionStatus() {
|
|
||||||
return myExpansionStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExpansionStatus(TermValueSetPreExpansionStatusEnum theExpansionStatus) {
|
|
||||||
myExpansionStatus = theExpansionStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValueSetVersionId() {
|
|
||||||
return myValueSetVersionId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetVersion setValueSetVersionId(String theValueSetVersionId) {
|
|
||||||
ValidateUtil.isNotTooLongOrThrowIllegalArgument(
|
|
||||||
theValueSetVersionId, MAX_VERSION_LENGTH,
|
|
||||||
"Version ID exceeds maximum length (" + MAX_VERSION_LENGTH + "): " + length(theValueSetVersionId));
|
|
||||||
myValueSetVersionId = theValueSetVersionId;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSet getValueSet() {
|
|
||||||
return myValueSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TermValueSetVersion setValueSet(TermValueSet theValueSet) {
|
|
||||||
myValueSet = theValueSet;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getValueSetPid() {
|
|
||||||
return myValueSetPid;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object theO) {
|
|
||||||
if (this == theO) return true;
|
|
||||||
|
|
||||||
if (!(theO instanceof TermValueSetVersion)) return false;
|
|
||||||
|
|
||||||
TermValueSetVersion that = (TermValueSetVersion) theO;
|
|
||||||
|
|
||||||
return new EqualsBuilder()
|
|
||||||
.append(myValueSetVersionId, that.myValueSetVersionId)
|
|
||||||
.append(myValueSetPid, that.myValueSetPid)
|
|
||||||
.isEquals();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
HashCodeBuilder b = new HashCodeBuilder(17, 37);
|
|
||||||
b.append(myValueSetVersionId);
|
|
||||||
b.append(myValueSetPid);
|
|
||||||
return b.toHashCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
|
|
||||||
.append("myId", myId)
|
|
||||||
.append(myResource != null ? ("myResource=" + myResource.toString()) : ("myResource=(null)"))
|
|
||||||
.append("myResourcePid", myResourcePid)
|
|
||||||
.append("valueSetPid", myValueSetPid)
|
|
||||||
.append("valueSetVersionId", myValueSetVersionId)
|
|
||||||
.append(myConcepts != null ? ("myConcepts - size=" + myConcepts.size()) : ("myConcepts=(null)"))
|
|
||||||
.append("myTotalConcepts", myTotalConcepts)
|
|
||||||
.append("myTotalConceptDesignations", myTotalConceptDesignations)
|
|
||||||
.append("myExpansionStatus", myExpansionStatus)
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -45,7 +45,6 @@ import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptViewDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptViewDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetVersionDao;
|
|
||||||
import ca.uhn.fhir.jpa.entity.TermCodeSystem;
|
import ca.uhn.fhir.jpa.entity.TermCodeSystem;
|
||||||
import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion;
|
import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion;
|
||||||
import ca.uhn.fhir.jpa.entity.TermConcept;
|
import ca.uhn.fhir.jpa.entity.TermConcept;
|
||||||
|
@ -63,7 +62,6 @@ import ca.uhn.fhir.jpa.entity.TermValueSet;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConceptView;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConceptView;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
||||||
import ca.uhn.fhir.jpa.model.sched.HapiJob;
|
import ca.uhn.fhir.jpa.model.sched.HapiJob;
|
||||||
import ca.uhn.fhir.jpa.model.sched.ISchedulerService;
|
import ca.uhn.fhir.jpa.model.sched.ISchedulerService;
|
||||||
|
@ -83,7 +81,6 @@ import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||||
import ca.uhn.fhir.util.CoverageIgnore;
|
import ca.uhn.fhir.util.CoverageIgnore;
|
||||||
import ca.uhn.fhir.util.ObjectUtil;
|
|
||||||
import ca.uhn.fhir.util.StopWatch;
|
import ca.uhn.fhir.util.StopWatch;
|
||||||
import ca.uhn.fhir.util.UrlUtil;
|
import ca.uhn.fhir.util.UrlUtil;
|
||||||
import ca.uhn.fhir.util.ValidateUtil;
|
import ca.uhn.fhir.util.ValidateUtil;
|
||||||
|
@ -207,8 +204,6 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITermValueSetDao myValueSetDao;
|
protected ITermValueSetDao myValueSetDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITermValueSetVersionDao myValueSetVersionDao;
|
|
||||||
@Autowired
|
|
||||||
protected ITermValueSetConceptDao myValueSetConceptDao;
|
protected ITermValueSetConceptDao myValueSetConceptDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITermValueSetConceptDesignationDao myValueSetConceptDesignationDao;
|
protected ITermValueSetConceptDesignationDao myValueSetConceptDesignationDao;
|
||||||
|
@ -338,37 +333,16 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
|
|
||||||
public void deleteValueSetForResource(ResourceTable theResourceTable) {
|
public void deleteValueSetForResource(ResourceTable theResourceTable) {
|
||||||
// Get existing entity so it can be deleted.
|
// Get existing entity so it can be deleted.
|
||||||
Optional<TermValueSetVersion> optionalExistingTermValueSetVersionById = myValueSetVersionDao.findByResourcePid(theResourceTable.getId());
|
Optional<TermValueSet> optionalExistingTermValueSetById = myValueSetDao.findByResourcePid(theResourceTable.getId());
|
||||||
|
|
||||||
if (optionalExistingTermValueSetVersionById.isPresent()) {
|
if (optionalExistingTermValueSetById.isPresent()) {
|
||||||
TermValueSetVersion existingTermValueSetVersion = optionalExistingTermValueSetVersionById.get();
|
TermValueSet existingTermValueSet = optionalExistingTermValueSetById.get();
|
||||||
|
|
||||||
ourLog.info("Deleting existing TermValueSetVersion[{}] and its children...", existingTermValueSetVersion.getId());
|
ourLog.info("Deleting existing TermValueSet[{}] and its children...", existingTermValueSet.getId());
|
||||||
myValueSetConceptDesignationDao.deleteByTermValueSetId(existingTermValueSetVersion.getId());
|
myValueSetConceptDesignationDao.deleteByTermValueSetId(existingTermValueSet.getId());
|
||||||
myValueSetConceptDao.deleteByTermValueSetId(existingTermValueSetVersion.getId());
|
myValueSetConceptDao.deleteByTermValueSetId(existingTermValueSet.getId());
|
||||||
|
myValueSetDao.deleteById(existingTermValueSet.getId());
|
||||||
// Check if this is the current version. If so, clear the current version from TermValueSet.
|
ourLog.info("Done deleting existing TermValueSet[{}] and its children.", existingTermValueSet.getId());
|
||||||
TermValueSet termValueSet = existingTermValueSetVersion.getValueSet();
|
|
||||||
TransactionTemplate txTemplate = new TransactionTemplate(myTransactionManager);
|
|
||||||
txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
|
|
||||||
Boolean versionIsCurrent = termValueSet.getCurrentVersion().getId() == existingTermValueSetVersion.getId();
|
|
||||||
if (versionIsCurrent) {
|
|
||||||
txTemplate.executeWithoutResult(t -> {
|
|
||||||
termValueSet.setCurrentVersion(null);
|
|
||||||
myValueSetDao.save(termValueSet);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
myValueSetVersionDao.deleteById(existingTermValueSetVersion.getId());
|
|
||||||
ourLog.info("Done deleting existing TermValueSetVersion[{}] and its children.", existingTermValueSetVersion.getId());
|
|
||||||
|
|
||||||
// If this is the current version, then delete the TermValueSet master as well.
|
|
||||||
if (versionIsCurrent) {
|
|
||||||
txTemplate.executeWithoutResult(t -> {
|
|
||||||
ourLog.info(" * Deleting value set {}", termValueSet.getId());
|
|
||||||
myValueSetDao.deleteById(termValueSet.getId());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -418,7 +392,11 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
|
|
||||||
Optional<TermValueSet> optionalTermValueSet;
|
Optional<TermValueSet> optionalTermValueSet;
|
||||||
if (theValueSetToExpand.hasUrl()) {
|
if (theValueSetToExpand.hasUrl()) {
|
||||||
optionalTermValueSet = myValueSetDao.findByUrl(theValueSetToExpand.getUrl());
|
if (theValueSetToExpand.hasVersion()) {
|
||||||
|
optionalTermValueSet = myValueSetDao.findTermValueSetByUrlAndVersion(theValueSetToExpand.getUrl(), theValueSetToExpand.getVersion());
|
||||||
|
} else {
|
||||||
|
optionalTermValueSet = myValueSetDao.findTermValueSetByUrlAndNullVersion(theValueSetToExpand.getUrl());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
optionalTermValueSet = Optional.empty();
|
optionalTermValueSet = Optional.empty();
|
||||||
}
|
}
|
||||||
|
@ -429,17 +407,10 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
}
|
}
|
||||||
|
|
||||||
TermValueSet termValueSet = optionalTermValueSet.get();
|
TermValueSet termValueSet = optionalTermValueSet.get();
|
||||||
TermValueSetVersion termValueSetVersion;
|
|
||||||
String valueSetVersion = theValueSetToExpand.getVersion();
|
|
||||||
if (valueSetVersion != null) {
|
|
||||||
termValueSetVersion = myValueSetVersionDao.findByValueSetPidAndVersion(termValueSet.getId(),theValueSetToExpand.getVersion());
|
|
||||||
} else {
|
|
||||||
termValueSetVersion = myValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (termValueSetVersion.getExpansionStatus() != TermValueSetPreExpansionStatusEnum.EXPANDED) {
|
if (termValueSet.getExpansionStatus() != TermValueSetPreExpansionStatusEnum.EXPANDED) {
|
||||||
ourLog.warn("{} is present in terminology tables but not ready for persistence-backed invocation of operation $expand. Will perform in-memory expansion without parameters. Current status: {} | {}",
|
ourLog.warn("{} is present in terminology tables but not ready for persistence-backed invocation of operation $expand. Will perform in-memory expansion without parameters. Current status: {} | {}",
|
||||||
getValueSetInfo(theValueSetToExpand), termValueSetVersion.getExpansionStatus().name(), termValueSetVersion.getExpansionStatus().getDescription());
|
getValueSetInfo(theValueSetToExpand), termValueSet.getExpansionStatus().name(), termValueSet.getExpansionStatus().getDescription());
|
||||||
return expandValueSetInMemory(theExpansionOptions, theValueSetToExpand, null); // In-memory expansion.
|
return expandValueSetInMemory(theExpansionOptions, theValueSetToExpand, null); // In-memory expansion.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,7 +421,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
ValueSetExpansionOptions expansionOptions = provideExpansionOptions(theExpansionOptions);
|
ValueSetExpansionOptions expansionOptions = provideExpansionOptions(theExpansionOptions);
|
||||||
int offset = expansionOptions.getOffset();
|
int offset = expansionOptions.getOffset();
|
||||||
int count = expansionOptions.getCount();
|
int count = expansionOptions.getCount();
|
||||||
populateExpansionComponent(expansionComponent, termValueSetVersion, offset, count, termValueSet.getUrl());
|
populateExpansionComponent(expansionComponent, termValueSet, offset, count, termValueSet.getUrl());
|
||||||
|
|
||||||
ValueSet valueSet = new ValueSet();
|
ValueSet valueSet = new ValueSet();
|
||||||
valueSet.setStatus(Enumerations.PublicationStatus.ACTIVE);
|
valueSet.setStatus(Enumerations.PublicationStatus.ACTIVE);
|
||||||
|
@ -459,8 +430,8 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
return valueSet;
|
return valueSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateExpansionComponent(ValueSet.ValueSetExpansionComponent theExpansionComponent, TermValueSetVersion theTermValueSetVersion, int theOffset, int theCount, String theValueSetUrl) {
|
private void populateExpansionComponent(ValueSet.ValueSetExpansionComponent theExpansionComponent, TermValueSet theTermValueSet, int theOffset, int theCount, String theValueSetUrl) {
|
||||||
int total = theTermValueSetVersion.getTotalConcepts().intValue();
|
int total = theTermValueSet.getTotalConcepts().intValue();
|
||||||
theExpansionComponent.setTotal(total);
|
theExpansionComponent.setTotal(total);
|
||||||
theExpansionComponent.setOffset(theOffset);
|
theExpansionComponent.setOffset(theOffset);
|
||||||
theExpansionComponent.addParameter().setName("offset").setValue(new IntegerType(theOffset));
|
theExpansionComponent.addParameter().setName("offset").setValue(new IntegerType(theOffset));
|
||||||
|
@ -470,14 +441,14 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
expandConcepts(theExpansionComponent, theTermValueSetVersion, theOffset, theCount, theValueSetUrl);
|
expandConcepts(theExpansionComponent, theTermValueSet, theOffset, theCount, theValueSetUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void expandConcepts(ValueSet.ValueSetExpansionComponent theExpansionComponent, TermValueSetVersion theTermValueSetVersion, int theOffset, int theCount, String theValueSetUrl) {
|
private void expandConcepts(ValueSet.ValueSetExpansionComponent theExpansionComponent, TermValueSet theTermValueSet, int theOffset, int theCount, String theValueSetUrl) {
|
||||||
int conceptsExpanded = 0;
|
int conceptsExpanded = 0;
|
||||||
int designationsExpanded = 0;
|
int designationsExpanded = 0;
|
||||||
int toIndex = theOffset + theCount;
|
int toIndex = theOffset + theCount;
|
||||||
Collection<TermValueSetConceptView> conceptViews = myTermValueSetConceptViewDao.findByTermValueSetId(theOffset, toIndex, theTermValueSetVersion.getId());
|
Collection<TermValueSetConceptView> conceptViews = myTermValueSetConceptViewDao.findByTermValueSetId(theOffset, toIndex, theTermValueSet.getId());
|
||||||
|
|
||||||
if (conceptViews.isEmpty()) {
|
if (conceptViews.isEmpty()) {
|
||||||
logConceptsExpanded("No concepts to expand. ", theValueSetUrl, conceptsExpanded);
|
logConceptsExpanded("No concepts to expand. ", theValueSetUrl, conceptsExpanded);
|
||||||
|
@ -1273,17 +1244,10 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
}
|
}
|
||||||
|
|
||||||
TermValueSet termValueSet = optionalTermValueSet.get();
|
TermValueSet termValueSet = optionalTermValueSet.get();
|
||||||
TermValueSetVersion termValueSetVersion;
|
|
||||||
String valueSetVersion = theValueSet.getVersion();
|
|
||||||
if (valueSetVersion != null) {
|
|
||||||
termValueSetVersion = myValueSetVersionDao.findByValueSetPidAndVersion(termValueSet.getId(), valueSetVersion);
|
|
||||||
} else {
|
|
||||||
termValueSetVersion = myValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (termValueSetVersion.getExpansionStatus() != TermValueSetPreExpansionStatusEnum.EXPANDED) {
|
if (termValueSet.getExpansionStatus() != TermValueSetPreExpansionStatusEnum.EXPANDED) {
|
||||||
ourLog.warn("{} is present in terminology tables but not ready for persistence-backed invocation of operation $validation-code. Will perform in-memory code validation. Current status: {} | {}",
|
ourLog.warn("{} is present in terminology tables but not ready for persistence-backed invocation of operation $validation-code. Will perform in-memory code validation. Current status: {} | {}",
|
||||||
getValueSetInfo(theValueSet), termValueSetVersion.getExpansionStatus().name(), termValueSetVersion.getExpansionStatus().getDescription());
|
getValueSetInfo(theValueSet), termValueSet.getExpansionStatus().name(), termValueSet.getExpansionStatus().getDescription());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1698,15 +1662,15 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
StopWatch sw = new StopWatch();
|
StopWatch sw = new StopWatch();
|
||||||
TermValueSetVersion valueSetToExpand = txTemplate.execute(t -> {
|
TermValueSet valueSetToExpand = txTemplate.execute(t -> {
|
||||||
Optional<TermValueSetVersion> optionalTermValueSetVersion = getNextTermValueSetNotExpanded();
|
Optional<TermValueSet> optionalTermValueSet = getNextTermValueSetNotExpanded();
|
||||||
if (!optionalTermValueSetVersion.isPresent()) {
|
if (!optionalTermValueSet.isPresent()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
TermValueSetVersion termValueSetVersion = optionalTermValueSetVersion.get();
|
TermValueSet termValueSet = optionalTermValueSet.get();
|
||||||
termValueSetVersion.setExpansionStatus(TermValueSetPreExpansionStatusEnum.EXPANSION_IN_PROGRESS);
|
termValueSet.setExpansionStatus(TermValueSetPreExpansionStatusEnum.EXPANSION_IN_PROGRESS);
|
||||||
return myValueSetVersionDao.saveAndFlush(termValueSetVersion);
|
return myValueSetDao.saveAndFlush(termValueSet);
|
||||||
});
|
});
|
||||||
if (valueSetToExpand == null) {
|
if (valueSetToExpand == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -1715,18 +1679,17 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
// We have a ValueSet to pre-expand.
|
// We have a ValueSet to pre-expand.
|
||||||
try {
|
try {
|
||||||
ValueSet valueSet = txTemplate.execute(t -> {
|
ValueSet valueSet = txTemplate.execute(t -> {
|
||||||
TermValueSetVersion refreshedValueSetVersionToExpand = myValueSetVersionDao.findById(valueSetToExpand.getId()).get();
|
TermValueSet refreshedValueSetToExpand = myValueSetDao.findById(valueSetToExpand.getId()).get();
|
||||||
return getValueSetFromResourceTable(refreshedValueSetVersionToExpand.getResource());
|
return getValueSetFromResourceTable(refreshedValueSetToExpand.getResource());
|
||||||
});
|
});
|
||||||
|
|
||||||
ValueSetConceptAccumulator accumulator = new ValueSetConceptAccumulator(valueSetToExpand, myValueSetVersionDao, myValueSetDao, myValueSetConceptDao, myValueSetConceptDesignationDao);
|
ValueSetConceptAccumulator accumulator = new ValueSetConceptAccumulator(valueSetToExpand, myValueSetDao, myValueSetConceptDao, myValueSetConceptDesignationDao);
|
||||||
expandValueSet(null, valueSet, accumulator);
|
expandValueSet(null, valueSet, accumulator);
|
||||||
|
|
||||||
// We are done with this ValueSet.
|
// We are done with this ValueSet.
|
||||||
txTemplate.execute(t -> {
|
txTemplate.execute(t -> {
|
||||||
TermValueSetVersion finalValueSetToExpand = myValueSetVersionDao.findById(valueSetToExpand.getId()).get();
|
valueSetToExpand.setExpansionStatus(TermValueSetPreExpansionStatusEnum.EXPANDED);
|
||||||
finalValueSetToExpand.setExpansionStatus(TermValueSetPreExpansionStatusEnum.EXPANDED);
|
myValueSetDao.saveAndFlush(valueSetToExpand);
|
||||||
myValueSetVersionDao.saveAndFlush(finalValueSetToExpand);
|
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1736,7 +1699,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
ourLog.error("Failed to pre-expand ValueSet: " + e.getMessage(), e);
|
ourLog.error("Failed to pre-expand ValueSet: " + e.getMessage(), e);
|
||||||
txTemplate.execute(t -> {
|
txTemplate.execute(t -> {
|
||||||
valueSetToExpand.setExpansionStatus(TermValueSetPreExpansionStatusEnum.FAILED_TO_EXPAND);
|
valueSetToExpand.setExpansionStatus(TermValueSetPreExpansionStatusEnum.FAILED_TO_EXPAND);
|
||||||
myValueSetVersionDao.saveAndFlush(valueSetToExpand);
|
myValueSetDao.saveAndFlush(valueSetToExpand);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1801,9 +1764,9 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
|
|
||||||
protected abstract ValueSet getValueSetFromResourceTable(ResourceTable theResourceTable);
|
protected abstract ValueSet getValueSetFromResourceTable(ResourceTable theResourceTable);
|
||||||
|
|
||||||
private Optional<TermValueSetVersion> getNextTermValueSetNotExpanded() {
|
private Optional<TermValueSet> getNextTermValueSetNotExpanded() {
|
||||||
Optional<TermValueSetVersion> retVal = Optional.empty();
|
Optional<TermValueSet> retVal = Optional.empty();
|
||||||
Slice<TermValueSetVersion> page = myValueSetVersionDao.findByExpansionStatus(PageRequest.of(0, 1), TermValueSetPreExpansionStatusEnum.NOT_EXPANDED);
|
Slice<TermValueSet> page = myValueSetDao.findByExpansionStatus(PageRequest.of(0, 1), TermValueSetPreExpansionStatusEnum.NOT_EXPANDED);
|
||||||
|
|
||||||
if (!page.getContent().isEmpty()) {
|
if (!page.getContent().isEmpty()) {
|
||||||
retVal = Optional.of(page.getContent().get(0));
|
retVal = Optional.of(page.getContent().get(0));
|
||||||
|
@ -1823,7 +1786,11 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
/*
|
/*
|
||||||
* Get CodeSystem and validate CodeSystemVersion
|
* Get CodeSystem and validate CodeSystemVersion
|
||||||
*/
|
*/
|
||||||
TermValueSet termValueSet = getOrCreateDistinctTermValueSet(theResourceTable.getPersistentId(), theValueSet.getUrl(), theValueSet.getName(), theValueSet.getVersion(), theResourceTable);
|
TermValueSet termValueSet = new TermValueSet();
|
||||||
|
termValueSet.setResource(theResourceTable);
|
||||||
|
termValueSet.setUrl(theValueSet.getUrl());
|
||||||
|
termValueSet.setVersion(theValueSet.getVersion());
|
||||||
|
termValueSet.setName(theValueSet.hasName() ? theValueSet.getName() : null);
|
||||||
|
|
||||||
// Delete version being replaced
|
// Delete version being replaced
|
||||||
deleteValueSetForResource(theResourceTable);
|
deleteValueSetForResource(theResourceTable);
|
||||||
|
@ -1831,77 +1798,31 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||||
/*
|
/*
|
||||||
* Do the upload.
|
* Do the upload.
|
||||||
*/
|
*/
|
||||||
TermValueSetVersion termValueSetVersion = termValueSet.getCurrentVersion();
|
String url = termValueSet.getUrl();
|
||||||
if (termValueSetVersion == null) {
|
String version = termValueSet.getVersion();
|
||||||
termValueSetVersion = new TermValueSetVersion();
|
Optional<TermValueSet> optionalExistingTermValueSetByUrl;
|
||||||
}
|
if (version != null) {
|
||||||
|
optionalExistingTermValueSetByUrl = myValueSetDao.findTermValueSetByUrlAndVersion(url, version);
|
||||||
termValueSetVersion.setResource(theResourceTable);
|
|
||||||
termValueSetVersion.setValueSetVersionId(theValueSet.getVersion());
|
|
||||||
termValueSetVersion.setValueSet(termValueSet);
|
|
||||||
|
|
||||||
termValueSetVersion = myValueSetVersionDao.saveAndFlush(termValueSetVersion);
|
|
||||||
|
|
||||||
termValueSet.setCurrentVersion(termValueSetVersion);
|
|
||||||
termValueSet = myValueSetDao.saveAndFlush(termValueSet);
|
|
||||||
|
|
||||||
ourLog.info("Done storing TermValueSet[{}] for {}", termValueSet.getId(), theValueSet.getIdElement().toVersionless().getValueAsString());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
private TermValueSet getOrCreateDistinctTermValueSet(ResourcePersistentId theValueSetResourcePid, String theSystemUri, String theSystemName, String theSystemVersionId, ResourceTable theValueSetResourceTable) {
|
|
||||||
Optional<TermValueSet> termValueSetOptional = myValueSetDao.findByUrl(theSystemUri);
|
|
||||||
TermValueSet termValueSet;
|
|
||||||
if (!termValueSetOptional.isPresent()) {
|
|
||||||
termValueSetOptional = myValueSetDao.findByResourcePid(theValueSetResourcePid.getIdAsLong());
|
|
||||||
if (!termValueSetOptional.isPresent()) {
|
|
||||||
termValueSet = new TermValueSet();
|
|
||||||
} else {
|
|
||||||
termValueSet = termValueSetOptional.get();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
termValueSet = termValueSetOptional.get();
|
optionalExistingTermValueSetByUrl = myValueSetDao.findTermValueSetByUrlAndNullVersion(url);
|
||||||
}
|
}
|
||||||
|
if (!optionalExistingTermValueSetByUrl.isPresent()) {
|
||||||
termValueSet.setResource(theValueSetResourceTable);
|
myValueSetDao.save(termValueSet);
|
||||||
termValueSet.setUrl(theSystemUri);
|
|
||||||
termValueSet.setName(theSystemName);
|
|
||||||
termValueSet = myValueSetDao.save(termValueSet);
|
|
||||||
checkForValueSetVersionDuplicate(termValueSet,theSystemUri, theSystemVersionId, theValueSetResourceTable);
|
|
||||||
return termValueSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void checkForValueSetVersionDuplicate(TermValueSet theValueSet, String theSystemUri, String theSystemVersionId, ResourceTable theValueSetResourceTable) {
|
|
||||||
// Check if TermValueSetVersion entity already exists.
|
|
||||||
TermValueSetVersion valueSetVersionEntity;
|
|
||||||
String msg = null;
|
|
||||||
if (theSystemVersionId == null) {
|
|
||||||
// Check if a non-versioned TermValueSetVersion entity already exists for this TermValueSet.
|
|
||||||
valueSetVersionEntity = myValueSetVersionDao.findByValueSetPidAndNullVersion(theValueSet.getId());
|
|
||||||
if (valueSetVersionEntity != null) {
|
|
||||||
msg = myContext.getLocalizer().getMessage(BaseTermReadSvcImpl.class, "cannotCreateDuplicateValueSetUrl", theSystemUri, valueSetVersionEntity.getResource().getIdDt().toUnqualifiedVersionless().getValue());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Check if a TermValueSetVersion entity already exists for this TermValueSet and version.
|
TermValueSet existingTermValueSet = optionalExistingTermValueSetByUrl.get();
|
||||||
valueSetVersionEntity = myValueSetVersionDao.findByValueSetPidAndVersion(theValueSet.getId(), theSystemVersionId);
|
String msg;
|
||||||
if (valueSetVersionEntity != null) {
|
if (version != null) {
|
||||||
msg = myContext.getLocalizer().getMessage(BaseTermReadSvcImpl.class, "cannotCreateDuplicateValueSetUrlAndVersion", theSystemUri, theSystemVersionId, valueSetVersionEntity.getResource().getIdDt().toUnqualifiedVersionless().getValue());
|
msg = myContext.getLocalizer().getMessage(
|
||||||
|
BaseTermReadSvcImpl.class,
|
||||||
|
"cannotCreateDuplicateValueSetUrlAndVersion",
|
||||||
|
url, version, existingTermValueSet.getResource().getIdDt().toUnqualifiedVersionless().getValue());
|
||||||
} else {
|
} else {
|
||||||
// Check if a TermValueSetVersion entity already exists for this ValueSet resource (i.e. with a different version or URL)
|
msg = myContext.getLocalizer().getMessage(
|
||||||
Optional<TermValueSetVersion> valueSetVersionEntityOptional = myValueSetVersionDao.findByResourcePid(theValueSetResourceTable.getId());
|
BaseTermReadSvcImpl.class,
|
||||||
if (valueSetVersionEntityOptional.isPresent()) {
|
"cannotCreateDuplicateValueSetUrl",
|
||||||
msg = myContext.getLocalizer().getMessage(BaseTermReadSvcImpl.class, "cannotUpdateUrlOrVersionForValueSetResource", theSystemUri, theSystemVersionId, valueSetVersionEntity.getResource().getIdDt().toUnqualifiedVersionless().getValue());
|
url, existingTermValueSet.getResource().getIdDt().toUnqualifiedVersionless().getValue());
|
||||||
throw new UnprocessableEntityException(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Throw exception if the TermValueSet version is being duplicated.
|
|
||||||
if (valueSetVersionEntity != null) {
|
|
||||||
if (!ObjectUtil.equals(valueSetVersionEntity.getResource().getId(), theValueSetResourceTable.getId())) {
|
|
||||||
throw new UnprocessableEntityException(msg);
|
|
||||||
}
|
}
|
||||||
|
throw new UnprocessableEntityException(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -715,7 +715,7 @@ public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc {
|
||||||
// Check if a TermCodeSystemVersion entity already exists for this CodeSystem resource (i.e. with a different version or URL)
|
// Check if a TermCodeSystemVersion entity already exists for this CodeSystem resource (i.e. with a different version or URL)
|
||||||
codeSystemVersionEntity = myCodeSystemVersionDao.findByCodeSystemResourcePid(theCodeSystemResourceTable.getId());
|
codeSystemVersionEntity = myCodeSystemVersionDao.findByCodeSystemResourcePid(theCodeSystemResourceTable.getId());
|
||||||
if (codeSystemVersionEntity != null) {
|
if (codeSystemVersionEntity != null) {
|
||||||
msg = myContext.getLocalizer().getMessage(BaseTermReadSvcImpl.class, "cannotUpdateUrlOrVersionForCodeSystemResource", theSystemUri, theSystemVersionId, codeSystemVersionEntity.getResource().getIdDt().toUnqualifiedVersionless().getValue());
|
msg = myContext.getLocalizer().getMessage(BaseTermReadSvcImpl.class, "cannotUpdateUrlOrVersionForCodeSystemResource", codeSystemVersionEntity.getResource().getIdDt().toUnqualifiedVersionless().getValue(), theSystemUri, theSystemVersionId);
|
||||||
throw new UnprocessableEntityException(msg);
|
throw new UnprocessableEntityException(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,7 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc {
|
||||||
myDeferredConceptMaps.clear();
|
myDeferredConceptMaps.clear();
|
||||||
myDeferredConcepts.clear();
|
myDeferredConcepts.clear();
|
||||||
myDefferedCodeSystemsDeletions.clear();
|
myDefferedCodeSystemsDeletions.clear();
|
||||||
|
myConceptLinksToSaveLater.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.NEVER)
|
@Transactional(propagation = Propagation.NEVER)
|
||||||
|
|
|
@ -23,12 +23,10 @@ package ca.uhn.fhir.jpa.term;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetVersionDao;
|
|
||||||
import ca.uhn.fhir.jpa.entity.TermConceptDesignation;
|
import ca.uhn.fhir.jpa.entity.TermConceptDesignation;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import ca.uhn.fhir.util.ValidateUtil;
|
import ca.uhn.fhir.util.ValidateUtil;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
@ -43,8 +41,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||||
public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
|
public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
|
||||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ValueSetConceptAccumulator.class);
|
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ValueSetConceptAccumulator.class);
|
||||||
|
|
||||||
private TermValueSetVersion myTermValueSetVersion;
|
private TermValueSet myTermValueSet;
|
||||||
final private ITermValueSetVersionDao myValueSetVersionDao;
|
|
||||||
final private ITermValueSetDao myValueSetDao;
|
final private ITermValueSetDao myValueSetDao;
|
||||||
final private ITermValueSetConceptDao myValueSetConceptDao;
|
final private ITermValueSetConceptDao myValueSetConceptDao;
|
||||||
final private ITermValueSetConceptDesignationDao myValueSetConceptDesignationDao;
|
final private ITermValueSetConceptDesignationDao myValueSetConceptDesignationDao;
|
||||||
|
@ -52,9 +49,8 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
|
||||||
private int myDesignationsSaved;
|
private int myDesignationsSaved;
|
||||||
private int myConceptsExcluded;
|
private int myConceptsExcluded;
|
||||||
|
|
||||||
public ValueSetConceptAccumulator(@Nonnull TermValueSetVersion theTermValueSetVersion, @Nonnull ITermValueSetVersionDao theValueSetVersionDao, @Nonnull ITermValueSetDao theValueSetDao, @Nonnull ITermValueSetConceptDao theValueSetConceptDao, @Nonnull ITermValueSetConceptDesignationDao theValueSetConceptDesignationDao) {
|
public ValueSetConceptAccumulator(@Nonnull TermValueSet theTermValueSet, @Nonnull ITermValueSetDao theValueSetDao, @Nonnull ITermValueSetConceptDao theValueSetConceptDao, @Nonnull ITermValueSetConceptDesignationDao theValueSetConceptDesignationDao) {
|
||||||
myTermValueSetVersion = theTermValueSetVersion;
|
myTermValueSet = theTermValueSet;
|
||||||
myValueSetVersionDao = theValueSetVersionDao;
|
|
||||||
myValueSetDao = theValueSetDao;
|
myValueSetDao = theValueSetDao;
|
||||||
myValueSetConceptDao = theValueSetConceptDao;
|
myValueSetConceptDao = theValueSetConceptDao;
|
||||||
myValueSetConceptDesignationDao = theValueSetConceptDesignationDao;
|
myValueSetConceptDesignationDao = theValueSetConceptDesignationDao;
|
||||||
|
@ -91,23 +87,23 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get existing entity so it can be deleted.
|
// Get existing entity so it can be deleted.
|
||||||
Optional<TermValueSetConcept> optionalConcept = myValueSetConceptDao.findByTermValueSetIdSystemAndCode(myTermValueSetVersion.getId(), theSystem, theCode);
|
Optional<TermValueSetConcept> optionalConcept = myValueSetConceptDao.findByTermValueSetIdSystemAndCode(myTermValueSet.getId(), theSystem, theCode);
|
||||||
|
|
||||||
if (optionalConcept.isPresent()) {
|
if (optionalConcept.isPresent()) {
|
||||||
TermValueSetConcept concept = optionalConcept.get();
|
TermValueSetConcept concept = optionalConcept.get();
|
||||||
|
|
||||||
ourLog.debug("Excluding [{}|{}] from ValueSet[{}]", concept.getSystem(), concept.getCode(), myTermValueSetVersion.getValueSet().getUrl());
|
ourLog.debug("Excluding [{}|{}] from ValueSet[{}]", concept.getSystem(), concept.getCode(), myTermValueSet.getUrl());
|
||||||
for (TermValueSetConceptDesignation designation : concept.getDesignations()) {
|
for (TermValueSetConceptDesignation designation : concept.getDesignations()) {
|
||||||
myValueSetConceptDesignationDao.deleteById(designation.getId());
|
myValueSetConceptDesignationDao.deleteById(designation.getId());
|
||||||
myTermValueSetVersion.decrementTotalConceptDesignations();
|
myTermValueSet.decrementTotalConceptDesignations();
|
||||||
}
|
}
|
||||||
myValueSetConceptDao.deleteById(concept.getId());
|
myValueSetConceptDao.deleteById(concept.getId());
|
||||||
myTermValueSetVersion.decrementTotalConcepts();
|
myTermValueSet.decrementTotalConcepts();
|
||||||
myValueSetVersionDao.save(myTermValueSetVersion);
|
myValueSetDao.save(myTermValueSet);
|
||||||
ourLog.debug("Done excluding [{}|{}] from ValueSet[{}]", concept.getSystem(), concept.getCode(), myTermValueSetVersion.getValueSet().getUrl());
|
ourLog.debug("Done excluding [{}|{}] from ValueSet[{}]", concept.getSystem(), concept.getCode(), myTermValueSet.getUrl());
|
||||||
|
|
||||||
if (++myConceptsExcluded % 250 == 0) {
|
if (++myConceptsExcluded % 250 == 0) {
|
||||||
ourLog.info("Have excluded {} concepts from ValueSet[{}]", myConceptsExcluded, myTermValueSetVersion.getValueSet().getUrl());
|
ourLog.info("Have excluded {} concepts from ValueSet[{}]", myConceptsExcluded, myTermValueSet.getUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,9 +112,8 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
|
||||||
ValidateUtil.isNotBlankOrThrowInvalidRequest(theSystem, "ValueSet contains a concept with no system value");
|
ValidateUtil.isNotBlankOrThrowInvalidRequest(theSystem, "ValueSet contains a concept with no system value");
|
||||||
ValidateUtil.isNotBlankOrThrowInvalidRequest(theCode, "ValueSet contains a concept with no code value");
|
ValidateUtil.isNotBlankOrThrowInvalidRequest(theCode, "ValueSet contains a concept with no code value");
|
||||||
|
|
||||||
myTermValueSetVersion = myValueSetVersionDao.findById(myTermValueSetVersion.getId()).get();
|
|
||||||
TermValueSetConcept concept = new TermValueSetConcept();
|
TermValueSetConcept concept = new TermValueSetConcept();
|
||||||
concept.setValueSet(myTermValueSetVersion.getValueSet());
|
concept.setValueSet(myTermValueSet);
|
||||||
concept.setOrder(myConceptsSaved);
|
concept.setOrder(myConceptsSaved);
|
||||||
concept.setSystem(theSystem);
|
concept.setSystem(theSystem);
|
||||||
concept.setCode(theCode);
|
concept.setCode(theCode);
|
||||||
|
@ -126,23 +121,21 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
|
||||||
concept.setDisplay(theDisplay);
|
concept.setDisplay(theDisplay);
|
||||||
}
|
}
|
||||||
myValueSetConceptDao.save(concept);
|
myValueSetConceptDao.save(concept);
|
||||||
myTermValueSetVersion.incrementTotalConcepts();
|
myValueSetDao.save(myTermValueSet.incrementTotalConcepts());
|
||||||
myValueSetVersionDao.save(myTermValueSetVersion);
|
|
||||||
|
|
||||||
if (++myConceptsSaved % 250 == 0) {
|
if (++myConceptsSaved % 250 == 0) {
|
||||||
ourLog.info("Have pre-expanded {} concepts in ValueSet[{}]", myConceptsSaved, myTermValueSetVersion.getValueSet().getUrl());
|
ourLog.info("Have pre-expanded {} concepts in ValueSet[{}]", myConceptsSaved, myTermValueSet.getUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
return concept;
|
return concept;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveConceptDesignation(TermValueSetConcept theConcept, TermConceptDesignation theDesignation) {
|
private TermValueSetConceptDesignation saveConceptDesignation(TermValueSetConcept theConcept, TermConceptDesignation theDesignation) {
|
||||||
ValidateUtil.isNotBlankOrThrowInvalidRequest(theDesignation.getValue(), "ValueSet contains a concept designation with no value");
|
ValidateUtil.isNotBlankOrThrowInvalidRequest(theDesignation.getValue(), "ValueSet contains a concept designation with no value");
|
||||||
|
|
||||||
TermValueSetConceptDesignation designation = new TermValueSetConceptDesignation();
|
TermValueSetConceptDesignation designation = new TermValueSetConceptDesignation();
|
||||||
designation.setConcept(theConcept);
|
designation.setConcept(theConcept);
|
||||||
myTermValueSetVersion = myValueSetVersionDao.findById(myTermValueSetVersion.getId()).get();
|
designation.setValueSet(myTermValueSet);
|
||||||
designation.setValueSet(myTermValueSetVersion.getValueSet());
|
|
||||||
designation.setLanguage(theDesignation.getLanguage());
|
designation.setLanguage(theDesignation.getLanguage());
|
||||||
if (isNoneBlank(theDesignation.getUseSystem(), theDesignation.getUseCode())) {
|
if (isNoneBlank(theDesignation.getUseSystem(), theDesignation.getUseCode())) {
|
||||||
designation.setUseSystem(theDesignation.getUseSystem());
|
designation.setUseSystem(theDesignation.getUseSystem());
|
||||||
|
@ -153,12 +146,13 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
|
||||||
}
|
}
|
||||||
designation.setValue(theDesignation.getValue());
|
designation.setValue(theDesignation.getValue());
|
||||||
myValueSetConceptDesignationDao.save(designation);
|
myValueSetConceptDesignationDao.save(designation);
|
||||||
myValueSetVersionDao.save(myTermValueSetVersion.incrementTotalConceptDesignations());
|
myValueSetDao.save(myTermValueSet.incrementTotalConceptDesignations());
|
||||||
|
|
||||||
if (++myDesignationsSaved % 250 == 0) {
|
if (++myDesignationsSaved % 250 == 0) {
|
||||||
ourLog.debug("Have pre-expanded {} designations for Concept[{}|{}] in ValueSet[{}]", myDesignationsSaved, theConcept.getSystem(), theConcept.getCode(), myTermValueSetVersion.getValueSet().getUrl());
|
ourLog.debug("Have pre-expanded {} designations for Concept[{}|{}] in ValueSet[{}]", myDesignationsSaved, theConcept.getSystem(), theConcept.getCode(), myTermValueSet.getUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return designation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean removeGapsFromConceptOrder() {
|
public Boolean removeGapsFromConceptOrder() {
|
||||||
|
@ -166,13 +160,13 @@ public class ValueSetConceptAccumulator implements IValueSetConceptAccumulator {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ourLog.info("Removing gaps from concept order for ValueSet[{}]", myTermValueSetVersion.getValueSet().getUrl());
|
ourLog.info("Removing gaps from concept order for ValueSet[{}]", myTermValueSet.getUrl());
|
||||||
int order = 0;
|
int order = 0;
|
||||||
List<Long> conceptIds = myValueSetConceptDao.findIdsByTermValueSetId(myTermValueSetVersion.getId());
|
List<Long> conceptIds = myValueSetConceptDao.findIdsByTermValueSetId(myTermValueSet.getId());
|
||||||
for (Long conceptId : conceptIds) {
|
for (Long conceptId : conceptIds) {
|
||||||
myValueSetConceptDao.updateOrderById(conceptId, order++);
|
myValueSetConceptDao.updateOrderById(conceptId, order++);
|
||||||
}
|
}
|
||||||
ourLog.info("Have removed gaps from concept order for {} concepts in ValueSet[{}]", conceptIds.size(), myTermValueSetVersion.getValueSet().getUrl());
|
ourLog.info("Have removed gaps from concept order for {} concepts in ValueSet[{}]", conceptIds.size(), myTermValueSet.getUrl());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ import ca.uhn.fhir.jpa.dao.data.ITermConceptDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermConceptMapDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermConceptMapDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermConceptMapGroupElementTargetDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermConceptMapGroupElementTargetDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetVersionDao;
|
|
||||||
import ca.uhn.fhir.jpa.dao.dstu2.FhirResourceDaoDstu2SearchNoFtTest;
|
import ca.uhn.fhir.jpa.dao.dstu2.FhirResourceDaoDstu2SearchNoFtTest;
|
||||||
import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test;
|
import ca.uhn.fhir.jpa.dao.r4.BaseJpaR4Test;
|
||||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||||
|
@ -53,7 +52,6 @@ import ca.uhn.fhir.rest.api.Constants;
|
||||||
import ca.uhn.fhir.rest.api.EncodingEnum;
|
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||||
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
||||||
import ca.uhn.fhir.util.TestUtil;
|
|
||||||
import ca.uhn.fhir.util.UrlUtil;
|
import ca.uhn.fhir.util.UrlUtil;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.hibernate.search.jpa.FullTextEntityManager;
|
import org.hibernate.search.jpa.FullTextEntityManager;
|
||||||
|
@ -344,8 +342,6 @@ public abstract class BaseJpaDstu3Test extends BaseJpaTest {
|
||||||
private IBulkDataExportSvc myBulkDataExportSvc;
|
private IBulkDataExportSvc myBulkDataExportSvc;
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITermValueSetDao myTermValueSetDao;
|
protected ITermValueSetDao myTermValueSetDao;
|
||||||
@Autowired
|
|
||||||
protected ITermValueSetVersionDao myTermValueSetVersionDao;
|
|
||||||
|
|
||||||
@AfterEach()
|
@AfterEach()
|
||||||
public void afterCleanupDao() {
|
public void afterCleanupDao() {
|
||||||
|
|
|
@ -80,6 +80,7 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test {
|
||||||
private CodeSystem createExternalCs() {
|
private CodeSystem createExternalCs() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
codeSystem.setName("ACME Codes");
|
codeSystem.setName("ACME Codes");
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
@ -124,6 +125,7 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test {
|
||||||
private void createExternalCsLarge() {
|
private void createExternalCsLarge() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -165,6 +167,7 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test {
|
||||||
private CodeSystem createExternalCsDogs() {
|
private CodeSystem createExternalCsDogs() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -698,6 +701,7 @@ public class FhirResourceDaoDstu3TerminologyTest extends BaseJpaDstu3Test {
|
||||||
public void testLookupSnomed() {
|
public void testLookupSnomed() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl("http://snomed.info/sct");
|
codeSystem.setUrl("http://snomed.info/sct");
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
||||||
import ca.uhn.fhir.context.support.IValidationSupport;
|
import ca.uhn.fhir.context.support.IValidationSupport;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||||
import org.hl7.fhir.dstu3.model.CodeSystem;
|
import org.hl7.fhir.dstu3.model.CodeSystem;
|
||||||
import org.hl7.fhir.dstu3.model.CodeType;
|
import org.hl7.fhir.dstu3.model.CodeType;
|
||||||
|
@ -23,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static org.awaitility.Awaitility.await;
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.hamcrest.Matchers.not;
|
||||||
|
@ -59,9 +59,7 @@ public class FhirResourceDaoDstu3ValueSetTest extends BaseJpaDstu3Test {
|
||||||
|
|
||||||
runInTransaction(() -> {
|
runInTransaction(() -> {
|
||||||
TermValueSet vsEntity = myTermValueSetDao.findByUrl("http://decor.nictiz.nl/fhir/ValueSet/2.16.840.1.113883.2.4.3.11.60.40.2.20.5.2--20171231000000").orElseThrow(() -> new IllegalStateException());
|
TermValueSet vsEntity = myTermValueSetDao.findByUrl("http://decor.nictiz.nl/fhir/ValueSet/2.16.840.1.113883.2.4.3.11.60.40.2.20.5.2--20171231000000").orElseThrow(() -> new IllegalStateException());
|
||||||
Long valueSetId = vsEntity.getId();
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vsEntity.getExpansionStatus());
|
||||||
TermValueSetVersion vsvEntity = myTermValueSetVersionDao.findByValueSetPid(valueSetId).get(0);
|
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vsvEntity.getExpansionStatus());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
IValidationSupport.CodeValidationResult validationOutcome;
|
IValidationSupport.CodeValidationResult validationOutcome;
|
||||||
|
@ -79,12 +77,12 @@ public class FhirResourceDaoDstu3ValueSetTest extends BaseJpaDstu3Test {
|
||||||
validationOutcome = myValueSetDao.validateCode(vsIdentifier, null, code, system, null, null, null, mySrd);
|
validationOutcome = myValueSetDao.validateCode(vsIdentifier, null, code, system, null, null, null, mySrd);
|
||||||
assertEquals(false, validationOutcome.isOk());
|
assertEquals(false, validationOutcome.isOk());
|
||||||
|
|
||||||
|
await().until(() -> clearDeferredStorageQueue());
|
||||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||||
|
|
||||||
runInTransaction(() -> {
|
runInTransaction(() -> {
|
||||||
TermValueSet vsEntity = myTermValueSetDao.findByUrl("http://decor.nictiz.nl/fhir/ValueSet/2.16.840.1.113883.2.4.3.11.60.40.2.20.5.2--20171231000000").orElseThrow(() -> new IllegalStateException());
|
TermValueSet vsEntity = myTermValueSetDao.findByUrl("http://decor.nictiz.nl/fhir/ValueSet/2.16.840.1.113883.2.4.3.11.60.40.2.20.5.2--20171231000000").orElseThrow(() -> new IllegalStateException());
|
||||||
TermValueSetVersion vsvEntity = myTermValueSetVersionDao.findByValueSetPid(vsEntity.getId()).get(0);
|
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, vsEntity.getExpansionStatus());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, vsvEntity.getExpansionStatus());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Validate good
|
// Validate good
|
||||||
|
@ -99,6 +97,16 @@ public class FhirResourceDaoDstu3ValueSetTest extends BaseJpaDstu3Test {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean clearDeferredStorageQueue() {
|
||||||
|
|
||||||
|
if(!myTerminologyDeferredStorageSvc.isStorageQueueEmpty()) {
|
||||||
|
myTerminologyDeferredStorageSvc.saveAllDeferred();
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled
|
@Disabled
|
||||||
|
|
|
@ -47,7 +47,6 @@ import ca.uhn.fhir.jpa.dao.data.ITermConceptParentChildLinkDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetVersionDao;
|
|
||||||
import ca.uhn.fhir.jpa.dao.dstu2.FhirResourceDaoDstu2SearchNoFtTest;
|
import ca.uhn.fhir.jpa.dao.dstu2.FhirResourceDaoDstu2SearchNoFtTest;
|
||||||
import ca.uhn.fhir.jpa.dao.index.IdHelperService;
|
import ca.uhn.fhir.jpa.dao.index.IdHelperService;
|
||||||
import ca.uhn.fhir.jpa.entity.TermCodeSystem;
|
import ca.uhn.fhir.jpa.entity.TermCodeSystem;
|
||||||
|
@ -65,7 +64,6 @@ import ca.uhn.fhir.jpa.search.IStaleSearchDeletingSvc;
|
||||||
import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc;
|
import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc;
|
||||||
import ca.uhn.fhir.jpa.search.warm.ICacheWarmingSvc;
|
import ca.uhn.fhir.jpa.search.warm.ICacheWarmingSvc;
|
||||||
import ca.uhn.fhir.jpa.searchparam.registry.SearchParamRegistryImpl;
|
import ca.uhn.fhir.jpa.searchparam.registry.SearchParamRegistryImpl;
|
||||||
import ca.uhn.fhir.jpa.subscription.match.registry.SubscriptionRegistry;
|
|
||||||
import ca.uhn.fhir.jpa.term.BaseTermReadSvcImpl;
|
import ca.uhn.fhir.jpa.term.BaseTermReadSvcImpl;
|
||||||
import ca.uhn.fhir.jpa.term.TermDeferredStorageSvcImpl;
|
import ca.uhn.fhir.jpa.term.TermDeferredStorageSvcImpl;
|
||||||
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
|
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
|
||||||
|
@ -82,7 +80,6 @@ import ca.uhn.fhir.rest.server.BasePagingProvider;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
||||||
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
||||||
import ca.uhn.fhir.test.utilities.ITestDataBuilder;
|
import ca.uhn.fhir.test.utilities.ITestDataBuilder;
|
||||||
import ca.uhn.fhir.util.TestUtil;
|
|
||||||
import ca.uhn.fhir.util.UrlUtil;
|
import ca.uhn.fhir.util.UrlUtil;
|
||||||
import ca.uhn.fhir.validation.FhirValidator;
|
import ca.uhn.fhir.validation.FhirValidator;
|
||||||
import ca.uhn.fhir.validation.ValidationResult;
|
import ca.uhn.fhir.validation.ValidationResult;
|
||||||
|
@ -439,8 +436,6 @@ public abstract class BaseJpaR4Test extends BaseJpaTest implements ITestDataBuil
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITermValueSetDao myTermValueSetDao;
|
protected ITermValueSetDao myTermValueSetDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITermValueSetVersionDao myTermValueSetVersionDao;
|
|
||||||
@Autowired
|
|
||||||
protected ITermValueSetConceptDao myTermValueSetConceptDao;
|
protected ITermValueSetConceptDao myTermValueSetConceptDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITermValueSetConceptDesignationDao myTermValueSetConceptDesignationDao;
|
protected ITermValueSetConceptDesignationDao myTermValueSetConceptDesignationDao;
|
||||||
|
|
|
@ -209,6 +209,7 @@ public class FhirResourceDaoR4SearchWithElasticSearchIT extends BaseJpaTest {
|
||||||
private CodeSystem createExternalCs() {
|
private CodeSystem createExternalCs() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystem.CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystem.CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ public class FhirResourceDaoR4TerminologyElasticsearchIT extends BaseJpaTest {
|
||||||
public void testExpandWithIncludeContainingDashesInInclude() {
|
public void testExpandWithIncludeContainingDashesInInclude() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,7 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
|
||||||
private CodeSystem createExternalCs() {
|
private CodeSystem createExternalCs() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -129,6 +130,7 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
|
||||||
private CodeSystem createExternalCsDogs() {
|
private CodeSystem createExternalCsDogs() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -159,6 +161,7 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
|
||||||
private void createExternalCsLarge() {
|
private void createExternalCsLarge() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -473,6 +476,7 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
|
||||||
public void testExpandWithIncludeContainingDashesInInclude() {
|
public void testExpandWithIncludeContainingDashesInInclude() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -815,6 +819,7 @@ public class FhirResourceDaoR4TerminologyTest extends BaseJpaR4Test {
|
||||||
public void testLookupSnomed() {
|
public void testLookupSnomed() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl("http://snomed.info/sct");
|
codeSystem.setUrl("http://snomed.info/sct");
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,8 @@ import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
|
||||||
import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion;
|
import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
||||||
import ca.uhn.fhir.jpa.term.BaseTermReadSvcImpl;
|
import ca.uhn.fhir.jpa.term.BaseTermReadSvcImpl;
|
||||||
import ca.uhn.fhir.jpa.term.TerminologyLoaderSvcLoincTest;
|
|
||||||
import ca.uhn.fhir.jpa.term.ZipCollectionBuilder;
|
|
||||||
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
|
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
|
||||||
import ca.uhn.fhir.jpa.term.api.ITermLoaderSvc;
|
import ca.uhn.fhir.jpa.term.api.ITermLoaderSvc;
|
||||||
import ca.uhn.fhir.jpa.term.api.ITermReadSvc;
|
import ca.uhn.fhir.jpa.term.api.ITermReadSvc;
|
||||||
|
@ -81,7 +78,6 @@ import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.hamcrest.Matchers.not;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
@ -212,9 +208,10 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test {
|
||||||
myStructureDefinitionDao.create(loadResourceFromClasspath(StructureDefinition.class, "/r4/bl/bb-sd.json"));
|
myStructureDefinitionDao.create(loadResourceFromClasspath(StructureDefinition.class, "/r4/bl/bb-sd.json"));
|
||||||
|
|
||||||
runInTransaction(() -> {
|
runInTransaction(() -> {
|
||||||
TermValueSet vs = myTermValueSetDao.findByUrl("https://bb/ValueSet/BBDemographicAgeUnit").orElseThrow(() -> new IllegalArgumentException());
|
TermValueSet vs = myTermValueSetDao.findTermValueSetByUrlAndVersion("https://bb/ValueSet/BBDemographicAgeUnit","20190731").orElseThrow(() -> new IllegalArgumentException());
|
||||||
TermValueSetVersion vsv = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(vs.getId());
|
// TermValueSetVersion vsv = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(vs.getId());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vsv.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vsv.getExpansionStatus());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vs.getExpansionStatus());
|
||||||
});
|
});
|
||||||
|
|
||||||
OperationOutcome outcome;
|
OperationOutcome outcome;
|
||||||
|
@ -242,17 +239,19 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test {
|
||||||
|
|
||||||
// Before, the VS wasn't pre-expanded. Try again with it pre-expanded
|
// Before, the VS wasn't pre-expanded. Try again with it pre-expanded
|
||||||
runInTransaction(() -> {
|
runInTransaction(() -> {
|
||||||
TermValueSet vs = myTermValueSetDao.findByUrl("https://bb/ValueSet/BBDemographicAgeUnit").orElseThrow(() -> new IllegalArgumentException());
|
TermValueSet vs = myTermValueSetDao.findTermValueSetByUrlAndVersion("https://bb/ValueSet/BBDemographicAgeUnit","20190731").orElseThrow(() -> new IllegalArgumentException());
|
||||||
TermValueSetVersion vsv = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(vs.getId());
|
// TermValueSetVersion vsv = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(vs.getId());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vsv.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vsv.getExpansionStatus());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vs.getExpansionStatus());
|
||||||
});
|
});
|
||||||
|
|
||||||
myTermReadSvc.preExpandDeferredValueSetsToTerminologyTables();
|
myTermReadSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||||
|
|
||||||
runInTransaction(() -> {
|
runInTransaction(() -> {
|
||||||
TermValueSet vs = myTermValueSetDao.findByUrl("https://bb/ValueSet/BBDemographicAgeUnit").orElseThrow(() -> new IllegalArgumentException());
|
TermValueSet vs = myTermValueSetDao.findTermValueSetByUrlAndVersion("https://bb/ValueSet/BBDemographicAgeUnit", "20190731").orElseThrow(() -> new IllegalArgumentException());
|
||||||
TermValueSetVersion vsv = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(vs.getId());
|
// TermValueSetVersion vsv = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(vs.getId());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, vsv.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, vsv.getExpansionStatus());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, vs.getExpansionStatus());
|
||||||
});
|
});
|
||||||
|
|
||||||
// Use a code that's in the ValueSet
|
// Use a code that's in the ValueSet
|
||||||
|
@ -285,9 +284,10 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test {
|
||||||
myStructureDefinitionDao.create(loadResourceFromClasspath(StructureDefinition.class, "/r4/bl/bb-sd.json"));
|
myStructureDefinitionDao.create(loadResourceFromClasspath(StructureDefinition.class, "/r4/bl/bb-sd.json"));
|
||||||
|
|
||||||
runInTransaction(() -> {
|
runInTransaction(() -> {
|
||||||
TermValueSet vs = myTermValueSetDao.findByUrl("https://bb/ValueSet/BBDemographicAgeUnit").orElseThrow(() -> new IllegalArgumentException());
|
TermValueSet vs = myTermValueSetDao.findTermValueSetByUrlAndVersion("https://bb/ValueSet/BBDemographicAgeUnit", "20190731").orElseThrow(() -> new IllegalArgumentException());
|
||||||
TermValueSetVersion vsv = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(vs.getId());
|
// TermValueSetVersion vsv = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(vs.getId());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vsv.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vsv.getExpansionStatus());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, vs.getExpansionStatus());
|
||||||
});
|
});
|
||||||
|
|
||||||
OperationOutcome outcome;
|
OperationOutcome outcome;
|
||||||
|
|
|
@ -44,7 +44,6 @@ import ca.uhn.fhir.jpa.dao.data.ITermConceptParentChildLinkDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetVersionDao;
|
|
||||||
import ca.uhn.fhir.jpa.dao.dstu2.FhirResourceDaoDstu2SearchNoFtTest;
|
import ca.uhn.fhir.jpa.dao.dstu2.FhirResourceDaoDstu2SearchNoFtTest;
|
||||||
import ca.uhn.fhir.jpa.interceptor.PerformanceTracingLoggingInterceptor;
|
import ca.uhn.fhir.jpa.interceptor.PerformanceTracingLoggingInterceptor;
|
||||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||||
|
@ -70,7 +69,6 @@ import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||||
import ca.uhn.fhir.rest.server.BasePagingProvider;
|
import ca.uhn.fhir.rest.server.BasePagingProvider;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
||||||
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
||||||
import ca.uhn.fhir.util.TestUtil;
|
|
||||||
import ca.uhn.fhir.util.UrlUtil;
|
import ca.uhn.fhir.util.UrlUtil;
|
||||||
import ca.uhn.fhir.validation.FhirValidator;
|
import ca.uhn.fhir.validation.FhirValidator;
|
||||||
import ca.uhn.fhir.validation.ValidationResult;
|
import ca.uhn.fhir.validation.ValidationResult;
|
||||||
|
@ -385,8 +383,8 @@ public abstract class BaseJpaR5Test extends BaseJpaTest {
|
||||||
protected IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> myValueSetDao;
|
protected IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> myValueSetDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITermValueSetDao myTermValueSetDao;
|
protected ITermValueSetDao myTermValueSetDao;
|
||||||
@Autowired
|
// @Autowired
|
||||||
protected ITermValueSetVersionDao myTermValueSetVersionDao;
|
// protected ITermValueSetVersionDao myTermValueSetVersionDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITermValueSetConceptDao myTermValueSetConceptDao;
|
protected ITermValueSetConceptDao myTermValueSetConceptDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -137,6 +137,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
||||||
runInTransaction(() -> {
|
runInTransaction(() -> {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(CS_URL);
|
codeSystem.setUrl(CS_URL);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,6 @@ public class ResourceProviderR4CodeSystemTest extends BaseResourceProviderR4Test
|
||||||
CodeSystem cs = loadResourceFromClasspath(CodeSystem.class, "/extensional-case-3-cs.xml");
|
CodeSystem cs = loadResourceFromClasspath(CodeSystem.class, "/extensional-case-3-cs.xml");
|
||||||
myCodeSystemDao.create(cs, mySrd);
|
myCodeSystemDao.create(cs, mySrd);
|
||||||
|
|
||||||
ValueSet upload = loadResourceFromClasspath(ValueSet.class, "/extensional-case-3-vs.xml");
|
|
||||||
myValueSetDao.create(upload, mySrd).getId().toUnqualifiedVersionless();
|
|
||||||
|
|
||||||
CodeSystem parentChildCs = new CodeSystem();
|
CodeSystem parentChildCs = new CodeSystem();
|
||||||
parentChildCs.setUrl(SYSTEM_PARENTCHILD);
|
parentChildCs.setUrl(SYSTEM_PARENTCHILD);
|
||||||
parentChildCs.setStatus(Enumerations.PublicationStatus.ACTIVE);
|
parentChildCs.setStatus(Enumerations.PublicationStatus.ACTIVE);
|
||||||
|
|
|
@ -37,9 +37,6 @@ public class ResourceProviderR4CodeSystemVersionedTest extends BaseResourceProvi
|
||||||
cs = loadResourceFromClasspath(CodeSystem.class, "/extensional-case-3-cs-v2.xml");
|
cs = loadResourceFromClasspath(CodeSystem.class, "/extensional-case-3-cs-v2.xml");
|
||||||
myCodeSystemDao.create(cs, mySrd);
|
myCodeSystemDao.create(cs, mySrd);
|
||||||
|
|
||||||
ValueSet upload = loadResourceFromClasspath(ValueSet.class, "/extensional-case-3-vs.xml");
|
|
||||||
myValueSetDao.create(upload, mySrd).getId().toUnqualifiedVersionless();
|
|
||||||
|
|
||||||
CodeSystem parentChildCs = new CodeSystem();
|
CodeSystem parentChildCs = new CodeSystem();
|
||||||
parentChildCs.setUrl(SYSTEM_PARENTCHILD);
|
parentChildCs.setUrl(SYSTEM_PARENTCHILD);
|
||||||
parentChildCs.setVersion("1");
|
parentChildCs.setVersion("1");
|
||||||
|
|
|
@ -10,14 +10,12 @@ import ca.uhn.fhir.jpa.entity.TermValueSet;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
||||||
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
|
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
|
||||||
import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
|
import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||||
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
|
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
|
||||||
import ca.uhn.fhir.util.ParametersUtil;
|
|
||||||
import ca.uhn.fhir.util.UrlUtil;
|
import ca.uhn.fhir.util.UrlUtil;
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
@ -809,9 +807,11 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals(theValueSetName, termValueSet.getName());
|
assertEquals(theValueSetName, termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(0, termValueSetVersion.getConcepts().size());
|
// assertEquals(0, termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(0, termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSet.getExpansionStatus());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -828,11 +828,14 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals(theValueSetName, termValueSet.getName());
|
assertEquals(theValueSetName, termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(theCodeSystem.getConcept().size(), termValueSetVersion.getConcepts().size());
|
// assertEquals(theCodeSystem.getConcept().size(), termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(theCodeSystem.getConcept().size(), termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSet.getExpansionStatus());
|
||||||
|
|
||||||
TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
// TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
||||||
|
TermValueSetConcept concept = termValueSet.getConcepts().get(0);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8450-9", concept.getCode());
|
assertEquals("8450-9", concept.getCode());
|
||||||
|
@ -854,7 +857,8 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(1);
|
// concept = termValueSetVersion.getConcepts().get(1);
|
||||||
|
concept = termValueSet.getConcepts().get(1);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("11378-7", concept.getCode());
|
assertEquals("11378-7", concept.getCode());
|
||||||
|
@ -864,7 +868,8 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(22);
|
// concept = termValueSetVersion.getConcepts().get(22);
|
||||||
|
concept = termValueSet.getConcepts().get(22);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8491-3", concept.getCode());
|
assertEquals("8491-3", concept.getCode());
|
||||||
|
@ -879,7 +884,8 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(23);
|
// concept = termValueSetVersion.getConcepts().get(23);
|
||||||
|
concept = termValueSet.getConcepts().get(23);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8492-1", concept.getCode());
|
assertEquals("8492-1", concept.getCode());
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes
|
||||||
ourLog.info(resp);
|
ourLog.info(resp);
|
||||||
|
|
||||||
assertThat(((IntegerType) respParam.getParameter().get(1).getValue()).getValue(), greaterThan(1));
|
assertThat(((IntegerType) respParam.getParameter().get(1).getValue()).getValue(), greaterThan(1));
|
||||||
assertThat(((Reference) respParam.getParameter().get(2).getValue()).getReference(), matchesPattern("CodeSystem\\/[a-zA-Z0-9]+"));
|
assertThat(((Reference) respParam.getParameter().get(2).getValue()).getReference(), matchesPattern("CodeSystem\\/[a-zA-Z0-9\\.\\-]+"));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try uploading a second time
|
* Try uploading a second time
|
||||||
|
|
|
@ -1120,9 +1120,11 @@ public class ResourceProviderR5ValueSetTest extends BaseResourceProviderR5Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals(theValueSetName, termValueSet.getName());
|
assertEquals(theValueSetName, termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(0, termValueSetVersion.getConcepts().size());
|
// assertEquals(0, termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(0, termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSet.getExpansionStatus());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1139,11 +1141,14 @@ public class ResourceProviderR5ValueSetTest extends BaseResourceProviderR5Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals(theValueSetName, termValueSet.getName());
|
assertEquals(theValueSetName, termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(theCodeSystem.getConcept().size(), termValueSetVersion.getConcepts().size());
|
// assertEquals(theCodeSystem.getConcept().size(), termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(theCodeSystem.getConcept().size(), termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSet.getExpansionStatus());
|
||||||
|
|
||||||
TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
// TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
||||||
|
TermValueSetConcept concept = termValueSet.getConcepts().get(0);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8450-9", concept.getCode());
|
assertEquals("8450-9", concept.getCode());
|
||||||
|
@ -1165,7 +1170,8 @@ public class ResourceProviderR5ValueSetTest extends BaseResourceProviderR5Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(1);
|
// concept = termValueSetVersion.getConcepts().get(1);
|
||||||
|
concept = termValueSet.getConcepts().get(1);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("11378-7", concept.getCode());
|
assertEquals("11378-7", concept.getCode());
|
||||||
|
@ -1175,7 +1181,8 @@ public class ResourceProviderR5ValueSetTest extends BaseResourceProviderR5Test {
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(22);
|
// concept = termValueSetVersion.getConcepts().get(22);
|
||||||
|
concept = termValueSet.getConcepts().get(22);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8491-3", concept.getCode());
|
assertEquals("8491-3", concept.getCode());
|
||||||
|
@ -1190,7 +1197,8 @@ public class ResourceProviderR5ValueSetTest extends BaseResourceProviderR5Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(23);
|
// concept = termValueSetVersion.getConcepts().get(23);
|
||||||
|
concept = termValueSet.getConcepts().get(23);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8492-1", concept.getCode());
|
assertEquals("8492-1", concept.getCode());
|
||||||
|
@ -1408,6 +1416,7 @@ public class ResourceProviderR5ValueSetTest extends BaseResourceProviderR5Test {
|
||||||
public static CodeSystem createExternalCs(IFhirResourceDao<CodeSystem> theCodeSystemDao, IResourceTableDao theResourceTableDao, ITermCodeSystemStorageSvc theTermCodeSystemStorageSvc, ServletRequestDetails theRequestDetails) {
|
public static CodeSystem createExternalCs(IFhirResourceDao<CodeSystem> theCodeSystemDao, IResourceTableDao theResourceTableDao, ITermCodeSystemStorageSvc theTermCodeSystemStorageSvc, ServletRequestDetails theRequestDetails) {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = theCodeSystemDao.create(codeSystem, theRequestDetails).getId().toUnqualified();
|
IIdType id = theCodeSystemDao.create(codeSystem, theRequestDetails).getId().toUnqualified();
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
|
||||||
codeSystem.setUrl(CS_URL);
|
codeSystem.setUrl(CS_URL);
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
codeSystem.setName("SYSTEM NAME");
|
codeSystem.setName("SYSTEM NAME");
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
ResourceTable table = myResourceTableDao.findById(id.getIdPartAsLong()).orElseThrow(IllegalArgumentException::new);
|
ResourceTable table = myResourceTableDao.findById(id.getIdPartAsLong()).orElseThrow(IllegalArgumentException::new);
|
||||||
|
@ -116,6 +117,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
|
||||||
private void createCodeSystem2() {
|
private void createCodeSystem2() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(CS_URL_2);
|
codeSystem.setUrl(CS_URL_2);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -135,6 +137,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
|
||||||
runInTransaction(() -> {
|
runInTransaction(() -> {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(LOINC_URI);
|
codeSystem.setUrl(LOINC_URI);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -204,6 +207,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
|
||||||
public void testCreateDuplicateCodeSystemUri() {
|
public void testCreateDuplicateCodeSystemUri() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(CS_URL);
|
codeSystem.setUrl(CS_URL);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -226,12 +230,13 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
|
||||||
// Try to update to a different resource
|
// Try to update to a different resource
|
||||||
codeSystem = new CodeSystem();
|
codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(CS_URL);
|
codeSystem.setUrl(CS_URL);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
try {
|
try {
|
||||||
myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
fail();
|
fail();
|
||||||
} catch (UnprocessableEntityException e) {
|
} catch (UnprocessableEntityException e) {
|
||||||
assertThat(e.getMessage(), containsString("Can not create multiple CodeSystem resources with CodeSystem.url \"http://example.com/my_code_system\", already have one with resource ID: CodeSystem/"));
|
assertThat(e.getMessage(), containsString("Can not create multiple CodeSystem resources with CodeSystem.url \"http://example.com/my_code_system\" and CodeSystem.version \"SYSTEM VERSION\", already have one with resource ID: CodeSystem/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1813,6 +1818,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
|
||||||
public void testStoreCodeSystemInvalidCyclicLoop() {
|
public void testStoreCodeSystemInvalidCyclicLoop() {
|
||||||
CodeSystem codeSystem = new CodeSystem();
|
CodeSystem codeSystem = new CodeSystem();
|
||||||
codeSystem.setUrl(CS_URL);
|
codeSystem.setUrl(CS_URL);
|
||||||
|
codeSystem.setVersion("SYSTEM VERSION");
|
||||||
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
codeSystem.setContent(CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
IIdType id = myCodeSystemDao.create(codeSystem, mySrd).getId().toUnqualified();
|
||||||
|
|
||||||
|
@ -1834,7 +1840,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
|
||||||
child.addChild(parent, RelationshipTypeEnum.ISA);
|
child.addChild(parent, RelationshipTypeEnum.ISA);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
myTermCodeSystemStorageSvc.storeNewCodeSystemVersion(table.getPersistentId(), "http://foo", "SYSTEM NAME", "SYSTEM VERSION", cs, table);
|
myTermCodeSystemStorageSvc.storeNewCodeSystemVersion(table.getPersistentId(), CS_URL, "SYSTEM NAME", "SYSTEM VERSION", cs, table);
|
||||||
fail();
|
fail();
|
||||||
} catch (InvalidRequestException e) {
|
} catch (InvalidRequestException e) {
|
||||||
assertEquals("CodeSystem contains circular reference around code parent", e.getMessage());
|
assertEquals("CodeSystem contains circular reference around code parent", e.getMessage());
|
||||||
|
@ -1948,6 +1954,7 @@ public class TerminologySvcImplDstu3Test extends BaseJpaDstu3Test {
|
||||||
|
|
||||||
CodeSystem cs = new CodeSystem();
|
CodeSystem cs = new CodeSystem();
|
||||||
cs.setUrl("http://codesystems-r-us");
|
cs.setUrl("http://codesystems-r-us");
|
||||||
|
cs.setVersion("SYSTEM VERSION");
|
||||||
cs.setContent(CodeSystem.CodeSystemContentMode.NOTPRESENT);
|
cs.setContent(CodeSystem.CodeSystemContentMode.NOTPRESENT);
|
||||||
IIdType csId = myCodeSystemDao.create(cs).getId().toUnqualifiedVersionless();
|
IIdType csId = myCodeSystemDao.create(cs).getId().toUnqualifiedVersionless();
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ import ca.uhn.fhir.jpa.entity.TermConceptMapGroup;
|
||||||
import ca.uhn.fhir.jpa.entity.TermConceptMapGroupElement;
|
import ca.uhn.fhir.jpa.entity.TermConceptMapGroupElement;
|
||||||
import ca.uhn.fhir.jpa.entity.TermConceptMapGroupElementTarget;
|
import ca.uhn.fhir.jpa.entity.TermConceptMapGroupElementTarget;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||||
import org.hl7.fhir.instance.model.api.IIdType;
|
import org.hl7.fhir.instance.model.api.IIdType;
|
||||||
import org.hl7.fhir.r4.model.CanonicalType;
|
import org.hl7.fhir.r4.model.CanonicalType;
|
||||||
|
@ -195,10 +194,12 @@ public class TerminologySvcImplR4Test extends BaseTermR4Test {
|
||||||
TermValueSet termValueSet = myTermValueSetDao.findByResourcePid(myExtensionalVsIdOnResourceTable).get();
|
TermValueSet termValueSet = myTermValueSetDao.findByResourcePid(myExtensionalVsIdOnResourceTable).get();
|
||||||
Long termValueSetId = termValueSet.getId();
|
Long termValueSetId = termValueSet.getId();
|
||||||
assertEquals(3, myTermValueSetConceptDesignationDao.countByTermValueSetId(termValueSetId).intValue());
|
assertEquals(3, myTermValueSetConceptDesignationDao.countByTermValueSetId(termValueSetId).intValue());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(3, termValueSetVersion.getTotalConceptDesignations().intValue());
|
// assertEquals(3, termValueSetVersion.getTotalConceptDesignations().intValue());
|
||||||
|
assertEquals(3, termValueSet.getTotalConceptDesignations().intValue());
|
||||||
assertEquals(24, myTermValueSetConceptDao.countByTermValueSetId(termValueSetId).intValue());
|
assertEquals(24, myTermValueSetConceptDao.countByTermValueSetId(termValueSetId).intValue());
|
||||||
assertEquals(24, termValueSetVersion.getTotalConcepts().intValue());
|
// assertEquals(24, termValueSetVersion.getTotalConcepts().intValue());
|
||||||
|
assertEquals(24, termValueSet.getTotalConcepts().intValue());
|
||||||
|
|
||||||
new TransactionTemplate(myTxManager).execute(new TransactionCallbackWithoutResult() {
|
new TransactionTemplate(myTxManager).execute(new TransactionCallbackWithoutResult() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -233,10 +234,12 @@ public class TerminologySvcImplR4Test extends BaseTermR4Test {
|
||||||
TermValueSet termValueSet = myTermValueSetDao.findByResourcePid(myExtensionalVsIdOnResourceTable).get();
|
TermValueSet termValueSet = myTermValueSetDao.findByResourcePid(myExtensionalVsIdOnResourceTable).get();
|
||||||
Long termValueSetId = termValueSet.getId();
|
Long termValueSetId = termValueSet.getId();
|
||||||
assertEquals(3, myTermValueSetConceptDesignationDao.countByTermValueSetId(termValueSetId).intValue());
|
assertEquals(3, myTermValueSetConceptDesignationDao.countByTermValueSetId(termValueSetId).intValue());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(3, termValueSetVersion.getTotalConceptDesignations().intValue());
|
// assertEquals(3, termValueSetVersion.getTotalConceptDesignations().intValue());
|
||||||
|
assertEquals(3, termValueSet.getTotalConceptDesignations().intValue());
|
||||||
assertEquals(24, myTermValueSetConceptDao.countByTermValueSetId(termValueSetId).intValue());
|
assertEquals(24, myTermValueSetConceptDao.countByTermValueSetId(termValueSetId).intValue());
|
||||||
assertEquals(24, termValueSetVersion.getTotalConcepts().intValue());
|
// assertEquals(24, termValueSetVersion.getTotalConcepts().intValue());
|
||||||
|
assertEquals(24, termValueSet.getTotalConcepts().intValue());
|
||||||
|
|
||||||
new TransactionTemplate(myTxManager).execute(new TransactionCallbackWithoutResult() {
|
new TransactionTemplate(myTxManager).execute(new TransactionCallbackWithoutResult() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,10 +2,10 @@ package ca.uhn.fhir.jpa.term;
|
||||||
|
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetConceptDesignationDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.ITermValueSetVersionDao;
|
import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
||||||
|
import ca.uhn.fhir.jpa.entity.TermValueSet;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
@ -25,9 +25,9 @@ import static org.mockito.Mockito.when;
|
||||||
public class ValueSetConceptAccumulatorTest {
|
public class ValueSetConceptAccumulatorTest {
|
||||||
|
|
||||||
private ValueSetConceptAccumulator myAccumulator;
|
private ValueSetConceptAccumulator myAccumulator;
|
||||||
private TermValueSetVersion myValueSetVersion;
|
private TermValueSet myValueSet;
|
||||||
@Mock
|
@Mock
|
||||||
private ITermValueSetVersionDao myValueSetVersionDao;
|
private ITermValueSetDao myValueSetDao;
|
||||||
@Mock
|
@Mock
|
||||||
private ITermValueSetConceptDesignationDao myValueSetDesignationDao;
|
private ITermValueSetConceptDesignationDao myValueSetDesignationDao;
|
||||||
@Mock
|
@Mock
|
||||||
|
@ -35,8 +35,8 @@ public class ValueSetConceptAccumulatorTest {
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void before() {
|
public void before() {
|
||||||
myValueSetVersion = new TermValueSetVersion();
|
myValueSet = new TermValueSet();
|
||||||
myAccumulator = new ValueSetConceptAccumulator(myValueSetVersion, myValueSetVersionDao, null, myValueSetConceptDao, myValueSetDesignationDao);
|
myAccumulator = new ValueSetConceptAccumulator(myValueSet, myValueSetDao, myValueSetConceptDao, myValueSetDesignationDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -9,7 +9,6 @@ import ca.uhn.fhir.jpa.entity.TermValueSet;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConcept;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
import ca.uhn.fhir.jpa.entity.TermValueSetConceptDesignation;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
import ca.uhn.fhir.jpa.entity.TermValueSetPreExpansionStatusEnum;
|
||||||
import ca.uhn.fhir.jpa.entity.TermValueSetVersion;
|
|
||||||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
||||||
import ca.uhn.fhir.jpa.term.custom.CustomTerminologySet;
|
import ca.uhn.fhir.jpa.term.custom.CustomTerminologySet;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||||
|
@ -1166,9 +1165,11 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(0, termValueSetVersion.getConcepts().size());
|
// assertEquals(0, termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(0, termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSet.getExpansionStatus());
|
||||||
});
|
});
|
||||||
|
|
||||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||||
|
@ -1185,11 +1186,14 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(codeSystem.getConcept().size(), termValueSetVersion.getConcepts().size());
|
// assertEquals(codeSystem.getConcept().size(), termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(codeSystem.getConcept().size(), termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSet.getExpansionStatus());
|
||||||
|
|
||||||
TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
// TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
||||||
|
TermValueSetConcept concept = termValueSet.getConcepts().get(0);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8450-9", concept.getCode());
|
assertEquals("8450-9", concept.getCode());
|
||||||
|
@ -1211,7 +1215,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(1);
|
// concept = termValueSetVersion.getConcepts().get(1);
|
||||||
|
concept = termValueSet.getConcepts().get(1);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("11378-7", concept.getCode());
|
assertEquals("11378-7", concept.getCode());
|
||||||
|
@ -1221,7 +1226,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(22);
|
// concept = termValueSetVersion.getConcepts().get(22);
|
||||||
|
concept = termValueSet.getConcepts().get(22);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8491-3", concept.getCode());
|
assertEquals("8491-3", concept.getCode());
|
||||||
|
@ -1236,7 +1242,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(23);
|
// concept = termValueSetVersion.getConcepts().get(23);
|
||||||
|
concept = termValueSet.getConcepts().get(23);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8492-1", concept.getCode());
|
assertEquals("8492-1", concept.getCode());
|
||||||
|
@ -1270,9 +1277,11 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(0, termValueSetVersion.getConcepts().size());
|
// assertEquals(0, termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(0, termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSet.getExpansionStatus());
|
||||||
});
|
});
|
||||||
|
|
||||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||||
|
@ -1289,11 +1298,14 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(codeSystem.getConcept().size(), termValueSetVersion.getConcepts().size());
|
// assertEquals(codeSystem.getConcept().size(), termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(codeSystem.getConcept().size(), termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSet.getExpansionStatus());
|
||||||
|
|
||||||
TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
// TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
||||||
|
TermValueSetConcept concept = termValueSet.getConcepts().get(0);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8450-9", concept.getCode());
|
assertEquals("8450-9", concept.getCode());
|
||||||
|
@ -1315,7 +1327,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(1);
|
// concept = termValueSetVersion.getConcepts().get(1);
|
||||||
|
concept = termValueSet.getConcepts().get(1);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("11378-7", concept.getCode());
|
assertEquals("11378-7", concept.getCode());
|
||||||
|
@ -1325,7 +1338,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(22);
|
// concept = termValueSetVersion.getConcepts().get(22);
|
||||||
|
concept = termValueSet.getConcepts().get(22);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8491-3", concept.getCode());
|
assertEquals("8491-3", concept.getCode());
|
||||||
|
@ -1340,7 +1354,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(23);
|
// concept = termValueSetVersion.getConcepts().get(23);
|
||||||
|
concept = termValueSet.getConcepts().get(23);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8492-1", concept.getCode());
|
assertEquals("8492-1", concept.getCode());
|
||||||
|
@ -1374,9 +1389,11 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(0, termValueSetVersion.getConcepts().size());
|
// assertEquals(0, termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(0, termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSet.getExpansionStatus());
|
||||||
});
|
});
|
||||||
|
|
||||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||||
|
@ -1393,11 +1410,14 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(codeSystem.getConcept().size() - 2, termValueSetVersion.getConcepts().size());
|
// assertEquals(codeSystem.getConcept().size() - 2, termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(codeSystem.getConcept().size() - 2, termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSet.getExpansionStatus());
|
||||||
|
|
||||||
TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
// TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
||||||
|
TermValueSetConcept concept = termValueSet.getConcepts().get(0);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8450-9", concept.getCode());
|
assertEquals("8450-9", concept.getCode());
|
||||||
|
@ -1419,7 +1439,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(1);
|
// concept = termValueSetVersion.getConcepts().get(1);
|
||||||
|
concept = termValueSet.getConcepts().get(1);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("11378-7", concept.getCode());
|
assertEquals("11378-7", concept.getCode());
|
||||||
|
@ -1429,7 +1450,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(20);
|
// concept = termValueSetVersion.getConcepts().get(20);
|
||||||
|
concept = termValueSet.getConcepts().get(20);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8491-3", concept.getCode());
|
assertEquals("8491-3", concept.getCode());
|
||||||
|
@ -1444,7 +1466,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(21);
|
// concept = termValueSetVersion.getConcepts().get(21);
|
||||||
|
concept = termValueSet.getConcepts().get(21);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8492-1", concept.getCode());
|
assertEquals("8492-1", concept.getCode());
|
||||||
|
@ -1478,9 +1501,11 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(0, termValueSetVersion.getConcepts().size());
|
// assertEquals(0, termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(0, termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.NOT_EXPANDED, termValueSet.getExpansionStatus());
|
||||||
});
|
});
|
||||||
|
|
||||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||||
|
@ -1497,11 +1522,14 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
ourLog.info("ValueSet:\n" + termValueSet.toString());
|
||||||
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
assertEquals("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", termValueSet.getUrl());
|
||||||
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
assertEquals("Terminology Services Connectation #1 Extensional case #2", termValueSet.getName());
|
||||||
TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
// TermValueSetVersion termValueSetVersion = myTermValueSetVersionDao.findByValueSetPidAndNullVersion(termValueSet.getId());
|
||||||
assertEquals(codeSystem.getConcept().size() - 2, termValueSetVersion.getConcepts().size());
|
// assertEquals(codeSystem.getConcept().size() - 2, termValueSetVersion.getConcepts().size());
|
||||||
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
// assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSetVersion.getExpansionStatus());
|
||||||
|
assertEquals(codeSystem.getConcept().size() - 2, termValueSet.getConcepts().size());
|
||||||
|
assertEquals(TermValueSetPreExpansionStatusEnum.EXPANDED, termValueSet.getExpansionStatus());
|
||||||
|
|
||||||
TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
// TermValueSetConcept concept = termValueSetVersion.getConcepts().get(0);
|
||||||
|
TermValueSetConcept concept = termValueSet.getConcepts().get(0);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8450-9", concept.getCode());
|
assertEquals("8450-9", concept.getCode());
|
||||||
|
@ -1523,7 +1551,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
assertEquals("Systoliskt blodtryck - utgång", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(1);
|
// concept = termValueSetVersion.getConcepts().get(1);
|
||||||
|
concept = termValueSet.getConcepts().get(1);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("11378-7", concept.getCode());
|
assertEquals("11378-7", concept.getCode());
|
||||||
|
@ -1533,7 +1562,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(20);
|
// concept = termValueSetVersion.getConcepts().get(20);
|
||||||
|
concept = termValueSet.getConcepts().get(20);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8491-3", concept.getCode());
|
assertEquals("8491-3", concept.getCode());
|
||||||
|
@ -1548,7 +1578,8 @@ public class ValueSetExpansionR4Test extends BaseTermR4Test {
|
||||||
assertEquals("Synonym", designation.getUseDisplay());
|
assertEquals("Synonym", designation.getUseDisplay());
|
||||||
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
assertEquals("Systolische bloeddruk minimaal 1 uur", designation.getValue());
|
||||||
|
|
||||||
concept = termValueSetVersion.getConcepts().get(21);
|
// concept = termValueSetVersion.getConcepts().get(21);
|
||||||
|
concept = termValueSet.getConcepts().get(21);
|
||||||
ourLog.info("Concept:\n" + concept.toString());
|
ourLog.info("Concept:\n" + concept.toString());
|
||||||
assertEquals("http://acme.org", concept.getSystem());
|
assertEquals("http://acme.org", concept.getSystem());
|
||||||
assertEquals("8492-1", concept.getCode());
|
assertEquals("8492-1", concept.getCode());
|
||||||
|
|
Loading…
Reference in New Issue