Incremental progress fixing tests after enabling pre-expansion by default.
This commit is contained in:
parent
799848291f
commit
6b22d705c7
|
@ -149,21 +149,21 @@ public class DaoConfig {
|
|||
private boolean myFilterParameterEnabled = false;
|
||||
private StoreMetaSourceInformationEnum myStoreMetaSourceInformation = StoreMetaSourceInformationEnum.SOURCE_URI_AND_REQUEST_ID;
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production! Do not change default of {@code false}!
|
||||
* Do not change default of {@code true}!
|
||||
*/
|
||||
private boolean myPreExpandValueSetsExperimental = false;
|
||||
private boolean myPreExpandValueSets = true;
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production! Do not change default of {@code 0}!
|
||||
* Do not change default of {@code 0}!
|
||||
*/
|
||||
private int myPreExpandValueSetsDefaultOffsetExperimental = 0;
|
||||
private int myPreExpandValueSetsDefaultOffset = 0;
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production! Do not change default of {@code 1000}!
|
||||
* Do not change default of {@code 1000}!
|
||||
*/
|
||||
private int myPreExpandValueSetsDefaultCountExperimental = 1000;
|
||||
private int myPreExpandValueSetsDefaultCount = 1000;
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production! Do not change default of {@code 1000}!
|
||||
* Do not change default of {@code 1000}!
|
||||
*/
|
||||
private int myPreExpandValueSetsMaxCountExperimental = 1000;
|
||||
private int myPreExpandValueSetsMaxCount = 1000;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -920,7 +920,7 @@ public class DaoConfig {
|
|||
* <p>
|
||||
* Default is {@literal true} beginning in HAPI FHIR 2.4, since this
|
||||
* feature is now specified in the FHIR specification. (Previously it
|
||||
* was an experimental/rpposed feature)
|
||||
* was an experimental/proposed feature)
|
||||
* </p>
|
||||
*
|
||||
* @since 1.5
|
||||
|
@ -1621,34 +1621,6 @@ public class DaoConfig {
|
|||
myModelConfig.setWebsocketContextPath(theWebsocketContextPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production!
|
||||
* <p>
|
||||
* If set to {@code true}, ValueSets and expansions are stored in terminology tables. This is to facilitate
|
||||
* future optimization of the $expand operation on large ValueSets.
|
||||
* </p>
|
||||
* <p>
|
||||
* The default value for this setting is {@code false}.
|
||||
* </p>
|
||||
*/
|
||||
public boolean isPreExpandValueSetsExperimental() {
|
||||
return myPreExpandValueSetsExperimental;
|
||||
}
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production!
|
||||
* <p>
|
||||
* If set to {@code true}, ValueSets and expansions are stored in terminology tables. This is to facilitate
|
||||
* future optimization of the $expand operation on large ValueSets.
|
||||
* </p>
|
||||
* <p>
|
||||
* The default value for this setting is {@code false}.
|
||||
* </p>
|
||||
*/
|
||||
public void setPreExpandValueSetsExperimental(boolean thePreExpandValueSetsExperimental) {
|
||||
myPreExpandValueSetsExperimental = thePreExpandValueSetsExperimental;
|
||||
}
|
||||
|
||||
/**
|
||||
* If set to <code>true</code> the _filter search parameter will be enabled on this server. Note that _filter
|
||||
* is very powerful, but also potentially dangerous as it can allow a user to create a query for which there
|
||||
|
@ -1720,83 +1692,104 @@ public class DaoConfig {
|
|||
}
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production!
|
||||
* <p>
|
||||
* If set to {@code true}, ValueSets and expansions are stored in terminology tables. This is to facilitate
|
||||
* optimization of the $expand operation on large ValueSets.
|
||||
* </p>
|
||||
* <p>
|
||||
* The default value for this setting is {@code true}.
|
||||
* </p>
|
||||
*/
|
||||
public boolean isPreExpandValueSets() {
|
||||
return myPreExpandValueSets;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* If set to {@code true}, ValueSets and expansions are stored in terminology tables. This is to facilitate
|
||||
* optimization of the $expand operation on large ValueSets.
|
||||
* </p>
|
||||
* <p>
|
||||
* The default value for this setting is {@code true}.
|
||||
* </p>
|
||||
*/
|
||||
public void setPreExpandValueSets(boolean thePreExpandValueSets) {
|
||||
myPreExpandValueSets = thePreExpandValueSets;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* This is the default value of {@code offset} parameter for the ValueSet {@code $expand} operation when
|
||||
* {@link DaoConfig#isPreExpandValueSetsExperimental()} returns {@code true}.
|
||||
* {@link DaoConfig#isPreExpandValueSets()} returns {@code true}.
|
||||
* </p>
|
||||
* <p>
|
||||
* The default value for this setting is {@code 0}.
|
||||
* </p>
|
||||
*/
|
||||
public int getPreExpandValueSetsDefaultOffsetExperimental() {
|
||||
return myPreExpandValueSetsDefaultOffsetExperimental;
|
||||
public int getPreExpandValueSetsDefaultOffset() {
|
||||
return myPreExpandValueSetsDefaultOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production!
|
||||
* <p>
|
||||
* This is the default value of {@code count} parameter for the ValueSet {@code $expand} operation when
|
||||
* {@link DaoConfig#isPreExpandValueSetsExperimental()} returns {@code true}.
|
||||
* {@link DaoConfig#isPreExpandValueSets()} returns {@code true}.
|
||||
* </p>
|
||||
* <p>
|
||||
* The default value for this setting is {@code 1000}.
|
||||
* </p>
|
||||
*/
|
||||
public int getPreExpandValueSetsDefaultCountExperimental() {
|
||||
return myPreExpandValueSetsDefaultCountExperimental;
|
||||
public int getPreExpandValueSetsDefaultCount() {
|
||||
return myPreExpandValueSetsDefaultCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production!
|
||||
* <p>
|
||||
* This is the default value of {@code count} parameter for the ValueSet {@code $expand} operation when
|
||||
* {@link DaoConfig#isPreExpandValueSetsExperimental()} returns {@code true}.
|
||||
* {@link DaoConfig#isPreExpandValueSets()} returns {@code true}.
|
||||
* </p>
|
||||
* <p>
|
||||
* If {@code thePreExpandValueSetsDefaultCountExperimental} is greater than
|
||||
* {@link DaoConfig#getPreExpandValueSetsMaxCountExperimental()}, the lesser value is used.
|
||||
* If {@code thePreExpandValueSetsDefaultCount} is greater than
|
||||
* {@link DaoConfig#getPreExpandValueSetsMaxCount()}, the lesser value is used.
|
||||
* </p>
|
||||
* <p>
|
||||
* The default value for this setting is {@code 1000}.
|
||||
* </p>
|
||||
*/
|
||||
public void setPreExpandValueSetsDefaultCountExperimental(int thePreExpandValueSetsDefaultCountExperimental) {
|
||||
myPreExpandValueSetsDefaultCountExperimental = Math.min(thePreExpandValueSetsDefaultCountExperimental, getPreExpandValueSetsMaxCountExperimental());
|
||||
public void setPreExpandValueSetsDefaultCount(int thePreExpandValueSetsDefaultCount) {
|
||||
myPreExpandValueSetsDefaultCount = Math.min(thePreExpandValueSetsDefaultCount, getPreExpandValueSetsMaxCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production!
|
||||
* <p>
|
||||
* This is the max value of {@code count} parameter for the ValueSet {@code $expand} operation when
|
||||
* {@link DaoConfig#isPreExpandValueSetsExperimental()} returns {@code true}.
|
||||
* {@link DaoConfig#isPreExpandValueSets()} returns {@code true}.
|
||||
* </p>
|
||||
* <p>
|
||||
* The default value for this setting is {@code 1000}.
|
||||
* </p>
|
||||
*/
|
||||
public int getPreExpandValueSetsMaxCountExperimental() {
|
||||
return myPreExpandValueSetsMaxCountExperimental;
|
||||
public int getPreExpandValueSetsMaxCount() {
|
||||
return myPreExpandValueSetsMaxCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL - Do not use in production!
|
||||
* <p>
|
||||
* This is the max value of {@code count} parameter for the ValueSet {@code $expand} operation when
|
||||
* {@link DaoConfig#isPreExpandValueSetsExperimental()} returns {@code true}.
|
||||
* {@link DaoConfig#isPreExpandValueSets()} returns {@code true}.
|
||||
* </p>
|
||||
* <p>
|
||||
* If {@code thePreExpandValueSetsMaxCountExperimental} is lesser than
|
||||
* {@link DaoConfig#getPreExpandValueSetsDefaultCountExperimental()}, the default {@code count} is lowered to the
|
||||
* If {@code thePreExpandValueSetsMaxCount} is lesser than
|
||||
* {@link DaoConfig#getPreExpandValueSetsDefaultCount()}, the default {@code count} is lowered to the
|
||||
* new max {@code count}.
|
||||
* </p>
|
||||
* <p>
|
||||
* The default value for this setting is {@code 1000}.
|
||||
* </p>
|
||||
*/
|
||||
public void setPreExpandValueSetsMaxCountExperimental(int thePreExpandValueSetsMaxCountExperimental) {
|
||||
myPreExpandValueSetsMaxCountExperimental = thePreExpandValueSetsMaxCountExperimental;
|
||||
setPreExpandValueSetsDefaultCountExperimental(Math.min(getPreExpandValueSetsDefaultCountExperimental(), getPreExpandValueSetsMaxCountExperimental()));
|
||||
public void setPreExpandValueSetsMaxCount(int thePreExpandValueSetsMaxCount) {
|
||||
myPreExpandValueSetsMaxCount = thePreExpandValueSetsMaxCount;
|
||||
setPreExpandValueSetsDefaultCount(Math.min(getPreExpandValueSetsDefaultCount(), getPreExpandValueSetsMaxCount()));
|
||||
}
|
||||
|
||||
public enum IndexEnabledEnum {
|
||||
|
|
|
@ -310,6 +310,7 @@ public class FhirResourceDaoValueSetDstu3 extends FhirResourceDaoDstu3<ValueSet>
|
|||
|
||||
boolean haveIdentifierParam = theValueSetIdentifier != null && theValueSetIdentifier.isEmpty() == false;
|
||||
ValueSet vs = null;
|
||||
boolean isBuiltInValueSet = false;
|
||||
if (theId != null) {
|
||||
vs = read(theId, theRequestDetails);
|
||||
} else if (haveIdentifierParam) {
|
||||
|
@ -317,6 +318,7 @@ public class FhirResourceDaoValueSetDstu3 extends FhirResourceDaoDstu3<ValueSet>
|
|||
if (vs == null) {
|
||||
throw new InvalidRequestException("Unknown ValueSet identifier: " + theValueSetIdentifier.getValue());
|
||||
}
|
||||
isBuiltInValueSet = true;
|
||||
} else {
|
||||
if (theCode == null || theCode.isEmpty()) {
|
||||
throw new InvalidRequestException("Either ValueSet ID or ValueSet identifier or system and code must be provided. Unable to validate.");
|
||||
|
@ -332,7 +334,7 @@ public class FhirResourceDaoValueSetDstu3 extends FhirResourceDaoDstu3<ValueSet>
|
|||
|
||||
if (vs != null) {
|
||||
ValidateCodeResult result;
|
||||
if (myDaoConfig.isPreExpandValueSetsExperimental() && myTerminologySvc.isValueSetPreExpandedForCodeValidation(vs)) {
|
||||
if (myDaoConfig.isPreExpandValueSets() && !isBuiltInValueSet && myTerminologySvc.isValueSetPreExpandedForCodeValidation(vs)) {
|
||||
result = myTerminologySvc.validateCodeIsInPreExpandedValueSet(vs, toStringOrNull(theSystem), toStringOrNull(theCode), toStringOrNull(theDisplay), theCoding, theCodeableConcept);
|
||||
} else {
|
||||
ValueSet expansion = doExpand(vs);
|
||||
|
@ -399,7 +401,7 @@ public class FhirResourceDaoValueSetDstu3 extends FhirResourceDaoDstu3<ValueSet>
|
|||
boolean theUpdateVersion, Date theUpdateTime, boolean theForceUpdate, boolean theCreateNewHistoryEntry) {
|
||||
ResourceTable retVal = super.updateEntity(theRequestDetails, theResource, theEntity, theDeletedTimestampOrNull, thePerformIndexing, theUpdateVersion, theUpdateTime, theForceUpdate, theCreateNewHistoryEntry);
|
||||
|
||||
if (myDaoConfig.isPreExpandValueSetsExperimental()) {
|
||||
if (myDaoConfig.isPreExpandValueSets()) {
|
||||
if (retVal.getDeleted() == null) {
|
||||
try {
|
||||
ValueSet valueSet = (ValueSet) theResource;
|
||||
|
|
|
@ -306,6 +306,7 @@ public class FhirResourceDaoValueSetR4 extends FhirResourceDaoR4<ValueSet> imple
|
|||
|
||||
boolean haveIdentifierParam = theValueSetIdentifier != null && !theValueSetIdentifier.isEmpty();
|
||||
ValueSet vs = null;
|
||||
boolean isBuiltInValueSet = false;
|
||||
if (theId != null) {
|
||||
vs = read(theId, theRequestDetails);
|
||||
} else if (haveIdentifierParam) {
|
||||
|
@ -313,6 +314,7 @@ public class FhirResourceDaoValueSetR4 extends FhirResourceDaoR4<ValueSet> imple
|
|||
if (vs == null) {
|
||||
throw new InvalidRequestException("Unknown ValueSet identifier: " + theValueSetIdentifier.getValue());
|
||||
}
|
||||
isBuiltInValueSet = true;
|
||||
} else {
|
||||
if (theCode == null || theCode.isEmpty()) {
|
||||
throw new InvalidRequestException("Either ValueSet ID or ValueSet identifier or system and code must be provided. Unable to validate.");
|
||||
|
@ -328,7 +330,7 @@ public class FhirResourceDaoValueSetR4 extends FhirResourceDaoR4<ValueSet> imple
|
|||
|
||||
if (vs != null) {
|
||||
ValidateCodeResult result;
|
||||
if (myDaoConfig.isPreExpandValueSetsExperimental() && myTerminologySvc.isValueSetPreExpandedForCodeValidation(vs)) {
|
||||
if (myDaoConfig.isPreExpandValueSets() && !isBuiltInValueSet && myTerminologySvc.isValueSetPreExpandedForCodeValidation(vs)) {
|
||||
result = myTerminologySvc.validateCodeIsInPreExpandedValueSet(vs, toStringOrNull(theSystem), toStringOrNull(theCode), toStringOrNull(theDisplay), theCoding, theCodeableConcept);
|
||||
} else {
|
||||
ValueSet expansion = doExpand(vs);
|
||||
|
@ -395,7 +397,7 @@ public class FhirResourceDaoValueSetR4 extends FhirResourceDaoR4<ValueSet> imple
|
|||
boolean theUpdateVersion, Date theUpdateTime, boolean theForceUpdate, boolean theCreateNewHistoryEntry) {
|
||||
ResourceTable retVal = super.updateEntity(theRequestDetails, theResource, theEntity, theDeletedTimestampOrNull, thePerformIndexing, theUpdateVersion, theUpdateTime, theForceUpdate, theCreateNewHistoryEntry);
|
||||
|
||||
if (myDaoConfig.isPreExpandValueSetsExperimental()) {
|
||||
if (myDaoConfig.isPreExpandValueSets()) {
|
||||
if (retVal.getDeleted() == null) {
|
||||
ValueSet valueSet = (ValueSet) theResource;
|
||||
myHapiTerminologySvc.storeTermValueSet(retVal, valueSet);
|
||||
|
|
|
@ -312,6 +312,7 @@ public class FhirResourceDaoValueSetR5 extends FhirResourceDaoR5<ValueSet> imple
|
|||
|
||||
boolean haveIdentifierParam = theValueSetIdentifier != null && theValueSetIdentifier.isEmpty() == false;
|
||||
ValueSet vs = null;
|
||||
boolean isBuiltInValueSet = false;
|
||||
if (theId != null) {
|
||||
vs = read(theId, theRequestDetails);
|
||||
} else if (haveIdentifierParam) {
|
||||
|
@ -319,6 +320,7 @@ public class FhirResourceDaoValueSetR5 extends FhirResourceDaoR5<ValueSet> imple
|
|||
if (vs == null) {
|
||||
throw new InvalidRequestException("Unknown ValueSet identifier: " + theValueSetIdentifier.getValue());
|
||||
}
|
||||
isBuiltInValueSet = true;
|
||||
} else {
|
||||
if (theCode == null || theCode.isEmpty()) {
|
||||
throw new InvalidRequestException("Either ValueSet ID or ValueSet identifier or system and code must be provided. Unable to validate.");
|
||||
|
@ -334,7 +336,7 @@ public class FhirResourceDaoValueSetR5 extends FhirResourceDaoR5<ValueSet> imple
|
|||
|
||||
if (vs != null) {
|
||||
ValidateCodeResult result;
|
||||
if (myDaoConfig.isPreExpandValueSetsExperimental() && myTerminologySvc.isValueSetPreExpandedForCodeValidation(vs)) {
|
||||
if (myDaoConfig.isPreExpandValueSets() && !isBuiltInValueSet && myTerminologySvc.isValueSetPreExpandedForCodeValidation(vs)) {
|
||||
result = myTerminologySvc.validateCodeIsInPreExpandedValueSet(vs, toStringOrNull(theSystem), toStringOrNull(theCode), toStringOrNull(theDisplay), theCoding, theCodeableConcept);
|
||||
} else {
|
||||
ValueSet expansion = doExpand(vs);
|
||||
|
@ -401,7 +403,7 @@ public class FhirResourceDaoValueSetR5 extends FhirResourceDaoR5<ValueSet> imple
|
|||
boolean theUpdateVersion, Date theUpdateTime, boolean theForceUpdate, boolean theCreateNewHistoryEntry) {
|
||||
ResourceTable retVal = super.updateEntity(theRequestDetails, theResource, theEntity, theDeletedTimestampOrNull, thePerformIndexing, theUpdateVersion, theUpdateTime, theForceUpdate, theCreateNewHistoryEntry);
|
||||
|
||||
if (myDaoConfig.isPreExpandValueSetsExperimental()) {
|
||||
if (myDaoConfig.isPreExpandValueSets()) {
|
||||
if (retVal.getDeleted() == null) {
|
||||
ValueSet valueSet = (ValueSet) theResource;
|
||||
myHapiTerminologySvc.storeTermValueSet(retVal, org.hl7.fhir.convertors.conv40_50.ValueSet.convertValueSet(valueSet));
|
||||
|
|
|
@ -68,7 +68,7 @@ public class BaseJpaResourceProviderValueSetDstu3 extends JpaResourceProviderDst
|
|||
throw new InvalidRequestException("$expand must EITHER be invoked at the instance level, or have an identifier specified, or have a ValueSet specified. Can not combine these options.");
|
||||
}
|
||||
|
||||
int offset = myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental();
|
||||
int offset = myDaoConfig.getPreExpandValueSetsDefaultOffset();
|
||||
if (theOffset != null && theOffset.hasValue()) {
|
||||
if (theOffset.getValue() >= 0) {
|
||||
offset = theOffset.getValue();
|
||||
|
@ -77,7 +77,7 @@ public class BaseJpaResourceProviderValueSetDstu3 extends JpaResourceProviderDst
|
|||
}
|
||||
}
|
||||
|
||||
int count = myDaoConfig.getPreExpandValueSetsDefaultCountExperimental();
|
||||
int count = myDaoConfig.getPreExpandValueSetsDefaultCount();
|
||||
if (theCount != null && theCount.hasValue()) {
|
||||
if (theCount.getValue() >= 0) {
|
||||
count = theCount.getValue();
|
||||
|
@ -85,7 +85,7 @@ public class BaseJpaResourceProviderValueSetDstu3 extends JpaResourceProviderDst
|
|||
throw new InvalidRequestException("count parameter for $expand operation must be >= 0 when specified. count: " + theCount.getValue());
|
||||
}
|
||||
}
|
||||
int countMax = myDaoConfig.getPreExpandValueSetsMaxCountExperimental();
|
||||
int countMax = myDaoConfig.getPreExpandValueSetsMaxCount();
|
||||
if (count > countMax) {
|
||||
ourLog.warn("count parameter for $expand operation of {} exceeds maximum value of {}; using maximum value.", count, countMax);
|
||||
count = countMax;
|
||||
|
@ -94,7 +94,7 @@ public class BaseJpaResourceProviderValueSetDstu3 extends JpaResourceProviderDst
|
|||
startRequest(theServletRequest);
|
||||
try {
|
||||
IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> dao = (IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept>) getDao();
|
||||
if (myDaoConfig.isPreExpandValueSetsExperimental()) {
|
||||
if (myDaoConfig.isPreExpandValueSets()) {
|
||||
if (haveId) {
|
||||
return dao.expand(theId, toFilterString(theFilter), offset, count, theRequestDetails);
|
||||
} else if (haveIdentifier) {
|
||||
|
|
|
@ -60,7 +60,7 @@ public class BaseJpaResourceProviderValueSetR4 extends JpaResourceProviderR4<Val
|
|||
throw new InvalidRequestException("$expand must EITHER be invoked at the instance level, or have a url specified, or have a ValueSet specified. Can not combine these options.");
|
||||
}
|
||||
|
||||
int offset = myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental();
|
||||
int offset = myDaoConfig.getPreExpandValueSetsDefaultOffset();
|
||||
if (theOffset != null && theOffset.hasValue()) {
|
||||
if (theOffset.getValue() >= 0) {
|
||||
offset = theOffset.getValue();
|
||||
|
@ -69,7 +69,7 @@ public class BaseJpaResourceProviderValueSetR4 extends JpaResourceProviderR4<Val
|
|||
}
|
||||
}
|
||||
|
||||
int count = myDaoConfig.getPreExpandValueSetsDefaultCountExperimental();
|
||||
int count = myDaoConfig.getPreExpandValueSetsDefaultCount();
|
||||
if (theCount != null && theCount.hasValue()) {
|
||||
if (theCount.getValue() >= 0) {
|
||||
count = theCount.getValue();
|
||||
|
@ -77,7 +77,7 @@ public class BaseJpaResourceProviderValueSetR4 extends JpaResourceProviderR4<Val
|
|||
throw new InvalidRequestException("count parameter for $expand operation must be >= 0 when specified. count: " + theCount.getValue());
|
||||
}
|
||||
}
|
||||
int countMax = myDaoConfig.getPreExpandValueSetsMaxCountExperimental();
|
||||
int countMax = myDaoConfig.getPreExpandValueSetsMaxCount();
|
||||
if (count > countMax) {
|
||||
ourLog.warn("count parameter for $expand operation of {} exceeds maximum value of {}; using maximum value.", count, countMax);
|
||||
count = countMax;
|
||||
|
@ -86,7 +86,7 @@ public class BaseJpaResourceProviderValueSetR4 extends JpaResourceProviderR4<Val
|
|||
startRequest(theServletRequest);
|
||||
try {
|
||||
IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> dao = (IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept>) getDao();
|
||||
if (myDaoConfig.isPreExpandValueSetsExperimental()) {
|
||||
if (myDaoConfig.isPreExpandValueSets()) {
|
||||
if (haveId) {
|
||||
return dao.expand(theId, toFilterString(theFilter), offset, count, theRequestDetails);
|
||||
} else if (haveIdentifier) {
|
||||
|
|
|
@ -60,7 +60,7 @@ public class BaseJpaResourceProviderValueSetR5 extends JpaResourceProviderR5<Val
|
|||
throw new InvalidRequestException("$expand must EITHER be invoked at the instance level, or have a url specified, or have a ValueSet specified. Can not combine these options.");
|
||||
}
|
||||
|
||||
int offset = myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental();
|
||||
int offset = myDaoConfig.getPreExpandValueSetsDefaultOffset();
|
||||
if (theOffset != null && theOffset.hasValue()) {
|
||||
if (theOffset.getValue() >= 0) {
|
||||
offset = theOffset.getValue();
|
||||
|
@ -69,7 +69,7 @@ public class BaseJpaResourceProviderValueSetR5 extends JpaResourceProviderR5<Val
|
|||
}
|
||||
}
|
||||
|
||||
int count = myDaoConfig.getPreExpandValueSetsDefaultCountExperimental();
|
||||
int count = myDaoConfig.getPreExpandValueSetsDefaultCount();
|
||||
if (theCount != null && theCount.hasValue()) {
|
||||
if (theCount.getValue() >= 0) {
|
||||
count = theCount.getValue();
|
||||
|
@ -77,7 +77,7 @@ public class BaseJpaResourceProviderValueSetR5 extends JpaResourceProviderR5<Val
|
|||
throw new InvalidRequestException("count parameter for $expand operation must be >= 0 when specified. count: " + theCount.getValue());
|
||||
}
|
||||
}
|
||||
int countMax = myDaoConfig.getPreExpandValueSetsMaxCountExperimental();
|
||||
int countMax = myDaoConfig.getPreExpandValueSetsMaxCount();
|
||||
if (count > countMax) {
|
||||
ourLog.warn("count parameter for $expand operation of {} exceeds maximum value of {}; using maximum value.", count, countMax);
|
||||
count = countMax;
|
||||
|
@ -86,7 +86,7 @@ public class BaseJpaResourceProviderValueSetR5 extends JpaResourceProviderR5<Val
|
|||
startRequest(theServletRequest);
|
||||
try {
|
||||
IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> dao = (IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept>) getDao();
|
||||
if (myDaoConfig.isPreExpandValueSetsExperimental()) {
|
||||
if (myDaoConfig.isPreExpandValueSets()) {
|
||||
if (haveId) {
|
||||
return dao.expand(theId, toFilterString(theFilter), offset, count, theRequestDetails);
|
||||
} else if (haveIdentifier) {
|
||||
|
|
|
@ -63,9 +63,9 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
|
|||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
import org.hl7.fhir.r4.model.*;
|
||||
import org.hl7.fhir.r4.model.codesystems.ConceptSubsumptionOutcome;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.hl7.fhir.r4.model.codesystems.ConceptSubsumptionOutcome;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
@ -204,22 +204,6 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
|
|||
}
|
||||
}
|
||||
|
||||
private void addDisplayFilterExact(QueryBuilder qb, BooleanJunction<?> bool, ValueSet.ConceptSetFilterComponent nextFilter) {
|
||||
bool.must(qb.phrase().onField("myDisplay").sentence(nextFilter.getValue()).createQuery());
|
||||
}
|
||||
|
||||
private void addDisplayFilterInexact(QueryBuilder qb, BooleanJunction<?> bool, ValueSet.ConceptSetFilterComponent nextFilter) {
|
||||
Query textQuery = qb
|
||||
.phrase()
|
||||
.withSlop(2)
|
||||
.onField("myDisplay").boostedTo(4.0f)
|
||||
.andField("myDisplayEdgeNGram").boostedTo(2.0f)
|
||||
// .andField("myDisplayNGram").boostedTo(1.0f)
|
||||
// .andField("myDisplayPhonetic").boostedTo(0.5f)
|
||||
.sentence(nextFilter.getValue().toLowerCase()).createQuery();
|
||||
bool.must(textQuery);
|
||||
}
|
||||
|
||||
private boolean addToSet(Set<TermConcept> theSetToPopulate, TermConcept theConcept) {
|
||||
boolean retVal = theSetToPopulate.add(theConcept);
|
||||
if (retVal) {
|
||||
|
@ -894,6 +878,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
|
|||
throw new InvalidRequestException("Invalid filter, property " + theFilter.getProperty() + " is LOINC-specific and cannot be used with system: " + theSystem);
|
||||
}
|
||||
break;
|
||||
// FIXME: DM 2019-09-24 - Need to implement LOINC-specific filters for "ancestor" and "descendant".
|
||||
case "copyright":
|
||||
if (isCodeSystemLoinc(theSystem)) {
|
||||
handleFilterLoincCopyright(theQb, theBool, theFilter);
|
||||
|
@ -923,6 +908,22 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
|
|||
}
|
||||
}
|
||||
|
||||
private void addDisplayFilterExact(QueryBuilder qb, BooleanJunction<?> bool, ValueSet.ConceptSetFilterComponent nextFilter) {
|
||||
bool.must(qb.phrase().onField("myDisplay").sentence(nextFilter.getValue()).createQuery());
|
||||
}
|
||||
|
||||
private void addDisplayFilterInexact(QueryBuilder qb, BooleanJunction<?> bool, ValueSet.ConceptSetFilterComponent nextFilter) {
|
||||
Query textQuery = qb
|
||||
.phrase()
|
||||
.withSlop(2)
|
||||
.onField("myDisplay").boostedTo(4.0f)
|
||||
.andField("myDisplayEdgeNGram").boostedTo(2.0f)
|
||||
// .andField("myDisplayNGram").boostedTo(1.0f)
|
||||
// .andField("myDisplayPhonetic").boostedTo(0.5f)
|
||||
.sentence(nextFilter.getValue().toLowerCase()).createQuery();
|
||||
bool.must(textQuery);
|
||||
}
|
||||
|
||||
private void handleFilterConceptAndCode(String theSystem, QueryBuilder theQb, BooleanJunction<?> theBool, ValueSet.ConceptSetFilterComponent theFilter) {
|
||||
TermConcept code = findCode(theSystem, theFilter.getValue())
|
||||
.orElseThrow(() -> new InvalidRequestException("Invalid filter criteria - code does not exist: {" + theSystem + "}" + theFilter.getValue()));
|
||||
|
|
|
@ -229,7 +229,7 @@ public class FhirResourceDaoDstu3ValueSetTest extends BaseJpaDstu3Test {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testValiedateCodeAgainstBuiltInValueSetAndCodeSystemWithValidCode() {
|
||||
public void testValidateCodeAgainstBuiltInValueSetAndCodeSystemWithValidCode() {
|
||||
IPrimitiveType<String> display = null;
|
||||
Coding coding = null;
|
||||
CodeableConcept codeableConcept = null;
|
||||
|
|
|
@ -22,7 +22,7 @@ public class FhirResourceDaoR4ValueSetTest extends BaseJpaR4Test {
|
|||
|
||||
@After
|
||||
public void after() {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(new DaoConfig().isPreExpandValueSetsExperimental());
|
||||
myDaoConfig.setPreExpandValueSets(new DaoConfig().isPreExpandValueSets());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
@ -128,7 +128,7 @@ public class FhirResourceDaoR4ValueSetTest extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testValidateCodeOperationByResourceIdAndCodeableConceptWithExistingValueSetAndPreExpansionEnabled() {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
UriType valueSetIdentifier = null;
|
||||
IIdType id = myExtensionalVsId;
|
||||
|
@ -169,7 +169,7 @@ public class FhirResourceDaoR4ValueSetTest extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testValidateCodeOperationByResourceIdAndCodeAndSystemWithExistingValueSetAndPreExpansionEnabled() {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
UriType valueSetIdentifier = null;
|
||||
IIdType id = myExtensionalVsId;
|
||||
|
|
|
@ -140,7 +140,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
createLocalVsWithUnknownCode(codeSystem);
|
||||
}
|
||||
|
||||
private void createLocalCsAndVs() {
|
||||
private void createLocalCs() {
|
||||
CodeSystem codeSystem = new CodeSystem();
|
||||
codeSystem.setUrl(URL_MY_CODE_SYSTEM);
|
||||
codeSystem.setContent(CodeSystemContentMode.COMPLETE);
|
||||
|
@ -155,8 +155,6 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
.addConcept(new ConceptDefinitionComponent().setCode("BA").setDisplay("Code BA"))
|
||||
.addConcept(new ConceptDefinitionComponent().setCode("BB").setDisplay("Code BB"));
|
||||
myCodeSystemDao.create(codeSystem, mySrd);
|
||||
|
||||
createLocalVs(codeSystem);
|
||||
}
|
||||
|
||||
|
||||
|
@ -242,6 +240,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
|
||||
// Include
|
||||
vs = new ValueSet();
|
||||
vs.setUrl("http://www.example.org/vs");
|
||||
vs.getCompose()
|
||||
.addInclude()
|
||||
.setSystem(CS_URL);
|
||||
|
@ -282,6 +281,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
|
||||
// Include
|
||||
vs = new ValueSet();
|
||||
vs.setUrl("http://www.example.org/vs");
|
||||
vs.getCompose()
|
||||
.addInclude()
|
||||
.setSystem(CS_URL);
|
||||
|
@ -329,7 +329,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
|
||||
@Test
|
||||
public void testExpandByIdWithPreExpansion() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
@ -445,7 +445,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
|
||||
@Test
|
||||
public void testExpandByUrlWithPreExpansion() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
@ -468,7 +468,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
|
||||
@Test
|
||||
public void testExpandByUrlWithPreExpansionAndBogusUrl() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
@ -746,7 +746,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
public void testValidateCodeOperationByCodeAndSystemInstanceOnInstance() throws IOException {
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
|
||||
createLocalCsAndVs();
|
||||
createLocalCs();
|
||||
createLocalVsWithIncludeConcept();
|
||||
|
||||
String url = ourServerBase +
|
||||
|
@ -789,7 +789,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
* Technically this is the wrong param name
|
||||
*/
|
||||
@Test
|
||||
public void testValiedateCodeAgainstBuiltInSystem() throws Exception {
|
||||
public void testValidateCodeAgainstBuiltInSystem() throws Exception {
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
|
||||
Parameters respParam = ourClient
|
||||
|
@ -819,7 +819,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
* Technically this is the right param name
|
||||
*/
|
||||
@Test
|
||||
public void testValiedateCodeAgainstBuiltInSystemByUrl() throws Exception {
|
||||
public void testValidateCodeAgainstBuiltInSystemByUrl() throws Exception {
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
|
||||
Parameters respParam = ourClient
|
||||
|
@ -847,7 +847,7 @@ public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3
|
|||
|
||||
@After
|
||||
public void afterResetPreExpansionDefault() {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(new DaoConfig().isPreExpandValueSetsExperimental());
|
||||
myDaoConfig.setPreExpandValueSets(new DaoConfig().isPreExpandValueSets());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
|
|
@ -846,7 +846,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void interceptResponse(IHttpResponse theResponse) { // TODO Auto-generated method stu
|
||||
public void interceptResponse(IHttpResponse theResponse) { // TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -3919,7 +3919,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
|
|||
.returnBundle(Bundle.class)
|
||||
.execute();
|
||||
final String uuid2 = toSearchUuidFromLinkNext(result2);
|
||||
assertNotEquals(uuid1, uuid2);
|
||||
assertNotEquals(uuid1, uuid2); // TODO: DM 2019-09-24 - This test fails intermittently; I suspect it's a timing issue with sleepOneClick();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -244,7 +244,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandByIdWithPreExpansion() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
@ -296,7 +296,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandByIdWithFilterWithPreExpansion() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
@ -355,7 +355,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandByUrlWithPreExpansion() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
@ -378,7 +378,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandByUrlWithPreExpansionAndBogusUrl() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
@ -420,7 +420,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandByValueSetWithPreExpansion() throws IOException {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystem(HttpVerb.POST);
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
@ -711,7 +711,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
|||
|
||||
@Test
|
||||
public void testUpdateValueSetTriggersAnotherPreExpansion() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -740,7 +740,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
|||
|
||||
@Test
|
||||
public void testUpdateValueSetTriggersAnotherPreExpansionUsingTransactionBundle() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -951,7 +951,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testValiedateCodeAgainstBuiltInSystem() {
|
||||
public void testValidateCodeAgainstBuiltInSystem() {
|
||||
Parameters respParam = ourClient
|
||||
.operation()
|
||||
.onType(ValueSet.class)
|
||||
|
@ -1023,7 +1023,7 @@ public class ResourceProviderR4ValueSetTest extends BaseResourceProviderR4Test {
|
|||
|
||||
@After
|
||||
public void afterResetPreExpansionDefault() {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(new DaoConfig().isPreExpandValueSetsExperimental());
|
||||
myDaoConfig.setPreExpandValueSets(new DaoConfig().isPreExpandValueSets());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
|
|
@ -65,7 +65,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
@After
|
||||
public void after() {
|
||||
myDaoConfig.setAllowExternalReferences(new DaoConfig().isAllowExternalReferences());
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(new DaoConfig().isPreExpandValueSetsExperimental());
|
||||
myDaoConfig.setPreExpandValueSets(new DaoConfig().isPreExpandValueSets());
|
||||
}
|
||||
|
||||
private IIdType createCodeSystem() {
|
||||
|
@ -629,7 +629,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testDeleteValueSet() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -641,7 +641,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), myDaoConfig.getPreExpandValueSetsDefaultCountExperimental());
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), myDaoConfig.getPreExpandValueSetsDefaultCount());
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
TermValueSet termValueSet = myTermValueSetDao.findByResourcePid(myExtensionalVsIdOnResourceTable).get();
|
||||
|
@ -666,7 +666,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testDeleteValueSetWithClientAssignedId() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.PUT);
|
||||
|
||||
|
@ -678,7 +678,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), myDaoConfig.getPreExpandValueSetsDefaultCountExperimental());
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), myDaoConfig.getPreExpandValueSetsDefaultCount());
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
TermValueSet termValueSet = myTermValueSetDao.findByResourcePid(myExtensionalVsIdOnResourceTable).get();
|
||||
|
@ -723,7 +723,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testDuplicateValueSetUrls() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
// DM 2019-03-05 - We pre-load our custom CodeSystem otherwise pre-expansion of the ValueSet will fail.
|
||||
loadAndPersistCodeSystemAndValueSet(HttpVerb.POST);
|
||||
|
@ -736,7 +736,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildren() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -750,7 +750,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myCaptureQueriesListener.clear();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), myDaoConfig.getPreExpandValueSetsDefaultCountExperimental());
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), myDaoConfig.getPreExpandValueSetsDefaultCount());
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
myCaptureQueriesListener.logSelectQueriesForCurrentThread();
|
||||
|
@ -760,7 +760,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
assertThat(myCaptureQueriesListener.getDeleteQueriesForCurrentThread(), empty());
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffset(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(2, expandedValueSet.getExpansion().getParameter().size());
|
||||
assertEquals("offset", expandedValueSet.getExpansion().getParameter().get(0).getName());
|
||||
assertEquals(0, expandedValueSet.getExpansion().getParameter().get(0).getValueIntegerType().getValue().intValue());
|
||||
|
@ -821,7 +821,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
public void testExpandExistingValueSetNotPreExpanded() throws Exception {
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
CodeSystem codeSystem = myCodeSystemDao.read(myExtensionalCsId);
|
||||
ourLog.info("CodeSystem:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(codeSystem));
|
||||
|
@ -829,11 +829,11 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
ValueSet valueSet = myValueSetDao.read(myExtensionalVsId);
|
||||
ourLog.info("ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(valueSet));
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), myDaoConfig.getPreExpandValueSetsDefaultCountExperimental());
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), myDaoConfig.getPreExpandValueSetsDefaultCount());
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffset(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(0, expandedValueSet.getExpansion().getParameter().size());
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getContains().size());
|
||||
|
@ -885,11 +885,11 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
assertEquals("Systolic blood pressure 8 hour minimum", containsComponent.getDisplay());
|
||||
assertFalse(containsComponent.hasDesignation());
|
||||
|
||||
expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), myDaoConfig.getPreExpandValueSetsDefaultCountExperimental());
|
||||
expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), myDaoConfig.getPreExpandValueSetsDefaultCount());
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffset(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(0, expandedValueSet.getExpansion().getParameter().size());
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getContains().size());
|
||||
|
@ -944,7 +944,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildrenWithClientAssignedId() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.PUT);
|
||||
|
||||
|
@ -956,11 +956,11 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), myDaoConfig.getPreExpandValueSetsDefaultCountExperimental());
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), myDaoConfig.getPreExpandValueSetsDefaultCount());
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffset(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(2, expandedValueSet.getExpansion().getParameter().size());
|
||||
assertEquals("offset", expandedValueSet.getExpansion().getParameter().get(0).getName());
|
||||
assertEquals(0, expandedValueSet.getExpansion().getParameter().get(0).getValueIntegerType().getValue().intValue());
|
||||
|
@ -1019,7 +1019,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildrenWithCount() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -1031,11 +1031,11 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), 23);
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), 23);
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffset(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(2, expandedValueSet.getExpansion().getParameter().size());
|
||||
assertEquals("offset", expandedValueSet.getExpansion().getParameter().get(0).getName());
|
||||
assertEquals(0, expandedValueSet.getExpansion().getParameter().get(0).getValueIntegerType().getValue().intValue());
|
||||
|
@ -1088,7 +1088,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildrenWithCountWithClientAssignedId() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.PUT);
|
||||
|
||||
|
@ -1100,11 +1100,11 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), 23);
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), 23);
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffset(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(2, expandedValueSet.getExpansion().getParameter().size());
|
||||
assertEquals("offset", expandedValueSet.getExpansion().getParameter().get(0).getName());
|
||||
assertEquals(0, expandedValueSet.getExpansion().getParameter().get(0).getValueIntegerType().getValue().intValue());
|
||||
|
@ -1157,7 +1157,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildrenWithCountOfZero() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -1169,11 +1169,11 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), 0);
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), 0);
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffset(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(2, expandedValueSet.getExpansion().getParameter().size());
|
||||
assertEquals("offset", expandedValueSet.getExpansion().getParameter().get(0).getName());
|
||||
assertEquals(0, expandedValueSet.getExpansion().getParameter().get(0).getValueIntegerType().getValue().intValue());
|
||||
|
@ -1185,7 +1185,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildrenWithCountOfZeroWithClientAssignedId() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.PUT);
|
||||
|
||||
|
@ -1197,11 +1197,11 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), 0);
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, myDaoConfig.getPreExpandValueSetsDefaultOffset(), 0);
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffsetExperimental(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(myDaoConfig.getPreExpandValueSetsDefaultOffset(), expandedValueSet.getExpansion().getOffset());
|
||||
assertEquals(2, expandedValueSet.getExpansion().getParameter().size());
|
||||
assertEquals("offset", expandedValueSet.getExpansion().getParameter().get(0).getName());
|
||||
assertEquals(0, expandedValueSet.getExpansion().getParameter().get(0).getValueIntegerType().getValue().intValue());
|
||||
|
@ -1213,7 +1213,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildrenWithOffset() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -1225,7 +1225,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, 1, myDaoConfig.getPreExpandValueSetsDefaultCountExperimental());
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, 1, myDaoConfig.getPreExpandValueSetsDefaultCount());
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
|
@ -1274,7 +1274,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildrenWithOffsetWithClientAssignedId() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.PUT);
|
||||
|
||||
|
@ -1286,7 +1286,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
myTermSvc.preExpandDeferredValueSetsToTerminologyTables();
|
||||
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, 1, myDaoConfig.getPreExpandValueSetsDefaultCountExperimental());
|
||||
ValueSet expandedValueSet = myTermSvc.expandValueSet(valueSet, 1, myDaoConfig.getPreExpandValueSetsDefaultCount());
|
||||
ourLog.info("Expanded ValueSet:\n" + myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(expandedValueSet));
|
||||
|
||||
assertEquals(codeSystem.getConcept().size(), expandedValueSet.getExpansion().getTotal());
|
||||
|
@ -1335,7 +1335,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildrenWithOffsetAndCount() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -1390,7 +1390,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testExpandTermValueSetAndChildrenWithOffsetAndCountWithClientAssignedId() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.PUT);
|
||||
|
||||
|
@ -2046,7 +2046,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testStoreTermValueSetAndChildren() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -2148,7 +2148,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testStoreTermValueSetAndChildrenWithClientAssignedId() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.PUT);
|
||||
|
||||
|
@ -2250,7 +2250,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testStoreTermValueSetAndChildrenWithExclude() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignationsAndExclude(HttpVerb.POST);
|
||||
|
||||
|
@ -2352,7 +2352,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testStoreTermValueSetAndChildrenWithExcludeWithClientAssignedId() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignationsAndExclude(HttpVerb.PUT);
|
||||
|
||||
|
@ -3600,7 +3600,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testValidateCodeIsInPreExpandedValueSet() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.POST);
|
||||
|
||||
|
@ -3650,7 +3650,7 @@ public class TerminologySvcImplR4Test extends BaseJpaR4Test {
|
|||
|
||||
@Test
|
||||
public void testValidateCodeIsInPreExpandedValueSetWithClientAssignedId() throws Exception {
|
||||
myDaoConfig.setPreExpandValueSetsExperimental(true);
|
||||
myDaoConfig.setPreExpandValueSets(true);
|
||||
|
||||
loadAndPersistCodeSystemAndValueSetWithDesignations(HttpVerb.PUT);
|
||||
|
||||
|
|
Loading…
Reference in New Issue