Merge branch 'master' into jr-20210922-narrowing-interceptor
This commit is contained in:
commit
58a2f23c0d
|
@ -1,34 +1,50 @@
|
|||
package ca.uhn.fhir.android.client;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Date;
|
||||
|
||||
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||
import ca.uhn.fhir.rest.api.PreferReturnEnum;
|
||||
import org.hl7.fhir.dstu3.model.*;
|
||||
import org.junit.jupiter.api.*; import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.parser.IParser;
|
||||
import ca.uhn.fhir.rest.api.Constants;
|
||||
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||
import ca.uhn.fhir.rest.api.MethodOutcome;
|
||||
import ca.uhn.fhir.rest.api.PreferReturnEnum;
|
||||
import ca.uhn.fhir.rest.client.api.IGenericClient;
|
||||
import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum;
|
||||
import ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException;
|
||||
import ca.uhn.fhir.util.TestUtil;
|
||||
import ca.uhn.fhir.util.VersionUtil;
|
||||
import okhttp3.*;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Headers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.Protocol;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.ResponseBody;
|
||||
import okio.Buffer;
|
||||
import org.hl7.fhir.dstu3.model.Binary;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Date;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
public class GenericClientDstu3IT {
|
||||
|
||||
|
@ -280,7 +296,7 @@ public class GenericClientDstu3IT {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -20,16 +20,8 @@ package ca.uhn.fhir.util;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.i18n.HapiLocalizer;
|
||||
import ch.qos.logback.classic.Level;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
import java.util.concurrent.Callable;
|
||||
|
@ -52,58 +44,10 @@ public class TestUtil {
|
|||
* tons of memory being used by the end and the JVM crashes in Travis. Manually clearing all of the
|
||||
* static fields seems to solve this.
|
||||
*/
|
||||
public static void clearAllStaticFieldsForUnitTest() {
|
||||
public static void randomizeLocaleAndTimezone() {
|
||||
HapiLocalizer.setOurFailOnMissingMessage(true);
|
||||
|
||||
Class<?> theType;
|
||||
try {
|
||||
throw new Exception();
|
||||
} catch (Exception e) {
|
||||
StackTraceElement[] st = e.getStackTrace();
|
||||
StackTraceElement elem = st[1];
|
||||
String clazzName = elem.getClassName();
|
||||
try {
|
||||
theType = Class.forName(clazzName);
|
||||
} catch (ClassNotFoundException e1) {
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
for (Field next : Arrays.asList(theType.getDeclaredFields())) {
|
||||
if (Modifier.isStatic(next.getModifiers())) {
|
||||
if (!Modifier.isFinal(next.getModifiers()) && !next.getType().isPrimitive()) {
|
||||
ourLog.info("Clearing value of field: {}", next.toString());
|
||||
try {
|
||||
next.setAccessible(true);
|
||||
next.set(theType, null);
|
||||
} catch (Exception e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
if (Modifier.isFinal(next.getModifiers())) {
|
||||
if (next.getType().equals(FhirContext.class)) {
|
||||
throw new Error("Test has final field of type FhirContext: " + next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
randomizeLocale();
|
||||
|
||||
/*
|
||||
* If we're running a CI build, set all loggers to TRACE level to ensure coverage
|
||||
* on trace blocks
|
||||
*/
|
||||
try {
|
||||
if ("true".equals(System.getProperty("ci"))) {
|
||||
for (Logger next : ((LoggerContext) LoggerFactory.getILoggerFactory()).getLoggerList()) {
|
||||
next.setLevel(Level.TRACE);
|
||||
}
|
||||
}
|
||||
} catch (NoClassDefFoundError e) {
|
||||
// ignore
|
||||
}
|
||||
doRandomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -111,7 +55,7 @@ public class TestUtil {
|
|||
* but it helps us make sure we don't have any tests that depend on a particular
|
||||
* environment
|
||||
*/
|
||||
public static void randomizeLocale() {
|
||||
public static void doRandomizeLocaleAndTimezone() {
|
||||
// Locale[] availableLocales = {Locale.CANADA, Locale.GERMANY, Locale.TAIWAN};
|
||||
Locale[] availableLocales = {Locale.US};
|
||||
Locale.setDefault(availableLocales[(int) (Math.random() * availableLocales.length)]);
|
||||
|
|
|
@ -37,7 +37,7 @@ public class QualifiedParamListTest {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ public class ExportConceptMapToCsvCommandDstu3Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -81,7 +81,7 @@ public class ExportConceptMapToCsvCommandR4Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -341,7 +341,7 @@ public class ImportCsvToConceptMapCommandDstu3Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -422,7 +422,7 @@ public class ImportCsvToConceptMapCommandR4Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -76,7 +76,7 @@ public class VersionedApiConverterInterceptorR4Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
type: change
|
||||
issue: 3017
|
||||
title: "Removed loinc.xml file from application, which was used as a fallback if not provided when uploading a
|
||||
CodeSystem. it is now required as input for LOINC CodeSystem upload."
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
type: add
|
||||
issue: 3020
|
||||
jira: SMILE-685,SMILE-3146
|
||||
title: "Added documentation for `$partition-management-read-partition`. Added `$partition-management-list-partitions` operation and documentation."
|
|
@ -186,3 +186,92 @@ The following request body could be used:
|
|||
}
|
||||
```
|
||||
|
||||
# Reading a Partition
|
||||
|
||||
The `$partition-management-read-partition` operation can be used to read an existing partition. This operation takes the following parameters:
|
||||
|
||||
<table class="table table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Cardinality</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>Integer</td>
|
||||
<td>1..1</td>
|
||||
<td>
|
||||
The numeric ID for the partition to update. This ID must already exist.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Example
|
||||
|
||||
An HTTP POST to the following URL would be used to invoke this operation:
|
||||
|
||||
```url
|
||||
http://example.com/DEFAULT/$partition-management-read-partition
|
||||
```
|
||||
|
||||
The following request body could be used:
|
||||
|
||||
```json
|
||||
{
|
||||
"resourceType": "Parameters",
|
||||
"parameter": [ {
|
||||
"name": "id",
|
||||
"valueInteger": 123
|
||||
} ]
|
||||
}
|
||||
```
|
||||
|
||||
# Listing all Partitions
|
||||
|
||||
The `$partition-management-list-partitions` operation can be used to list all existing partitions.
|
||||
|
||||
## Example
|
||||
|
||||
An HTTP POST to the following URL would be used to invoke this operation:
|
||||
|
||||
```url
|
||||
http://example.com/DEFAULT/$partition-management-list-partitions
|
||||
```
|
||||
|
||||
This operation returns a `Parameters` resource that looks like the following:
|
||||
```json
|
||||
{
|
||||
"resourceType": "Parameters",
|
||||
"parameter": [ {
|
||||
"name": "partition",
|
||||
"part": [ {
|
||||
"name": "id",
|
||||
"valueInteger": 1
|
||||
}, {
|
||||
"name": "name",
|
||||
"valueCode": "PARTITION-1"
|
||||
}, {
|
||||
"name": "description",
|
||||
"valueString": "a description1"
|
||||
} ]
|
||||
}, {
|
||||
"name": "partition",
|
||||
"part": [ {
|
||||
"name": "id",
|
||||
"valueInteger": 2
|
||||
}, {
|
||||
"name": "name",
|
||||
"valueCode": "PARTITION-2"
|
||||
}, {
|
||||
"name": "description",
|
||||
"valueString": "a description2"
|
||||
} ]
|
||||
} ]
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -23,8 +23,17 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.hl7.fhir.dstu3.model.*;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu3.model.CapabilityStatement;
|
||||
import org.hl7.fhir.dstu3.model.DateType;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Identifier;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Resource;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
|
@ -81,7 +90,7 @@ public class AbstractJaxRsResourceProviderDstu3Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(jettyServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
private void compareResultUrl(String url, IBaseResource resource) {
|
||||
|
|
|
@ -90,7 +90,7 @@ public class AbstractJaxRsResourceProviderTest {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(jettyServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
private Patient createPatient(long id) {
|
||||
|
|
|
@ -38,7 +38,6 @@ import ca.uhn.fhir.rest.param.UriParam;
|
|||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import com.github.benmanes.caffeine.cache.Cache;
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
@ -63,7 +62,6 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.function.Supplier;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||
import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_GENERIC_VALUESET_URL_PLUS_SLASH;
|
||||
import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW;
|
||||
|
||||
/**
|
||||
|
@ -144,13 +142,11 @@ public class JpaPersistedResourceValidationSupport implements IValidationSupport
|
|||
* version is always pointed by the ForcedId for the no-versioned VS
|
||||
*/
|
||||
private Optional<IBaseResource> getValueSetCurrentVersion(UriType theUrl) {
|
||||
if (TermReadSvcUtil.mustReturnEmptyValueSet(theUrl.getValueAsString())) return Optional.empty();
|
||||
|
||||
String forcedId = theUrl.getValue().substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length());
|
||||
if (StringUtils.isBlank(forcedId)) return Optional.empty();
|
||||
Optional<String> vsIdOpt = TermReadSvcUtil.getValueSetId(theUrl.getValueAsString());
|
||||
if (! vsIdOpt.isPresent()) return Optional.empty();
|
||||
|
||||
IFhirResourceDao<? extends IBaseResource> valueSetResourceDao = myDaoRegistry.getResourceDao(myValueSetType);
|
||||
IBaseResource valueSet = valueSetResourceDao.read(new IdDt("ValueSet", forcedId));
|
||||
IBaseResource valueSet = valueSetResourceDao.read(new IdDt("ValueSet", vsIdOpt.get()));
|
||||
return Optional.ofNullable(valueSet);
|
||||
}
|
||||
|
||||
|
|
|
@ -276,7 +276,7 @@ public class LegacySearchBuilder implements ISearchBuilder {
|
|||
*/
|
||||
if (myParams.containsKey(Constants.PARAM_CONTENT) || myParams.containsKey(Constants.PARAM_TEXT) || myParams.isLastN()) {
|
||||
if (myParams.containsKey(Constants.PARAM_CONTENT) || myParams.containsKey(Constants.PARAM_TEXT)) {
|
||||
if (myFulltextSearchSvc == null) {
|
||||
if (myFulltextSearchSvc == null || myFulltextSearchSvc.isDisabled()) {
|
||||
if (myParams.containsKey(Constants.PARAM_TEXT)) {
|
||||
throw new InvalidRequestException("Fulltext search is not enabled on this service, can not process parameter: " + Constants.PARAM_TEXT);
|
||||
} else if (myParams.containsKey(Constants.PARAM_CONTENT)) {
|
||||
|
|
|
@ -24,6 +24,7 @@ import ca.uhn.fhir.jpa.entity.PartitionEntity;
|
|||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public interface IPartitionLookupSvc {
|
||||
|
||||
|
@ -51,4 +52,5 @@ public interface IPartitionLookupSvc {
|
|||
|
||||
void deletePartition(Integer thePartitionId);
|
||||
|
||||
List<PartitionEntity> listPartitions();
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.springframework.transaction.support.TransactionTemplate;
|
|||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -169,6 +170,12 @@ public class PartitionLookupSvcImpl implements IPartitionLookupSvc {
|
|||
clearCaches();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PartitionEntity> listPartitions() {
|
||||
List<PartitionEntity> allPartitions = myPartitionDao.findAll();
|
||||
return allPartitions;
|
||||
}
|
||||
|
||||
private void validatePartitionNameDoesntAlreadyExist(String theName) {
|
||||
if (myPartitionDao.findForName(theName).isPresent()) {
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionLookupSvcImpl.class, "cantCreateDuplicatePartitionName", theName);
|
||||
|
|
|
@ -25,14 +25,19 @@ import ca.uhn.fhir.jpa.entity.PartitionEntity;
|
|||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.annotation.ResourceParam;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import ca.uhn.fhir.util.ParametersUtil;
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
import org.hl7.fhir.instance.model.api.IBaseParameters;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.validatePartitionIdSupplied;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
import static org.hl7.fhir.instance.model.api.IPrimitiveType.toValueOrNull;
|
||||
|
@ -43,6 +48,8 @@ import static org.hl7.fhir.instance.model.api.IPrimitiveType.toValueOrNull;
|
|||
* <li><code>partition-management-create-partition</code></li>
|
||||
* <li><code>partition-management-update-partition</code></li>
|
||||
* <li><code>partition-management-delete-partition</code></li>
|
||||
* <li><code>partition-management-read-partition</code></li>
|
||||
* <li><code>partition-management-list-partitions</code></li>
|
||||
* </ul>
|
||||
*/
|
||||
public class PartitionManagementProvider {
|
||||
|
@ -142,6 +149,20 @@ public class PartitionManagementProvider {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Partition:
|
||||
* <code>
|
||||
* $partition-management-list-partitions
|
||||
* </code>
|
||||
*/
|
||||
@Operation(name = ProviderConstants.PARTITION_MANAGEMENT_LIST_PARTITIONS, idempotent = true)
|
||||
public IBaseParameters addPartitions(
|
||||
@ResourceParam IBaseParameters theRequest
|
||||
) {
|
||||
List<PartitionEntity> output = myPartitionLookupSvc.listPartitions();
|
||||
return prepareOutputList(output);
|
||||
}
|
||||
|
||||
private IBaseParameters prepareOutput(PartitionEntity theOutput) {
|
||||
IBaseParameters retVal = ParametersUtil.newInstance(myCtx);
|
||||
ParametersUtil.addParameterToParametersInteger(myCtx, retVal, ProviderConstants.PARTITION_MANAGEMENT_PARTITION_ID, theOutput.getId());
|
||||
|
@ -152,6 +173,19 @@ public class PartitionManagementProvider {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
private IBaseParameters prepareOutputList(List<PartitionEntity> theOutput) {
|
||||
IBaseParameters retVal = ParametersUtil.newInstance(myCtx);
|
||||
for (PartitionEntity partitionEntity : theOutput) {
|
||||
IBase resultPart = ParametersUtil.addParameterToParameters(myCtx, retVal, "partition");
|
||||
ParametersUtil.addPartInteger(myCtx, resultPart, ProviderConstants.PARTITION_MANAGEMENT_PARTITION_ID, partitionEntity.getId());
|
||||
ParametersUtil.addPartCode(myCtx, resultPart, ProviderConstants.PARTITION_MANAGEMENT_PARTITION_NAME, partitionEntity.getName());
|
||||
if (isNotBlank(partitionEntity.getDescription())) {
|
||||
ParametersUtil.addPartString(myCtx, resultPart, ProviderConstants.PARTITION_MANAGEMENT_PARTITION_DESC, partitionEntity.getDescription());
|
||||
}
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
private PartitionEntity parseInput(@OperationParam(name = ProviderConstants.PARTITION_MANAGEMENT_PARTITION_ID, min = 1, max = 1, typeName = "integer") IPrimitiveType<Integer> thePartitionId, @OperationParam(name = ProviderConstants.PARTITION_MANAGEMENT_PARTITION_NAME, min = 1, max = 1, typeName = "code") IPrimitiveType<String> thePartitionName, @OperationParam(name = ProviderConstants.PARTITION_MANAGEMENT_PARTITION_DESC, min = 0, max = 1, typeName = "string") IPrimitiveType<String> thePartitionDescription) {
|
||||
PartitionEntity input = new PartitionEntity();
|
||||
|
|
|
@ -314,7 +314,7 @@ public class SearchBuilder implements ISearchBuilder {
|
|||
*/
|
||||
if (myParams.containsKey(Constants.PARAM_CONTENT) || myParams.containsKey(Constants.PARAM_TEXT) || myParams.isLastN()) {
|
||||
if (myParams.containsKey(Constants.PARAM_CONTENT) || myParams.containsKey(Constants.PARAM_TEXT)) {
|
||||
if (myFulltextSearchSvc == null) {
|
||||
if (myFulltextSearchSvc == null || myFulltextSearchSvc.isDisabled()) {
|
||||
if (myParams.containsKey(Constants.PARAM_TEXT)) {
|
||||
throw new InvalidRequestException("Fulltext search is not enabled on this service, can not process parameter: " + Constants.PARAM_TEXT);
|
||||
} else if (myParams.containsKey(Constants.PARAM_CONTENT)) {
|
||||
|
|
|
@ -181,7 +181,6 @@ import static org.apache.commons.lang3.StringUtils.isNoneBlank;
|
|||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
import static org.apache.commons.lang3.StringUtils.lowerCase;
|
||||
import static org.apache.commons.lang3.StringUtils.startsWithIgnoreCase;
|
||||
import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_GENERIC_VALUESET_URL_PLUS_SLASH;
|
||||
import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW;
|
||||
|
||||
public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
||||
|
@ -2349,16 +2348,19 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc {
|
|||
@Override
|
||||
public Optional<TermValueSet> findCurrentTermValueSet(String theUrl) {
|
||||
if (TermReadSvcUtil.isLoincNotGenericUnversionedValueSet(theUrl)) {
|
||||
if (TermReadSvcUtil.mustReturnEmptyValueSet(theUrl)) return Optional.empty();
|
||||
Optional<String> vsIdOpt = TermReadSvcUtil.getValueSetId(theUrl);
|
||||
if (! vsIdOpt.isPresent()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length());
|
||||
if (StringUtils.isBlank(forcedId)) return Optional.empty();
|
||||
|
||||
return myTermValueSetDao.findTermValueSetByForcedId(forcedId);
|
||||
return myTermValueSetDao.findTermValueSetByForcedId(vsIdOpt.get());
|
||||
}
|
||||
|
||||
List<TermValueSet> termValueSetList = myTermValueSetDao.findTermValueSetByUrl(Pageable.ofSize(1), theUrl);
|
||||
if (termValueSetList.isEmpty()) return Optional.empty();
|
||||
if (termValueSetList.isEmpty()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
return Optional.of(termValueSetList.get(0));
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ import ca.uhn.fhir.rest.api.EncodingEnum;
|
|||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import ca.uhn.fhir.util.ClasspathUtil;
|
||||
import ca.uhn.fhir.util.ValidateUtil;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Charsets;
|
||||
|
@ -68,6 +67,7 @@ import java.io.InputStream;
|
|||
import java.io.InputStreamReader;
|
||||
import java.io.LineNumberReader;
|
||||
import java.io.Reader;
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -417,7 +417,7 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc {
|
|||
Properties getProperties(LoadedFileDescriptors theDescriptors, String thePropertiesFile) {
|
||||
Properties retVal = new Properties();
|
||||
|
||||
try (InputStream propertyStream = TermLoaderSvcImpl.class.getResourceAsStream("/ca/uhn/fhir/jpa/term/loinc/loincupload.properties")) {
|
||||
try (InputStream propertyStream = ca.uhn.fhir.jpa.term.TermLoaderSvcImpl.class.getResourceAsStream("/ca/uhn/fhir/jpa/term/loinc/loincupload.properties")) {
|
||||
retVal.load(propertyStream);
|
||||
} catch (IOException e) {
|
||||
throw new InternalErrorException("Failed to process loinc.properties", e);
|
||||
|
@ -558,15 +558,19 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc {
|
|||
|
||||
final List<LoincLinguisticVariantsHandler.LinguisticVariant> linguisticVariants = new ArrayList<>();
|
||||
|
||||
LoincXmlFileZipContentsHandler loincXmlHandler = new LoincXmlFileZipContentsHandler();
|
||||
LoincXmlFileZipContentsHandler loincXmlHandler = getLoincXmlFileZipContentsHandler();
|
||||
iterateOverZipFile(theDescriptors, "loinc.xml", false, false, loincXmlHandler);
|
||||
String loincCsString = loincXmlHandler.getContents();
|
||||
|
||||
if (isBlank(loincCsString)) {
|
||||
ourLog.warn("Did not find loinc.xml in the ZIP distribution. Using built-in copy");
|
||||
loincCsString = ClasspathUtil.loadResource("/ca/uhn/fhir/jpa/term/loinc/loinc.xml");
|
||||
throw new InvalidRequestException("Did not find loinc.xml in the ZIP distribution.");
|
||||
}
|
||||
|
||||
CodeSystem loincCs = FhirContext.forR4().newXmlParser().parseResource(CodeSystem.class, loincCsString);
|
||||
if (isNotBlank(loincCs.getVersion())) {
|
||||
throw new InvalidRequestException("'loinc.xml' file must not have a version defined. To define a version use '" +
|
||||
LOINC_CODESYSTEM_VERSION.getCode() + "' property of 'loincupload.properties' file");
|
||||
}
|
||||
|
||||
String codeSystemVersionId = theUploadProperties.getProperty(LOINC_CODESYSTEM_VERSION.getCode());
|
||||
if (codeSystemVersionId != null) {
|
||||
loincCs.setVersion(codeSystemVersionId);
|
||||
|
@ -703,6 +707,12 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc {
|
|||
return new UploadStatistics(conceptCount, target);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
protected LoincXmlFileZipContentsHandler getLoincXmlFileZipContentsHandler() {
|
||||
return new LoincXmlFileZipContentsHandler();
|
||||
}
|
||||
|
||||
|
||||
private ValueSet getValueSetLoincAll(Properties theUploadProperties) {
|
||||
ValueSet retVal = new ValueSet();
|
||||
|
||||
|
|
|
@ -20,24 +20,30 @@ package ca.uhn.fhir.jpa.term;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||
import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_GENERIC_VALUESET_URL;
|
||||
import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_GENERIC_VALUESET_URL_PLUS_SLASH;
|
||||
import static org.hl7.fhir.common.hapi.validation.support.ValidationConstants.LOINC_LOW;
|
||||
|
||||
public class TermReadSvcUtil {
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(TermReadSvcUtil.class);
|
||||
|
||||
public static boolean mustReturnEmptyValueSet(String theUrl) {
|
||||
if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL)) return true;
|
||||
public static Optional<String> getValueSetId(String theUrl) {
|
||||
if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL)) return Optional.empty();
|
||||
|
||||
if (! theUrl.startsWith(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH)) {
|
||||
throw new InternalErrorException("Don't know how to extract ValueSet's ForcedId from url: " + theUrl);
|
||||
ourLog.error("Don't know how to extract ValueSet's ForcedId from url: " + theUrl);
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
String forcedId = theUrl.substring(LOINC_GENERIC_VALUESET_URL_PLUS_SLASH.length());
|
||||
return StringUtils.isBlank(forcedId);
|
||||
return isBlank(forcedId) ? Optional.empty() : Optional.of(forcedId);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ public enum LoincUploadPropertiesEnum {
|
|||
// Consumer Name
|
||||
LOINC_CONSUMER_NAME_FILE("loinc.consumer.name.file"),
|
||||
LOINC_CONSUMER_NAME_FILE_DEFAULT("AccessoryFiles/ConsumerName/ConsumerName.csv"),
|
||||
|
||||
|
||||
// Linguistic Variants
|
||||
LOINC_LINGUISTIC_VARIANTS_FILE("loinc.linguistic.variants.file"),
|
||||
LOINC_LINGUISTIC_VARIANTS_FILE_DEFAULT("AccessoryFiles/LinguisticVariants/LinguisticVariants.csv"),
|
||||
|
|
|
@ -1,548 +0,0 @@
|
|||
<!--
|
||||
LOINC is a freely available international standard for tests, measurements, and observations. It is a well maintained, version independent code system.
|
||||
|
||||
Use of LOINC is governed by the LOINC License: https://loinc.org/license/
|
||||
|
||||
This CodeSystem resource describes 'LOINC' independent of any particular version. There are notes about changes for version specific LOINC code system resources.
|
||||
|
||||
Note that the following set of codes are defined by the LOINC code systems:
|
||||
- the main LOINC codes
|
||||
- the LOINC Answer codes (LA-) and the LOINC Answer list codes (LL-)
|
||||
- the LOINC Part codes (LP-) in the Multiaxial Hierarchy
|
||||
- the LOINC Part codes (LP-) for the properties
|
||||
Note: there are license restrictions on the use of LOINC Part codes
|
||||
- the LOINC Group codes (LG-)
|
||||
Note: presently the LOINC Group codes are used to identify these roll-up groups as ValueSets, but are not yet loaded as codes in the CodeSystem
|
||||
|
||||
Servers may generate variants of this for the LOINC version(s) and features they support.
|
||||
|
||||
File Version: 0.6
|
||||
-->
|
||||
|
||||
<CodeSystem xmlns="http://hl7.org/fhir">
|
||||
<id value="loinc"/>
|
||||
|
||||
<!--
|
||||
This url is unchanged for all versions of LOINC. There can only be one correct Code System resource for each value of the version attribute (at least, only one per server).
|
||||
-->
|
||||
<url value="http://loinc.org"/>
|
||||
|
||||
<!-- the HL7 v3 OID assigned to LOINC -->
|
||||
<identifier>
|
||||
<system value="urn:ietf:rfc:3986"/>
|
||||
<value value="urn:oid:2.16.840.1.113883.6.1"/>
|
||||
</identifier>
|
||||
|
||||
<!--
|
||||
If a version is specified:
|
||||
<version value="2.68"/>
|
||||
-->
|
||||
|
||||
<!--
|
||||
If a specific version is specified, the name should carry this information (e.g. LOINC_268).
|
||||
-->
|
||||
<name value="LOINC"/>
|
||||
<title value="LOINC Code System"/>
|
||||
<status value="active"/>
|
||||
<experimental value="false"/>
|
||||
|
||||
<publisher value="Regenstrief Institute, Inc."/>
|
||||
<contact>
|
||||
<telecom>
|
||||
<value value="http://loinc.org"/>
|
||||
</telecom>
|
||||
</contact>
|
||||
|
||||
<!--
|
||||
<date value=2020-06/>
|
||||
-->
|
||||
<description value="LOINC is a freely available international standard for tests, measurements, and observations"/>
|
||||
<copyright value="This material contains content from LOINC (http://loinc.org). LOINC is copyright ©1995-2020, Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc."/>
|
||||
<caseSensitive value="false"/>
|
||||
|
||||
<valueSet value=" http://loinc.org/vs"/>
|
||||
<!--
|
||||
For a version specific reference:
|
||||
<valueSet value="http://loinc.org/2.68/vs"/>
|
||||
-->
|
||||
|
||||
<!--
|
||||
It's at the discretion of servers whether to present fragments of LOINC hierarchically or not, when using the code system resource. But, if they are hierarchical, the Hierarchy SHALL be based on the is-a relationship that is derived from the LOINC Multiaxial Hierarchy.
|
||||
-->
|
||||
<hierarchyMeaning value="is-a"/>
|
||||
<compositional value="false"/> <!-- no compositional grammar in LOINC -->
|
||||
<versionNeeded value="false"/>
|
||||
|
||||
<!--
|
||||
This canonical definition of LOINC does not include the LOINC content, which is distributed separately for portability.
|
||||
|
||||
Servers may choose to include fragments of LOINC for illustration purposes.
|
||||
-->
|
||||
<content value="not-present"/>
|
||||
|
||||
<!--
|
||||
<count value="65000"/>
|
||||
If working with a specific version, you could nominate a count of the total number of concepts (including the answers, Hierarchy, etc.). In this canonical definition we do not.
|
||||
-->
|
||||
|
||||
<!--
|
||||
FILTERS
|
||||
Generally defined filters for specifying value sets
|
||||
In LOINC, all the properties can also be used as filters, but they are not defined explicitly as filters.
|
||||
Parent/child properties are as defined by FHIR. Note that at this time the LOINC code system resource does not support ancestor/descendant relationships.
|
||||
|
||||
For illustration purposes, consider this slice of the LOINC Multiaxial Hierarchy when reading the descriptions below:
|
||||
|
||||
Microbiology [LP7819-8]
|
||||
Microorganism [LP14559-6]
|
||||
Virus [LP14855-8]
|
||||
Zika virus [LP200137-0]
|
||||
Zika virus RNA | XXX [LP203271-4]
|
||||
Zika virus RNA | XXX | Microbiology [LP379670-5]
|
||||
Zika virus RNA [Presence] in Unspecified specimen by Probe and target amplification method [79190-5]
|
||||
|
||||
Language Note: The filters defined here are specified using the default LOINC language - English (US). Requests are meant to be specified and interpreted on the English version. The return can be in a specified language (if supported by the server). But note that not all filters/properties have language translations available.
|
||||
-->
|
||||
<filter>
|
||||
<code value="parent"/>
|
||||
<description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Parent selects immediate parent only. For example, the code '79190-5' has the parent 'LP379670-5'"/>
|
||||
<operator value="="/>
|
||||
<value value="A Part code"/>
|
||||
</filter>
|
||||
<filter>
|
||||
<code value="child"/>
|
||||
<description value="Allows for the selection of a set of codes based on their appearance in the LOINC Multiaxial Hierarchy. Child selects immediate children only. For example, the code 'LP379670-5' has the child '79190-5'. Only LOINC Parts have children; LOINC codes do not have any children because they are leaf nodes."/>
|
||||
<operator value="="/>
|
||||
<value value="A comma separated list of Part or LOINC codes"/>
|
||||
</filter>
|
||||
<filter>
|
||||
<code value="copyright"/>
|
||||
<description value="Allows for the inclusion or exclusion of LOINC codes that include 3rd party copyright notices. LOINC = only codes with a sole copyright by Regenstrief. 3rdParty = only codes with a 3rd party copyright in addition to the one from Regenstrief"/>
|
||||
<operator value="="/>
|
||||
<value value="LOINC | 3rdParty"/>
|
||||
</filter>
|
||||
|
||||
<!--
|
||||
PROPERTIES
|
||||
There are 4 kinds of properties that apply to all LOINC codes:
|
||||
1. FHIR: display, designation; these are not described here since they are inherent in the specification
|
||||
2. Infrastructural: defined by FHIR, but documented here for the LOINC Multiaxial Hierarchy
|
||||
3. Primary LOINC properties: defined by the main LOINC table
|
||||
4. Secondary LOINC properties: defined by the LoincPartLink table
|
||||
Additionally, there are 2 kinds of properties specific to Document ontology and Radiology codes, respectively:
|
||||
1. LOINC/RSNA Radiology Playbook properties
|
||||
2. Document Ontology properties
|
||||
-->
|
||||
<!--
|
||||
Infrastructural properties - inherited from FHIR, but documented here for the LOINC Multiaxial Hierarchy.
|
||||
-->
|
||||
|
||||
<property>
|
||||
<code value="parent"/>
|
||||
<uri value="http://hl7.org/fhir/concept-properties#parent"/>
|
||||
<description value="A parent code in the Multiaxial Hierarchy"/>
|
||||
<type value=""/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="child"/>
|
||||
<uri value="http://hl7.org/fhir/concept-properties#child"/>
|
||||
<description value="A child code in the Multiaxial Hierarchy"/>
|
||||
<type value=""/>
|
||||
</property>
|
||||
|
||||
<!--
|
||||
Primary LOINC properties.
|
||||
These apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes.
|
||||
Notes:
|
||||
In the LOINC code system resource, the display element = LONG_COMMON_NAME
|
||||
Many properties are specified as type "coding", which allows use of LOINC Part codes (LP-) and the display text. LOINC Parts and their associations to LOINC terms are published in the LOINC Part File.
|
||||
The properties defined here follow the guidance of the LOINC Users' Manual, which states that they should be expressed with the LOINC attributes contained in the LOINC Table. Properties that are not defined in the LOINC Table use FHIR-styled names.
|
||||
-->
|
||||
|
||||
<property>
|
||||
<code value="STATUS"/>
|
||||
<uri value="http://loinc.org/property/STATUS"/>
|
||||
<description value="Status of the term. Within LOINC, codes with STATUS=DEPRECATED are considered inactive. Current values: ACTIVE, TRIAL, DISCOURAGED, and DEPRECATED"/>
|
||||
<type value="string"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="COMPONENT"/>
|
||||
<uri value="http://loinc.org/property/COMPONENT"/>
|
||||
<description value="First major axis-component or analyte: Analyte Name, Analyte sub-class, Challenge"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="PROPERTY"/>
|
||||
<uri value="http://loinc.org/property/PROPERTY"/>
|
||||
<description value="Second major axis-property observed: Kind of Property (also called kind of quantity)"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="TIME_ASPCT"/>
|
||||
<uri value="http://loinc.org/property/TIME_ASPCT"/>
|
||||
<description value="Third major axis-timing of the measurement: Time Aspect (Point or moment in time vs. time interval)"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="SYSTEM"/>
|
||||
<uri value="http://loinc.org/property/SYSTEM"/>
|
||||
<description value="Fourth major axis-type of specimen or system: System (Sample) Type"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="SCALE_TYP"/>
|
||||
<uri value="http://loinc.org/property/SCALE_TYP"/>
|
||||
<description value="Fifth major axis-scale of measurement: Type of Scale"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="METHOD_TYP"/>
|
||||
<uri value="http://loinc.org/property/METHOD_TYP"/>
|
||||
<description value="Sixth major axis-method of measurement: Type of Method"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="CLASS"/>
|
||||
<uri value="http://loinc.org/property/CLASS"/>
|
||||
<description value="An arbitrary classification of the terms for grouping related observations together"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="VersionLastChanged"/>
|
||||
<uri value="http://loinc.org/property/VersionLastChanged"/>
|
||||
<description value="The LOINC version number in which the record has last changed. For new records, this field contains the same value as the VersionFirstReleased property."/>
|
||||
<type value="string"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="CLASSTYPE"/>
|
||||
<uri value="http://loinc.org/property/CLASSTYPE"/>
|
||||
<description value="1=Laboratory class; 2=Clinical class; 3=Claims attachments; 4=Surveys"/>
|
||||
<type value="string"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="ORDER_OBS"/>
|
||||
<uri value="http://loinc.org/property/ORDER_OBS"/>
|
||||
<description value="Provides users with an idea of the intended use of the term by categorizing it as an order only, observation only, or both"/>
|
||||
<type value="string"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="HL7_ATTACHMENT_STRUCTURE"/>
|
||||
<uri value="http://loinc.org/property/HL7_ATTACHMENT_STRUCTURE"/>
|
||||
<description value="This property is populated in collaboration with the HL7 Attachments Work Group as described in the HL7 Attachment Specification: Supplement to Consolidated CDA Templated Guide."/>
|
||||
<type value="string"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="VersionFirstReleased"/>
|
||||
<uri value="http://loinc.org/property/VersionFirstReleased"/>
|
||||
<description value="This is the LOINC version number in which this LOINC term was first published."/>
|
||||
<type value="string"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="PanelType"/>
|
||||
<uri value="http://loinc.org/property/PanelType"/>
|
||||
<description value="For LOINC terms that are panels, this attribute classifies them as a 'Convenience group', 'Organizer', or 'Panel'"/>
|
||||
<type value="string"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="ValidHL7AttachmentRequest"/>
|
||||
<uri value="http://loinc.org/property/ValidHL7AttachmentRequest"/>
|
||||
<description value="A value of Y in this field indicates that this LOINC code can be sent by a payer as part of an HL7 Attachment request for additional information."/>
|
||||
<type value="string"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="DisplayName"/>
|
||||
<uri value="http://loinc.org/property/DisplayName"/>
|
||||
<description value="A name that is more 'clinician-friendly' compared to the current LOINC Short Name, Long Common Name, and Fully Specified Name. It is created algorithmically from the manually crafted display text for each Part and is generally more concise than the Long Common Name."/>
|
||||
<type value="string"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="answer-list"/>
|
||||
<uri value="http://loinc.org/property/answer-list"/>
|
||||
<description value="An answer list associated with this LOINC code (if there are matching answer lists defined)."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
|
||||
<!--
|
||||
Secondary LOINC properties.
|
||||
These properties also apply to the main LOINC codes, but not the Multiaxial Hierarchy, Answer lists, or the Part codes.
|
||||
Notes:
|
||||
These properties are defined in the LoincPartLink table.
|
||||
-->
|
||||
|
||||
<property>
|
||||
<code value="analyte"/>
|
||||
<uri value="http://loinc.org/property/analyte"/>
|
||||
<description value="First sub-part of the Component, i.e., the part of the Component before the first carat"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="analyte-core"/>
|
||||
<uri value="http://loinc.org/property/analyte-core"/>
|
||||
<description value="The primary part of the analyte without the suffix"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="analyte-suffix"/>
|
||||
<uri value="http://loinc.org/property/analyte-suffix"/>
|
||||
<description value="The suffix part of the analyte, if present, e.g., Ab or DNA"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="analyte-numerator"/>
|
||||
<uri value="http://loinc.org/property/analyte-numerator"/>
|
||||
<description value="The numerator part of the analyte, i.e., everything before the slash in analytes that contain a divisor"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="analyte-divisor"/>
|
||||
<uri value="http://loinc.org/property/analyte-divisor"/>
|
||||
<description value="The divisor part of the analyte, if present, i.e., after the slash and before the first carat"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="analyte-divisor-suffix"/>
|
||||
<uri value="http://loinc.org/property/analyte-divisor-suffix"/>
|
||||
<description value="The suffix part of the divisor, if present"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="challenge"/>
|
||||
<uri value="http://loinc.org/property/challenge"/>
|
||||
<description value="Second sub-part of the Component, i.e., after the first carat"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="adjustment"/>
|
||||
<uri value="http://loinc.org/property/adjustment"/>
|
||||
<description value="Third sub-part of the Component, i.e., after the second carat"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="count"/>
|
||||
<uri value="http://loinc.org/property/count"/>
|
||||
<description value="Fourth sub-part of the Component, i.e., after the third carat"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="time-core"/>
|
||||
<uri value="http://loinc.org/property/time-core"/>
|
||||
<description value="The primary part of the Time"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="time-modifier"/>
|
||||
<uri value="http://loinc.org/property/time-modifier"/>
|
||||
<description value="The modifier of the Time value, such as mean or max"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="system-core"/>
|
||||
<uri value="http://loinc.org/property/system-core"/>
|
||||
<description value="The primary part of the System, i.e., without the super system"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="super-system"/>
|
||||
<uri value="http://loinc.org/property/super-system"/>
|
||||
<description value="The super system part of the System, if present. The super system represents the source of the specimen when the source is someone or something other than the patient whose chart the result will be stored in. For example, fetus is the super system for measurements done on obstetric ultrasounds, because the fetus is being measured and that measurement is being recorded in the patient's (mother's) chart."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="analyte-gene"/>
|
||||
<uri value="http://loinc.org/property/analyte-gene"/>
|
||||
<description value="The specific gene represented in the analyte"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="category"/>
|
||||
<uri value="http://loinc.org/property/category"/>
|
||||
<description value="A single LOINC term can be assigned one or more categories based on both programmatic and manual tagging. Category properties also utilize LOINC Class Parts."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="search"/>
|
||||
<uri value="http://loinc.org/property/search"/>
|
||||
<description value="Synonyms, fragments, and other Parts that are linked to a term to enable more encompassing search results."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
|
||||
<!--
|
||||
LOINC/RSNA Radiology Playbook properties. These apply only to terms in the LOINC/RSNA Radiology Playbook File.
|
||||
Notes:
|
||||
Properties are specified as type "coding", which are represented by LOINC Part codes (LP-) and their display names.
|
||||
The attribute names here use FHIR styled names rather than their original LOINC style names because the original names contain periods.
|
||||
-->
|
||||
|
||||
<property>
|
||||
<code value="rad-modality-modality-type"/>
|
||||
<uri value="http://loinc.org/property/rad-modality-modality-type"/>
|
||||
<description value="Modality is used to represent the device used to acquire imaging information."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-modality-modality-subtype"/>
|
||||
<uri value="http://loinc.org/property/rad-modality-modality-subtype"/>
|
||||
<description value="Modality subtype may be optionally included to signify a particularly common or evocative configuration of the modality."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-anatomic-location-region-imaged"/>
|
||||
<uri value="http://loinc.org/property/rad-anatomic-location-region-imaged"/>
|
||||
<description value="The Anatomic Location Region Imaged attribute is used in two ways: as a coarse-grained descriptor of the area imaged and a grouper for finding related imaging exams; or, it is used just as a grouper."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-anatomic-location-imaging-focus"/>
|
||||
<uri value="http://loinc.org/property/rad-anatomic-location-imaging-focus"/>
|
||||
<description value="The Anatomic Location Imaging Focus is a more fine-grained descriptor of the specific target structure of an imaging exam. In many areas, the focus should be a specific organ."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-anatomic-location-laterality-presence"/>
|
||||
<uri value="http://loinc.org/property/rad-anatomic-location-laterality-presence"/>
|
||||
<description value="Radiology Exams that require laterality to be specified in order to be performed are signified with an Anatomic Location Laterality Presence attribute set to 'True'"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-anatomic-location-laterality"/>
|
||||
<uri value="http://loinc.org/property/rad-anatomic-location-laterality"/>
|
||||
<description value="Radiology exam Laterality is specified as one of: Left, Right, Bilateral, Unilateral, Unspecified"/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-view-aggregation"/>
|
||||
<uri value="http://loinc.org/property/rad-view-aggregation"/>
|
||||
<description value="Aggregation describes the extent of the imaging performed, whether in quantitative terms (e.g., '3 or more views') or subjective terms (e.g., 'complete')."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-view-view-type"/>
|
||||
<uri value="http://loinc.org/property/rad-view-view-type"/>
|
||||
<description value="View type names specific views, such as 'lateral' or 'AP'."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-maneuver-maneuver-type"/>
|
||||
<uri value="http://loinc.org/property/rad-maneuver-maneuver-type"/>
|
||||
<description value="Maneuver type indicates an action taken with the goal of elucidating or testing a dynamic aspect of the anatomy."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-timing"/>
|
||||
<uri value="http://loinc.org/property/rad-timing"/>
|
||||
<description value="The Timing/Existence property used in conjunction with pharmaceutical and maneuver properties. It specifies whether or not the imaging occurs in the presence of the administered pharmaceutical or a maneuver designed to test some dynamic aspect of anatomy or physiology ."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-pharmaceutical-substance-given"/>
|
||||
<uri value="http://loinc.org/property/rad-pharmaceutical-substance-given"/>
|
||||
<description value="The Pharmaceutical Substance Given specifies administered contrast agents, radiopharmaceuticals, medications, or other clinically important agents and challenges during the imaging procedure."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-pharmaceutical-route"/>
|
||||
<uri value="http://loinc.org/property/rad-pharmaceutical-route"/>
|
||||
<description value="Route specifies the route of administration of the pharmaceutical."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-reason-for-exam"/>
|
||||
<uri value="http://loinc.org/property/rad-reason-for-exam"/>
|
||||
<description value="Reason for exam is used to describe a clinical indication or a purpose for the study."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-guidance-for-presence"/>
|
||||
<uri value="http://loinc.org/property/rad-guidance-for-presence"/>
|
||||
<description value="Guidance for.Presence indicates when a procedure is guided by imaging."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-guidance-for-approach"/>
|
||||
<uri value="http://loinc.org/property/rad-guidance-for-approach"/>
|
||||
<description value="Guidance for.Approach refers to the primary route of access used, such as percutaneous, transcatheter, or transhepatic."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-guidance-for-action"/>
|
||||
<uri value="http://loinc.org/property/rad-guidance-for-action"/>
|
||||
<description value="Guidance for.Action indicates the intervention performed, such as biopsy, aspiration, or ablation."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-guidance-for-object"/>
|
||||
<uri value="http://loinc.org/property/rad-guidance-for-object"/>
|
||||
<description value="Guidance for.Object specifies the target of the action, such as mass, abscess or cyst."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="rad-subject"/>
|
||||
<uri value="http://loinc.org/property/rad-subject"/>
|
||||
<description value="Subject is intended for use when there is a need to distinguish between the patient associated with an imaging study, and the target of the study."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
|
||||
<!--
|
||||
Document Ontology properties.
|
||||
These apply only to terms in the LOINC Document Ontology File
|
||||
Notes
|
||||
Properties are specified as type "coding", which are represented by LOINC Part codes (LP-) and their display names.
|
||||
The attribute names here use FHIR styled names rather than their original LOINC style names because those contain periods.
|
||||
-->
|
||||
|
||||
<property>
|
||||
<code value="document-kind"/>
|
||||
<uri value="http://loinc.org/property/document-kind"/>
|
||||
<description value="Characterizes the general structure of the document at a macro level."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="document-role"/>
|
||||
<uri value="http://loinc.org/property/document-role"/>
|
||||
<description value="Characterizes the training or professional level of the author of the document, but does not break down to specialty or subspecialty."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="document-setting"/>
|
||||
<uri value="http://loinc.org/property/document-setting"/>
|
||||
<description value="Setting is a modest extension of CMS’s coarse definition of care settings, such as outpatient, hospital, etc. Setting is not equivalent to location, which typically has more locally defined meanings."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="document-subject-matter-domain"/>
|
||||
<uri value="http://loinc.org/property/document-subject-matter-domain"/>
|
||||
<description value="Characterizes the clinical domain that is the subject of the document. For example, Internal Medicine, Neurology, Physical Therapy, etc."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="document-type-of-service"/>
|
||||
<uri value="http://loinc.org/property/document-type-of-service"/>
|
||||
<description value="Characterizes the kind of service or activity provided to/for the patient (or other subject of the service) that is described in the document."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
|
||||
<!-- Answer list related properties -->
|
||||
<property>
|
||||
<code value="answers-for"/>
|
||||
<uri value="http://loinc.org/property/answers-for"/>
|
||||
<description value="A LOINC Code for which this answer list is used."/>
|
||||
<type value="Coding"/>
|
||||
</property>
|
||||
|
||||
<!-- Note for future consideration. These are properties of LA codes in the context of a particular list. Not global properties.
|
||||
<property>
|
||||
<code value="sequence"/>
|
||||
<uri value="http://loinc.org/property/sequence"/>
|
||||
<description value="Sequence Number of a answer in a set of answers (LA- codes only)"/>
|
||||
<type value="integer"/>
|
||||
</property>
|
||||
<property>
|
||||
<code value="score"/>
|
||||
<uri value="http://loinc.org/property/score"/>
|
||||
<description value="Score assigned to an answer (LA- codes only)"/>
|
||||
<type value="integer"/>
|
||||
</property>
|
||||
-->
|
||||
</CodeSystem>
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package ca.uhn.fhir.jpa.config;
|
||||
|
||||
import ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer;
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.util.CircularQueueCaptureQueriesListener;
|
||||
import ca.uhn.fhir.jpa.util.CurrentThreadCaptureQueriesListener;
|
||||
import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
|
||||
|
@ -10,10 +10,6 @@ import net.ttddyy.dsproxy.listener.ThreadQueryCountHolder;
|
|||
import net.ttddyy.dsproxy.support.ProxyDataSourceBuilder;
|
||||
import org.apache.commons.dbcp2.BasicDataSource;
|
||||
import org.hibernate.dialect.H2Dialect;
|
||||
import org.hibernate.search.backend.lucene.cfg.LuceneBackendSettings;
|
||||
import org.hibernate.search.backend.lucene.cfg.LuceneIndexSettings;
|
||||
import org.hibernate.search.engine.cfg.BackendSettings;
|
||||
import org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
|
@ -31,7 +27,6 @@ import java.util.Map;
|
|||
import java.util.Properties;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static ca.uhn.fhir.jpa.dao.BaseJpaTest.buildHeapLuceneHibernateSearchProperties;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
@Configuration
|
||||
|
@ -155,7 +150,9 @@ public class TestDstu2Config extends BaseJavaConfigDstu2 {
|
|||
extraProperties.put("hibernate.hbm2ddl.auto", "update");
|
||||
extraProperties.put("hibernate.dialect", H2Dialect.class.getName());
|
||||
|
||||
extraProperties.putAll(buildHeapLuceneHibernateSearchProperties());
|
||||
boolean enableLucene = myEnv.getProperty(BaseJpaTest.CONFIG_ENABLE_LUCENE, Boolean.TYPE, BaseJpaTest.CONFIG_ENABLE_LUCENE_DEFAULT_VALUE);
|
||||
Map<String, String> hibernateSearchProperties = BaseJpaTest.buildHibernateSearchProperties(enableLucene);
|
||||
extraProperties.putAll(hibernateSearchProperties);
|
||||
|
||||
return extraProperties;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package ca.uhn.fhir.jpa.config;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer;
|
||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl;
|
||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
||||
|
@ -27,9 +28,12 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static ca.uhn.fhir.jpa.dao.BaseJpaTest.buildHeapLuceneHibernateSearchProperties;
|
||||
import static ca.uhn.fhir.jpa.dao.BaseJpaTest.buildHibernateSearchProperties;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
@Configuration
|
||||
|
@ -155,11 +159,9 @@ public class TestDstu3Config extends BaseJavaConfigDstu3 {
|
|||
extraProperties.put("hibernate.hbm2ddl.auto", "update");
|
||||
extraProperties.put("hibernate.dialect", H2Dialect.class.getName());
|
||||
|
||||
extraProperties.put(BackendSettings.backendKey(BackendSettings.TYPE), "lucene");
|
||||
extraProperties.put(BackendSettings.backendKey(LuceneBackendSettings.ANALYSIS_CONFIGURER), HapiLuceneAnalysisConfigurer.class.getName());
|
||||
extraProperties.put(BackendSettings.backendKey(LuceneIndexSettings.DIRECTORY_TYPE), "local-heap");
|
||||
extraProperties.put(BackendSettings.backendKey(LuceneBackendSettings.LUCENE_VERSION), "LUCENE_CURRENT");
|
||||
extraProperties.put(HibernateOrmMapperSettings.ENABLED, "true");
|
||||
boolean enableLucene = myEnv.getProperty(BaseJpaTest.CONFIG_ENABLE_LUCENE, Boolean.TYPE, BaseJpaTest.CONFIG_ENABLE_LUCENE_DEFAULT_VALUE);
|
||||
Map<String, String> hibernateSearchProperties = BaseJpaTest.buildHibernateSearchProperties(enableLucene);
|
||||
extraProperties.putAll(hibernateSearchProperties);
|
||||
|
||||
return extraProperties;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package ca.uhn.fhir.jpa.config;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.jpa.batch.BatchJobsConfig;
|
||||
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
|
||||
import ca.uhn.fhir.jpa.batch.svc.BatchJobSubmitterImpl;
|
||||
import ca.uhn.fhir.jpa.binstore.IBinaryStorageSvc;
|
||||
import ca.uhn.fhir.jpa.binstore.MemoryBinaryStorageSvcImpl;
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.util.CircularQueueCaptureQueriesListener;
|
||||
import ca.uhn.fhir.jpa.util.CurrentThreadCaptureQueriesListener;
|
||||
import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
|
||||
|
@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -58,7 +59,6 @@ public class TestR4Config extends BaseJavaConfigR4 {
|
|||
|
||||
private Exception myLastStackTrace;
|
||||
|
||||
|
||||
@Override
|
||||
@Bean
|
||||
public IBatchJobSubmitter batchJobSubmitter() {
|
||||
|
@ -164,7 +164,9 @@ public class TestR4Config extends BaseJavaConfigR4 {
|
|||
extraProperties.put("hibernate.hbm2ddl.auto", "update");
|
||||
extraProperties.put("hibernate.dialect", H2Dialect.class.getName());
|
||||
|
||||
extraProperties.putAll(buildHeapLuceneHibernateSearchProperties());
|
||||
boolean enableLucene = myEnv.getProperty(BaseJpaTest.CONFIG_ENABLE_LUCENE, Boolean.TYPE, BaseJpaTest.CONFIG_ENABLE_LUCENE_DEFAULT_VALUE);
|
||||
Map<String, String> hibernateSearchProperties = BaseJpaTest.buildHibernateSearchProperties(enableLucene);
|
||||
extraProperties.putAll(hibernateSearchProperties);
|
||||
|
||||
return extraProperties;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package ca.uhn.fhir.jpa.config;
|
|||
|
||||
import ca.uhn.fhir.jpa.binstore.IBinaryStorageSvc;
|
||||
import ca.uhn.fhir.jpa.binstore.MemoryBinaryStorageSvcImpl;
|
||||
import ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer;
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.util.CircularQueueCaptureQueriesListener;
|
||||
import ca.uhn.fhir.jpa.util.CurrentThreadCaptureQueriesListener;
|
||||
import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
|
||||
|
@ -11,10 +11,6 @@ import net.ttddyy.dsproxy.listener.SingleQueryCountHolder;
|
|||
import net.ttddyy.dsproxy.support.ProxyDataSourceBuilder;
|
||||
import org.apache.commons.dbcp2.BasicDataSource;
|
||||
import org.hibernate.dialect.H2Dialect;
|
||||
import org.hibernate.search.backend.lucene.cfg.LuceneBackendSettings;
|
||||
import org.hibernate.search.backend.lucene.cfg.LuceneIndexSettings;
|
||||
import org.hibernate.search.engine.cfg.BackendSettings;
|
||||
import org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
@ -27,6 +23,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static ca.uhn.fhir.jpa.dao.BaseJpaTest.buildHeapLuceneHibernateSearchProperties;
|
||||
|
@ -154,7 +151,9 @@ public class TestR5Config extends BaseJavaConfigR5 {
|
|||
extraProperties.put("hibernate.hbm2ddl.auto", "update");
|
||||
extraProperties.put("hibernate.dialect", H2Dialect.class.getName());
|
||||
|
||||
extraProperties.putAll(buildHeapLuceneHibernateSearchProperties());
|
||||
boolean enableLucene = myEnv.getProperty(BaseJpaTest.CONFIG_ENABLE_LUCENE, Boolean.TYPE, BaseJpaTest.CONFIG_ENABLE_LUCENE_DEFAULT_VALUE);
|
||||
Map<String, String> hibernateSearchProperties = BaseJpaTest.buildHibernateSearchProperties(enableLucene);
|
||||
extraProperties.putAll(hibernateSearchProperties);
|
||||
|
||||
return extraProperties;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import ca.uhn.fhir.jpa.api.model.ExpungeOptions;
|
|||
import ca.uhn.fhir.jpa.api.svc.ISearchCoordinatorSvc;
|
||||
import ca.uhn.fhir.jpa.bulk.export.api.IBulkDataExportSvc;
|
||||
import ca.uhn.fhir.jpa.config.BaseConfig;
|
||||
import ca.uhn.fhir.jpa.config.TestDstu2Config;
|
||||
import ca.uhn.fhir.jpa.dao.data.IForcedIdDao;
|
||||
import ca.uhn.fhir.jpa.dao.data.IResourceHistoryTableDao;
|
||||
import ca.uhn.fhir.jpa.dao.data.IResourceIndexedComboTokensNonUniqueDao;
|
||||
|
@ -62,13 +63,16 @@ import org.hibernate.SessionFactory;
|
|||
import org.hibernate.search.backend.lucene.cfg.LuceneBackendSettings;
|
||||
import org.hibernate.search.backend.lucene.cfg.LuceneIndexSettings;
|
||||
import org.hibernate.search.engine.cfg.BackendSettings;
|
||||
import org.hibernate.search.mapper.orm.Search;
|
||||
import org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings;
|
||||
import org.hibernate.search.mapper.orm.session.SearchSession;
|
||||
import org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu3.model.Resource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBundle;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
@ -88,6 +92,7 @@ import org.springframework.transaction.support.TransactionCallbackWithoutResult;
|
|||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.persistence.EntityManager;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
|
@ -103,7 +108,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static ca.uhn.fhir.util.TestUtil.randomizeLocale;
|
||||
import static ca.uhn.fhir.util.TestUtil.doRandomizeLocaleAndTimezone;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
|
@ -118,6 +123,9 @@ import static org.mockito.Mockito.when;
|
|||
UnregisterScheduledProcessor.SCHEDULING_DISABLED_EQUALS_TRUE
|
||||
})
|
||||
public abstract class BaseJpaTest extends BaseTest {
|
||||
public static final String CONFIG_ENABLE_LUCENE="hapi_test.enable_lucene";
|
||||
public static final String CONFIG_ENABLE_LUCENE_FALSE = CONFIG_ENABLE_LUCENE + "=false";
|
||||
public static final boolean CONFIG_ENABLE_LUCENE_DEFAULT_VALUE = true;
|
||||
|
||||
protected static final String CM_URL = "http://example.com/my_concept_map";
|
||||
protected static final String CS_URL = "http://example.com/my_code_system";
|
||||
|
@ -180,6 +188,8 @@ public abstract class BaseJpaTest extends BaseTest {
|
|||
private IResourceHistoryTableDao myResourceHistoryTableDao;
|
||||
@Autowired
|
||||
private IForcedIdDao myForcedIdDao;
|
||||
@Autowired(required = false)
|
||||
protected IFulltextSearchSvc myFulltestSearchSvc;
|
||||
|
||||
@AfterEach
|
||||
public void afterPerformCleanup() {
|
||||
|
@ -251,6 +261,16 @@ public abstract class BaseJpaTest extends BaseTest {
|
|||
return deliveryLatch;
|
||||
}
|
||||
|
||||
protected void purgeHibernateSearch(EntityManager theEntityManager) {
|
||||
runInTransaction(() -> {
|
||||
if (myFulltestSearchSvc != null && !myFulltestSearchSvc.isDisabled()) {
|
||||
SearchSession searchSession = Search.session(theEntityManager);
|
||||
searchSession.workspace(ResourceTable.class).purge();
|
||||
searchSession.indexingPlan().execute();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected abstract FhirContext getContext();
|
||||
|
||||
protected abstract PlatformTransactionManager getTxManager();
|
||||
|
@ -589,7 +609,21 @@ public abstract class BaseJpaTest extends BaseTest {
|
|||
}
|
||||
}
|
||||
|
||||
public static Map<?, ?> buildHeapLuceneHibernateSearchProperties() {
|
||||
@NotNull
|
||||
public static Map<String, String> buildHibernateSearchProperties(boolean enableLucene) {
|
||||
Map<String, String> hibernateSearchProperties;
|
||||
if (enableLucene) {
|
||||
ourLog.warn("Hibernate Search is enabled");
|
||||
hibernateSearchProperties = buildHeapLuceneHibernateSearchProperties();
|
||||
} else {
|
||||
ourLog.warn("Hibernate Search is disabled");
|
||||
hibernateSearchProperties = new HashMap<>();
|
||||
hibernateSearchProperties.put("hibernate.search.enabled", "false");
|
||||
}
|
||||
return hibernateSearchProperties;
|
||||
}
|
||||
|
||||
public static Map<String, String> buildHeapLuceneHibernateSearchProperties() {
|
||||
Map<String, String> props = new HashMap<>();
|
||||
props.put(BackendSettings.backendKey(BackendSettings.TYPE), "lucene");
|
||||
props.put(BackendSettings.backendKey(LuceneBackendSettings.ANALYSIS_CONFIGURER), HapiLuceneAnalysisConfigurer.class.getName());
|
||||
|
@ -601,7 +635,7 @@ public abstract class BaseJpaTest extends BaseTest {
|
|||
|
||||
@BeforeAll
|
||||
public static void beforeClassRandomizeLocale() {
|
||||
randomizeLocale();
|
||||
doRandomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
|
|
|
@ -226,12 +226,7 @@ public abstract class BaseJpaDstu2Test extends BaseJpaTest {
|
|||
|
||||
@BeforeEach
|
||||
public void beforeFlushFT() {
|
||||
runInTransaction(() -> {
|
||||
SearchSession searchSession = Search.session(myEntityManager);
|
||||
searchSession.workspace(ResourceTable.class).purge();
|
||||
// searchSession.workspace(ResourceIndexedSearchParamString.class).purge();
|
||||
searchSession.indexingPlan().execute();
|
||||
});
|
||||
purgeHibernateSearch(myEntityManager);
|
||||
|
||||
myDaoConfig.setSchedulingDisabled(true);
|
||||
myDaoConfig.setIndexMissingFields(DaoConfig.IndexEnabledEnum.ENABLED);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu2;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
|
||||
import ca.uhn.fhir.jpa.searchparam.SearchParamConstants;
|
||||
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
|
||||
|
@ -41,6 +42,7 @@ import org.junit.jupiter.api.BeforeEach;
|
|||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
|
@ -63,6 +65,9 @@ import static org.junit.jupiter.api.Assertions.fail;
|
|||
import static org.mockito.Mockito.mock;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@TestPropertySource(properties = {
|
||||
BaseJpaTest.CONFIG_ENABLE_LUCENE_FALSE
|
||||
})
|
||||
public class FhirResourceDaoDstu2SearchNoFtTest extends BaseJpaDstu2Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu2SearchNoFtTest.class);
|
||||
@Autowired
|
||||
|
@ -1521,12 +1526,11 @@ public class FhirResourceDaoDstu2SearchNoFtTest extends BaseJpaDstu2Test {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void testSearchUnknownContentParam() {
|
||||
SearchParameterMap params = new SearchParameterMap();
|
||||
params.add(Constants.PARAM_CONTENT, new StringDt("fulltext"));
|
||||
try {
|
||||
myPatientDao.search(params);
|
||||
myPatientDao.search(params).getAllResources();
|
||||
fail();
|
||||
} catch (InvalidRequestException e) {
|
||||
assertEquals("Fulltext search is not enabled on this service, can not process parameter: _content", e.getMessage());
|
||||
|
@ -1534,12 +1538,11 @@ public class FhirResourceDaoDstu2SearchNoFtTest extends BaseJpaDstu2Test {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void testSearchUnknownTextParam() {
|
||||
SearchParameterMap params = new SearchParameterMap();
|
||||
params.add(Constants.PARAM_TEXT, new StringDt("fulltext"));
|
||||
try {
|
||||
myPatientDao.search(params);
|
||||
myPatientDao.search(params).getAllResources();
|
||||
fail();
|
||||
} catch (InvalidRequestException e) {
|
||||
assertEquals("Fulltext search is not enabled on this service, can not process parameter: _text", e.getMessage());
|
||||
|
|
|
@ -386,12 +386,7 @@ public abstract class BaseJpaDstu3Test extends BaseJpaTest {
|
|||
|
||||
@BeforeEach
|
||||
public void beforeFlushFT() {
|
||||
runInTransaction(() -> {
|
||||
SearchSession searchSession = Search.session(myEntityManager);
|
||||
searchSession.workspace(ResourceTable.class).purge();
|
||||
// searchSession.workspace(ResourceIndexedSearchParamString.class).purge();
|
||||
searchSession.indexingPlan().execute();
|
||||
});
|
||||
purgeHibernateSearch(myEntityManager);
|
||||
|
||||
myDaoConfig.setSchedulingDisabled(true);
|
||||
myDaoConfig.setIndexMissingFields(DaoConfig.IndexEnabledEnum.ENABLED);
|
||||
|
|
|
@ -4,6 +4,7 @@ import ca.uhn.fhir.context.phonetic.ApacheEncoder;
|
|||
import ca.uhn.fhir.context.phonetic.NumericEncoder;
|
||||
import ca.uhn.fhir.context.phonetic.PhoneticEncoderEnum;
|
||||
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamString;
|
||||
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
|
||||
import ca.uhn.fhir.rest.param.StringParam;
|
||||
|
@ -19,6 +20,7 @@ import org.junit.jupiter.api.AfterEach;
|
|||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -30,6 +32,9 @@ import static org.hamcrest.Matchers.hasSize;
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
|
||||
@TestPropertySource(properties = {
|
||||
BaseJpaTest.CONFIG_ENABLE_LUCENE_FALSE
|
||||
})
|
||||
public class FhirResourceDaoDstu3PhoneticSearchNoFtTest extends BaseJpaDstu3Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3PhoneticSearchNoFtTest.class);
|
||||
public static final String GALE = "Gale";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamDate;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamNumber;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamQuantity;
|
||||
|
@ -95,6 +96,7 @@ import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
|||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.TransactionCallback;
|
||||
|
@ -125,6 +127,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
@TestPropertySource(properties = {
|
||||
BaseJpaTest.CONFIG_ENABLE_LUCENE_FALSE
|
||||
})
|
||||
@SuppressWarnings("unchecked")
|
||||
public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3SearchNoFtTest.class);
|
||||
|
@ -2234,12 +2239,11 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void testSearchUnknownContentParam() {
|
||||
SearchParameterMap params = new SearchParameterMap();
|
||||
params.add(Constants.PARAM_CONTENT, new StringParam("fulltext"));
|
||||
try {
|
||||
myPatientDao.search(params);
|
||||
myPatientDao.search(params).getAllResources();
|
||||
fail();
|
||||
} catch (InvalidRequestException e) {
|
||||
assertEquals("Fulltext search is not enabled on this service, can not process parameter: _content", e.getMessage());
|
||||
|
@ -2247,12 +2251,11 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void testSearchUnknownTextParam() {
|
||||
SearchParameterMap params = new SearchParameterMap();
|
||||
params.add(Constants.PARAM_TEXT, new StringParam("fulltext"));
|
||||
try {
|
||||
myPatientDao.search(params);
|
||||
myPatientDao.search(params).getAllResources();
|
||||
fail();
|
||||
} catch (InvalidRequestException e) {
|
||||
assertEquals("Fulltext search is not enabled on this service, can not process parameter: _text", e.getMessage());
|
||||
|
|
|
@ -550,11 +550,7 @@ public abstract class BaseJpaR4Test extends BaseJpaTest implements ITestDataBuil
|
|||
|
||||
@BeforeEach
|
||||
public void beforeFlushFT() {
|
||||
runInTransaction(() -> {
|
||||
SearchSession searchSession = Search.session(myEntityManager);
|
||||
searchSession.workspace(ResourceTable.class).purge();
|
||||
searchSession.indexingPlan().execute();
|
||||
});
|
||||
purgeHibernateSearch(this.myEntityManager);
|
||||
|
||||
myDaoConfig.setSchedulingDisabled(true);
|
||||
myDaoConfig.setIndexMissingFields(new DaoConfig().getIndexMissingFields());
|
||||
|
|
|
@ -593,7 +593,7 @@ public class BaseR4SearchLastN extends BaseJpaTest {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import ca.uhn.fhir.interceptor.api.HookParams;
|
|||
import ca.uhn.fhir.interceptor.api.IAnonymousInterceptor;
|
||||
import ca.uhn.fhir.interceptor.api.Pointcut;
|
||||
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.entity.Search;
|
||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||
|
@ -132,6 +133,7 @@ import org.junit.jupiter.api.Test;
|
|||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.ArgumentMatchers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.TransactionCallback;
|
||||
|
@ -174,9 +176,11 @@ import static org.mockito.Mockito.times;
|
|||
import static org.mockito.Mockito.verify;
|
||||
|
||||
@SuppressWarnings({"unchecked", "Duplicates"})
|
||||
@TestPropertySource(properties = {
|
||||
BaseJpaTest.CONFIG_ENABLE_LUCENE_FALSE
|
||||
})
|
||||
public class FhirResourceDaoR4SearchNoFtTest extends BaseJpaR4Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoR4SearchNoFtTest.class);
|
||||
|
||||
@Autowired
|
||||
MatchUrlService myMatchUrlService;
|
||||
|
||||
|
@ -3981,12 +3985,11 @@ public class FhirResourceDaoR4SearchNoFtTest extends BaseJpaR4Test {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void testSearchUnknownContentParam() {
|
||||
SearchParameterMap params = new SearchParameterMap();
|
||||
params.add(Constants.PARAM_CONTENT, new StringParam("fulltext"));
|
||||
try {
|
||||
myPatientDao.search(params);
|
||||
myPatientDao.search(params).getAllResources();
|
||||
fail();
|
||||
} catch (InvalidRequestException e) {
|
||||
assertEquals("Fulltext search is not enabled on this service, can not process parameter: _content", e.getMessage());
|
||||
|
@ -3994,12 +3997,11 @@ public class FhirResourceDaoR4SearchNoFtTest extends BaseJpaR4Test {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void testSearchUnknownTextParam() {
|
||||
SearchParameterMap params = new SearchParameterMap();
|
||||
params.add(Constants.PARAM_TEXT, new StringParam("fulltext"));
|
||||
try {
|
||||
myPatientDao.search(params);
|
||||
myPatientDao.search(params).getAllResources();
|
||||
fail();
|
||||
} catch (InvalidRequestException e) {
|
||||
assertEquals("Fulltext search is not enabled on this service, can not process parameter: _text", e.getMessage());
|
||||
|
|
|
@ -14,10 +14,10 @@ import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion;
|
|||
import ca.uhn.fhir.jpa.entity.TermConcept;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
||||
import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc;
|
||||
import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
|
||||
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
|
||||
import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
|
||||
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
|
||||
import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
|
||||
import ca.uhn.fhir.test.utilities.docker.RequiresDocker;
|
||||
import ca.uhn.fhir.util.TestUtil;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
|
@ -162,7 +162,7 @@ public class FhirResourceDaoR4TerminologyElasticsearchIT extends BaseJpaTest {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -477,12 +477,7 @@ public abstract class BaseJpaR5Test extends BaseJpaTest implements ITestDataBuil
|
|||
|
||||
@BeforeEach
|
||||
public void beforeFlushFT() {
|
||||
runInTransaction(() -> {
|
||||
SearchSession searchSession = Search.session(myEntityManager);
|
||||
searchSession.workspace(ResourceTable.class).purge();
|
||||
// searchSession.workspace(ResourceIndexedSearchParamString.class).purge();
|
||||
searchSession.indexingPlan().execute();
|
||||
});
|
||||
purgeHibernateSearch(myEntityManager);
|
||||
|
||||
myDaoConfig.setSchedulingDisabled(true);
|
||||
myDaoConfig.setIndexMissingFields(DaoConfig.IndexEnabledEnum.ENABLED);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package ca.uhn.fhir.jpa.dao.r5;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceHistoryTable;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
||||
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
|
||||
|
@ -16,12 +17,16 @@ import org.hl7.fhir.r5.model.Practitioner;
|
|||
import org.hl7.fhir.r5.model.PractitionerRole;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@TestPropertySource(properties = {
|
||||
BaseJpaTest.CONFIG_ENABLE_LUCENE_FALSE
|
||||
})
|
||||
@SuppressWarnings({"unchecked", "Duplicates"})
|
||||
public class FhirResourceDaoR5SearchNoFtTest extends BaseJpaR5Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoR5SearchNoFtTest.class);
|
||||
|
|
|
@ -28,6 +28,13 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.hasSize;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
|
@ -233,6 +240,55 @@ public class PartitionManagementProviderTest {
|
|||
verify(myPartitionConfigSvc, times(0)).createPartition(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testListPartitions() {
|
||||
PartitionEntity partition1 = new PartitionEntity();
|
||||
partition1.setId(1);
|
||||
partition1.setName("PARTITION-1");
|
||||
partition1.setDescription("a description1");
|
||||
|
||||
PartitionEntity partition2 = new PartitionEntity();
|
||||
partition2.setId(2);
|
||||
partition2.setName("PARTITION-2");
|
||||
partition2.setDescription("a description2");
|
||||
|
||||
List<PartitionEntity> partitionList = new ArrayList<PartitionEntity>();
|
||||
partitionList.add(partition1);
|
||||
partitionList.add(partition2);
|
||||
when(myPartitionConfigSvc.listPartitions()).thenReturn(partitionList);
|
||||
|
||||
Parameters response = myClient
|
||||
.operation()
|
||||
.onServer()
|
||||
.named(ProviderConstants.PARTITION_MANAGEMENT_LIST_PARTITIONS)
|
||||
.withNoParameters(Parameters.class)
|
||||
.useHttpGet()
|
||||
.encodedXml()
|
||||
.execute();
|
||||
|
||||
ourLog.info("Response:\n{}", ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(response));
|
||||
verify(myPartitionConfigSvc, times(1)).listPartitions();
|
||||
verifyNoMoreInteractions(myPartitionConfigSvc);
|
||||
|
||||
List<Parameters.ParametersParameterComponent> list = getParametersByName(response, "partition");
|
||||
assertThat(list, hasSize(2));
|
||||
List<Parameters.ParametersParameterComponent> part = list.get(0).getPart();
|
||||
assertThat(part.get(0).getName(), is(ProviderConstants.PARTITION_MANAGEMENT_PARTITION_ID));
|
||||
assertEquals(1, ((IntegerType) part.get(0).getValue()).getValue().intValue());
|
||||
assertThat(part.get(1).getName(), is(ProviderConstants.PARTITION_MANAGEMENT_PARTITION_NAME));
|
||||
assertEquals("PARTITION-1", part.get(1).getValue().toString());
|
||||
assertThat(part.get(2).getName(), is(ProviderConstants.PARTITION_MANAGEMENT_PARTITION_DESC));
|
||||
assertEquals("a description1", part.get(2).getValue().toString());
|
||||
|
||||
part = list.get(1).getPart();
|
||||
assertThat(part.get(0).getName(), is(ProviderConstants.PARTITION_MANAGEMENT_PARTITION_ID));
|
||||
assertEquals(2, ((IntegerType) part.get(0).getValue()).getValue().intValue());
|
||||
assertThat(part.get(1).getName(), is(ProviderConstants.PARTITION_MANAGEMENT_PARTITION_NAME));
|
||||
assertEquals("PARTITION-2", part.get(1).getValue().toString());
|
||||
assertThat(part.get(2).getName(), is(ProviderConstants.PARTITION_MANAGEMENT_PARTITION_DESC));
|
||||
assertEquals("a description2", part.get(2).getValue().toString());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
public static class MyConfig {
|
||||
|
||||
|
@ -253,4 +309,7 @@ public class PartitionManagementProviderTest {
|
|||
return t -> t.getArgument(0, PartitionEntity.class);
|
||||
}
|
||||
|
||||
private List<Parameters.ParametersParameterComponent> getParametersByName(Parameters theParams, String theName) {
|
||||
return theParams.getParameter().stream().filter(p -> p.getName().equals(theName)).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,10 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
|||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
public class PartitionSettingsSvcImplTest extends BaseJpaR4Test {
|
||||
|
@ -166,4 +169,25 @@ public class PartitionSettingsSvcImplTest extends BaseJpaR4Test {
|
|||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testListPartitions() {
|
||||
PartitionEntity partition1 = new PartitionEntity();
|
||||
partition1.setId(1);
|
||||
partition1.setName("PARTITION-1");
|
||||
partition1.setDescription("a description1");
|
||||
|
||||
PartitionEntity partition2 = new PartitionEntity();
|
||||
partition2.setId(2);
|
||||
partition2.setName("PARTITION-2");
|
||||
partition2.setDescription("a description2");
|
||||
|
||||
myPartitionConfigSvc.createPartition(partition1);
|
||||
myPartitionConfigSvc.createPartition(partition2);
|
||||
|
||||
List<PartitionEntity> actual = myPartitionConfigSvc.listPartitions();
|
||||
|
||||
assertEquals(2, actual.size());
|
||||
assertTrue(actual.stream().anyMatch(item -> "PARTITION-1".equals(item.getName())));
|
||||
assertTrue(actual.stream().anyMatch(item -> "PARTITION-2".equals(item.getName())));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_TOP2000
|
|||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_TOP2000_COMMON_LAB_RESULTS_US_FILE_DEFAULT;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_UNIVERSAL_LAB_ORDER_VALUESET_FILE_DEFAULT;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_UPLOAD_PROPERTIES_FILE;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_XML_FILE;
|
||||
import static org.apache.commons.lang3.StringUtils.leftPad;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
@ -634,6 +635,7 @@ public class TerminologyUploaderProviderR4Test extends BaseResourceProviderR4Tes
|
|||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ZipOutputStream zos = new ZipOutputStream(bos);
|
||||
|
||||
addFile(zos, LOINC_XML_FILE.getCode());
|
||||
addFile(zos, LOINC_UPLOAD_PROPERTIES_FILE.getCode());
|
||||
addFile(zos, LOINC_PART_FILE_DEFAULT.getCode());
|
||||
addFile(zos, LOINC_FILE_DEFAULT.getCode());
|
||||
|
|
|
@ -3,6 +3,7 @@ package ca.uhn.fhir.jpa.subscription.module.matcher;
|
|||
import ca.uhn.fhir.context.FhirContext;
|
||||
|
||||
import ca.uhn.fhir.jpa.config.TestR4Config;
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||
import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamString;
|
||||
|
@ -70,6 +71,7 @@ import org.junit.jupiter.api.Test;
|
|||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -83,6 +85,9 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
|
|||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
@TestPropertySource(properties = {
|
||||
BaseJpaTest.CONFIG_ENABLE_LUCENE_FALSE
|
||||
})
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@ContextConfiguration(classes = {TestR4Config.class})
|
||||
public class InMemorySubscriptionMatcherR4Test {
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
package ca.uhn.fhir.jpa.term;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.term.api.ITermCodeSystemStorageSvc;
|
||||
import ca.uhn.fhir.jpa.term.api.ITermDeferredStorageSvc;
|
||||
import ca.uhn.fhir.jpa.term.loinc.LoincXmlFileZipContentsHandler;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class TermLoaderSvcImplTest {
|
||||
|
||||
@Mock private ITermDeferredStorageSvc theDeferredStorageSvc;
|
||||
@Mock private ITermCodeSystemStorageSvc theCodeSystemStorageSvc;
|
||||
|
||||
@Mock private LoadedFileDescriptors theDescriptors;
|
||||
@Mock private RequestDetails theRequestDetails;
|
||||
@Mock private Properties theUploadProperties;
|
||||
@Mock private LoincXmlFileZipContentsHandler myZipContentsHandler;
|
||||
|
||||
private final TermLoaderSvcImpl myTermLoaderSvc = TermLoaderSvcImpl.withoutProxyCheck(
|
||||
theDeferredStorageSvc, theCodeSystemStorageSvc);
|
||||
private final TermLoaderSvcImpl testedClass = spy(myTermLoaderSvc);
|
||||
|
||||
public static final String versionedLoinXmlsString =
|
||||
"<CodeSystem xmlns=\"http://hl7.org/fhir\">" +
|
||||
" <id value=\"loinc\"/>" +
|
||||
" <url value=\"http://loinc.org\"/>" +
|
||||
" <version value=\"2.70\"/>" +
|
||||
"</CodeSystem>";
|
||||
|
||||
|
||||
@Test
|
||||
void loadLoincWithoutLoincXmlFileThrows() {
|
||||
InvalidRequestException thrown = assertThrows(
|
||||
InvalidRequestException.class,
|
||||
() -> testedClass.processLoincFiles(
|
||||
theDescriptors, theRequestDetails, theUploadProperties, true));
|
||||
|
||||
assertTrue(thrown.getMessage().contains("Did not find loinc.xml in the ZIP distribution."));
|
||||
}
|
||||
|
||||
@Test
|
||||
void loadLoincWithLoincXmlFileWithVersionThrows() {
|
||||
when(testedClass.getLoincXmlFileZipContentsHandler()).thenReturn(myZipContentsHandler);
|
||||
when(myZipContentsHandler.getContents()).thenReturn(versionedLoinXmlsString);
|
||||
|
||||
InvalidRequestException thrown = assertThrows(
|
||||
InvalidRequestException.class,
|
||||
() -> testedClass.processLoincFiles(
|
||||
theDescriptors, theRequestDetails, theUploadProperties, true));
|
||||
|
||||
assertTrue(thrown.getMessage().contains("'loinc.xml' file must not have a version defined."));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
package ca.uhn.fhir.jpa.term;
|
||||
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class TermReadSvcUtilTest {
|
||||
|
||||
@Nested
|
||||
public class GetValueSetId {
|
||||
|
||||
@Test
|
||||
void doesntStartWithLoincGenericValuesetIdReturnsEmpty() {
|
||||
Optional<String> result = TermReadSvcUtil.getValueSetId("http://boinc.org");
|
||||
assertFalse(result.isPresent());
|
||||
}
|
||||
|
||||
@Test
|
||||
void doesntStartWithLoincGenericValuesetIdPluSlashReturnsEmpty() {
|
||||
Optional<String> result = TermReadSvcUtil.getValueSetId("http://loinc.org/vs-something-else.ar");
|
||||
assertFalse(result.isPresent());
|
||||
}
|
||||
|
||||
@Test
|
||||
void startWithLoincGenericValuesetIdPluSlashButNothingElseReturnsEmpty() {
|
||||
Optional<String> result = TermReadSvcUtil.getValueSetId("http://loinc.org/vs/");
|
||||
assertFalse(result.isPresent());
|
||||
}
|
||||
|
||||
@Test
|
||||
void startWithLoincGenericValuesetIdPluSlashPlusIdReturnsId() {
|
||||
Optional<String> result = TermReadSvcUtil.getValueSetId("http://loinc.org/vs/radiology-playbook");
|
||||
assertTrue(result.isPresent());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Nested
|
||||
public class IsLoincNotGenericUnversionedValueSet {
|
||||
|
||||
@Test
|
||||
void doesntContainLoincReturnsFalse() {
|
||||
boolean result = TermReadSvcUtil.isLoincNotGenericUnversionedValueSet(
|
||||
"http://l-oinc.org/vs/radiology-playbook");
|
||||
assertFalse(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void containsVersionDelimiterReturnsFalse() {
|
||||
boolean result = TermReadSvcUtil.isLoincNotGenericUnversionedValueSet(
|
||||
"http://loinc.org/vs/radiology-playbook|v2.68");
|
||||
assertFalse(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void isLoincGenericValueSetUrlReturnsFalse() {
|
||||
boolean result = TermReadSvcUtil.isLoincNotGenericUnversionedValueSet(
|
||||
"http://loinc.org/vs");
|
||||
assertFalse(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void isLoincWithoutVersionAndNotGenericValuesetUrlReturnsTrue() {
|
||||
boolean result = TermReadSvcUtil.isLoincNotGenericUnversionedValueSet(
|
||||
"http://loinc.org/vs/radiology-playbook");
|
||||
assertTrue(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Nested
|
||||
public class IsLoincNotGenericUnversionedCodeSystem {
|
||||
|
||||
@Test
|
||||
void doesntContainLoincReturnsFalse() {
|
||||
boolean result = TermReadSvcUtil.isLoincNotGenericUnversionedCodeSystem(
|
||||
"http://loin-c.org");
|
||||
assertFalse(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void hasVersionDelimiterReturnsFalse() {
|
||||
boolean result = TermReadSvcUtil.isLoincNotGenericUnversionedCodeSystem(
|
||||
"http://loinc.org|v2.68");
|
||||
assertFalse(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void containsLoincNadNoVersionDelimiterReturnsTrue() {
|
||||
boolean result = TermReadSvcUtil.isLoincNotGenericUnversionedCodeSystem(
|
||||
"http://loinc.org");
|
||||
assertTrue(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -68,6 +68,7 @@ import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_TOP2000
|
|||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_TOP2000_COMMON_LAB_RESULTS_US_FILE_DEFAULT;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_UNIVERSAL_LAB_ORDER_VALUESET_FILE_DEFAULT;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_UPLOAD_PROPERTIES_FILE;
|
||||
import static ca.uhn.fhir.jpa.term.loinc.LoincUploadPropertiesEnum.LOINC_XML_FILE;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
|
@ -711,6 +712,7 @@ public class TerminologyLoaderSvcLoincTest extends BaseLoaderTest {
|
|||
}
|
||||
|
||||
private static void addBaseLoincMandatoryFilesToZip(ZipCollectionBuilder theFiles, Boolean theIncludeTop2000) throws IOException{
|
||||
theFiles.addFileZip("/loinc/", LOINC_XML_FILE.getCode());
|
||||
theFiles.addFileZip("/loinc/", LOINC_GROUP_FILE_DEFAULT.getCode());
|
||||
theFiles.addFileZip("/loinc/", LOINC_GROUP_TERMS_FILE_DEFAULT.getCode());
|
||||
theFiles.addFileZip("/loinc/", LOINC_PARENT_GROUP_FILE_DEFAULT.getCode());
|
||||
|
|
|
@ -26,7 +26,6 @@ import ca.uhn.fhir.jpa.dao.data.ITermValueSetDao;
|
|||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
||||
import ca.uhn.fhir.jpa.term.TermReadSvcR4;
|
||||
import ca.uhn.fhir.jpa.term.TermReadSvcUtil;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.r4.model.CodeSystem;
|
||||
|
@ -96,33 +95,30 @@ class ITermReadSvcTest {
|
|||
|
||||
|
||||
@Nested
|
||||
public class MustReturnEmptyValueSet {
|
||||
public class GetValueSetId {
|
||||
|
||||
@Test
|
||||
void doesntStartWithGenericVSReturnsTrue() {
|
||||
boolean ret = TermReadSvcUtil.mustReturnEmptyValueSet("http://boing.org");
|
||||
assertTrue(ret);
|
||||
void doesntStartWithGenericVSReturnsEmpty() {
|
||||
Optional<String> vsIdOpt = TermReadSvcUtil.getValueSetId("http://boing.org");
|
||||
assertFalse(vsIdOpt.isPresent());
|
||||
}
|
||||
|
||||
@Test
|
||||
void doesntStartWithGenericVSPlusSlashThrows() {
|
||||
InternalErrorException thrown = assertThrows(
|
||||
InternalErrorException.class,
|
||||
() -> TermReadSvcUtil.mustReturnEmptyValueSet("http://loinc.org/vs-no-slash-after-vs"));
|
||||
|
||||
assertTrue(thrown.getMessage().contains("Don't know how to extract ValueSet's ForcedId from url:"));
|
||||
void doesntStartWithGenericVSPlusSlashReturnsEmpty() {
|
||||
Optional<String> vsIdOpt = TermReadSvcUtil.getValueSetId("http://loinc.org/vs-no-slash-after-vs");
|
||||
assertFalse(vsIdOpt.isPresent());
|
||||
}
|
||||
|
||||
@Test
|
||||
void blankVsIdReturnsTrue() {
|
||||
boolean ret = TermReadSvcUtil.mustReturnEmptyValueSet("http://loinc.org/vs/");
|
||||
assertTrue(ret);
|
||||
void blankVsIdReturnsEmpty() {
|
||||
Optional<String> vsIdOpt = TermReadSvcUtil.getValueSetId("http://loinc.org");
|
||||
assertFalse(vsIdOpt.isPresent());
|
||||
}
|
||||
|
||||
@Test
|
||||
void startsWithGenericPlusSlashPlusIdReturnsFalse() {
|
||||
boolean ret = TermReadSvcUtil.mustReturnEmptyValueSet("http://loinc.org/vs/some-vs-id");
|
||||
assertFalse(ret);
|
||||
void startsWithGenericPlusSlashPlusIdReturnsValid() {
|
||||
Optional<String> vsIdOpt = TermReadSvcUtil.getValueSetId("http://loinc.org/vs/some-vs-id");
|
||||
assertTrue(vsIdOpt.isPresent());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ public class TagTypeEnumTest {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ public class SearchParamExtractorDstu3Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,6 +44,11 @@ public class ProviderConstants {
|
|||
*/
|
||||
public static final String PARTITION_MANAGEMENT_READ_PARTITION = "$partition-management-read-partition";
|
||||
|
||||
/**
|
||||
* Operation name: list partitions
|
||||
*/
|
||||
public static final String PARTITION_MANAGEMENT_LIST_PARTITIONS = "$partition-management-list-partitions";
|
||||
|
||||
public static final String PARTITION_MANAGEMENT_PARTITION_ID = "id";
|
||||
public static final String PARTITION_MANAGEMENT_PARTITION_NAME = "name";
|
||||
public static final String PARTITION_MANAGEMENT_PARTITION_DESC = "description";
|
||||
|
|
|
@ -24,7 +24,7 @@ public class IdTypeDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ModelDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class ModelSerializationDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ import org.hl7.fhir.dstu2016may.model.Patient;
|
|||
import org.hl7.fhir.dstu2016may.model.Quantity;
|
||||
import org.hl7.fhir.dstu2016may.model.StringType;
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -45,7 +45,7 @@ public class CustomTypeDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public class EmptyElementWithExtensionDstu3Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1874,6 +1874,6 @@ public class JsonParserDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,17 +15,48 @@ import org.hamcrest.collection.IsEmptyCollection;
|
|||
import org.hamcrest.core.StringContains;
|
||||
import org.hamcrest.text.StringContainsInOrder;
|
||||
import org.hl7.fhir.dstu2016may.model.Address.AddressUse;
|
||||
import org.hl7.fhir.dstu2016may.model.*;
|
||||
import org.hl7.fhir.dstu2016may.model.Appointment;
|
||||
import org.hl7.fhir.dstu2016may.model.AuditEvent;
|
||||
import org.hl7.fhir.dstu2016may.model.Binary;
|
||||
import org.hl7.fhir.dstu2016may.model.Bundle;
|
||||
import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu2016may.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu2016may.model.CodeType;
|
||||
import org.hl7.fhir.dstu2016may.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu2016may.model.Coding;
|
||||
import org.hl7.fhir.dstu2016may.model.Condition;
|
||||
import org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem;
|
||||
import org.hl7.fhir.dstu2016may.model.DateTimeType;
|
||||
import org.hl7.fhir.dstu2016may.model.DateType;
|
||||
import org.hl7.fhir.dstu2016may.model.DiagnosticReport;
|
||||
import org.hl7.fhir.dstu2016may.model.DiagnosticReport.DiagnosticReportStatus;
|
||||
import org.hl7.fhir.dstu2016may.model.DocumentManifest;
|
||||
import org.hl7.fhir.dstu2016may.model.Duration;
|
||||
import org.hl7.fhir.dstu2016may.model.Encounter;
|
||||
import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender;
|
||||
import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatus;
|
||||
import org.hl7.fhir.dstu2016may.model.Extension;
|
||||
import org.hl7.fhir.dstu2016may.model.HumanName;
|
||||
import org.hl7.fhir.dstu2016may.model.HumanName.NameUse;
|
||||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.Identifier;
|
||||
import org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse;
|
||||
import org.hl7.fhir.dstu2016may.model.InstantType;
|
||||
import org.hl7.fhir.dstu2016may.model.Location;
|
||||
import org.hl7.fhir.dstu2016may.model.Medication;
|
||||
import org.hl7.fhir.dstu2016may.model.MedicationOrder;
|
||||
import org.hl7.fhir.dstu2016may.model.Observation;
|
||||
import org.hl7.fhir.dstu2016may.model.Observation.ObservationRelationshipType;
|
||||
import org.hl7.fhir.dstu2016may.model.Observation.ObservationStatus;
|
||||
import org.hl7.fhir.dstu2016may.model.Organization;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.hl7.fhir.dstu2016may.model.PrimitiveType;
|
||||
import org.hl7.fhir.dstu2016may.model.Quantity;
|
||||
import org.hl7.fhir.dstu2016may.model.Reference;
|
||||
import org.hl7.fhir.dstu2016may.model.Resource;
|
||||
import org.hl7.fhir.dstu2016may.model.SampledData;
|
||||
import org.hl7.fhir.dstu2016may.model.SimpleQuantity;
|
||||
import org.hl7.fhir.dstu2016may.model.StringType;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
|
@ -2577,7 +2608,7 @@ public class XmlParserDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
public static void compareXml(String content, String reEncoded) {
|
||||
|
|
|
@ -144,7 +144,7 @@ public class ClientServerValidationDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,10 +15,10 @@ import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
|
|||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
import org.apache.http.message.BasicStatusLine;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
|
@ -40,7 +40,7 @@ public class ClientWithCustomTypeDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -38,13 +38,22 @@ import org.apache.http.client.methods.HttpPut;
|
|||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
import org.apache.http.message.BasicStatusLine;
|
||||
import org.hl7.fhir.dstu2016may.model.*;
|
||||
import org.hl7.fhir.dstu2016may.model.Binary;
|
||||
import org.hl7.fhir.dstu2016may.model.Bundle;
|
||||
import org.hl7.fhir.dstu2016may.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu2016may.model.Conformance;
|
||||
import org.hl7.fhir.dstu2016may.model.Device;
|
||||
import org.hl7.fhir.dstu2016may.model.Encounter;
|
||||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.Observation;
|
||||
import org.hl7.fhir.dstu2016may.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu2016may.model.Parameters;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
|
@ -53,7 +62,6 @@ import org.mockito.stubbing.Answer;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -1995,7 +2003,7 @@ public class GenericClientDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -28,10 +28,10 @@ import org.hl7.fhir.dstu2016may.model.IdType;
|
|||
import org.hl7.fhir.dstu2016may.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
|
@ -167,7 +167,7 @@ public class NonGenericClientDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -26,9 +26,9 @@ import org.apache.http.message.BasicHeader;
|
|||
import org.apache.http.message.BasicStatusLine;
|
||||
import org.hl7.fhir.dstu2016may.model.Parameters;
|
||||
import org.hl7.fhir.dstu2016may.model.StringType;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
|
@ -57,7 +57,7 @@ public class OperationClientDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@ import org.apache.http.message.BasicStatusLine;
|
|||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
|
@ -129,7 +129,7 @@ public class PatchClientDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -27,9 +27,9 @@ import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent;
|
|||
import org.hl7.fhir.dstu2016may.model.Extension;
|
||||
import org.hl7.fhir.dstu2016may.model.Location;
|
||||
import org.hl7.fhir.dstu2016may.model.StringType;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
|
@ -57,7 +57,7 @@ public class SearchClientDstu2_1Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
|
|
|
@ -22,10 +22,10 @@ import org.hl7.fhir.dstu2016may.model.Binary;
|
|||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -128,7 +128,7 @@ public class CreateBinaryDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -212,7 +212,7 @@ public class CreateDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -27,10 +27,10 @@ import org.eclipse.jetty.servlet.ServletHolder;
|
|||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
|
@ -129,7 +129,7 @@ public class CustomTypeServerDstu2_1 {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -18,10 +18,10 @@ import org.eclipse.jetty.servlet.ServletHolder;
|
|||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class DeleteConditionalDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ import org.eclipse.jetty.servlet.ServletHandler;
|
|||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -202,7 +202,7 @@ public class FormatParameterDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package ca.uhn.fhir.rest.server;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.rest.annotation.OptionalParam;
|
||||
import ca.uhn.fhir.rest.annotation.ResourceParam;
|
||||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
|
@ -143,7 +142,7 @@ public class MetadataConformanceDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
package ca.uhn.fhir.rest.server;
|
||||
|
||||
import static org.hamcrest.Matchers.containsInRelativeOrder;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.startsWith;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.annotation.Read;
|
||||
import ca.uhn.fhir.rest.api.Constants;
|
||||
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||
import ca.uhn.fhir.rest.api.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.client.api.IGenericClient;
|
||||
import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
|
||||
import ca.uhn.fhir.test.utilities.JettyUtil;
|
||||
import ca.uhn.fhir.util.TestUtil;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.methods.*;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
|
@ -25,23 +25,37 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
|||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.servlet.ServletHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.hl7.fhir.dstu2016may.model.*;
|
||||
import org.hl7.fhir.dstu2016may.model.Bundle;
|
||||
import org.hl7.fhir.dstu2016may.model.Conformance;
|
||||
import org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent;
|
||||
import org.hl7.fhir.dstu2016may.model.DateTimeType;
|
||||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.IntegerType;
|
||||
import org.hl7.fhir.dstu2016may.model.Money;
|
||||
import org.hl7.fhir.dstu2016may.model.OperationDefinition;
|
||||
import org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse;
|
||||
import org.hl7.fhir.dstu2016may.model.Parameters;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.hl7.fhir.dstu2016may.model.StringType;
|
||||
import org.hl7.fhir.dstu2016may.model.UnsignedIntType;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.jupiter.api.*; import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.rest.annotation.*;
|
||||
import ca.uhn.fhir.rest.api.Constants;
|
||||
import ca.uhn.fhir.rest.api.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.client.api.IGenericClient;
|
||||
import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
|
||||
import ca.uhn.fhir.test.utilities.JettyUtil;
|
||||
import ca.uhn.fhir.util.TestUtil;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.containsInRelativeOrder;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.startsWith;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
public class OperationServerDstu2_1Test {
|
||||
private static CloseableHttpClient ourClient;
|
||||
|
@ -530,7 +544,7 @@ public class OperationServerDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -36,10 +36,10 @@ import org.hl7.fhir.dstu2016may.model.Parameters;
|
|||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.hl7.fhir.dstu2016may.model.StringType;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
@ -387,7 +387,7 @@ public class OperationServerWithSearchParamTypesDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
@BeforeAll
|
||||
public static void beforeClass() throws Exception {
|
||||
|
|
|
@ -156,7 +156,7 @@ public class PatchDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -19,9 +19,9 @@ import org.eclipse.jetty.servlet.ServletHolder;
|
|||
import org.hl7.fhir.dstu2016may.model.DateType;
|
||||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -72,7 +72,7 @@ public class ReadDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -113,7 +113,7 @@ public class SearchCountParamDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -87,7 +87,7 @@ public class SearchDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -67,7 +67,7 @@ public class SearchHasParamDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -27,10 +27,10 @@ import org.eclipse.jetty.servlet.ServletHolder;
|
|||
import org.hl7.fhir.dstu2016may.model.HumanName;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
@ -204,7 +204,7 @@ public class SearchPostDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -77,7 +77,7 @@ public class SearchSortDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -66,7 +66,7 @@ public class SearchWithGenericListDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public class SearchWithIncludesDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ public class SearchWithServerAddressStrategyDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ public class ServerExceptionDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -349,7 +349,7 @@ public class ServerMimetypeDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -24,7 +24,7 @@ public class ServerUsingOldTypesDstu2_1Test {
|
|||
private static FhirContext ourCtx = FhirContext.forDstu2_1();
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -64,7 +64,7 @@ public class UnclassifiedServerExceptionDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -24,10 +24,10 @@ import org.eclipse.jetty.servlet.ServletHolder;
|
|||
import org.hl7.fhir.dstu2016may.model.IdType;
|
||||
import org.hl7.fhir.dstu2016may.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu2016may.model.Patient;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -146,7 +146,7 @@ public class UpdateDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -297,7 +297,7 @@ public class ValidateDstu2_1Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() throws Exception {
|
||||
JettyUtil.closeServer(ourServer);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -132,7 +132,7 @@ public class FhirContextDstu2Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
//Source: https://github.com/junit-team/junit4/wiki/multithreaded-code-and-concurrency
|
||||
|
|
|
@ -15,7 +15,7 @@ public class BundleTest {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ public class CompartmentDstu2Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ public class ModelDstu2Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ public class ModelInstantiationTest {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public class ModelSerializationDstu2Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -827,7 +827,7 @@ public class BaseDateTimeDtDstu2Test {
|
|||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
Locale.setDefault(ourDefaultLocale);
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -17,9 +17,9 @@ import org.apache.http.client.HttpClient;
|
|||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
import org.apache.http.message.BasicStatusLine;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
|
@ -45,7 +45,7 @@ public class BaseResourceReferenceDtTest {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ public class DateDtTest {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu2Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class CustomTypeDstu2Test {
|
|||
|
||||
@AfterAll
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
TestUtil.randomizeLocaleAndTimezone();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue