Fix broken test and cleanup.

This commit is contained in:
ianmarshall 2020-08-17 18:14:37 -04:00
parent bd94ff96cc
commit 4db00fa604
7 changed files with 8 additions and 49 deletions

View File

@ -227,11 +227,6 @@ public class DaoConfig {
*/
private boolean myPreloadBlobFromInputStream = false;
/**
* @since 5.1.0
*/
private boolean myMultipleCodeSystemVersionsEnabled = false;
/**
* Constructor
*/
@ -2131,34 +2126,4 @@ public class DaoConfig {
myPreloadBlobFromInputStream = thePreloadBlobFromInputStream;
}
/**
* <p>
* This determines whether multiple code system versions will be enabled. If not enabled, existing code systems will be
* deleted when a new version is uploaded.
* </p>
* <p>
* The default value for this setting is {@code false}.
* </p>
*
* @since 5.1.0
*/
public boolean isMultipleCodeSystemVersionsEnabled() {
return myMultipleCodeSystemVersionsEnabled;
}
/**
* <p>
* This determines whether multiple code system versions will be enabled. If not enabled, existing code systems will be
* deleted when a new version is uploaded.
* </p>
* <p>
* The default value for this setting is {@code false}.
* </p>
*
* @since 5.1.0
*/
public void setMultipleCodeSystemVersionsEnabled(Boolean theMultipleCodeSystemVersionsEnabled) {
myMultipleCodeSystemVersionsEnabled = theMultipleCodeSystemVersionsEnabled;
}
}

View File

@ -43,12 +43,10 @@ import ca.uhn.fhir.rest.param.TokenParam;
import ca.uhn.fhir.rest.param.UriParam;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import org.apache.commons.codec.binary.StringUtils;
import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport;
import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@ -236,7 +234,6 @@ public class FhirResourceDaoValueSetDstu2 extends BaseHapiFhirResourceDao<ValueS
return null;
}
@NotNull
@Override
public IValidationSupport.LookupCodeResult lookupCode(IPrimitiveType<String> theCode, IPrimitiveType<String> theSystem, CodingDt theCoding, IPrimitiveType<String> theVersion, RequestDetails theRequestDetails) {
throw new UnsupportedOperationException();

View File

@ -44,7 +44,6 @@ import org.hl7.fhir.dstu3.model.Coding;
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.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Nonnull;
@ -87,7 +86,7 @@ public class FhirResourceDaoCodeSystemDstu3 extends BaseHapiFhirResourceDao<Code
return valueSetIds;
}
@NotNull
@Nonnull
@Override
public IValidationSupport.LookupCodeResult lookupCode(IPrimitiveType<String> theCode, IPrimitiveType<String> theSystem, Coding theCoding, RequestDetails theRequestDetails) {
return lookupCode(theCode, theSystem, theCoding, null, theRequestDetails);
@ -121,7 +120,7 @@ public class FhirResourceDaoCodeSystemDstu3 extends BaseHapiFhirResourceDao<Code
codeSystemVersion = theVersion.getValue();
}
ourLog.info("Looking up {} / {}, version {}", system, code, codeSystemVersion);
ourLog.debug("Looking up {} / {}, version {}", system, code, codeSystemVersion);
if (myValidationSupport.isCodeSystemSupported(new ValidationSupportContext(myValidationSupport), system)) {
ourLog.debug("Code system {} is supported", system);

View File

@ -44,7 +44,6 @@ import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.hl7.fhir.r4.model.CodeSystem;
import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.Coding;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Nonnull;
@ -82,7 +81,7 @@ public class FhirResourceDaoCodeSystemR4 extends BaseHapiFhirResourceDao<CodeSys
return valueSetIds;
}
@NotNull
@Nonnull
@Override
public IValidationSupport.LookupCodeResult lookupCode(IPrimitiveType<String> theCode, IPrimitiveType<String> theSystem, Coding theCoding, RequestDetails theRequestDetails) {
return lookupCode(theCode, theSystem, theCoding, null, theRequestDetails);
@ -116,7 +115,7 @@ public class FhirResourceDaoCodeSystemR4 extends BaseHapiFhirResourceDao<CodeSys
codeSystemVersion = theVersion.getValue();
}
ourLog.info("Looking up {} / {}, version {}", system, code, codeSystemVersion);
ourLog.debug("Looking up {} / {}, version {}", system, code, codeSystemVersion);
if (myValidationSupport.isCodeSystemSupported(new ValidationSupportContext(myValidationSupport), system)) {

View File

@ -45,7 +45,6 @@ import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.CodeableConcept;
import org.hl7.fhir.r5.model.Coding;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Nonnull;
@ -84,8 +83,8 @@ public class FhirResourceDaoCodeSystemR5 extends BaseHapiFhirResourceDao<CodeSys
return valueSetIds;
}
@NotNull
@Override
@Nonnull
@Override
public IValidationSupport.LookupCodeResult lookupCode(IPrimitiveType<String> theCode, IPrimitiveType<String> theSystem, Coding theCoding, RequestDetails theRequestDetails) {
return lookupCode(theCode, theSystem, theCoding, null, theRequestDetails);
}

View File

@ -504,7 +504,7 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc {
retVal.setId("loinc-all");
retVal.setUrl("http://loinc.org/vs");
retVal.setVersion("1.0.0");
retVal.setName("All LOINC codes");
retVal.setName("Ø");
retVal.setStatus(Enumerations.PublicationStatus.ACTIVE);
retVal.setDate(new Date());
retVal.setPublisher("Regenstrief Institute, Inc.");

View File

@ -254,7 +254,7 @@ public class FhirInstanceValidatorR4Test extends BaseTest {
return retVal;
}
});
when(mockSupport.lookupCode(any(), any(), any())).thenAnswer(t -> {
when(mockSupport.lookupCode(any(), any(), any(), any())).thenAnswer(t -> {
String system = t.getArgument(1, String.class);
String code = t.getArgument(2, String.class);
if (myValidConcepts.contains(system + "___" + code)) {