Switch DSTU2.1 to DSTU3 per FMB's decision
This commit is contained in:
parent
b7ec8f8ac0
commit
32daeb6f58
|
@ -27,7 +27,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-structures-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-structures-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -26,11 +26,11 @@ FhirContext ctxDstu2 = FhirContext.forDstu2();
|
|||
@SuppressWarnings("unused")
|
||||
public static void creatingContextHl7org() {
|
||||
// START SNIPPET: creatingContextHl7org
|
||||
// Create a context for DSTU2.1
|
||||
FhirContext ctx = FhirContext.forDstu2_1();
|
||||
// Create a context for DSTU3
|
||||
FhirContext ctx = FhirContext.forDstu3();
|
||||
|
||||
// Working with RI structures is similar to how it works with the HAPI structures
|
||||
org.hl7.fhir.dstu21.model.Patient patient = new org.hl7.fhir.dstu21.model.Patient();
|
||||
org.hl7.fhir.dstu3.model.Patient patient = new org.hl7.fhir.dstu3.model.Patient();
|
||||
patient.addName().addGiven("John").addFamily("Smith");
|
||||
patient.getBirthDateElement().setValueAsString("1998-02-22");
|
||||
|
||||
|
|
|
@ -508,12 +508,12 @@ public class FhirContext {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU2_1 DSTU 2.1}
|
||||
* Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU3 DSTU 3}
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
public static FhirContext forDstu2_1() {
|
||||
return new FhirContext(FhirVersionEnum.DSTU2_1);
|
||||
public static FhirContext forDstu3() {
|
||||
return new FhirContext(FhirVersionEnum.DSTU3);
|
||||
}
|
||||
|
||||
public static FhirContext forDstu2Hl7Org() {
|
||||
|
|
|
@ -38,7 +38,7 @@ public enum FhirVersionEnum {
|
|||
|
||||
DSTU2("ca.uhn.fhir.model.dstu2.FhirDstu2", null, false),
|
||||
|
||||
DSTU2_1("org.hl7.fhir.dstu21.hapi.ctx.FhirDstu21", null, true),
|
||||
DSTU3("org.hl7.fhir.dstu3.hapi.ctx.FhirDstu3", null, true),
|
||||
|
||||
DSTU2_HL7ORG("org.hl7.fhir.instance.FhirDstu2Hl7Org", DSTU2, true);
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-structures-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-structures-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -70,7 +70,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
|
|
|
@ -54,11 +54,12 @@ public abstract class BaseCommand implements Comparable<BaseCommand> {
|
|||
protected FhirContext getSpecVersionContext(CommandLine theCommandLine) throws ParseException {
|
||||
if (myFhirCtx == null) {
|
||||
String specVersion = theCommandLine.getOptionValue("f", SPEC_DEFAULT_VERSION);
|
||||
specVersion = specVersion.toLowerCase();
|
||||
FhirVersionEnum version;
|
||||
if ("dstu2".equals(specVersion)) {
|
||||
version = FhirVersionEnum.DSTU2;
|
||||
} else if ("dstu2.1".equals(specVersion)) {
|
||||
version = FhirVersionEnum.DSTU2_1;
|
||||
} else if ("dstu3".equals(specVersion)) {
|
||||
version = FhirVersionEnum.DSTU3;
|
||||
} else {
|
||||
throw new ParseException("Unknown spec version: " + specVersion);
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ public class ExampleDataUploader extends BaseCommand {
|
|||
case DSTU2:
|
||||
specUrl = "http://hl7.org/fhir/dstu2/examples-json.zip";
|
||||
break;
|
||||
case DSTU2_1:
|
||||
case DSTU3:
|
||||
specUrl = "http://hl7-fhir.github.io/examples-json.zip";
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package ca.uhn.fhir.cli;
|
||||
|
||||
import org.hl7.fhir.dstu21.hapi.validation.IValidationSupport;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.IValidationSupport;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
|
@ -11,11 +11,11 @@ import ca.uhn.fhir.rest.client.IGenericClient;
|
|||
import ca.uhn.fhir.rest.client.ServerValidationModeEnum;
|
||||
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
|
||||
|
||||
public class LoadingValidationSupportDstu21 implements IValidationSupport {
|
||||
public class LoadingValidationSupportDstu3 implements IValidationSupport {
|
||||
|
||||
private static FhirContext myCtx = FhirContext.forDstu2_1();
|
||||
private static FhirContext myCtx = FhirContext.forDstu3();
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(LoadingValidationSupportDstu21.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(LoadingValidationSupportDstu3.class);
|
||||
|
||||
@Override
|
||||
public ValueSetExpansionComponent expandValueSet(FhirContext theContext, ConceptSetComponent theInclude) {
|
|
@ -6,7 +6,6 @@ import java.io.FileOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.EventListener;
|
||||
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
@ -16,7 +15,6 @@ import org.apache.commons.cli.Options;
|
|||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
import org.springframework.web.context.ContextLoaderListener;
|
||||
|
@ -24,7 +22,7 @@ import org.springframework.web.context.support.AnnotationConfigWebApplicationCon
|
|||
|
||||
import ca.uhn.fhir.jpa.demo.ContextHolder;
|
||||
import ca.uhn.fhir.jpa.demo.FhirServerConfig;
|
||||
import ca.uhn.fhir.jpa.demo.FhirServerConfigDstu21;
|
||||
import ca.uhn.fhir.jpa.demo.FhirServerConfigDstu3;
|
||||
|
||||
public class RunServerCommand extends BaseCommand {
|
||||
|
||||
|
@ -95,8 +93,8 @@ public class RunServerCommand extends BaseCommand {
|
|||
case DSTU2:
|
||||
theSce.getServletContext().setInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, FhirServerConfig.class.getName());
|
||||
break;
|
||||
case DSTU2_1:
|
||||
theSce.getServletContext().setInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, FhirServerConfigDstu21.class.getName());
|
||||
case DSTU3:
|
||||
theSce.getServletContext().setInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, FhirServerConfigDstu3.class.getName());
|
||||
break;
|
||||
}
|
||||
cll.contextInitialized(theSce);
|
||||
|
|
|
@ -20,10 +20,10 @@ import org.apache.commons.cli.ParseException;
|
|||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import org.fusesource.jansi.Ansi.Color;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.FhirInstanceValidator;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.ValidationSupportChain;
|
||||
import org.hl7.fhir.dstu21.model.StructureDefinition;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.FhirInstanceValidator;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.ValidationSupportChain;
|
||||
import org.hl7.fhir.dstu3.model.StructureDefinition;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import com.phloc.commons.io.file.FileUtils;
|
||||
|
@ -127,7 +127,7 @@ public class ValidateCommand extends BaseCommand {
|
|||
instanceValidator.setValidationSupport(validationSupport);
|
||||
break;
|
||||
}
|
||||
case DSTU2_1: {
|
||||
case DSTU3: {
|
||||
FhirInstanceValidator instanceValidator = new FhirInstanceValidator();
|
||||
val.registerValidatorModule(instanceValidator);
|
||||
ValidationSupportChain validationSupport = new ValidationSupportChain(new DefaultProfileValidationSupport());
|
||||
|
@ -135,7 +135,7 @@ public class ValidateCommand extends BaseCommand {
|
|||
instanceValidator.setStructureDefintion((StructureDefinition) localProfileResource);
|
||||
}
|
||||
if (theCommandLine.hasOption("r")) {
|
||||
validationSupport.addValidationSupport(new LoadingValidationSupportDstu21());
|
||||
validationSupport.addValidationSupport(new LoadingValidationSupportDstu3());
|
||||
}
|
||||
instanceValidator.setValidationSupport(validationSupport);
|
||||
break;
|
||||
|
|
|
@ -20,8 +20,8 @@ public class ContextHolder {
|
|||
case DSTU2:
|
||||
ourPath = "/baseDstu2/";
|
||||
break;
|
||||
case DSTU2_1:
|
||||
ourPath = "/baseDstu2.1/";
|
||||
case DSTU3:
|
||||
ourPath = "/baseDstu3/";
|
||||
break;
|
||||
default:
|
||||
throw new ParseException("FHIR version not supported by this command: " + ContextHolder.getCtx().getVersion().getVersion());
|
||||
|
|
|
@ -15,23 +15,23 @@ import org.springframework.orm.jpa.JpaTransactionManager;
|
|||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
import ca.uhn.fhir.jpa.config.BaseJavaConfigDstu21;
|
||||
import ca.uhn.fhir.jpa.config.BaseJavaConfigDstu3;
|
||||
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu21;
|
||||
import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu3;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
||||
import ca.uhn.fhir.rest.server.interceptor.LoggingInterceptor;
|
||||
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
|
||||
|
||||
/**
|
||||
* This class isn't used by default by the example, but
|
||||
* you can use it as a config if you want to support DSTU2.1
|
||||
* you can use it as a config if you want to support DSTU3
|
||||
* instead of DSTU2 in your server.
|
||||
*
|
||||
* See https://github.com/jamesagnew/hapi-fhir/issues/278
|
||||
*/
|
||||
@Configuration
|
||||
@EnableTransactionManagement()
|
||||
public class FhirServerConfigDstu21 extends BaseJavaConfigDstu21 {
|
||||
public class FhirServerConfigDstu3 extends BaseJavaConfigDstu3 {
|
||||
|
||||
/**
|
||||
* Configure FHIR properties around the the JPA server via this bean
|
||||
|
@ -115,7 +115,7 @@ public class FhirServerConfigDstu21 extends BaseJavaConfigDstu21 {
|
|||
|
||||
@Bean(autowire = Autowire.BY_TYPE)
|
||||
public IServerInterceptor subscriptionSecurityInterceptor() {
|
||||
SubscriptionsRequireManualActivationInterceptorDstu21 retVal = new SubscriptionsRequireManualActivationInterceptorDstu21();
|
||||
SubscriptionsRequireManualActivationInterceptorDstu3 retVal = new SubscriptionsRequireManualActivationInterceptorDstu3();
|
||||
return retVal;
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.springframework.web.context.ContextLoaderListener;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
|
@ -15,10 +15,10 @@ import ca.uhn.fhir.jpa.dao.DaoConfig;
|
|||
import ca.uhn.fhir.jpa.dao.IFhirSystemDao;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu1;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu2;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu21;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu1;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu2;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu21;
|
||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaConformanceProviderDstu3;
|
||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.dstu2.composite.MetaDt;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Bundle;
|
||||
|
@ -60,8 +60,8 @@ public class JpaServerDemo extends RestfulServer {
|
|||
case DSTU2:
|
||||
resourceProviderBeanName = "myResourceProvidersDstu2";
|
||||
break;
|
||||
case DSTU2_1:
|
||||
resourceProviderBeanName = "myResourceProvidersDstu21";
|
||||
case DSTU3:
|
||||
resourceProviderBeanName = "myResourceProvidersDstu3";
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
|
@ -79,8 +79,8 @@ public class JpaServerDemo extends RestfulServer {
|
|||
systemProvider = myAppCtx.getBean("mySystemProviderDstu1", JpaSystemProviderDstu1.class);
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU2) {
|
||||
systemProvider = myAppCtx.getBean("mySystemProviderDstu2", JpaSystemProviderDstu2.class);
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU2_1) {
|
||||
systemProvider = myAppCtx.getBean("mySystemProviderDstu21", JpaSystemProviderDstu21.class);
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU3) {
|
||||
systemProvider = myAppCtx.getBean("mySystemProviderDstu3", JpaSystemProviderDstu3.class);
|
||||
} else {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
@ -103,10 +103,10 @@ public class JpaServerDemo extends RestfulServer {
|
|||
myAppCtx.getBean(DaoConfig.class));
|
||||
confProvider.setImplementationDescription("Example Server");
|
||||
setServerConformanceProvider(confProvider);
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU2_1) {
|
||||
IFhirSystemDao<org.hl7.fhir.dstu21.model.Bundle, Meta> systemDao = myAppCtx
|
||||
.getBean("mySystemDaoDstu21", IFhirSystemDao.class);
|
||||
JpaConformanceProviderDstu21 confProvider = new JpaConformanceProviderDstu21(this, systemDao,
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU3) {
|
||||
IFhirSystemDao<org.hl7.fhir.dstu3.model.Bundle, org.hl7.fhir.dstu3.model.Meta> systemDao = myAppCtx
|
||||
.getBean("mySystemDaoDstu3", IFhirSystemDao.class);
|
||||
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(this, systemDao,
|
||||
myAppCtx.getBean(DaoConfig.class));
|
||||
confProvider.setImplementationDescription("Example Server");
|
||||
setServerConformanceProvider(confProvider);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-structures-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-structures-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -48,7 +48,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<source>../hapi-fhir-structures-dstu/src/test/java</source>
|
||||
<source>../hapi-fhir-structures-dstu2/src/test/java</source>
|
||||
<source>../hapi-fhir-structures-hl7org-dstu2/src/test/java</source>
|
||||
<source>../hapi-fhir-structures-dstu2.1/src/test/java</source>
|
||||
<source>../hapi-fhir-structures-dstu3/src/test/java</source>
|
||||
<source>../hapi-fhir-jpaserver-base/src/test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
|
@ -354,7 +354,7 @@
|
|||
<directory>../hapi-fhir-structures-hl7org-dstu2/src/test/resources</directory>
|
||||
</testResource>
|
||||
<testResource>
|
||||
<directory>../hapi-fhir-structures-dstu2.1/src/test/resources</directory>
|
||||
<directory>../hapi-fhir-structures-dstu3/src/test/resources</directory>
|
||||
</testResource>
|
||||
</testResources>
|
||||
</build>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-structures-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-structures-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -65,7 +65,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
|
@ -373,15 +373,15 @@
|
|||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>build_dstu21</id>
|
||||
<id>build_dstu3</id>
|
||||
<goals>
|
||||
<goal>generate-jparest-server</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<version>dstu21</version>
|
||||
<version>dstu3</version>
|
||||
<configPackageBase>ca.uhn.fhir.jpa.config</configPackageBase>
|
||||
<packageBase>ca.uhn.fhir.jpa.rp.dstu21</packageBase>
|
||||
<targetResourceSpringBeansFile>hapi-fhir-server-resourceproviders-dstu21.xml</targetResourceSpringBeansFile>
|
||||
<packageBase>ca.uhn.fhir.jpa.rp.dstu3</packageBase>
|
||||
<targetResourceSpringBeansFile>hapi-fhir-server-resourceproviders-dstu3.xml</targetResourceSpringBeansFile>
|
||||
<baseResourceNames></baseResourceNames>
|
||||
<excludeResourceNames>
|
||||
<!-- <excludeResourceName>OperationDefinition</excludeResourceName> <excludeResourceName>OperationOutcome</excludeResourceName> -->
|
||||
|
@ -402,12 +402,12 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-structures-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-structures-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -43,41 +43,20 @@ import ca.uhn.fhir.context.FhirContext;
|
|||
@EnableJpaRepositories(basePackages = "ca.uhn.fhir.jpa.dao.data")
|
||||
public class BaseConfig implements SchedulingConfigurer {
|
||||
|
||||
private static FhirContext ourFhirContextDstu21;
|
||||
private static FhirContext ourFhirContextDstu2;
|
||||
private static FhirContext ourFhirContextDstu1;
|
||||
private static FhirContext ourFhirContextDstu2;
|
||||
private static FhirContext ourFhirContextDstu2Hl7Org;
|
||||
|
||||
@Autowired
|
||||
protected Environment myEnv;
|
||||
|
||||
/**
|
||||
* This lets the "@Value" fields reference properties from the properties file
|
||||
*/
|
||||
@Bean
|
||||
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||
return new PropertySourcesPlaceholderConfigurer();
|
||||
}
|
||||
private static FhirContext ourFhirContextDstu3;
|
||||
|
||||
@Resource
|
||||
private ApplicationContext myAppCtx;
|
||||
|
||||
@Bean(name = "myFhirContextDstu2")
|
||||
@Lazy
|
||||
public FhirContext fhirContextDstu2() {
|
||||
if (ourFhirContextDstu2 == null) {
|
||||
ourFhirContextDstu2 = FhirContext.forDstu2();
|
||||
}
|
||||
return ourFhirContextDstu2;
|
||||
}
|
||||
@Autowired
|
||||
protected Environment myEnv;
|
||||
|
||||
@Bean(name = "myFhirContextDstu21")
|
||||
@Lazy
|
||||
public FhirContext fhirContextDstu21() {
|
||||
if (ourFhirContextDstu21 == null) {
|
||||
ourFhirContextDstu21 = FhirContext.forDstu2_1();
|
||||
}
|
||||
return ourFhirContextDstu21;
|
||||
@Override
|
||||
public void configureTasks(ScheduledTaskRegistrar theTaskRegistrar) {
|
||||
theTaskRegistrar.setTaskScheduler(taskScheduler());
|
||||
}
|
||||
|
||||
@Bean(name = "myFhirContextDstu1")
|
||||
|
@ -89,6 +68,15 @@ public class BaseConfig implements SchedulingConfigurer {
|
|||
return ourFhirContextDstu1;
|
||||
}
|
||||
|
||||
@Bean(name = "myFhirContextDstu2")
|
||||
@Lazy
|
||||
public FhirContext fhirContextDstu2() {
|
||||
if (ourFhirContextDstu2 == null) {
|
||||
ourFhirContextDstu2 = FhirContext.forDstu2();
|
||||
}
|
||||
return ourFhirContextDstu2;
|
||||
}
|
||||
|
||||
@Bean(name = "myFhirContextDstu2Hl7Org")
|
||||
@Lazy
|
||||
public FhirContext fhirContextDstu2Hl7Org() {
|
||||
|
@ -98,9 +86,13 @@ public class BaseConfig implements SchedulingConfigurer {
|
|||
return ourFhirContextDstu2Hl7Org;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureTasks(ScheduledTaskRegistrar theTaskRegistrar) {
|
||||
theTaskRegistrar.setTaskScheduler(taskScheduler());
|
||||
@Bean(name = "myFhirContextDstu3")
|
||||
@Lazy
|
||||
public FhirContext fhirContextDstu3() {
|
||||
if (ourFhirContextDstu3 == null) {
|
||||
ourFhirContextDstu3 = FhirContext.forDstu3();
|
||||
}
|
||||
return ourFhirContextDstu3;
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
@ -110,6 +102,14 @@ public class BaseConfig implements SchedulingConfigurer {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* This lets the "@Value" fields reference properties from the properties file
|
||||
*/
|
||||
@Bean
|
||||
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||
return new PropertySourcesPlaceholderConfigurer();
|
||||
}
|
||||
|
||||
// @PostConstruct
|
||||
// public void wireResourceDaos() {
|
||||
// Map<String, IDao> daoBeans = myAppCtx.getBeansOfType(IDao.class);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package ca.uhn.fhir.jpa.config;
|
||||
package ca.uhn.fhir.jpa.config.dstu3;
|
||||
|
||||
import org.hl7.fhir.dstu21.hapi.validation.FhirInstanceValidator;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.FhirQuestionnaireResponseValidator;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.IValidationSupport;
|
||||
import org.hl7.fhir.dstu21.validation.IResourceValidator.BestPracticeWarningLevel;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.FhirInstanceValidator;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.FhirQuestionnaireResponseValidator;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.IValidationSupport;
|
||||
import org.hl7.fhir.dstu3.validation.IResourceValidator.BestPracticeWarningLevel;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -33,67 +33,68 @@ import org.springframework.context.annotation.Primary;
|
|||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.jpa.config.BaseConfig;
|
||||
import ca.uhn.fhir.jpa.dao.FhirSearchDao;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirSystemDao;
|
||||
import ca.uhn.fhir.jpa.dao.ISearchDao;
|
||||
import ca.uhn.fhir.jpa.validation.JpaValidationSupportChainDstu21;
|
||||
import ca.uhn.fhir.jpa.validation.JpaValidationSupportChainDstu3;
|
||||
import ca.uhn.fhir.validation.IValidatorModule;
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
public class BaseDstu21Config extends BaseConfig {
|
||||
public class BaseDstu3Config extends BaseConfig {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public FhirContext defaultFhirContext() {
|
||||
return fhirContextDstu21();
|
||||
return fhirContextDstu3();
|
||||
}
|
||||
|
||||
@Bean(name = "mySystemDaoDstu21", autowire = Autowire.BY_NAME)
|
||||
public IFhirSystemDao<org.hl7.fhir.dstu21.model.Bundle, org.hl7.fhir.dstu21.model.Meta> systemDaoDstu21() {
|
||||
ca.uhn.fhir.jpa.dao.FhirSystemDaoDstu21 retVal = new ca.uhn.fhir.jpa.dao.FhirSystemDaoDstu21();
|
||||
@Bean(name = "mySystemDaoDstu3", autowire = Autowire.BY_NAME)
|
||||
public IFhirSystemDao<org.hl7.fhir.dstu3.model.Bundle, org.hl7.fhir.dstu3.model.Meta> systemDaoDstu3() {
|
||||
ca.uhn.fhir.jpa.dao.dstu3.FhirSystemDaoDstu3 retVal = new ca.uhn.fhir.jpa.dao.dstu3.FhirSystemDaoDstu3();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@Bean(name = "mySystemProviderDstu21")
|
||||
public ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu21 systemProviderDstu21() {
|
||||
ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu21 retVal = new ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu21();
|
||||
retVal.setDao(systemDaoDstu21());
|
||||
@Bean(name = "mySystemProviderDstu3")
|
||||
public ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3 systemProviderDstu3() {
|
||||
ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3 retVal = new ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3();
|
||||
retVal.setDao(systemDaoDstu3());
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@Bean(name = "myJpaValidationSupportDstu21", autowire = Autowire.BY_NAME)
|
||||
public ca.uhn.fhir.jpa.dao.IJpaValidationSupportDstu21 jpaValidationSupportDstu21() {
|
||||
ca.uhn.fhir.jpa.dao.JpaValidationSupportDstu21 retVal = new ca.uhn.fhir.jpa.dao.JpaValidationSupportDstu21();
|
||||
@Bean(name = "myJpaValidationSupportDstu3", autowire = Autowire.BY_NAME)
|
||||
public ca.uhn.fhir.jpa.dao.dstu3.IJpaValidationSupportDstu3 jpaValidationSupportDstu3() {
|
||||
ca.uhn.fhir.jpa.dao.dstu3.JpaValidationSupportDstu3 retVal = new ca.uhn.fhir.jpa.dao.dstu3.JpaValidationSupportDstu3();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@Bean(autowire = Autowire.BY_TYPE)
|
||||
public ISearchDao searchDaoDstu21() {
|
||||
public ISearchDao searchDaoDstu3() {
|
||||
FhirSearchDao searchDao = new FhirSearchDao();
|
||||
return searchDao;
|
||||
}
|
||||
|
||||
@Bean(name="myInstanceValidatorDstu21")
|
||||
@Bean(name="myInstanceValidatorDstu3")
|
||||
@Lazy
|
||||
public IValidatorModule instanceValidatorDstu21() {
|
||||
public IValidatorModule instanceValidatorDstu3() {
|
||||
FhirInstanceValidator val = new FhirInstanceValidator();
|
||||
val.setBestPracticeWarningLevel(BestPracticeWarningLevel.Warning);
|
||||
val.setValidationSupport(validationSupportChainDstu21());
|
||||
val.setValidationSupport(validationSupportChainDstu3());
|
||||
return val;
|
||||
}
|
||||
|
||||
@Bean(name="myQuestionnaireResponseValidatorDstu21")
|
||||
@Bean(name="myQuestionnaireResponseValidatorDstu3")
|
||||
@Lazy
|
||||
public IValidatorModule questionnaireResponseValidatorDstu21() {
|
||||
public IValidatorModule questionnaireResponseValidatorDstu3() {
|
||||
FhirQuestionnaireResponseValidator module = new FhirQuestionnaireResponseValidator();
|
||||
module.setValidationSupport(validationSupportChainDstu21());
|
||||
module.setValidationSupport(validationSupportChainDstu3());
|
||||
return module;
|
||||
}
|
||||
|
||||
@Bean(autowire=Autowire.BY_NAME, name="myJpaValidationSupportChainDstu21")
|
||||
public IValidationSupport validationSupportChainDstu21() {
|
||||
return new JpaValidationSupportChainDstu21();
|
||||
@Bean(autowire=Autowire.BY_NAME, name="myJpaValidationSupportChainDstu3")
|
||||
public IValidationSupport validationSupportChainDstu3() {
|
||||
return new JpaValidationSupportChainDstu3();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.config;
|
||||
package ca.uhn.fhir.jpa.config.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -31,20 +31,20 @@ import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
|
|||
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
|
||||
import org.springframework.web.socket.handler.PerConnectionWebSocketHandler;
|
||||
|
||||
import ca.uhn.fhir.jpa.subscription.SubscriptionWebsocketHandlerDstu21;
|
||||
import ca.uhn.fhir.jpa.subscription.SubscriptionWebsocketHandlerDstu3;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSocket()
|
||||
public class WebsocketDstu21Config implements WebSocketConfigurer {
|
||||
public class WebsocketDstu3Config implements WebSocketConfigurer {
|
||||
|
||||
@Override
|
||||
public void registerWebSocketHandlers(WebSocketHandlerRegistry theRegistry) {
|
||||
theRegistry.addHandler(subscriptionWebSocketHandler(), "/websocket/dstu2.1");
|
||||
theRegistry.addHandler(subscriptionWebSocketHandler(), "/websocket/dstu3");
|
||||
}
|
||||
|
||||
@Bean(autowire = Autowire.BY_TYPE)
|
||||
public WebSocketHandler subscriptionWebSocketHandler() {
|
||||
PerConnectionWebSocketHandler retVal = new PerConnectionWebSocketHandler(SubscriptionWebsocketHandlerDstu21.class);
|
||||
PerConnectionWebSocketHandler retVal = new PerConnectionWebSocketHandler(SubscriptionWebsocketHandlerDstu3.class);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class WebsocketDstu21Config implements WebSocketConfigurer {
|
|||
getScheduledThreadPoolExecutor().setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
|
||||
}
|
||||
};
|
||||
retVal.setThreadNamePrefix("ws-dstu21-");
|
||||
retVal.setThreadNamePrefix("ws-dstu3-");
|
||||
retVal.setPoolSize(5);
|
||||
|
||||
return retVal;
|
|
@ -53,9 +53,9 @@ import org.apache.commons.lang3.NotImplementedException;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.utils.URLEncodedUtils;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseCoding;
|
||||
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
|
||||
|
@ -82,6 +82,7 @@ import ca.uhn.fhir.context.FhirVersionEnum;
|
|||
import ca.uhn.fhir.context.RuntimeChildResourceDefinition;
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.context.RuntimeSearchParam;
|
||||
import ca.uhn.fhir.jpa.dao.dstu3.SearchParamExtractorDstu3;
|
||||
import ca.uhn.fhir.jpa.entity.BaseHasResource;
|
||||
import ca.uhn.fhir.jpa.entity.BaseResourceIndexedSearchParam;
|
||||
import ca.uhn.fhir.jpa.entity.BaseTag;
|
||||
|
@ -1113,8 +1114,8 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> implements IDao {
|
|||
case DSTU2:
|
||||
mySearchParamExtractor = new SearchParamExtractorDstu2(theContext);
|
||||
break;
|
||||
case DSTU2_1:
|
||||
mySearchParamExtractor = new SearchParamExtractorDstu21(theContext);
|
||||
case DSTU3:
|
||||
mySearchParamExtractor = new SearchParamExtractorDstu3(theContext);
|
||||
break;
|
||||
case DSTU2_HL7ORG:
|
||||
throw new IllegalStateException("Don't know how to handle version: " + myContext.getVersion().getVersion());
|
||||
|
@ -1681,7 +1682,7 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> implements IDao {
|
|||
}
|
||||
}
|
||||
|
||||
static String normalizeString(String theString) {
|
||||
public static String normalizeString(String theString) {
|
||||
char[] out = new char[theString.length()];
|
||||
theString = Normalizer.normalize(theString, Normalizer.Form.NFD);
|
||||
int j = 0;
|
||||
|
|
|
@ -37,7 +37,7 @@ import javax.persistence.NoResultException;
|
|||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseCoding;
|
||||
import org.hl7.fhir.instance.model.api.IBaseMetaType;
|
||||
|
|
|
@ -33,7 +33,7 @@ import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString;
|
|||
import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamUri;
|
||||
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||
|
||||
interface ISearchParamExtractor {
|
||||
public interface ISearchParamExtractor {
|
||||
|
||||
public abstract Set<ResourceIndexedSearchParamCoords> extractSearchParamCoords(ResourceTable theEntity, IBaseResource theResource);
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleType;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -26,7 +26,7 @@ import org.hl7.fhir.dstu21.model.Bundle.BundleType;
|
|||
|
||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
|
||||
public class FhirResourceDaoBundleDstu21 extends FhirResourceDaoDstu21<Bundle> {
|
||||
public class FhirResourceDaoBundleDstu3 extends FhirResourceDaoDstu3<Bundle> {
|
||||
|
||||
@Override
|
||||
protected void preProcessResourceForStorage(Bundle theResource) {
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -26,11 +26,11 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.OperationOutcomeIssueComponent;
|
||||
import org.hl7.fhir.dstu3.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent;
|
||||
import org.hl7.fhir.instance.model.OperationOutcome.IssueType;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
|
||||
|
@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
|||
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.context.RuntimeSearchParam;
|
||||
import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao;
|
||||
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||
import ca.uhn.fhir.jpa.util.DeleteConflict;
|
||||
import ca.uhn.fhir.model.api.Bundle;
|
||||
|
@ -60,12 +61,12 @@ import ca.uhn.fhir.validation.IValidationContext;
|
|||
import ca.uhn.fhir.validation.IValidatorModule;
|
||||
import ca.uhn.fhir.validation.ValidationResult;
|
||||
|
||||
public class FhirResourceDaoDstu21<T extends IAnyResource> extends BaseHapiFhirResourceDao<T> {
|
||||
public class FhirResourceDaoDstu3<T extends IAnyResource> extends BaseHapiFhirResourceDao<T> {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu21.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3.class);
|
||||
|
||||
@Autowired()
|
||||
@Qualifier("myInstanceValidatorDstu21")
|
||||
@Qualifier("myInstanceValidatorDstu3")
|
||||
private IValidatorModule myInstanceValidator;
|
||||
|
||||
@Override
|
||||
|
@ -75,7 +76,7 @@ public class FhirResourceDaoDstu21<T extends IAnyResource> extends BaseHapiFhirR
|
|||
issue.getSeverityElement().setValueAsString(theSeverity);
|
||||
issue.setDiagnostics(theMessage);
|
||||
try {
|
||||
issue.setCode(org.hl7.fhir.dstu21.model.OperationOutcome.IssueType.fromCode(theCode));
|
||||
issue.setCode(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.fromCode(theCode));
|
||||
} catch (FHIRException e) {
|
||||
ourLog.error("Unknown code: {}", theCode);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -24,10 +24,12 @@ import java.util.Collections;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Encounter;
|
||||
import org.hl7.fhir.dstu3.model.Encounter;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoEncounter;
|
||||
import ca.uhn.fhir.jpa.dao.SearchParameterMap;
|
||||
import ca.uhn.fhir.jpa.dao.SearchParameterMap.EverythingModeEnum;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.rest.api.SortSpec;
|
||||
|
@ -35,7 +37,7 @@ import ca.uhn.fhir.rest.param.DateRangeParam;
|
|||
import ca.uhn.fhir.rest.param.StringParam;
|
||||
import ca.uhn.fhir.rest.server.IBundleProvider;
|
||||
|
||||
public class FhirResourceDaoEncounterDstu21 extends FhirResourceDaoDstu21<Encounter>implements IFhirResourceDaoEncounter<Encounter> {
|
||||
public class FhirResourceDaoEncounterDstu3 extends FhirResourceDaoDstu3<Encounter>implements IFhirResourceDaoEncounter<Encounter> {
|
||||
|
||||
@Override
|
||||
public IBundleProvider encounterInstanceEverything(HttpServletRequest theServletRequest, IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdated, SortSpec theSort) {
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -24,10 +24,13 @@ import java.util.Collections;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoPatient;
|
||||
import ca.uhn.fhir.jpa.dao.SearchBuilder;
|
||||
import ca.uhn.fhir.jpa.dao.SearchParameterMap;
|
||||
import ca.uhn.fhir.jpa.dao.SearchParameterMap.EverythingModeEnum;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
|
||||
|
@ -39,7 +42,7 @@ import ca.uhn.fhir.rest.server.Constants;
|
|||
import ca.uhn.fhir.rest.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
||||
|
||||
public class FhirResourceDaoPatientDstu21 extends FhirResourceDaoDstu21<Patient>implements IFhirResourceDaoPatient<Patient> {
|
||||
public class FhirResourceDaoPatientDstu3 extends FhirResourceDaoDstu3<Patient>implements IFhirResourceDaoPatient<Patient> {
|
||||
|
||||
private IBundleProvider doEverythingOperation(IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdated, SortSpec theSort, StringAndListParam theContent, StringAndListParam theNarrative) {
|
||||
SearchParameterMap paramMap = new SearchParameterMap();
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -22,16 +22,17 @@ package ca.uhn.fhir.jpa.dao;
|
|||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu21.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
||||
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
|
@ -40,13 +41,13 @@ import ca.uhn.fhir.validation.IResourceLoader;
|
|||
import ca.uhn.fhir.validation.IValidatorModule;
|
||||
import ca.uhn.fhir.validation.ValidationResult;
|
||||
|
||||
public class FhirResourceDaoQuestionnaireResponseDstu21 extends FhirResourceDaoDstu21<QuestionnaireResponse> {
|
||||
public class FhirResourceDaoQuestionnaireResponseDstu3 extends FhirResourceDaoDstu3<QuestionnaireResponse> {
|
||||
|
||||
private Boolean myValidateResponses;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myQuestionnaireResponseValidatorDstu21")
|
||||
private IValidatorModule myQuestionnaireResponseValidatorDstu21;
|
||||
@Qualifier("myQuestionnaireResponseValidatorDstu3")
|
||||
private IValidatorModule myQuestionnaireResponseValidatorDstu3;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -77,7 +78,7 @@ public class FhirResourceDaoQuestionnaireResponseDstu21 extends FhirResourceDaoD
|
|||
val.setValidateAgainstStandardSchema(false);
|
||||
val.setValidateAgainstStandardSchematron(false);
|
||||
|
||||
val.registerValidatorModule(myQuestionnaireResponseValidatorDstu21);
|
||||
val.registerValidatorModule(myQuestionnaireResponseValidatorDstu3);
|
||||
|
||||
ValidationResult result = val.validateWithResult(getContext().newJsonParser().parseResource(getContext().newJsonParser().encodeResourceToString(theResource)));
|
||||
if (!result.isSuccessful()) {
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -21,13 +21,16 @@ package ca.uhn.fhir.jpa.dao;
|
|||
*/
|
||||
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu21.model.SearchParameter;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.SearchParameter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
||||
public class FhirResourceDaoSearchParameterDstu21 extends FhirResourceDaoDstu21<SearchParameter>implements IFhirResourceDaoSearchParameter<SearchParameter> {
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoSearchParameter;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirSystemDao;
|
||||
|
||||
public class FhirResourceDaoSearchParameterDstu3 extends FhirResourceDaoDstu3<SearchParameter>implements IFhirResourceDaoSearchParameter<SearchParameter> {
|
||||
|
||||
@Autowired
|
||||
private IFhirSystemDao<Bundle, Meta> mySystemDao;
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -30,8 +30,8 @@ import java.util.List;
|
|||
import javax.persistence.Query;
|
||||
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.hl7.fhir.dstu21.model.Subscription;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.dstu3.model.Subscription;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
|
@ -48,6 +48,10 @@ import org.springframework.transaction.support.TransactionCallback;
|
|||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.jpa.dao.IDao;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoSubscription;
|
||||
import ca.uhn.fhir.jpa.dao.SearchParameterMap;
|
||||
import ca.uhn.fhir.jpa.dao.data.ISubscriptionFlaggedResourceDataDao;
|
||||
import ca.uhn.fhir.jpa.dao.data.ISubscriptionTableDao;
|
||||
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||
|
@ -66,9 +70,9 @@ import ca.uhn.fhir.rest.server.Constants;
|
|||
import ca.uhn.fhir.rest.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
|
||||
public class FhirResourceDaoSubscriptionDstu21 extends FhirResourceDaoDstu21<Subscription>implements IFhirResourceDaoSubscription<Subscription> {
|
||||
public class FhirResourceDaoSubscriptionDstu3 extends FhirResourceDaoDstu3<Subscription>implements IFhirResourceDaoSubscription<Subscription> {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoSubscriptionDstu21.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoSubscriptionDstu3.class);
|
||||
|
||||
@Autowired
|
||||
private ISubscriptionFlaggedResourceDataDao mySubscriptionFlaggedResourceDataDao;
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -33,34 +33,37 @@ import java.util.Set;
|
|||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.codec.binary.StringUtils;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.HapiWorkerContext;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.ValidationSupportChain;
|
||||
import org.hl7.fhir.dstu21.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptDefinitionComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptReferenceComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ValueSetExpansionContainsComponent;
|
||||
import org.hl7.fhir.dstu21.terminologies.ValueSetExpander;
|
||||
import org.hl7.fhir.dstu21.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.HapiWorkerContext;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.ValidationSupportChain;
|
||||
import org.hl7.fhir.dstu3.terminologies.ValueSetExpander;
|
||||
import org.hl7.fhir.dstu3.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
|
||||
import org.hl7.fhir.dstu3.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet.ConceptDefinitionComponent;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.LookupCodeResult;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult;
|
||||
import ca.uhn.fhir.rest.param.TokenParam;
|
||||
import ca.uhn.fhir.rest.param.UriParam;
|
||||
import ca.uhn.fhir.rest.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
|
||||
public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSet> implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
||||
public class FhirResourceDaoValueSetDstu3 extends FhirResourceDaoDstu3<ValueSet> implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
||||
|
||||
@Autowired
|
||||
private IJpaValidationSupportDstu21 myJpaValidationSupport;
|
||||
private IJpaValidationSupportDstu3 myJpaValidationSupport;
|
||||
|
||||
private ValidationSupportChain myValidationSupport;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -39,16 +39,16 @@ import java.util.Set;
|
|||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryResponseComponent;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu21.model.Resource;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu3.model.Resource;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseReference;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
@ -66,6 +66,9 @@ import org.springframework.transaction.support.TransactionTemplate;
|
|||
import com.google.common.collect.ArrayListMultimap;
|
||||
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.jpa.dao.BaseHapiFhirSystemDao;
|
||||
import ca.uhn.fhir.jpa.dao.DaoMethodOutcome;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
||||
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||
import ca.uhn.fhir.jpa.entity.TagDefinition;
|
||||
import ca.uhn.fhir.jpa.provider.ServletSubRequestDetails;
|
||||
|
@ -91,8 +94,8 @@ import ca.uhn.fhir.util.FhirTerser;
|
|||
import ca.uhn.fhir.util.UrlUtil;
|
||||
import ca.uhn.fhir.util.UrlUtil.UrlParts;
|
||||
|
||||
public class FhirSystemDaoDstu21 extends BaseHapiFhirSystemDao<Bundle, Meta> {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirSystemDaoDstu21.class);
|
||||
public class FhirSystemDaoDstu3 extends BaseHapiFhirSystemDao<Bundle, Meta> {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirSystemDaoDstu3.class);
|
||||
|
||||
@Autowired
|
||||
private PlatformTransactionManager myTxManager;
|
|
@ -1,6 +1,6 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import org.hl7.fhir.dstu21.hapi.validation.IValidationSupport;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.IValidationSupport;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -22,6 +22,6 @@ import org.hl7.fhir.dstu21.hapi.validation.IValidationSupport;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
public interface IJpaValidationSupportDstu21 extends IValidationSupport {
|
||||
public interface IJpaValidationSupportDstu3 extends IValidationSupport {
|
||||
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu21.model.StructureDefinition;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.StructureDefinition;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
|
||||
/*
|
||||
|
@ -33,31 +33,32 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
||||
import ca.uhn.fhir.rest.param.StringParam;
|
||||
import ca.uhn.fhir.rest.param.UriParam;
|
||||
import ca.uhn.fhir.rest.server.IBundleProvider;
|
||||
|
||||
public class JpaValidationSupportDstu21 implements IJpaValidationSupportDstu21 {
|
||||
public class JpaValidationSupportDstu3 implements IJpaValidationSupportDstu3 {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(JpaValidationSupportDstu21.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(JpaValidationSupportDstu3.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myStructureDefinitionDaoDstu21")
|
||||
@Qualifier("myStructureDefinitionDaoDstu3")
|
||||
private IFhirResourceDao<StructureDefinition> myStructureDefinitionDao;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myValueSetDaoDstu21")
|
||||
@Qualifier("myValueSetDaoDstu3")
|
||||
private IFhirResourceDao<ValueSet> myValueSetDao;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myQuestionnaireDaoDstu21")
|
||||
@Qualifier("myQuestionnaireDaoDstu3")
|
||||
private IFhirResourceDao<Questionnaire> myQuestionnaireDao;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myFhirContextDstu21")
|
||||
private FhirContext myDstu21Ctx;
|
||||
@Qualifier("myFhirContextDstu3")
|
||||
private FhirContext myDstu3Ctx;
|
||||
|
||||
public JpaValidationSupportDstu21() {
|
||||
public JpaValidationSupportDstu3() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -80,7 +81,7 @@ public class JpaValidationSupportDstu21 implements IJpaValidationSupportDstu21 {
|
|||
localReference = true;
|
||||
}
|
||||
|
||||
String resourceName = myDstu21Ctx.getResourceDefinition(theClass).getName();
|
||||
String resourceName = myDstu3Ctx.getResourceDefinition(theClass).getName();
|
||||
IBundleProvider search;
|
||||
if ("ValueSet".equals(resourceName)) {
|
||||
if (localReference) {
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -34,25 +34,25 @@ import javax.measure.unit.Unit;
|
|||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.hl7.fhir.dstu21.model.Address;
|
||||
import org.hl7.fhir.dstu21.model.BaseDateTimeType;
|
||||
import org.hl7.fhir.dstu21.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.Conformance.ConformanceRestSecurityComponent;
|
||||
import org.hl7.fhir.dstu21.model.ContactPoint;
|
||||
import org.hl7.fhir.dstu21.model.Duration;
|
||||
import org.hl7.fhir.dstu21.model.Enumeration;
|
||||
import org.hl7.fhir.dstu21.model.HumanName;
|
||||
import org.hl7.fhir.dstu21.model.Identifier;
|
||||
import org.hl7.fhir.dstu21.model.IntegerType;
|
||||
import org.hl7.fhir.dstu21.model.Location.LocationPositionComponent;
|
||||
import org.hl7.fhir.dstu21.model.Patient.PatientCommunicationComponent;
|
||||
import org.hl7.fhir.dstu21.model.Period;
|
||||
import org.hl7.fhir.dstu21.model.Quantity;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu21.model.UriType;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.Address;
|
||||
import org.hl7.fhir.dstu3.model.BaseDateTimeType;
|
||||
import org.hl7.fhir.dstu3.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.ContactPoint;
|
||||
import org.hl7.fhir.dstu3.model.Duration;
|
||||
import org.hl7.fhir.dstu3.model.Enumeration;
|
||||
import org.hl7.fhir.dstu3.model.HumanName;
|
||||
import org.hl7.fhir.dstu3.model.Identifier;
|
||||
import org.hl7.fhir.dstu3.model.IntegerType;
|
||||
import org.hl7.fhir.dstu3.model.Period;
|
||||
import org.hl7.fhir.dstu3.model.Quantity;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.UriType;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestSecurityComponent;
|
||||
import org.hl7.fhir.dstu3.model.Location.LocationPositionComponent;
|
||||
import org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent;
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
|
@ -61,6 +61,9 @@ import ca.uhn.fhir.context.ConfigurationException;
|
|||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.context.RuntimeSearchParam;
|
||||
import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao;
|
||||
import ca.uhn.fhir.jpa.dao.BaseSearchParamExtractor;
|
||||
import ca.uhn.fhir.jpa.dao.ISearchParamExtractor;
|
||||
import ca.uhn.fhir.jpa.entity.BaseResourceIndexedSearchParam;
|
||||
import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamCoords;
|
||||
import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate;
|
||||
|
@ -72,11 +75,11 @@ import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamUri;
|
|||
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||
import ca.uhn.fhir.rest.method.RestSearchParameterTypeEnum;
|
||||
|
||||
public class SearchParamExtractorDstu21 extends BaseSearchParamExtractor implements ISearchParamExtractor {
|
||||
public class SearchParamExtractorDstu3 extends BaseSearchParamExtractor implements ISearchParamExtractor {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchParamExtractorDstu21.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchParamExtractorDstu3.class);
|
||||
|
||||
public SearchParamExtractorDstu21(FhirContext theContext) {
|
||||
public SearchParamExtractorDstu3(FhirContext theContext) {
|
||||
super(theContext);
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package ca.uhn.fhir.jpa.provider;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Encounter;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.UnsignedIntType;
|
||||
import org.hl7.fhir.dstu3.model.Encounter;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.UnsignedIntType;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -34,7 +34,7 @@ import ca.uhn.fhir.rest.api.SortSpec;
|
|||
import ca.uhn.fhir.rest.param.DateRangeParam;
|
||||
import ca.uhn.fhir.rest.server.Constants;
|
||||
|
||||
public class BaseJpaResourceProviderEncounterDstu21 extends JpaResourceProviderDstu21<Encounter> {
|
||||
public class BaseJpaResourceProviderEncounterDstu3 extends JpaResourceProviderDstu3<Encounter> {
|
||||
|
||||
/**
|
||||
* Encounter/123/$everything
|
|
@ -1,13 +1,13 @@
|
|||
package ca.uhn.fhir.jpa.provider;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu21.model.UnsignedIntType;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.UnsignedIntType;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -42,7 +42,7 @@ import ca.uhn.fhir.rest.param.StringOrListParam;
|
|||
import ca.uhn.fhir.rest.param.StringParam;
|
||||
import ca.uhn.fhir.rest.server.Constants;
|
||||
|
||||
public class BaseJpaResourceProviderPatientDstu21 extends JpaResourceProviderDstu21<Patient> {
|
||||
public class BaseJpaResourceProviderPatientDstu3 extends JpaResourceProviderDstu3<Patient> {
|
||||
|
||||
/**
|
||||
* Patient/123/$everything
|
|
@ -1,6 +1,6 @@
|
|||
package ca.uhn.fhir.jpa.provider;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu3.model.QuestionnaireResponse;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -22,7 +22,7 @@ import org.hl7.fhir.dstu21.model.QuestionnaireResponse;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
public class BaseJpaResourceProviderQuestionnaireResponseDstu21 extends JpaResourceProviderDstu21<QuestionnaireResponse> {
|
||||
public class BaseJpaResourceProviderQuestionnaireResponseDstu3 extends JpaResourceProviderDstu3<QuestionnaireResponse> {
|
||||
|
||||
// nothing yet
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.provider;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -24,15 +24,15 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.BooleanType;
|
||||
import org.hl7.fhir.dstu21.model.CodeType;
|
||||
import org.hl7.fhir.dstu21.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Parameters;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu21.model.UriType;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.BooleanType;
|
||||
import org.hl7.fhir.dstu3.model.CodeType;
|
||||
import org.hl7.fhir.dstu3.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.UriType;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.LookupCodeResult;
|
||||
|
@ -43,7 +43,7 @@ import ca.uhn.fhir.rest.annotation.OperationParam;
|
|||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
|
||||
public class BaseJpaResourceProviderValueSetDstu21 extends JpaResourceProviderDstu21<ValueSet> {
|
||||
public class BaseJpaResourceProviderValueSetDstu3 extends JpaResourceProviderDstu3<ValueSet> {
|
||||
|
||||
//@formatter:off
|
||||
@Operation(name = "$expand", idempotent = true)
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.provider;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -25,17 +25,17 @@ import java.util.Map;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.CodeType;
|
||||
import org.hl7.fhir.dstu21.model.Conformance;
|
||||
import org.hl7.fhir.dstu21.model.Conformance.ConditionalDeleteStatus;
|
||||
import org.hl7.fhir.dstu21.model.Conformance.ConformanceRestComponent;
|
||||
import org.hl7.fhir.dstu21.model.Conformance.ConformanceRestResourceComponent;
|
||||
import org.hl7.fhir.dstu21.model.Conformance.ConformanceRestResourceSearchParamComponent;
|
||||
import org.hl7.fhir.dstu21.model.DecimalType;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.SearchParamType;
|
||||
import org.hl7.fhir.dstu21.model.Extension;
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.CodeType;
|
||||
import org.hl7.fhir.dstu3.model.Conformance;
|
||||
import org.hl7.fhir.dstu3.model.DecimalType;
|
||||
import org.hl7.fhir.dstu3.model.Extension;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.Conformance.ConditionalDeleteStatus;
|
||||
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestComponent;
|
||||
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceComponent;
|
||||
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceSearchParamComponent;
|
||||
import org.hl7.fhir.dstu3.model.Enumerations.SearchParamType;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
|
@ -46,7 +46,7 @@ import ca.uhn.fhir.rest.server.RestfulServer;
|
|||
import ca.uhn.fhir.util.CoverageIgnore;
|
||||
import ca.uhn.fhir.util.ExtensionConstants;
|
||||
|
||||
public class JpaConformanceProviderDstu21 extends org.hl7.fhir.dstu21.hapi.rest.server.ServerConformanceProvider {
|
||||
public class JpaConformanceProviderDstu3 extends org.hl7.fhir.dstu3.hapi.rest.server.ServerConformanceProvider {
|
||||
|
||||
private volatile Conformance myCachedValue;
|
||||
private DaoConfig myDaoConfig;
|
||||
|
@ -58,7 +58,7 @@ public class JpaConformanceProviderDstu21 extends org.hl7.fhir.dstu21.hapi.rest.
|
|||
* Constructor
|
||||
*/
|
||||
@CoverageIgnore
|
||||
public JpaConformanceProviderDstu21(){
|
||||
public JpaConformanceProviderDstu3(){
|
||||
super();
|
||||
super.setCache(false);
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public class JpaConformanceProviderDstu21 extends org.hl7.fhir.dstu21.hapi.rest.
|
|||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public JpaConformanceProviderDstu21(RestfulServer theRestfulServer, IFhirSystemDao<Bundle, Meta> theSystemDao, DaoConfig theDaoConfig) {
|
||||
public JpaConformanceProviderDstu3(RestfulServer theRestfulServer, IFhirSystemDao<Bundle, Meta> theSystemDao, DaoConfig theDaoConfig) {
|
||||
super(theRestfulServer);
|
||||
myRestfulServer = theRestfulServer;
|
||||
mySystemDao = theSystemDao;
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.provider;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -22,12 +22,13 @@ package ca.uhn.fhir.jpa.provider;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu21.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
||||
import ca.uhn.fhir.jpa.provider.BaseJpaResourceProvider;
|
||||
import ca.uhn.fhir.rest.annotation.ConditionalUrlParam;
|
||||
import ca.uhn.fhir.rest.annotation.Create;
|
||||
import ca.uhn.fhir.rest.annotation.Delete;
|
||||
|
@ -42,17 +43,17 @@ import ca.uhn.fhir.rest.api.ValidationModeEnum;
|
|||
import ca.uhn.fhir.rest.server.EncodingEnum;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
|
||||
public class JpaResourceProviderDstu21<T extends IAnyResource> extends BaseJpaResourceProvider<T> {
|
||||
public class JpaResourceProviderDstu3<T extends IAnyResource> extends BaseJpaResourceProvider<T> {
|
||||
|
||||
public static final String OPERATION_NAME_META = "$meta";
|
||||
public static final String OPERATION_NAME_META_DELETE = "$meta-delete";
|
||||
public static final String OPERATION_NAME_META_ADD = "$meta-add";
|
||||
|
||||
public JpaResourceProviderDstu21() {
|
||||
public JpaResourceProviderDstu3() {
|
||||
// nothing
|
||||
}
|
||||
|
||||
public JpaResourceProviderDstu21(IFhirResourceDao<T> theDao) {
|
||||
public JpaResourceProviderDstu3(IFhirResourceDao<T> theDao) {
|
||||
super(theDao);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.provider;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||
|
||||
|
@ -28,17 +28,18 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.DecimalType;
|
||||
import org.hl7.fhir.dstu21.model.IntegerType;
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu21.model.Parameters;
|
||||
import org.hl7.fhir.dstu21.model.Parameters.ParametersParameterComponent;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.DecimalType;
|
||||
import org.hl7.fhir.dstu3.model.IntegerType;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.FhirSearchDao.Suggestion;
|
||||
import ca.uhn.fhir.jpa.provider.BaseJpaSystemProvider;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirSystemDao;
|
||||
import ca.uhn.fhir.jpa.dao.ISearchDao;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
|
@ -51,10 +52,10 @@ import ca.uhn.fhir.rest.method.RequestDetails;
|
|||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
|
||||
|
||||
public class JpaSystemProviderDstu21 extends BaseJpaSystemProvider<Bundle, Meta> {
|
||||
public class JpaSystemProviderDstu3 extends BaseJpaSystemProvider<Bundle, Meta> {
|
||||
|
||||
@Autowired()
|
||||
@Qualifier("mySystemDaoDstu21")
|
||||
@Qualifier("mySystemDaoDstu3")
|
||||
private IFhirSystemDao<Bundle, Meta> mySystemDao;
|
||||
|
||||
@Autowired
|
|
@ -29,10 +29,10 @@ import javax.annotation.PreDestroy;
|
|||
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.utils.URLEncodedUtils;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Subscription;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -50,11 +50,11 @@ import ca.uhn.fhir.rest.server.EncodingEnum;
|
|||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
|
||||
public class SubscriptionWebsocketHandlerDstu21 extends TextWebSocketHandler implements ISubscriptionWebsocketHandler, Runnable {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SubscriptionWebsocketHandlerDstu21.class);
|
||||
public class SubscriptionWebsocketHandlerDstu3 extends TextWebSocketHandler implements ISubscriptionWebsocketHandler, Runnable {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SubscriptionWebsocketHandlerDstu3.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myFhirContextDstu21")
|
||||
@Qualifier("myFhirContextDstu3")
|
||||
private FhirContext myCtx;
|
||||
|
||||
private ScheduledFuture<?> myScheduleFuture;
|
|
@ -22,12 +22,12 @@ package ca.uhn.fhir.jpa.subscription;
|
|||
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
|
||||
public class SubscriptionWebsocketHandlerFactoryDstu21 implements FactoryBean<ISubscriptionWebsocketHandler> {
|
||||
static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SubscriptionWebsocketHandlerDstu21.class);
|
||||
public class SubscriptionWebsocketHandlerFactoryDstu3 implements FactoryBean<ISubscriptionWebsocketHandler> {
|
||||
static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SubscriptionWebsocketHandlerDstu3.class);
|
||||
|
||||
@Override
|
||||
public ISubscriptionWebsocketHandler getObject() throws Exception {
|
||||
return new SubscriptionWebsocketHandlerDstu21();
|
||||
return new SubscriptionWebsocketHandlerDstu3();
|
||||
}
|
||||
|
||||
@Override
|
|
@ -2,9 +2,9 @@ package ca.uhn.fhir.jpa.util;
|
|||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Subscription;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.dstu3.model.Subscription;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
|
@ -30,8 +30,8 @@ import org.hl7.fhir.instance.model.api.IIdType;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.FhirResourceDaoSubscriptionDstu21;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
||||
import ca.uhn.fhir.jpa.dao.dstu3.FhirResourceDaoSubscriptionDstu3;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
||||
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
|
||||
|
@ -44,9 +44,9 @@ import ca.uhn.fhir.util.CoverageIgnore;
|
|||
* Interceptor which requires newly created {@link Subscription subscriptions} to be in
|
||||
* {@link SubscriptionStatus#REQUESTED} state and prevents clients from changing the status.
|
||||
*/
|
||||
public class SubscriptionsRequireManualActivationInterceptorDstu21 extends InterceptorAdapter {
|
||||
public class SubscriptionsRequireManualActivationInterceptorDstu3 extends InterceptorAdapter {
|
||||
|
||||
public static final ResourceMetadataKeyEnum<Object> ALLOW_STATUS_CHANGE = new ResourceMetadataKeyEnum<Object>(FhirResourceDaoSubscriptionDstu21.class.getName() + "_ALLOW_STATUS_CHANGE") {
|
||||
public static final ResourceMetadataKeyEnum<Object> ALLOW_STATUS_CHANGE = new ResourceMetadataKeyEnum<Object>(FhirResourceDaoSubscriptionDstu3.class.getName() + "_ALLOW_STATUS_CHANGE") {
|
||||
private static final long serialVersionUID = 1;
|
||||
|
||||
@CoverageIgnore
|
||||
|
@ -63,7 +63,7 @@ public class SubscriptionsRequireManualActivationInterceptorDstu21 extends Inter
|
|||
};
|
||||
|
||||
@Autowired
|
||||
@Qualifier("mySubscriptionDaoDstu21")
|
||||
@Qualifier("mySubscriptionDaoDstu3")
|
||||
private IFhirResourceDao<Subscription> myDao;
|
||||
|
||||
@Override
|
|
@ -2,20 +2,20 @@ package ca.uhn.fhir.jpa.validation;
|
|||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.hl7.fhir.dstu21.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.ValidationSupportChain;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.ValidationSupportChain;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
public class JpaValidationSupportChainDstu21 extends ValidationSupportChain {
|
||||
public class JpaValidationSupportChainDstu3 extends ValidationSupportChain {
|
||||
|
||||
private DefaultProfileValidationSupport myDefaultProfileValidationSupport = new DefaultProfileValidationSupport();
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myJpaValidationSupportDstu21")
|
||||
public ca.uhn.fhir.jpa.dao.IJpaValidationSupportDstu21 myJpaValidationSupportDstu21;
|
||||
@Qualifier("myJpaValidationSupportDstu3")
|
||||
public ca.uhn.fhir.jpa.dao.dstu3.IJpaValidationSupportDstu3 myJpaValidationSupportDstu3;
|
||||
|
||||
public JpaValidationSupportChainDstu21() {
|
||||
public JpaValidationSupportChainDstu3() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,6 @@ public class JpaValidationSupportChainDstu21 extends ValidationSupportChain {
|
|||
@PostConstruct
|
||||
public void postConstruct() {
|
||||
addValidationSupport(myDefaultProfileValidationSupport);
|
||||
addValidationSupport(myJpaValidationSupportDstu21);
|
||||
addValidationSupport(myJpaValidationSupportDstu3);
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@ import ca.uhn.fhir.jpa.dao.DaoConfig;
|
|||
|
||||
@Configuration
|
||||
@EnableTransactionManagement()
|
||||
public class TestDstu21Config extends BaseJavaConfigDstu21 {
|
||||
public class TestDstu3Config extends BaseJavaConfigDstu3 {
|
||||
|
||||
@Bean()
|
||||
public DaoConfig daoConfig() {
|
||||
|
@ -59,7 +59,7 @@ public class TestDstu21Config extends BaseJavaConfigDstu21 {
|
|||
extraProperties.put("hibernate.hbm2ddl.auto", "update");
|
||||
extraProperties.put("hibernate.dialect", "org.hibernate.dialect.DerbyTenSevenDialect");
|
||||
extraProperties.put("hibernate.search.default.directory_provider" ,"filesystem");
|
||||
extraProperties.put("hibernate.search.default.indexBase", "target/lucene_index_dstu21");
|
||||
extraProperties.put("hibernate.search.default.indexBase", "target/lucene_index_dstu3");
|
||||
extraProperties.put("hibernate.search.lucene_version","LUCENE_CURRENT");
|
||||
extraProperties.put("hibernate.search.autoregister_listeners", "true");
|
||||
return extraProperties;
|
|
@ -8,7 +8,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.AfterClass;
|
||||
|
@ -37,7 +37,7 @@ public class BaseJpaTest {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
protected List<IIdType> toUnqualifiedVersionlessIds(org.hl7.fhir.dstu21.model.Bundle theFound) {
|
||||
protected List<IIdType> toUnqualifiedVersionlessIds(org.hl7.fhir.dstu3.model.Bundle theFound) {
|
||||
List<IIdType> retVal = new ArrayList<IIdType>();
|
||||
for (BundleEntryComponent next : theFound.getEntry()) {
|
||||
// if (next.getResource()!= null) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
@ -11,11 +11,11 @@ import javax.servlet.http.HttpServletRequest;
|
|||
|
||||
import org.junit.Before;
|
||||
|
||||
import ca.uhn.fhir.jpa.rp.dstu21.PatientResourceProvider;
|
||||
import ca.uhn.fhir.jpa.rp.dstu3.PatientResourceProvider;
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
|
||||
|
||||
public abstract class BaseJpaDstu21SystemTest extends BaseJpaDstu21Test {
|
||||
public abstract class BaseJpaDstu3SystemTest extends BaseJpaDstu3Test {
|
||||
protected ServletRequestDetails myRequestDetails;
|
||||
private RestfulServer myServer;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
@ -11,32 +11,32 @@ import javax.persistence.EntityManager;
|
|||
import org.apache.commons.io.IOUtils;
|
||||
import org.hibernate.search.jpa.FullTextEntityManager;
|
||||
import org.hibernate.search.jpa.Search;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.IValidationSupport;
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.ConceptMap;
|
||||
import org.hl7.fhir.dstu21.model.Device;
|
||||
import org.hl7.fhir.dstu21.model.DiagnosticOrder;
|
||||
import org.hl7.fhir.dstu21.model.DiagnosticReport;
|
||||
import org.hl7.fhir.dstu21.model.Encounter;
|
||||
import org.hl7.fhir.dstu21.model.Immunization;
|
||||
import org.hl7.fhir.dstu21.model.Location;
|
||||
import org.hl7.fhir.dstu21.model.Media;
|
||||
import org.hl7.fhir.dstu21.model.Medication;
|
||||
import org.hl7.fhir.dstu21.model.MedicationOrder;
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu21.model.NamingSystem;
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.Organization;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Practitioner;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu21.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu21.model.StructureDefinition;
|
||||
import org.hl7.fhir.dstu21.model.Subscription;
|
||||
import org.hl7.fhir.dstu21.model.Substance;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.IValidationSupport;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.ConceptMap;
|
||||
import org.hl7.fhir.dstu3.model.Device;
|
||||
import org.hl7.fhir.dstu3.model.DiagnosticOrder;
|
||||
import org.hl7.fhir.dstu3.model.DiagnosticReport;
|
||||
import org.hl7.fhir.dstu3.model.Encounter;
|
||||
import org.hl7.fhir.dstu3.model.Immunization;
|
||||
import org.hl7.fhir.dstu3.model.Location;
|
||||
import org.hl7.fhir.dstu3.model.Media;
|
||||
import org.hl7.fhir.dstu3.model.Medication;
|
||||
import org.hl7.fhir.dstu3.model.MedicationOrder;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.NamingSystem;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.Organization;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Practitioner;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu3.model.StructureDefinition;
|
||||
import org.hl7.fhir.dstu3.model.Subscription;
|
||||
import org.hl7.fhir.dstu3.model.Substance;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.junit.Before;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -52,7 +52,7 @@ import org.springframework.transaction.support.TransactionCallback;
|
|||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.jpa.config.TestDstu21Config;
|
||||
import ca.uhn.fhir.jpa.config.TestDstu3Config;
|
||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
||||
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
||||
|
@ -78,45 +78,45 @@ import ca.uhn.fhir.jpa.entity.ResourceTag;
|
|||
import ca.uhn.fhir.jpa.entity.SubscriptionFlaggedResource;
|
||||
import ca.uhn.fhir.jpa.entity.SubscriptionTable;
|
||||
import ca.uhn.fhir.jpa.entity.TagDefinition;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu21;
|
||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3;
|
||||
import ca.uhn.fhir.parser.IParser;
|
||||
import ca.uhn.fhir.rest.method.MethodUtil;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
||||
|
||||
//@formatter:off
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes= {TestDstu21Config.class})
|
||||
@ContextConfiguration(classes= {TestDstu3Config.class})
|
||||
//@formatter:on
|
||||
public abstract class BaseJpaDstu21Test extends BaseJpaTest {
|
||||
public abstract class BaseJpaDstu3Test extends BaseJpaTest {
|
||||
@Autowired
|
||||
@Qualifier("myJpaValidationSupportChainDstu21")
|
||||
@Qualifier("myJpaValidationSupportChainDstu3")
|
||||
protected IValidationSupport myValidationSupport;
|
||||
@Autowired
|
||||
protected ApplicationContext myAppCtx;
|
||||
@Autowired
|
||||
protected ISearchDao mySearchDao;
|
||||
@Autowired
|
||||
@Qualifier("myConceptMapDaoDstu21")
|
||||
@Qualifier("myConceptMapDaoDstu3")
|
||||
protected IFhirResourceDao<ConceptMap> myConceptMapDao;
|
||||
@Autowired
|
||||
@Qualifier("myMedicationDaoDstu21")
|
||||
@Qualifier("myMedicationDaoDstu3")
|
||||
protected IFhirResourceDao<Medication> myMedicationDao;
|
||||
@Autowired
|
||||
@Qualifier("myMedicationOrderDaoDstu21")
|
||||
@Qualifier("myMedicationOrderDaoDstu3")
|
||||
protected IFhirResourceDao<MedicationOrder> myMedicationOrderDao;
|
||||
@Autowired
|
||||
protected DaoConfig myDaoConfig;
|
||||
@Autowired
|
||||
@Qualifier("myDeviceDaoDstu21")
|
||||
@Qualifier("myDeviceDaoDstu3")
|
||||
protected IFhirResourceDao<Device> myDeviceDao;
|
||||
@Autowired
|
||||
@Qualifier("myDiagnosticOrderDaoDstu21")
|
||||
@Qualifier("myDiagnosticOrderDaoDstu3")
|
||||
protected IFhirResourceDao<DiagnosticOrder> myDiagnosticOrderDao;
|
||||
@Autowired
|
||||
@Qualifier("myDiagnosticReportDaoDstu21")
|
||||
@Qualifier("myDiagnosticReportDaoDstu3")
|
||||
protected IFhirResourceDao<DiagnosticReport> myDiagnosticReportDao;
|
||||
@Autowired
|
||||
@Qualifier("myEncounterDaoDstu21")
|
||||
@Qualifier("myEncounterDaoDstu3")
|
||||
protected IFhirResourceDao<Encounter> myEncounterDao;
|
||||
|
||||
// @PersistenceContext()
|
||||
|
@ -124,61 +124,61 @@ public abstract class BaseJpaDstu21Test extends BaseJpaTest {
|
|||
protected EntityManager myEntityManager;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myFhirContextDstu21")
|
||||
@Qualifier("myFhirContextDstu3")
|
||||
protected FhirContext myFhirCtx;
|
||||
@Autowired
|
||||
@Qualifier("myImmunizationDaoDstu21")
|
||||
@Qualifier("myImmunizationDaoDstu3")
|
||||
protected IFhirResourceDao<Immunization> myImmunizationDao;
|
||||
protected IServerInterceptor myInterceptor;
|
||||
@Autowired
|
||||
@Qualifier("myLocationDaoDstu21")
|
||||
@Qualifier("myLocationDaoDstu3")
|
||||
protected IFhirResourceDao<Location> myLocationDao;
|
||||
@Autowired
|
||||
@Qualifier("myObservationDaoDstu21")
|
||||
@Qualifier("myObservationDaoDstu3")
|
||||
protected IFhirResourceDao<Observation> myObservationDao;
|
||||
@Autowired
|
||||
@Qualifier("myOrganizationDaoDstu21")
|
||||
@Qualifier("myOrganizationDaoDstu3")
|
||||
protected IFhirResourceDao<Organization> myOrganizationDao;
|
||||
@Autowired
|
||||
@Qualifier("myPatientDaoDstu21")
|
||||
@Qualifier("myPatientDaoDstu3")
|
||||
protected IFhirResourceDaoPatient<Patient> myPatientDao;
|
||||
@Autowired
|
||||
@Qualifier("myNamingSystemDaoDstu21")
|
||||
@Qualifier("myNamingSystemDaoDstu3")
|
||||
protected IFhirResourceDao<NamingSystem> myNamingSystemDao;
|
||||
@Autowired
|
||||
@Qualifier("myMediaDaoDstu21")
|
||||
@Qualifier("myMediaDaoDstu3")
|
||||
protected IFhirResourceDao<Media> myMediaDao;
|
||||
@Autowired
|
||||
@Qualifier("myPractitionerDaoDstu21")
|
||||
@Qualifier("myPractitionerDaoDstu3")
|
||||
protected IFhirResourceDao<Practitioner> myPractitionerDao;
|
||||
@Autowired
|
||||
@Qualifier("myQuestionnaireDaoDstu21")
|
||||
@Qualifier("myQuestionnaireDaoDstu3")
|
||||
protected IFhirResourceDao<Questionnaire> myQuestionnaireDao;
|
||||
@Autowired
|
||||
@Qualifier("myQuestionnaireResponseDaoDstu21")
|
||||
@Qualifier("myQuestionnaireResponseDaoDstu3")
|
||||
protected IFhirResourceDao<QuestionnaireResponse> myQuestionnaireResponseDao;
|
||||
@Autowired
|
||||
@Qualifier("myResourceProvidersDstu21")
|
||||
@Qualifier("myResourceProvidersDstu3")
|
||||
protected Object myResourceProviders;
|
||||
@Autowired
|
||||
@Qualifier("myStructureDefinitionDaoDstu21")
|
||||
@Qualifier("myStructureDefinitionDaoDstu3")
|
||||
protected IFhirResourceDao<StructureDefinition> myStructureDefinitionDao;
|
||||
@Autowired
|
||||
@Qualifier("mySubscriptionDaoDstu21")
|
||||
@Qualifier("mySubscriptionDaoDstu3")
|
||||
protected IFhirResourceDaoSubscription<Subscription> mySubscriptionDao;
|
||||
@Autowired
|
||||
@Qualifier("mySubstanceDaoDstu21")
|
||||
@Qualifier("mySubstanceDaoDstu3")
|
||||
protected IFhirResourceDao<Substance> mySubstanceDao;
|
||||
@Autowired
|
||||
@Qualifier("mySystemDaoDstu21")
|
||||
@Qualifier("mySystemDaoDstu3")
|
||||
protected IFhirSystemDao<Bundle, Meta> mySystemDao;
|
||||
@Autowired
|
||||
@Qualifier("mySystemProviderDstu21")
|
||||
protected JpaSystemProviderDstu21 mySystemProvider;
|
||||
@Qualifier("mySystemProviderDstu3")
|
||||
protected JpaSystemProviderDstu3 mySystemProvider;
|
||||
@Autowired
|
||||
protected PlatformTransactionManager myTxManager;
|
||||
@Autowired
|
||||
@Qualifier("myValueSetDaoDstu21")
|
||||
@Qualifier("myValueSetDaoDstu3")
|
||||
protected IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> myValueSetDao;
|
||||
|
||||
@Before
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
@ -7,8 +7,8 @@ import static org.mockito.Mockito.mock;
|
|||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -19,7 +19,7 @@ import ca.uhn.fhir.jpa.interceptor.IJpaServerInterceptor;
|
|||
import ca.uhn.fhir.jpa.interceptor.JpaServerInterceptorAdapter;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
||||
|
||||
public class FhirResourceDaoDstu21InterceptorTest extends BaseJpaDstu21Test {
|
||||
public class FhirResourceDaoDstu3InterceptorTest extends BaseJpaDstu3Test {
|
||||
|
||||
private IJpaServerInterceptor myJpaInterceptor;
|
||||
private JpaServerInterceptorAdapter myJpaInterceptorAdapter = new JpaServerInterceptorAdapter();
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
|
@ -13,14 +13,14 @@ import java.util.List;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Base64BinaryType;
|
||||
import org.hl7.fhir.dstu21.model.Device;
|
||||
import org.hl7.fhir.dstu21.model.Media;
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.Observation.ObservationStatus;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Quantity;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.Base64BinaryType;
|
||||
import org.hl7.fhir.dstu3.model.Device;
|
||||
import org.hl7.fhir.dstu3.model.Media;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Quantity;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.Observation.ObservationStatus;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -33,9 +33,9 @@ import ca.uhn.fhir.rest.param.StringParam;
|
|||
import ca.uhn.fhir.rest.param.TokenParam;
|
||||
import ca.uhn.fhir.rest.server.Constants;
|
||||
|
||||
public class FhirResourceDaoDstu21SearchFtTest extends BaseJpaDstu21Test {
|
||||
public class FhirResourceDaoDstu3SearchFtTest extends BaseJpaDstu3Test {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu21SearchFtTest.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3SearchFtTest.class);
|
||||
|
||||
@Test
|
||||
@Ignore
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
|
@ -23,35 +23,35 @@ import java.util.Set;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hl7.fhir.dstu21.model.BaseResource;
|
||||
import org.hl7.fhir.dstu21.model.CodeType;
|
||||
import org.hl7.fhir.dstu21.model.ConceptMap;
|
||||
import org.hl7.fhir.dstu21.model.ContactPoint.ContactPointSystem;
|
||||
import org.hl7.fhir.dstu21.model.DateTimeType;
|
||||
import org.hl7.fhir.dstu21.model.DateType;
|
||||
import org.hl7.fhir.dstu21.model.Device;
|
||||
import org.hl7.fhir.dstu21.model.DiagnosticOrder;
|
||||
import org.hl7.fhir.dstu21.model.DiagnosticReport;
|
||||
import org.hl7.fhir.dstu21.model.Encounter;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Immunization;
|
||||
import org.hl7.fhir.dstu21.model.Location;
|
||||
import org.hl7.fhir.dstu21.model.Medication;
|
||||
import org.hl7.fhir.dstu21.model.MedicationOrder;
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.Organization;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Period;
|
||||
import org.hl7.fhir.dstu21.model.Practitioner;
|
||||
import org.hl7.fhir.dstu21.model.Quantity;
|
||||
import org.hl7.fhir.dstu21.model.Reference;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu21.model.Subscription;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.dstu21.model.Substance;
|
||||
import org.hl7.fhir.dstu21.model.TemporalPrecisionEnum;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.BaseResource;
|
||||
import org.hl7.fhir.dstu3.model.CodeType;
|
||||
import org.hl7.fhir.dstu3.model.ConceptMap;
|
||||
import org.hl7.fhir.dstu3.model.DateTimeType;
|
||||
import org.hl7.fhir.dstu3.model.DateType;
|
||||
import org.hl7.fhir.dstu3.model.Device;
|
||||
import org.hl7.fhir.dstu3.model.DiagnosticOrder;
|
||||
import org.hl7.fhir.dstu3.model.DiagnosticReport;
|
||||
import org.hl7.fhir.dstu3.model.Encounter;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Immunization;
|
||||
import org.hl7.fhir.dstu3.model.Location;
|
||||
import org.hl7.fhir.dstu3.model.Medication;
|
||||
import org.hl7.fhir.dstu3.model.MedicationOrder;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.Organization;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Period;
|
||||
import org.hl7.fhir.dstu3.model.Practitioner;
|
||||
import org.hl7.fhir.dstu3.model.Quantity;
|
||||
import org.hl7.fhir.dstu3.model.Reference;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription;
|
||||
import org.hl7.fhir.dstu3.model.Substance;
|
||||
import org.hl7.fhir.dstu3.model.TemporalPrecisionEnum;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Ignore;
|
||||
|
@ -90,8 +90,8 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
|||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class FhirResourceDaoDstu21SearchNoFtTest extends BaseJpaDstu21Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu21SearchNoFtTest.class);
|
||||
public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3SearchNoFtTest.class);
|
||||
|
||||
@Test
|
||||
public void testCodeSearch() {
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
|
@ -19,12 +19,12 @@ import java.util.List;
|
|||
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.Observation.ObservationStatus;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Subscription;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Subscription;
|
||||
import org.hl7.fhir.dstu3.model.Observation.ObservationStatus;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Before;
|
||||
|
@ -39,9 +39,9 @@ import ca.uhn.fhir.rest.server.IBundleProvider;
|
|||
import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
|
||||
public class FhirResourceDaoDstu21SubscriptionTest extends BaseJpaDstu21Test {
|
||||
public class FhirResourceDaoDstu3SubscriptionTest extends BaseJpaDstu3Test {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu21SubscriptionTest.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3SubscriptionTest.class);
|
||||
|
||||
@Autowired
|
||||
private ISubscriptionFlaggedResourceDataDao mySubscriptionFlaggedResourceDataDao;
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.defaultString;
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
|
@ -34,35 +34,35 @@ import java.util.Set;
|
|||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.hamcrest.core.StringContains;
|
||||
import org.hl7.fhir.dstu21.model.BaseResource;
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu21.model.CodeType;
|
||||
import org.hl7.fhir.dstu21.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.ConceptMap;
|
||||
import org.hl7.fhir.dstu21.model.DateTimeType;
|
||||
import org.hl7.fhir.dstu21.model.DateType;
|
||||
import org.hl7.fhir.dstu21.model.Device;
|
||||
import org.hl7.fhir.dstu21.model.DiagnosticReport;
|
||||
import org.hl7.fhir.dstu21.model.Encounter;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.AdministrativeGender;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu21.model.NamingSystem;
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.IssueType;
|
||||
import org.hl7.fhir.dstu21.model.Organization;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Period;
|
||||
import org.hl7.fhir.dstu21.model.Quantity;
|
||||
import org.hl7.fhir.dstu21.model.Quantity.QuantityComparator;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu21.model.Reference;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu21.model.UriType;
|
||||
import org.hl7.fhir.dstu3.model.BaseResource;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.CodeType;
|
||||
import org.hl7.fhir.dstu3.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.ConceptMap;
|
||||
import org.hl7.fhir.dstu3.model.DateTimeType;
|
||||
import org.hl7.fhir.dstu3.model.DateType;
|
||||
import org.hl7.fhir.dstu3.model.Device;
|
||||
import org.hl7.fhir.dstu3.model.DiagnosticReport;
|
||||
import org.hl7.fhir.dstu3.model.Encounter;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.NamingSystem;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu3.model.Organization;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Period;
|
||||
import org.hl7.fhir.dstu3.model.Quantity;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.Reference;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.UriType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome.IssueType;
|
||||
import org.hl7.fhir.dstu3.model.Quantity.QuantityComparator;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
|
@ -71,7 +71,6 @@ import org.mockito.ArgumentCaptor;
|
|||
|
||||
import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao;
|
||||
import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao;
|
||||
import ca.uhn.fhir.jpa.dao.FhirResourceDaoDstu21;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoPatient;
|
||||
import ca.uhn.fhir.jpa.dao.SearchParameterMap;
|
||||
|
@ -106,9 +105,9 @@ import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
|||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class FhirResourceDaoDstu21Test extends BaseJpaDstu21Test {
|
||||
public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu21Test.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3Test.class);
|
||||
|
||||
private List<String> extractNames(IBundleProvider theSearch) {
|
||||
ArrayList<String> retVal = new ArrayList<String>();
|
||||
|
@ -285,18 +284,18 @@ public class FhirResourceDaoDstu21Test extends BaseJpaDstu21Test {
|
|||
*/
|
||||
assertEquals(org.hl7.fhir.instance.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_ERROR);
|
||||
assertEquals(ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum.ERROR.getCode(), BaseHapiFhirResourceDao.OO_SEVERITY_ERROR);
|
||||
assertEquals(org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_ERROR);
|
||||
assertEquals(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.ERROR.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_ERROR);
|
||||
assertEquals(org.hl7.fhir.instance.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_INFO);
|
||||
assertEquals(ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum.INFORMATION.getCode(), BaseHapiFhirResourceDao.OO_SEVERITY_INFO);
|
||||
assertEquals(org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_INFO);
|
||||
assertEquals(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.INFORMATION.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_INFO);
|
||||
assertEquals(org.hl7.fhir.instance.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_WARN);
|
||||
assertEquals(ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum.WARNING.getCode(), BaseHapiFhirResourceDao.OO_SEVERITY_WARN);
|
||||
assertEquals(org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_WARN);
|
||||
assertEquals(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.WARNING.toCode(), BaseHapiFhirResourceDao.OO_SEVERITY_WARN);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateOperationOutcomeError() {
|
||||
FhirResourceDaoDstu21<Bundle> dao = new FhirResourceDaoDstu21<Bundle>();
|
||||
FhirResourceDaoDstu3<Bundle> dao = new FhirResourceDaoDstu3<Bundle>();
|
||||
OperationOutcome oo = (OperationOutcome) dao.createErrorOperationOutcome("my message", "incomplete");
|
||||
assertEquals(IssueSeverity.ERROR.toCode(), oo.getIssue().get(0).getSeverity().toCode());
|
||||
assertEquals("my message", oo.getIssue().get(0).getDiagnostics());
|
||||
|
@ -305,7 +304,7 @@ public class FhirResourceDaoDstu21Test extends BaseJpaDstu21Test {
|
|||
|
||||
@Test
|
||||
public void testCreateOperationOutcomeInfo() {
|
||||
FhirResourceDaoDstu21<Bundle> dao = new FhirResourceDaoDstu21<Bundle>();
|
||||
FhirResourceDaoDstu3<Bundle> dao = new FhirResourceDaoDstu3<Bundle>();
|
||||
OperationOutcome oo = (OperationOutcome) dao.createInfoOperationOutcome("my message");
|
||||
assertEquals(IssueSeverity.INFORMATION.toCode(), oo.getIssue().get(0).getSeverity().toCode());
|
||||
assertEquals("my message", oo.getIssue().get(0).getDiagnostics());
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
|
@ -22,13 +22,13 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.InstantType;
|
||||
import org.hl7.fhir.dstu21.model.Organization;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Resource;
|
||||
import org.hl7.fhir.dstu21.model.UriType;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.InstantType;
|
||||
import org.hl7.fhir.dstu3.model.Organization;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Resource;
|
||||
import org.hl7.fhir.dstu3.model.UriType;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Test;
|
||||
|
@ -42,8 +42,8 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
|||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
||||
|
||||
public class FhirResourceDaoDstu21UpdateTest extends BaseJpaDstu21Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu21UpdateTest.class);
|
||||
public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3UpdateTest.class);
|
||||
|
||||
@Test
|
||||
public void testUpdateAndGetHistoryResource() throws InterruptedException {
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
@ -7,16 +7,16 @@ import static org.junit.Assert.fail;
|
|||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.Observation.ObservationStatus;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu21.model.Organization;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.StructureDefinition;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu3.model.Organization;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.StructureDefinition;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu3.model.Observation.ObservationStatus;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Ignore;
|
||||
|
@ -29,8 +29,8 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
|||
import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException;
|
||||
|
||||
public class FhirResourceDaoDstu21ValidateTest extends BaseJpaDstu21Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu21ValidateTest.class);
|
||||
public class FhirResourceDaoDstu3ValidateTest extends BaseJpaDstu3Test {
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3ValidateTest.class);
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
|
@ -59,7 +59,7 @@ public class FhirResourceDaoDstu21ValidateTest extends BaseJpaDstu21Test {
|
|||
}
|
||||
|
||||
private OperationOutcome doTestValidateResourceContainingProfileDeclaration(String methodName, EncodingEnum enc) throws IOException {
|
||||
Bundle vss = loadResourceFromClasspath(Bundle.class, "/org/hl7/fhir/instance/model/dstu21/valueset/valuesets.xml");
|
||||
Bundle vss = loadResourceFromClasspath(Bundle.class, "/org/hl7/fhir/instance/model/dstu3/valueset/valuesets.xml");
|
||||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-status"));
|
||||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-category"));
|
||||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-codes"));
|
||||
|
@ -70,7 +70,7 @@ public class FhirResourceDaoDstu21ValidateTest extends BaseJpaDstu21Test {
|
|||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "referencerange-meaning"));
|
||||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-relationshiptypes"));
|
||||
|
||||
StructureDefinition sd = loadResourceFromClasspath(StructureDefinition.class, "/org/hl7/fhir/instance/model/dstu21/profile/devicemetricobservation.profile.xml");
|
||||
StructureDefinition sd = loadResourceFromClasspath(StructureDefinition.class, "/org/hl7/fhir/instance/model/dstu3/profile/devicemetricobservation.profile.xml");
|
||||
sd.setId(new IdType());
|
||||
sd.setUrl("http://example.com/foo/bar/" + methodName);
|
||||
myStructureDefinitionDao.create(sd);
|
||||
|
@ -246,7 +246,7 @@ public class FhirResourceDaoDstu21ValidateTest extends BaseJpaDstu21Test {
|
|||
|
||||
@Test
|
||||
public void testValidateNewQuestionnaireFormat() throws Exception {
|
||||
String input =IOUtils.toString(FhirResourceDaoDstu21ValidateTest.class.getResourceAsStream("/questionnaire_dstu21.xml"));
|
||||
String input =IOUtils.toString(FhirResourceDaoDstu3ValidateTest.class.getResourceAsStream("/questionnaire_dstu3.xml"));
|
||||
try {
|
||||
MethodOutcome results = myQuestionnaireDao.validate(null, null, input, EncodingEnum.XML, ValidationModeEnum.UPDATE, null);
|
||||
OperationOutcome oo = (OperationOutcome) results.getOperationOutcome();
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
@ -10,13 +10,13 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.CodeType;
|
||||
import org.hl7.fhir.dstu21.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu21.model.UriType;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.CodeType;
|
||||
import org.hl7.fhir.dstu3.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.UriType;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
|
@ -25,9 +25,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult;
|
||||
|
||||
public class FhirResourceDaoValueSetDstu21Test extends BaseJpaDstu21Test {
|
||||
public class FhirResourceDaoValueSetDstu3Test extends BaseJpaDstu3Test {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoValueSetDstu21Test.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoValueSetDstu3Test.class);
|
||||
|
||||
private IIdType myExtensionalVsId;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
import static org.hamcrest.Matchers.empty;
|
||||
|
@ -6,8 +6,8 @@ import static org.junit.Assert.assertThat;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Organization;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Organization;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
@ -18,7 +18,7 @@ import ca.uhn.fhir.rest.param.StringOrListParam;
|
|||
import ca.uhn.fhir.rest.param.StringParam;
|
||||
import ca.uhn.fhir.rest.server.Constants;
|
||||
|
||||
public class FhirSearchDaoDstu21Test extends BaseJpaDstu21Test {
|
||||
public class FhirSearchDaoDstu3Test extends BaseJpaDstu3Test {
|
||||
|
||||
@Autowired
|
||||
private ISearchDao mySearchDao;
|
|
@ -1,8 +1,8 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class FhirSystemDaoDstu21SearchTest extends BaseJpaDstu21SystemTest {
|
||||
public class FhirSystemDaoDstu3SearchTest extends BaseJpaDstu3SystemTest {
|
||||
|
||||
@Test
|
||||
public void testSearchByParans() {
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.dao.dstu21;
|
||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.emptyString;
|
||||
|
@ -24,24 +24,24 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryRequestComponent;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryResponseComponent;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Medication;
|
||||
import org.hl7.fhir.dstu21.model.MedicationOrder;
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Reference;
|
||||
import org.hl7.fhir.dstu21.model.UriType;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Medication;
|
||||
import org.hl7.fhir.dstu3.model.MedicationOrder;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Reference;
|
||||
import org.hl7.fhir.dstu3.model.UriType;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Test;
|
||||
|
@ -65,9 +65,9 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException;
|
|||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
||||
|
||||
public class FhirSystemDaoDstu21Test extends BaseJpaDstu21SystemTest {
|
||||
public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirSystemDaoDstu21Test.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirSystemDaoDstu3Test.class);
|
||||
|
||||
@Test
|
||||
public void testReindexing() {
|
||||
|
@ -480,7 +480,7 @@ public class FhirSystemDaoDstu21Test extends BaseJpaDstu21SystemTest {
|
|||
|
||||
@Test
|
||||
public void testTransactionCreateWithPutUsingUrl2() throws Exception {
|
||||
String req = IOUtils.toString(FhirSystemDaoDstu21Test.class.getResourceAsStream("/bundle-dstu21.xml"));
|
||||
String req = IOUtils.toString(FhirSystemDaoDstu3Test.class.getResourceAsStream("/bundle-dstu3.xml"));
|
||||
Bundle request = myFhirCtx.newXmlParser().parseResource(Bundle.class, req);
|
||||
mySystemDao.transaction(myRequestDetails, request);
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package ca.uhn.fhir.jpa.provider.dstu21;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import ca.uhn.fhir.jpa.provider.JpaResourceProviderDstu21;
|
||||
|
||||
public class QuestionnaireResourceProviderDstu21 extends JpaResourceProviderDstu21<Questionnaire> {
|
||||
|
||||
@Override
|
||||
public Class<? extends IBaseResource> getResourceType() {
|
||||
return Questionnaire.class;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.provider.dstu21;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
|
@ -12,10 +12,10 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
|||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
|
@ -27,11 +27,10 @@ import org.springframework.web.context.support.GenericWebApplicationContext;
|
|||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
import org.springframework.web.servlet.DispatcherServlet;
|
||||
|
||||
import ca.uhn.fhir.jpa.config.WebsocketDstu21Config;
|
||||
import ca.uhn.fhir.jpa.dao.dstu21.BaseJpaDstu21Test;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu21;
|
||||
import ca.uhn.fhir.jpa.config.dstu3.WebsocketDstu3Config;
|
||||
import ca.uhn.fhir.jpa.dao.dstu3.BaseJpaDstu3Test;
|
||||
import ca.uhn.fhir.jpa.testutil.RandomServerPortProvider;
|
||||
import ca.uhn.fhir.jpa.validation.JpaValidationSupportChainDstu21;
|
||||
import ca.uhn.fhir.jpa.validation.JpaValidationSupportChainDstu3;
|
||||
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
|
||||
import ca.uhn.fhir.rest.client.IGenericClient;
|
||||
import ca.uhn.fhir.rest.client.ServerValidationModeEnum;
|
||||
|
@ -39,7 +38,7 @@ import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
|
|||
import ca.uhn.fhir.rest.server.FifoMemoryPagingProvider;
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
|
||||
public abstract class BaseResourceProviderDstu21Test extends BaseJpaDstu21Test {
|
||||
public abstract class BaseResourceProviderDstu3Test extends BaseJpaDstu3Test {
|
||||
|
||||
protected static IGenericClient ourClient;
|
||||
protected static CloseableHttpClient ourHttpClient;
|
||||
|
@ -47,9 +46,9 @@ public abstract class BaseResourceProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
private static Server ourServer;
|
||||
protected static String ourServerBase;
|
||||
protected static RestfulServer ourRestServer;
|
||||
private static JpaValidationSupportChainDstu21 myValidationSupport;
|
||||
private static JpaValidationSupportChainDstu3 myValidationSupport;
|
||||
|
||||
public BaseResourceProviderDstu21Test() {
|
||||
public BaseResourceProviderDstu3Test() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -98,7 +97,7 @@ public abstract class BaseResourceProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
|
||||
ourRestServer.setPlainProviders(mySystemProvider);
|
||||
|
||||
JpaConformanceProviderDstu21 confProvider = new JpaConformanceProviderDstu21(ourRestServer, mySystemDao, myDaoConfig);
|
||||
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(ourRestServer, mySystemDao, myDaoConfig);
|
||||
confProvider.setImplementationDescription("THIS IS THE DESC");
|
||||
ourRestServer.setServerConformanceProvider(confProvider);
|
||||
|
||||
|
@ -126,7 +125,7 @@ public abstract class BaseResourceProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
dispatcherServlet.setContextClass(AnnotationConfigWebApplicationContext.class);
|
||||
ServletHolder subsServletHolder = new ServletHolder();
|
||||
subsServletHolder.setServlet(dispatcherServlet);
|
||||
subsServletHolder.setInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, WebsocketDstu21Config.class.getName());
|
||||
subsServletHolder.setInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, WebsocketDstu3Config.class.getName());
|
||||
proxyHandler.addServlet(subsServletHolder, "/*");
|
||||
|
||||
|
||||
|
@ -134,7 +133,7 @@ public abstract class BaseResourceProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
server.start();
|
||||
|
||||
WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(subsServletHolder.getServlet().getServletConfig().getServletContext());
|
||||
myValidationSupport = wac.getBean(JpaValidationSupportChainDstu21.class);
|
||||
myValidationSupport = wac.getBean(JpaValidationSupportChainDstu3.class);
|
||||
|
||||
ourClient = myFhirCtx.newRestfulGenericClient(ourServerBase);
|
||||
ourClient.registerInterceptor(new LoggingInterceptor(true));
|
|
@ -0,0 +1,13 @@
|
|||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
public class QuestionnaireResourceProviderDstu3 extends JpaResourceProviderDstu3<Questionnaire> {
|
||||
|
||||
@Override
|
||||
public Class<? extends IBaseResource> getResourceType() {
|
||||
return Questionnaire.class;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.provider.dstu21;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
|
@ -38,52 +38,52 @@ import org.apache.http.client.methods.HttpPost;
|
|||
import org.apache.http.client.methods.HttpPut;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.hl7.fhir.dstu21.model.BaseResource;
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.SearchEntryMode;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.Condition;
|
||||
import org.hl7.fhir.dstu21.model.DateTimeType;
|
||||
import org.hl7.fhir.dstu21.model.DateType;
|
||||
import org.hl7.fhir.dstu21.model.Device;
|
||||
import org.hl7.fhir.dstu21.model.DiagnosticOrder;
|
||||
import org.hl7.fhir.dstu21.model.DocumentManifest;
|
||||
import org.hl7.fhir.dstu21.model.DocumentReference;
|
||||
import org.hl7.fhir.dstu21.model.DomainResource;
|
||||
import org.hl7.fhir.dstu21.model.Encounter;
|
||||
import org.hl7.fhir.dstu21.model.Encounter.EncounterClass;
|
||||
import org.hl7.fhir.dstu21.model.Encounter.EncounterLocationComponent;
|
||||
import org.hl7.fhir.dstu21.model.Encounter.EncounterState;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.AdministrativeGender;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.ImagingStudy;
|
||||
import org.hl7.fhir.dstu21.model.InstantType;
|
||||
import org.hl7.fhir.dstu21.model.Location;
|
||||
import org.hl7.fhir.dstu21.model.Medication;
|
||||
import org.hl7.fhir.dstu21.model.MedicationOrder;
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu21.model.Narrative.NarrativeStatus;
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.Organization;
|
||||
import org.hl7.fhir.dstu21.model.Parameters;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Period;
|
||||
import org.hl7.fhir.dstu21.model.Practitioner;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire.QuestionnaireItemType;
|
||||
import org.hl7.fhir.dstu21.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu21.model.Reference;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu21.model.Subscription;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.dstu21.model.TemporalPrecisionEnum;
|
||||
import org.hl7.fhir.dstu21.model.UnsignedIntType;
|
||||
import org.hl7.fhir.dstu21.model.UriType;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.BaseResource;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.Condition;
|
||||
import org.hl7.fhir.dstu3.model.DateTimeType;
|
||||
import org.hl7.fhir.dstu3.model.DateType;
|
||||
import org.hl7.fhir.dstu3.model.Device;
|
||||
import org.hl7.fhir.dstu3.model.DiagnosticOrder;
|
||||
import org.hl7.fhir.dstu3.model.DocumentManifest;
|
||||
import org.hl7.fhir.dstu3.model.DocumentReference;
|
||||
import org.hl7.fhir.dstu3.model.DomainResource;
|
||||
import org.hl7.fhir.dstu3.model.Encounter;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.ImagingStudy;
|
||||
import org.hl7.fhir.dstu3.model.InstantType;
|
||||
import org.hl7.fhir.dstu3.model.Location;
|
||||
import org.hl7.fhir.dstu3.model.Medication;
|
||||
import org.hl7.fhir.dstu3.model.MedicationOrder;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.Organization;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Period;
|
||||
import org.hl7.fhir.dstu3.model.Practitioner;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu3.model.Reference;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription;
|
||||
import org.hl7.fhir.dstu3.model.TemporalPrecisionEnum;
|
||||
import org.hl7.fhir.dstu3.model.UnsignedIntType;
|
||||
import org.hl7.fhir.dstu3.model.UriType;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode;
|
||||
import org.hl7.fhir.dstu3.model.Encounter.EncounterClass;
|
||||
import org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent;
|
||||
import org.hl7.fhir.dstu3.model.Encounter.EncounterState;
|
||||
import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender;
|
||||
import org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Ignore;
|
||||
|
@ -105,9 +105,9 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException;
|
|||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
import ca.uhn.fhir.util.UrlUtil;
|
||||
|
||||
public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
||||
public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceProviderDstu21Test.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceProviderDstu3Test.class);
|
||||
|
||||
@Override
|
||||
public void before() throws Exception {
|
||||
|
@ -187,7 +187,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
public void testBundleCreate() throws Exception {
|
||||
IGenericClient client = ourClient;
|
||||
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu21Test.class.getResource("/document-father.json"));
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu3Test.class.getResource("/document-father.json"));
|
||||
IIdType id = client.create().resource(resBody).execute().getId();
|
||||
|
||||
ourLog.info("Created: {}", id);
|
||||
|
@ -201,7 +201,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
public void testBundleCreateWithTypeTransaction() throws Exception {
|
||||
IGenericClient client = ourClient;
|
||||
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu21Test.class.getResource("/document-father.json"));
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu3Test.class.getResource("/document-father.json"));
|
||||
resBody = resBody.replace("\"type\": \"document\"", "\"type\": \"transaction\"");
|
||||
try {
|
||||
client.create().resource(resBody).execute().getId();
|
||||
|
@ -772,7 +772,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
|
||||
int initialSize = client.search().forResource(DocumentManifest.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu21Test.class.getResource("/documentmanifest.json"));
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu3Test.class.getResource("/documentmanifest.json"));
|
||||
client.create().resource(resBody).execute();
|
||||
|
||||
int newSize = client.search().forResource(DocumentManifest.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
@ -790,7 +790,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
|
||||
int initialSize = client.search().forResource(DocumentReference.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu21Test.class.getResource("/documentreference.json"));
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu3Test.class.getResource("/documentreference.json"));
|
||||
client.create().resource(resBody).execute();
|
||||
|
||||
int newSize = client.search().forResource(DocumentReference.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
@ -929,7 +929,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
@Test
|
||||
public void testEverythingPatientDoesntRepeatPatient() throws Exception {
|
||||
Bundle b;
|
||||
b = myFhirCtx.newJsonParser().parseResource(Bundle.class, new InputStreamReader(ResourceProviderDstu21Test.class.getResourceAsStream("/bug147-bundle.json")));
|
||||
b = myFhirCtx.newJsonParser().parseResource(Bundle.class, new InputStreamReader(ResourceProviderDstu3Test.class.getResourceAsStream("/bug147-bundle.json")));
|
||||
|
||||
Bundle resp = ourClient.transaction().withBundle(b).execute();
|
||||
List<IdType> ids = new ArrayList<IdType>();
|
||||
|
@ -1271,7 +1271,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
|
||||
int initialSize = client.search().forResource(ImagingStudy.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu21Test.class.getResource("/imagingstudy.json"));
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu3Test.class.getResource("/imagingstudy.json"));
|
||||
client.create().resource(resBody).execute();
|
||||
|
||||
int newSize = client.search().forResource(ImagingStudy.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
@ -2337,7 +2337,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
@Test
|
||||
public void testValueSetExpandOperation() throws IOException {
|
||||
|
||||
ValueSet upload = myFhirCtx.newXmlParser().parseResource(ValueSet.class, new InputStreamReader(ResourceProviderDstu21Test.class.getResourceAsStream("/extensional-case-2.1.xml")));
|
||||
ValueSet upload = myFhirCtx.newXmlParser().parseResource(ValueSet.class, new InputStreamReader(ResourceProviderDstu3Test.class.getResourceAsStream("/extensional-case-2.1.xml")));
|
||||
IIdType vsid = ourClient.create().resource(upload).execute().getId().toUnqualifiedVersionless();
|
||||
|
||||
HttpGet get = new HttpGet(ourServerBase + "/ValueSet/" + vsid.getIdPart() + "/$expand");
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.provider.dstu21;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
@ -9,13 +9,13 @@ import static org.junit.Assert.fail;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.BooleanType;
|
||||
import org.hl7.fhir.dstu21.model.CodeType;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.Parameters;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu21.model.UriType;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu3.model.BooleanType;
|
||||
import org.hl7.fhir.dstu3.model.CodeType;
|
||||
import org.hl7.fhir.dstu3.model.Coding;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.UriType;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -24,9 +24,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
|
||||
public class ResourceProviderDstu21ValueSetTest extends BaseResourceProviderDstu21Test {
|
||||
public class ResourceProviderDstu3ValueSetTest extends BaseResourceProviderDstu3Test {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceProviderDstu21ValueSetTest.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceProviderDstu3ValueSetTest.class);
|
||||
private IIdType myExtensionalVsId;
|
||||
|
||||
@Before
|
|
@ -1,15 +1,15 @@
|
|||
package ca.uhn.fhir.jpa.provider.dstu21;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.DecimalType;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire.QuestionnaireItemType;
|
||||
import org.hl7.fhir.dstu21.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu21.model.QuestionnaireResponse.QuestionnaireResponseStatus;
|
||||
import org.hl7.fhir.dstu3.model.DecimalType;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType;
|
||||
import org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
|
@ -22,9 +22,9 @@ import ca.uhn.fhir.rest.server.interceptor.ResponseValidatingInterceptor;
|
|||
import ca.uhn.fhir.validation.IValidatorModule;
|
||||
import ca.uhn.fhir.validation.ResultSeverityEnum;
|
||||
|
||||
public class ResourceProviderQuestionnaireResponseDstu21Test extends BaseResourceProviderDstu21Test {
|
||||
public class ResourceProviderQuestionnaireResponseDstu3Test extends BaseResourceProviderDstu3Test {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceProviderQuestionnaireResponseDstu21Test.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceProviderQuestionnaireResponseDstu3Test.class);
|
||||
private static RequestValidatingInterceptor ourValidatingInterceptor;
|
||||
|
||||
@Override
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.provider.dstu21;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
@ -14,25 +14,25 @@ import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage;
|
|||
import org.eclipse.jetty.websocket.api.annotations.WebSocket;
|
||||
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
|
||||
import org.eclipse.jetty.websocket.client.WebSocketClient;
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.Observation.ObservationStatus;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.Subscription;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu21.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
import org.hl7.fhir.dstu3.model.Subscription;
|
||||
import org.hl7.fhir.dstu3.model.Observation.ObservationStatus;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType;
|
||||
import org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu21;
|
||||
import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu3;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.rest.server.EncodingEnum;
|
||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
|
||||
public class SubscriptionsDstu21Test extends BaseResourceProviderDstu21Test {
|
||||
public class SubscriptionsDstu3Test extends BaseResourceProviderDstu3Test {
|
||||
|
||||
private static final String WEBSOCKET_PATH = "/websocket/dstu2.1";
|
||||
private static final String WEBSOCKET_PATH = "/websocket/dstu3";
|
||||
|
||||
public class BaseSocket {
|
||||
protected String myError;
|
||||
|
@ -42,7 +42,7 @@ public class SubscriptionsDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
|
||||
}
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SubscriptionsDstu21Test.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SubscriptionsDstu3Test.class);
|
||||
|
||||
@Before
|
||||
public void beforeEnableScheduling() {
|
||||
|
@ -53,7 +53,7 @@ public class SubscriptionsDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
public void beforeCreateInterceptor() {
|
||||
super.beforeCreateInterceptor();
|
||||
|
||||
SubscriptionsRequireManualActivationInterceptorDstu21 interceptor = new SubscriptionsRequireManualActivationInterceptorDstu21();
|
||||
SubscriptionsRequireManualActivationInterceptorDstu3 interceptor = new SubscriptionsRequireManualActivationInterceptorDstu3();
|
||||
interceptor.setDao(mySubscriptionDao);
|
||||
myDaoConfig.getInterceptors().add(interceptor);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package ca.uhn.fhir.jpa.provider.dstu21;
|
||||
package ca.uhn.fhir.jpa.provider.dstu3;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
@ -25,19 +25,19 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
|||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.FhirInstanceValidator;
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu21.model.DecimalType;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.AdministrativeGender;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.Observation;
|
||||
import org.hl7.fhir.dstu21.model.OperationDefinition;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu21.model.Parameters;
|
||||
import org.hl7.fhir.dstu21.model.Patient;
|
||||
import org.hl7.fhir.dstu21.model.StringType;
|
||||
import org.hl7.fhir.dstu3.hapi.validation.FhirInstanceValidator;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.DecimalType;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Observation;
|
||||
import org.hl7.fhir.dstu3.model.OperationDefinition;
|
||||
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.StringType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.HTTPVerb;
|
||||
import org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
|
@ -47,11 +47,11 @@ import org.springframework.transaction.annotation.Propagation;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.jpa.dao.dstu21.BaseJpaDstu21Test;
|
||||
import ca.uhn.fhir.jpa.dao.dstu3.BaseJpaDstu3Test;
|
||||
import ca.uhn.fhir.jpa.provider.SystemProviderDstu2Test;
|
||||
import ca.uhn.fhir.jpa.rp.dstu21.ObservationResourceProvider;
|
||||
import ca.uhn.fhir.jpa.rp.dstu21.OrganizationResourceProvider;
|
||||
import ca.uhn.fhir.jpa.rp.dstu21.PatientResourceProvider;
|
||||
import ca.uhn.fhir.jpa.rp.dstu3.ObservationResourceProvider;
|
||||
import ca.uhn.fhir.jpa.rp.dstu3.OrganizationResourceProvider;
|
||||
import ca.uhn.fhir.jpa.rp.dstu3.PatientResourceProvider;
|
||||
import ca.uhn.fhir.jpa.testutil.RandomServerPortProvider;
|
||||
import ca.uhn.fhir.rest.client.IGenericClient;
|
||||
import ca.uhn.fhir.rest.server.Constants;
|
||||
|
@ -63,13 +63,13 @@ import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
|
|||
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
|
||||
import ca.uhn.fhir.validation.ResultSeverityEnum;
|
||||
|
||||
public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
||||
public class SystemProviderDstu3Test extends BaseJpaDstu3Test {
|
||||
|
||||
private static RestfulServer myRestServer;
|
||||
private static IGenericClient ourClient;
|
||||
private static FhirContext ourCtx;
|
||||
private static CloseableHttpClient ourHttpClient;
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SystemProviderDstu21Test.class);
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SystemProviderDstu3Test.class);
|
||||
private static Server ourServer;
|
||||
private static String ourServerBase;
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
PatientResourceProvider patientRp = new PatientResourceProvider();
|
||||
patientRp.setDao(myPatientDao);
|
||||
|
||||
QuestionnaireResourceProviderDstu21 questionnaireRp = new QuestionnaireResourceProviderDstu21();
|
||||
QuestionnaireResourceProviderDstu3 questionnaireRp = new QuestionnaireResourceProviderDstu3();
|
||||
questionnaireRp.setDao(myQuestionnaireDao);
|
||||
|
||||
ObservationResourceProvider observationRp = new ObservationResourceProvider();
|
||||
|
@ -106,7 +106,7 @@ public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
servletHolder.setServlet(restServer);
|
||||
proxyHandler.addServlet(servletHolder, "/fhir/context/*");
|
||||
|
||||
ourCtx = FhirContext.forDstu2_1();
|
||||
ourCtx = FhirContext.forDstu3();
|
||||
restServer.setFhirContext(ourCtx);
|
||||
|
||||
ourServer.setHandler(proxyHandler);
|
||||
|
@ -344,7 +344,7 @@ public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
|
||||
@Test
|
||||
public void testTransactionFromBundle() throws Exception {
|
||||
InputStream bundleRes = SystemProviderDstu21Test.class.getResourceAsStream("/transaction_link_patient_eve.xml");
|
||||
InputStream bundleRes = SystemProviderDstu3Test.class.getResourceAsStream("/transaction_link_patient_eve.xml");
|
||||
String bundle = IOUtils.toString(bundleRes);
|
||||
String response = ourClient.transaction().withBundle(bundle).prettyPrint().execute();
|
||||
ourLog.info(response);
|
||||
|
@ -370,7 +370,7 @@ public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
@Test
|
||||
public void testTransactionFromBundle2() throws Exception {
|
||||
|
||||
InputStream bundleRes = SystemProviderDstu21Test.class.getResourceAsStream("/transaction_link_patient_eve_temp.xml");
|
||||
InputStream bundleRes = SystemProviderDstu3Test.class.getResourceAsStream("/transaction_link_patient_eve_temp.xml");
|
||||
String bundle = IOUtils.toString(bundleRes);
|
||||
String response = ourClient.transaction().withBundle(bundle).prettyPrint().execute();
|
||||
ourLog.info(response);
|
||||
|
@ -386,7 +386,7 @@ public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
* Same bundle!
|
||||
*/
|
||||
|
||||
bundleRes = SystemProviderDstu21Test.class.getResourceAsStream("/transaction_link_patient_eve_temp.xml");
|
||||
bundleRes = SystemProviderDstu3Test.class.getResourceAsStream("/transaction_link_patient_eve_temp.xml");
|
||||
bundle = IOUtils.toString(bundleRes);
|
||||
response = ourClient.transaction().withBundle(bundle).prettyPrint().execute();
|
||||
ourLog.info(response);
|
||||
|
@ -410,7 +410,7 @@ public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
// @Test
|
||||
public void testTransactionFromBundle3() throws Exception {
|
||||
|
||||
InputStream bundleRes = SystemProviderDstu21Test.class.getResourceAsStream("/grahame-transaction.xml");
|
||||
InputStream bundleRes = SystemProviderDstu3Test.class.getResourceAsStream("/grahame-transaction.xml");
|
||||
String bundle = IOUtils.toString(bundleRes);
|
||||
String response = ourClient.transaction().withBundle(bundle).prettyPrint().execute();
|
||||
ourLog.info(response);
|
||||
|
@ -418,7 +418,7 @@ public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
|
||||
@Test
|
||||
public void testTransactionFromBundle4() throws Exception {
|
||||
InputStream bundleRes = SystemProviderDstu21Test.class.getResourceAsStream("/simone_bundle.xml");
|
||||
InputStream bundleRes = SystemProviderDstu3Test.class.getResourceAsStream("/simone_bundle.xml");
|
||||
String bundle = IOUtils.toString(bundleRes);
|
||||
String response = ourClient.transaction().withBundle(bundle).prettyPrint().execute();
|
||||
ourLog.info(response);
|
||||
|
@ -433,7 +433,7 @@ public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
|
||||
@Test
|
||||
public void testTransactionFromBundle5() throws Exception {
|
||||
InputStream bundleRes = SystemProviderDstu21Test.class.getResourceAsStream("/simone_bundle2.xml");
|
||||
InputStream bundleRes = SystemProviderDstu3Test.class.getResourceAsStream("/simone_bundle2.xml");
|
||||
String bundle = IOUtils.toString(bundleRes);
|
||||
try {
|
||||
ourClient.transaction().withBundle(bundle).prettyPrint().execute();
|
||||
|
@ -447,7 +447,7 @@ public class SystemProviderDstu21Test extends BaseJpaDstu21Test {
|
|||
|
||||
@Test
|
||||
public void testTransactionFromBundle6() throws Exception {
|
||||
InputStream bundleRes = SystemProviderDstu21Test.class.getResourceAsStream("/simone_bundle3.xml");
|
||||
InputStream bundleRes = SystemProviderDstu3Test.class.getResourceAsStream("/simone_bundle3.xml");
|
||||
String bundle = IOUtils.toString(bundleRes);
|
||||
ourClient.transaction().withBundle(bundle).prettyPrint().execute();
|
||||
// try {
|
|
@ -15,23 +15,23 @@ import org.springframework.orm.jpa.JpaTransactionManager;
|
|||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
import ca.uhn.fhir.jpa.config.BaseJavaConfigDstu21;
|
||||
import ca.uhn.fhir.jpa.config.BaseJavaConfigDstu3;
|
||||
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu21;
|
||||
import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu3;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
||||
import ca.uhn.fhir.rest.server.interceptor.LoggingInterceptor;
|
||||
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
|
||||
|
||||
/**
|
||||
* This class isn't used by default by the example, but
|
||||
* you can use it as a config if you want to support DSTU2.1
|
||||
* you can use it as a config if you want to support DSTU3
|
||||
* instead of DSTU2 in your server.
|
||||
*
|
||||
* See https://github.com/jamesagnew/hapi-fhir/issues/278
|
||||
*/
|
||||
@Configuration
|
||||
@EnableTransactionManagement()
|
||||
public class FhirServerConfigDstu21 extends BaseJavaConfigDstu21 {
|
||||
public class FhirServerConfigDstu3 extends BaseJavaConfigDstu3 {
|
||||
|
||||
/**
|
||||
* Configure FHIR properties around the the JPA server via this bean
|
||||
|
@ -115,7 +115,7 @@ public class FhirServerConfigDstu21 extends BaseJavaConfigDstu21 {
|
|||
|
||||
@Bean(autowire = Autowire.BY_TYPE)
|
||||
public IServerInterceptor subscriptionSecurityInterceptor() {
|
||||
SubscriptionsRequireManualActivationInterceptorDstu21 retVal = new SubscriptionsRequireManualActivationInterceptorDstu21();
|
||||
SubscriptionsRequireManualActivationInterceptorDstu3 retVal = new SubscriptionsRequireManualActivationInterceptorDstu3();
|
||||
return retVal;
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Meta;
|
||||
import org.hl7.fhir.dstu3.model.Meta;
|
||||
import org.springframework.web.context.ContextLoaderListener;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
|
@ -15,10 +15,10 @@ import ca.uhn.fhir.jpa.dao.DaoConfig;
|
|||
import ca.uhn.fhir.jpa.dao.IFhirSystemDao;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu1;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu2;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu21;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu1;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu2;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu21;
|
||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaConformanceProviderDstu3;
|
||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.dstu2.composite.MetaDt;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Bundle;
|
||||
|
@ -63,8 +63,8 @@ public class JpaServerDemo extends RestfulServer {
|
|||
resourceProviderBeanName = "myResourceProvidersDstu1";
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU2) {
|
||||
resourceProviderBeanName = "myResourceProvidersDstu2";
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU2_1) {
|
||||
resourceProviderBeanName = "myResourceProvidersDstu21";
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU3) {
|
||||
resourceProviderBeanName = "myResourceProvidersDstu3";
|
||||
} else {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
@ -80,8 +80,8 @@ public class JpaServerDemo extends RestfulServer {
|
|||
systemProvider = myAppCtx.getBean("mySystemProviderDstu1", JpaSystemProviderDstu1.class);
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU2) {
|
||||
systemProvider = myAppCtx.getBean("mySystemProviderDstu2", JpaSystemProviderDstu2.class);
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU2_1) {
|
||||
systemProvider = myAppCtx.getBean("mySystemProviderDstu21", JpaSystemProviderDstu21.class);
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU3) {
|
||||
systemProvider = myAppCtx.getBean("mySystemProviderDstu3", JpaSystemProviderDstu3.class);
|
||||
} else {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
@ -104,10 +104,10 @@ public class JpaServerDemo extends RestfulServer {
|
|||
myAppCtx.getBean(DaoConfig.class));
|
||||
confProvider.setImplementationDescription("Example Server");
|
||||
setServerConformanceProvider(confProvider);
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU2_1) {
|
||||
IFhirSystemDao<org.hl7.fhir.dstu21.model.Bundle, Meta> systemDao = myAppCtx
|
||||
.getBean("mySystemDaoDstu21", IFhirSystemDao.class);
|
||||
JpaConformanceProviderDstu21 confProvider = new JpaConformanceProviderDstu21(this, systemDao,
|
||||
} else if (fhirVersion == FhirVersionEnum.DSTU3) {
|
||||
IFhirSystemDao<org.hl7.fhir.dstu3.model.Bundle, Meta> systemDao = myAppCtx
|
||||
.getBean("mySystemDaoDstu3", IFhirSystemDao.class);
|
||||
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(this, systemDao,
|
||||
myAppCtx.getBean(DaoConfig.class));
|
||||
confProvider.setImplementationDescription("Example Server");
|
||||
setServerConformanceProvider(confProvider);
|
||||
|
|
|
@ -36,6 +36,6 @@
|
|||
<classpathentry combineaccessrules="false" kind="src" path="/hapi-fhir-jpaserver-base"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/hapi-fhir-structures-dstu"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/hapi-fhir-structures-dstu2"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/hapi-fhir-structures-dstu2.1"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/hapi-fhir-structures-dstu3"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -14,16 +14,16 @@ import org.springframework.web.context.WebApplicationContext;
|
|||
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.jpa.config.WebsocketDstu21Config;
|
||||
import ca.uhn.fhir.jpa.config.WebsocketDstu2Config;
|
||||
import ca.uhn.fhir.jpa.config.dstu3.WebsocketDstu3Config;
|
||||
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirSystemDao;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu1;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu2;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu21;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu1;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu2;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu21;
|
||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaConformanceProviderDstu3;
|
||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3;
|
||||
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
|
||||
import ca.uhn.fhir.rest.server.ETagSupportEnum;
|
||||
import ca.uhn.fhir.rest.server.EncodingEnum;
|
||||
|
@ -33,7 +33,7 @@ import ca.uhn.fhir.rest.server.IResourceProvider;
|
|||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
||||
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
|
||||
import ca.uhn.fhirtest.config.TestDstu21Config;
|
||||
import ca.uhn.fhirtest.config.TestDstu3Config;
|
||||
import ca.uhn.fhirtest.config.TestDstu2Config;
|
||||
|
||||
public class TestRestfulServer extends RestfulServer {
|
||||
|
@ -65,7 +65,7 @@ public class TestRestfulServer extends RestfulServer {
|
|||
List<IResourceProvider> beans;
|
||||
JpaSystemProviderDstu1 systemProviderDstu1 = null;
|
||||
JpaSystemProviderDstu2 systemProviderDstu2 = null;
|
||||
JpaSystemProviderDstu21 systemProviderDstu21 = null;
|
||||
JpaSystemProviderDstu3 systemProviderDstu3 = null;
|
||||
@SuppressWarnings("rawtypes")
|
||||
IFhirSystemDao systemDao;
|
||||
ETagSupportEnum etagSupport;
|
||||
|
@ -105,21 +105,21 @@ public class TestRestfulServer extends RestfulServer {
|
|||
baseUrlProperty = "fhir.baseurl.dstu2";
|
||||
break;
|
||||
}
|
||||
case "DSTU21": {
|
||||
case "DSTU3": {
|
||||
myAppCtx = new AnnotationConfigWebApplicationContext();
|
||||
myAppCtx.setServletConfig(getServletConfig());
|
||||
myAppCtx.setParent(parentAppCtx);
|
||||
myAppCtx.register(TestDstu21Config.class, WebsocketDstu21Config.class);
|
||||
myAppCtx.register(TestDstu3Config.class, WebsocketDstu3Config.class);
|
||||
myAppCtx.refresh();
|
||||
setFhirContext(FhirContext.forDstu2_1());
|
||||
beans = myAppCtx.getBean("myResourceProvidersDstu21", List.class);
|
||||
systemProviderDstu21 = myAppCtx.getBean("mySystemProviderDstu21", JpaSystemProviderDstu21.class);
|
||||
systemDao = myAppCtx.getBean("mySystemDaoDstu21", IFhirSystemDao.class);
|
||||
setFhirContext(FhirContext.forDstu3());
|
||||
beans = myAppCtx.getBean("myResourceProvidersDstu3", List.class);
|
||||
systemProviderDstu3 = myAppCtx.getBean("mySystemProviderDstu3", JpaSystemProviderDstu3.class);
|
||||
systemDao = myAppCtx.getBean("mySystemDaoDstu3", IFhirSystemDao.class);
|
||||
etagSupport = ETagSupportEnum.ENABLED;
|
||||
JpaConformanceProviderDstu21 confProvider = new JpaConformanceProviderDstu21(this, systemDao, myAppCtx.getBean(DaoConfig.class));
|
||||
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(this, systemDao, myAppCtx.getBean(DaoConfig.class));
|
||||
confProvider.setImplementationDescription(implDesc);
|
||||
setServerConformanceProvider(confProvider);
|
||||
baseUrlProperty = "fhir.baseurl.dstu21";
|
||||
baseUrlProperty = "fhir.baseurl.dstu3";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -154,8 +154,8 @@ public class TestRestfulServer extends RestfulServer {
|
|||
if (systemProviderDstu2 != null) {
|
||||
provList.add(systemProviderDstu2);
|
||||
}
|
||||
if (systemProviderDstu21 != null) {
|
||||
provList.add(systemProviderDstu21);
|
||||
if (systemProviderDstu3 != null) {
|
||||
provList.add(systemProviderDstu3);
|
||||
}
|
||||
setPlainProviders(provList);
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ import org.springframework.orm.jpa.JpaTransactionManager;
|
|||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
import ca.uhn.fhir.jpa.config.BaseJavaConfigDstu21;
|
||||
import ca.uhn.fhir.jpa.config.BaseJavaConfigDstu3;
|
||||
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu21;
|
||||
import ca.uhn.fhir.jpa.util.SubscriptionsRequireManualActivationInterceptorDstu3;
|
||||
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
||||
import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
|
||||
|
@ -31,12 +31,12 @@ import ca.uhn.fhir.validation.ResultSeverityEnum;
|
|||
@Configuration
|
||||
@Import(CommonConfig.class)
|
||||
@EnableTransactionManagement()
|
||||
public class TestDstu21Config extends BaseJavaConfigDstu21 {
|
||||
public class TestDstu3Config extends BaseJavaConfigDstu3 {
|
||||
|
||||
@Value("${fhir.db.location.dstu21}")
|
||||
@Value("${fhir.db.location.dstu3}")
|
||||
private String myFhirDbLocation;
|
||||
|
||||
@Value("${fhir.lucene.location.dstu21}")
|
||||
@Value("${fhir.lucene.location.dstu3}")
|
||||
private String myFhirLuceneLocation;
|
||||
|
||||
@Bean()
|
||||
|
@ -49,7 +49,7 @@ public class TestDstu21Config extends BaseJavaConfigDstu21 {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
@Bean(name = "myPersistenceDataSourceDstu21", destroyMethod = "close")
|
||||
@Bean(name = "myPersistenceDataSourceDstu3", destroyMethod = "close")
|
||||
@DependsOn("dbServer")
|
||||
public DataSource dataSource() {
|
||||
BasicDataSource retVal = new BasicDataSource();
|
||||
|
@ -64,7 +64,7 @@ public class TestDstu21Config extends BaseJavaConfigDstu21 {
|
|||
@Bean()
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
|
||||
LocalContainerEntityManagerFactoryBean retVal = new LocalContainerEntityManagerFactoryBean();
|
||||
retVal.setPersistenceUnitName("PU_HapiFhirJpaDstu21");
|
||||
retVal.setPersistenceUnitName("PU_HapiFhirJpaDstu3");
|
||||
retVal.setDataSource(dataSource());
|
||||
retVal.setPackagesToScan("ca.uhn.fhir.jpa.entity");
|
||||
retVal.setPersistenceProvider(new HibernatePersistenceProvider());
|
||||
|
@ -97,8 +97,8 @@ public class TestDstu21Config extends BaseJavaConfigDstu21 {
|
|||
requestValidator.setFailOnSeverity(ResultSeverityEnum.ERROR);
|
||||
requestValidator.setAddResponseHeaderOnSeverity(null);
|
||||
requestValidator.setAddResponseOutcomeHeaderOnSeverity(ResultSeverityEnum.INFORMATION);
|
||||
requestValidator.addValidatorModule(questionnaireResponseValidatorDstu21());
|
||||
requestValidator.addValidatorModule(instanceValidatorDstu21());
|
||||
requestValidator.addValidatorModule(questionnaireResponseValidatorDstu3());
|
||||
requestValidator.addValidatorModule(instanceValidatorDstu3());
|
||||
|
||||
return requestValidator;
|
||||
}
|
||||
|
@ -123,14 +123,14 @@ public class TestDstu21Config extends BaseJavaConfigDstu21 {
|
|||
responseValidator.addExcludeOperationType(RestOperationTypeEnum.HISTORY_TYPE);
|
||||
responseValidator.addExcludeOperationType(RestOperationTypeEnum.SEARCH_SYSTEM);
|
||||
responseValidator.addExcludeOperationType(RestOperationTypeEnum.SEARCH_TYPE);
|
||||
responseValidator.addValidatorModule(questionnaireResponseValidatorDstu21());
|
||||
responseValidator.addValidatorModule(instanceValidatorDstu21());
|
||||
responseValidator.addValidatorModule(questionnaireResponseValidatorDstu3());
|
||||
responseValidator.addValidatorModule(instanceValidatorDstu3());
|
||||
return responseValidator;
|
||||
}
|
||||
|
||||
@Bean(autowire = Autowire.BY_TYPE)
|
||||
public IServerInterceptor subscriptionSecurityInterceptor() {
|
||||
return new SubscriptionsRequireManualActivationInterceptorDstu21();
|
||||
return new SubscriptionsRequireManualActivationInterceptorDstu3();
|
||||
}
|
||||
|
||||
@Bean()
|
|
@ -13,7 +13,7 @@
|
|||
<property name="servers">
|
||||
<list>
|
||||
<value>home_dev , DSTU2 , UHN/HAPI Server (DSTU2 FHIR) , http://fhirtest.uhn.ca/baseDstu2</value>
|
||||
<value>home_21 , DSTU2_1 , UHN/HAPI Server (DSTU2.1 FHIR) , http://fhirtest.uhn.ca/baseDstu2.1</value>
|
||||
<value>home_21 , DSTU3 , UHN/HAPI Server (DSTU3 FHIR) , http://fhirtest.uhn.ca/baseDstu3</value>
|
||||
<value>home , DSTU1 , UHN/HAPI Server (DSTU1 FHIR) , http://fhirtest.uhn.ca/baseDstu1</value>
|
||||
<value>hidev , DSTU2 , Health Intersections (DSTU2 FHIR) , http://fhir-dev.healthintersections.com.au/open</value>
|
||||
<value>hi , DSTU1 , Health Intersections (DSTU1 FHIR) , http://fhir.healthintersections.com.au/open</value>
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>fhirServletDstu21</servlet-name>
|
||||
<servlet-name>fhirServletDstu3</servlet-name>
|
||||
<servlet-class>ca.uhn.fhirtest.TestRestfulServer</servlet-class>
|
||||
<init-param>
|
||||
<param-name>ImplementationDescription</param-name>
|
||||
|
@ -106,7 +106,7 @@
|
|||
</init-param>
|
||||
<init-param>
|
||||
<param-name>FhirVersion</param-name>
|
||||
<param-value>DSTU21</param-value>
|
||||
<param-value>DSTU3</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
@ -127,9 +127,13 @@
|
|||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>fhirServletDstu21</servlet-name>
|
||||
<servlet-name>fhirServletDstu3</servlet-name>
|
||||
<url-pattern>/baseDstu2.1/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>fhirServletDstu3</servlet-name>
|
||||
<url-pattern>/baseDstu3/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>fhirServletDstu2</servlet-name>
|
||||
|
|
|
@ -25,12 +25,12 @@ public class UhnFhirTestApp {
|
|||
// new File("target/testdb").mkdirs();
|
||||
System.setProperty("fhir.db.location", "./target/testdb");
|
||||
System.setProperty("fhir.db.location.dstu2", "./target/testdb_dstu2");
|
||||
System.setProperty("fhir.db.location.dstu21", "./target/testdb_dstu21");
|
||||
System.setProperty("fhir.db.location.dstu3", "./target/testdb_dstu3");
|
||||
System.setProperty("fhir.lucene.location.dstu2", "./target/testlucene_dstu2");
|
||||
System.setProperty("fhir.lucene.location.dstu21", "./target/testlucene_dstu21");
|
||||
System.setProperty("fhir.lucene.location.dstu3", "./target/testlucene_dstu3");
|
||||
System.setProperty("fhir.baseurl.dstu1", base.replace("Dstu2", "Dstu1"));
|
||||
System.setProperty("fhir.baseurl.dstu2", base);
|
||||
System.setProperty("fhir.baseurl.dstu21", base.replace("Dstu2", "Dstu21"));
|
||||
System.setProperty("fhir.baseurl.dstu3", base.replace("Dstu2", "Dstu3"));
|
||||
|
||||
Server server = new Server(myPort);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-structures-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-structures-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -48,7 +48,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu2.1</artifactId>
|
||||
<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
|
@ -100,8 +100,8 @@
|
|||
<fileset dir="../hapi-fhir-structures-dstu2/src/main/java" />
|
||||
<fileset dir="../hapi-fhir-structures-dstu2/target/generated-sources/tinder" />
|
||||
<fileset dir="../hapi-fhir-structures-hl7org-dstu2/src/main/java" />
|
||||
<fileset dir="../hapi-fhir-structures-dstu2.1/src/main/java" />
|
||||
<!--<fileset dir="../hapi-fhir-structures-dstu2.1/target/generated-sources/tinder" /> -->
|
||||
<fileset dir="../hapi-fhir-structures-dstu3/src/main/java" />
|
||||
<!--<fileset dir="../hapi-fhir-structures-dstu3/target/generated-sources/tinder" /> -->
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
|
@ -219,12 +219,12 @@
|
|||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>../hapi-fhir-structures-dstu2.1/src/main/resources</directory>
|
||||
<directory>../hapi-fhir-structures-dstu3/src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<!--
|
||||
<resource>
|
||||
<directory>../hapi-fhir-structures-dstu2.1/target/generated-resources/tinder</directory>
|
||||
<directory>../hapi-fhir-structures-dstu3/target/generated-resources/tinder</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
-->
|
||||
|
@ -233,7 +233,7 @@
|
|||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>../hapi-fhir-validation-resources-dstu2.1/src/main/resources</directory>
|
||||
<directory>../hapi-fhir-validation-resources-dstu3/src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
|
|
|
@ -37,10 +37,10 @@ public class FhirContextDstu1Test {
|
|||
public void testUnknownVersion() {
|
||||
|
||||
try {
|
||||
Class.forName("org.hl7.fhir.dstu21.model.Patient");
|
||||
Class.forName("org.hl7.fhir.dstu3.model.Patient");
|
||||
|
||||
/*
|
||||
* If we found this class, DSTU2.1 structures are on the classpath so we're probably doing
|
||||
* If we found this class, DSTU3 structures are on the classpath so we're probably doing
|
||||
* the cobertura tests.. This one won't work since all structures are on the classpath for
|
||||
* cobertura tests
|
||||
*/
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class AdditionalmaterialsEnumFactory implements EnumFactory<Additionalmaterials> {
|
||||
|
||||
public Additionalmaterials fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("xray".equals(codeString))
|
||||
return Additionalmaterials.XRAY;
|
||||
if ("image".equals(codeString))
|
||||
return Additionalmaterials.IMAGE;
|
||||
if ("email".equals(codeString))
|
||||
return Additionalmaterials.EMAIL;
|
||||
if ("model".equals(codeString))
|
||||
return Additionalmaterials.MODEL;
|
||||
if ("document".equals(codeString))
|
||||
return Additionalmaterials.DOCUMENT;
|
||||
if ("other".equals(codeString))
|
||||
return Additionalmaterials.OTHER;
|
||||
throw new IllegalArgumentException("Unknown Additionalmaterials code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(Additionalmaterials code) {
|
||||
if (code == Additionalmaterials.XRAY)
|
||||
return "xray";
|
||||
if (code == Additionalmaterials.IMAGE)
|
||||
return "image";
|
||||
if (code == Additionalmaterials.EMAIL)
|
||||
return "email";
|
||||
if (code == Additionalmaterials.MODEL)
|
||||
return "model";
|
||||
if (code == Additionalmaterials.DOCUMENT)
|
||||
return "document";
|
||||
if (code == Additionalmaterials.OTHER)
|
||||
return "other";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(Additionalmaterials code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class AdjudicationEnumFactory implements EnumFactory<Adjudication> {
|
||||
|
||||
public Adjudication fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("total".equals(codeString))
|
||||
return Adjudication.TOTAL;
|
||||
if ("copay".equals(codeString))
|
||||
return Adjudication.COPAY;
|
||||
if ("eligible".equals(codeString))
|
||||
return Adjudication.ELIGIBLE;
|
||||
if ("deductible".equals(codeString))
|
||||
return Adjudication.DEDUCTIBLE;
|
||||
if ("eligpercent".equals(codeString))
|
||||
return Adjudication.ELIGPERCENT;
|
||||
if ("tax".equals(codeString))
|
||||
return Adjudication.TAX;
|
||||
if ("benefit".equals(codeString))
|
||||
return Adjudication.BENEFIT;
|
||||
throw new IllegalArgumentException("Unknown Adjudication code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(Adjudication code) {
|
||||
if (code == Adjudication.TOTAL)
|
||||
return "total";
|
||||
if (code == Adjudication.COPAY)
|
||||
return "copay";
|
||||
if (code == Adjudication.ELIGIBLE)
|
||||
return "eligible";
|
||||
if (code == Adjudication.DEDUCTIBLE)
|
||||
return "deductible";
|
||||
if (code == Adjudication.ELIGPERCENT)
|
||||
return "eligpercent";
|
||||
if (code == Adjudication.TAX)
|
||||
return "tax";
|
||||
if (code == Adjudication.BENEFIT)
|
||||
return "benefit";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(Adjudication code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class AdjudicationErrorEnumFactory implements EnumFactory<AdjudicationError> {
|
||||
|
||||
public AdjudicationError fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("a001".equals(codeString))
|
||||
return AdjudicationError.A001;
|
||||
if ("a002".equals(codeString))
|
||||
return AdjudicationError.A002;
|
||||
throw new IllegalArgumentException("Unknown AdjudicationError code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(AdjudicationError code) {
|
||||
if (code == AdjudicationError.A001)
|
||||
return "a001";
|
||||
if (code == AdjudicationError.A002)
|
||||
return "a002";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(AdjudicationError code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class AdjudicationReasonEnumFactory implements EnumFactory<AdjudicationReason> {
|
||||
|
||||
public AdjudicationReason fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("ar001".equals(codeString))
|
||||
return AdjudicationReason.AR001;
|
||||
if ("ar002".equals(codeString))
|
||||
return AdjudicationReason.AR002;
|
||||
throw new IllegalArgumentException("Unknown AdjudicationReason code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(AdjudicationReason code) {
|
||||
if (code == AdjudicationReason.AR001)
|
||||
return "ar001";
|
||||
if (code == AdjudicationReason.AR002)
|
||||
return "ar002";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(AdjudicationReason code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class AnimalBreedsEnumFactory implements EnumFactory<AnimalBreeds> {
|
||||
|
||||
public AnimalBreeds fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("gsd".equals(codeString))
|
||||
return AnimalBreeds.GSD;
|
||||
if ("irt".equals(codeString))
|
||||
return AnimalBreeds.IRT;
|
||||
if ("tibmas".equals(codeString))
|
||||
return AnimalBreeds.TIBMAS;
|
||||
if ("gret".equals(codeString))
|
||||
return AnimalBreeds.GRET;
|
||||
throw new IllegalArgumentException("Unknown AnimalBreeds code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(AnimalBreeds code) {
|
||||
if (code == AnimalBreeds.GSD)
|
||||
return "gsd";
|
||||
if (code == AnimalBreeds.IRT)
|
||||
return "irt";
|
||||
if (code == AnimalBreeds.TIBMAS)
|
||||
return "tibmas";
|
||||
if (code == AnimalBreeds.GRET)
|
||||
return "gret";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(AnimalBreeds code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class AnimalGenderstatusEnumFactory implements EnumFactory<AnimalGenderstatus> {
|
||||
|
||||
public AnimalGenderstatus fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("neutered".equals(codeString))
|
||||
return AnimalGenderstatus.NEUTERED;
|
||||
if ("intact".equals(codeString))
|
||||
return AnimalGenderstatus.INTACT;
|
||||
if ("unknown".equals(codeString))
|
||||
return AnimalGenderstatus.UNKNOWN;
|
||||
throw new IllegalArgumentException("Unknown AnimalGenderstatus code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(AnimalGenderstatus code) {
|
||||
if (code == AnimalGenderstatus.NEUTERED)
|
||||
return "neutered";
|
||||
if (code == AnimalGenderstatus.INTACT)
|
||||
return "intact";
|
||||
if (code == AnimalGenderstatus.UNKNOWN)
|
||||
return "unknown";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(AnimalGenderstatus code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class AnimalSpeciesEnumFactory implements EnumFactory<AnimalSpecies> {
|
||||
|
||||
public AnimalSpecies fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("canislf".equals(codeString))
|
||||
return AnimalSpecies.CANISLF;
|
||||
if ("ovisa".equals(codeString))
|
||||
return AnimalSpecies.OVISA;
|
||||
if ("serinuscd".equals(codeString))
|
||||
return AnimalSpecies.SERINUSCD;
|
||||
throw new IllegalArgumentException("Unknown AnimalSpecies code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(AnimalSpecies code) {
|
||||
if (code == AnimalSpecies.CANISLF)
|
||||
return "canislf";
|
||||
if (code == AnimalSpecies.OVISA)
|
||||
return "ovisa";
|
||||
if (code == AnimalSpecies.SERINUSCD)
|
||||
return "serinuscd";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(AnimalSpecies code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class AuditSourceTypeEnumFactory implements EnumFactory<AuditSourceType> {
|
||||
|
||||
public AuditSourceType fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("1".equals(codeString))
|
||||
return AuditSourceType._1;
|
||||
if ("2".equals(codeString))
|
||||
return AuditSourceType._2;
|
||||
if ("3".equals(codeString))
|
||||
return AuditSourceType._3;
|
||||
if ("4".equals(codeString))
|
||||
return AuditSourceType._4;
|
||||
if ("5".equals(codeString))
|
||||
return AuditSourceType._5;
|
||||
if ("6".equals(codeString))
|
||||
return AuditSourceType._6;
|
||||
if ("7".equals(codeString))
|
||||
return AuditSourceType._7;
|
||||
if ("8".equals(codeString))
|
||||
return AuditSourceType._8;
|
||||
if ("9".equals(codeString))
|
||||
return AuditSourceType._9;
|
||||
throw new IllegalArgumentException("Unknown AuditSourceType code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(AuditSourceType code) {
|
||||
if (code == AuditSourceType._1)
|
||||
return "1";
|
||||
if (code == AuditSourceType._2)
|
||||
return "2";
|
||||
if (code == AuditSourceType._3)
|
||||
return "3";
|
||||
if (code == AuditSourceType._4)
|
||||
return "4";
|
||||
if (code == AuditSourceType._5)
|
||||
return "5";
|
||||
if (code == AuditSourceType._6)
|
||||
return "6";
|
||||
if (code == AuditSourceType._7)
|
||||
return "7";
|
||||
if (code == AuditSourceType._8)
|
||||
return "8";
|
||||
if (code == AuditSourceType._9)
|
||||
return "9";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(AuditSourceType code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class BenefitCategoryEnumFactory implements EnumFactory<BenefitCategory> {
|
||||
|
||||
public BenefitCategory fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("oral".equals(codeString))
|
||||
return BenefitCategory.ORAL;
|
||||
if ("vision".equals(codeString))
|
||||
return BenefitCategory.VISION;
|
||||
if ("medical".equals(codeString))
|
||||
return BenefitCategory.MEDICAL;
|
||||
if ("pharmacy".equals(codeString))
|
||||
return BenefitCategory.PHARMACY;
|
||||
throw new IllegalArgumentException("Unknown BenefitCategory code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(BenefitCategory code) {
|
||||
if (code == BenefitCategory.ORAL)
|
||||
return "oral";
|
||||
if (code == BenefitCategory.VISION)
|
||||
return "vision";
|
||||
if (code == BenefitCategory.MEDICAL)
|
||||
return "medical";
|
||||
if (code == BenefitCategory.PHARMACY)
|
||||
return "pharmacy";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(BenefitCategory code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class BenefitNetworkEnumFactory implements EnumFactory<BenefitNetwork> {
|
||||
|
||||
public BenefitNetwork fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("in".equals(codeString))
|
||||
return BenefitNetwork.IN;
|
||||
if ("out".equals(codeString))
|
||||
return BenefitNetwork.OUT;
|
||||
throw new IllegalArgumentException("Unknown BenefitNetwork code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(BenefitNetwork code) {
|
||||
if (code == BenefitNetwork.IN)
|
||||
return "in";
|
||||
if (code == BenefitNetwork.OUT)
|
||||
return "out";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(BenefitNetwork code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class BenefitTermEnumFactory implements EnumFactory<BenefitTerm> {
|
||||
|
||||
public BenefitTerm fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("annual".equals(codeString))
|
||||
return BenefitTerm.ANNUAL;
|
||||
if ("lifetime".equals(codeString))
|
||||
return BenefitTerm.LIFETIME;
|
||||
throw new IllegalArgumentException("Unknown BenefitTerm code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(BenefitTerm code) {
|
||||
if (code == BenefitTerm.ANNUAL)
|
||||
return "annual";
|
||||
if (code == BenefitTerm.LIFETIME)
|
||||
return "lifetime";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(BenefitTerm code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class BenefitTypeEnumFactory implements EnumFactory<BenefitType> {
|
||||
|
||||
public BenefitType fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("deductable".equals(codeString))
|
||||
return BenefitType.DEDUCTABLE;
|
||||
if ("visit".equals(codeString))
|
||||
return BenefitType.VISIT;
|
||||
if ("copay".equals(codeString))
|
||||
return BenefitType.COPAY;
|
||||
if ("vision-exam".equals(codeString))
|
||||
return BenefitType.VISIONEXAM;
|
||||
if ("vision-glasses".equals(codeString))
|
||||
return BenefitType.VISIONGLASSES;
|
||||
if ("vision-contacts".equals(codeString))
|
||||
return BenefitType.VISIONCONTACTS;
|
||||
if ("medical-primarycare".equals(codeString))
|
||||
return BenefitType.MEDICALPRIMARYCARE;
|
||||
if ("pharmacy-dispense".equals(codeString))
|
||||
return BenefitType.PHARMACYDISPENSE;
|
||||
throw new IllegalArgumentException("Unknown BenefitType code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(BenefitType code) {
|
||||
if (code == BenefitType.DEDUCTABLE)
|
||||
return "deductable";
|
||||
if (code == BenefitType.VISIT)
|
||||
return "visit";
|
||||
if (code == BenefitType.COPAY)
|
||||
return "copay";
|
||||
if (code == BenefitType.VISIONEXAM)
|
||||
return "vision-exam";
|
||||
if (code == BenefitType.VISIONGLASSES)
|
||||
return "vision-glasses";
|
||||
if (code == BenefitType.VISIONCONTACTS)
|
||||
return "vision-contacts";
|
||||
if (code == BenefitType.MEDICALPRIMARYCARE)
|
||||
return "medical-primarycare";
|
||||
if (code == BenefitType.PHARMACYDISPENSE)
|
||||
return "pharmacy-dispense";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(BenefitType code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class BenefitUnitEnumFactory implements EnumFactory<BenefitUnit> {
|
||||
|
||||
public BenefitUnit fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("individual".equals(codeString))
|
||||
return BenefitUnit.INDIVIDUAL;
|
||||
if ("family".equals(codeString))
|
||||
return BenefitUnit.FAMILY;
|
||||
throw new IllegalArgumentException("Unknown BenefitUnit code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(BenefitUnit code) {
|
||||
if (code == BenefitUnit.INDIVIDUAL)
|
||||
return "individual";
|
||||
if (code == BenefitUnit.FAMILY)
|
||||
return "family";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(BenefitUnit code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class CarePlanActivityCategoryEnumFactory implements EnumFactory<CarePlanActivityCategory> {
|
||||
|
||||
public CarePlanActivityCategory fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("diet".equals(codeString))
|
||||
return CarePlanActivityCategory.DIET;
|
||||
if ("drug".equals(codeString))
|
||||
return CarePlanActivityCategory.DRUG;
|
||||
if ("encounter".equals(codeString))
|
||||
return CarePlanActivityCategory.ENCOUNTER;
|
||||
if ("observation".equals(codeString))
|
||||
return CarePlanActivityCategory.OBSERVATION;
|
||||
if ("procedure".equals(codeString))
|
||||
return CarePlanActivityCategory.PROCEDURE;
|
||||
if ("supply".equals(codeString))
|
||||
return CarePlanActivityCategory.SUPPLY;
|
||||
if ("other".equals(codeString))
|
||||
return CarePlanActivityCategory.OTHER;
|
||||
throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(CarePlanActivityCategory code) {
|
||||
if (code == CarePlanActivityCategory.DIET)
|
||||
return "diet";
|
||||
if (code == CarePlanActivityCategory.DRUG)
|
||||
return "drug";
|
||||
if (code == CarePlanActivityCategory.ENCOUNTER)
|
||||
return "encounter";
|
||||
if (code == CarePlanActivityCategory.OBSERVATION)
|
||||
return "observation";
|
||||
if (code == CarePlanActivityCategory.PROCEDURE)
|
||||
return "procedure";
|
||||
if (code == CarePlanActivityCategory.SUPPLY)
|
||||
return "supply";
|
||||
if (code == CarePlanActivityCategory.OTHER)
|
||||
return "other";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(CarePlanActivityCategory code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class ChoiceListOrientationEnumFactory implements EnumFactory<ChoiceListOrientation> {
|
||||
|
||||
public ChoiceListOrientation fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("horizontal".equals(codeString))
|
||||
return ChoiceListOrientation.HORIZONTAL;
|
||||
if ("vertical".equals(codeString))
|
||||
return ChoiceListOrientation.VERTICAL;
|
||||
throw new IllegalArgumentException("Unknown ChoiceListOrientation code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(ChoiceListOrientation code) {
|
||||
if (code == ChoiceListOrientation.HORIZONTAL)
|
||||
return "horizontal";
|
||||
if (code == ChoiceListOrientation.VERTICAL)
|
||||
return "vertical";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(ChoiceListOrientation code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class ClaimExceptionEnumFactory implements EnumFactory<ClaimException> {
|
||||
|
||||
public ClaimException fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("student".equals(codeString))
|
||||
return ClaimException.STUDENT;
|
||||
if ("disabled".equals(codeString))
|
||||
return ClaimException.DISABLED;
|
||||
throw new IllegalArgumentException("Unknown ClaimException code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(ClaimException code) {
|
||||
if (code == ClaimException.STUDENT)
|
||||
return "student";
|
||||
if (code == ClaimException.DISABLED)
|
||||
return "disabled";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(ClaimException code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class ClaimModifiersEnumFactory implements EnumFactory<ClaimModifiers> {
|
||||
|
||||
public ClaimModifiers fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("A".equals(codeString))
|
||||
return ClaimModifiers.A;
|
||||
if ("B".equals(codeString))
|
||||
return ClaimModifiers.B;
|
||||
if ("C".equals(codeString))
|
||||
return ClaimModifiers.C;
|
||||
if ("E".equals(codeString))
|
||||
return ClaimModifiers.E;
|
||||
if ("X".equals(codeString))
|
||||
return ClaimModifiers.X;
|
||||
throw new IllegalArgumentException("Unknown ClaimModifiers code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(ClaimModifiers code) {
|
||||
if (code == ClaimModifiers.A)
|
||||
return "A";
|
||||
if (code == ClaimModifiers.B)
|
||||
return "B";
|
||||
if (code == ClaimModifiers.C)
|
||||
return "C";
|
||||
if (code == ClaimModifiers.E)
|
||||
return "E";
|
||||
if (code == ClaimModifiers.X)
|
||||
return "X";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(ClaimModifiers code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class ClassificationOrContextEnumFactory implements EnumFactory<ClassificationOrContext> {
|
||||
|
||||
public ClassificationOrContext fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("classification".equals(codeString))
|
||||
return ClassificationOrContext.CLASSIFICATION;
|
||||
if ("context".equals(codeString))
|
||||
return ClassificationOrContext.CONTEXT;
|
||||
throw new IllegalArgumentException("Unknown ClassificationOrContext code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(ClassificationOrContext code) {
|
||||
if (code == ClassificationOrContext.CLASSIFICATION)
|
||||
return "classification";
|
||||
if (code == ClassificationOrContext.CONTEXT)
|
||||
return "context";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(ClassificationOrContext code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class ConditionCategoryEnumFactory implements EnumFactory<ConditionCategory> {
|
||||
|
||||
public ConditionCategory fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("complaint".equals(codeString))
|
||||
return ConditionCategory.COMPLAINT;
|
||||
if ("symptom".equals(codeString))
|
||||
return ConditionCategory.SYMPTOM;
|
||||
if ("finding".equals(codeString))
|
||||
return ConditionCategory.FINDING;
|
||||
if ("diagnosis".equals(codeString))
|
||||
return ConditionCategory.DIAGNOSIS;
|
||||
throw new IllegalArgumentException("Unknown ConditionCategory code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(ConditionCategory code) {
|
||||
if (code == ConditionCategory.COMPLAINT)
|
||||
return "complaint";
|
||||
if (code == ConditionCategory.SYMPTOM)
|
||||
return "symptom";
|
||||
if (code == ConditionCategory.FINDING)
|
||||
return "finding";
|
||||
if (code == ConditionCategory.DIAGNOSIS)
|
||||
return "diagnosis";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(ConditionCategory code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class ConditionClinicalEnumFactory implements EnumFactory<ConditionClinical> {
|
||||
|
||||
public ConditionClinical fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("active".equals(codeString))
|
||||
return ConditionClinical.ACTIVE;
|
||||
if ("relapse".equals(codeString))
|
||||
return ConditionClinical.RELAPSE;
|
||||
if ("remission".equals(codeString))
|
||||
return ConditionClinical.REMISSION;
|
||||
if ("resolved".equals(codeString))
|
||||
return ConditionClinical.RESOLVED;
|
||||
throw new IllegalArgumentException("Unknown ConditionClinical code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(ConditionClinical code) {
|
||||
if (code == ConditionClinical.ACTIVE)
|
||||
return "active";
|
||||
if (code == ConditionClinical.RELAPSE)
|
||||
return "relapse";
|
||||
if (code == ConditionClinical.REMISSION)
|
||||
return "remission";
|
||||
if (code == ConditionClinical.RESOLVED)
|
||||
return "resolved";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(ConditionClinical code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package org.hl7.fhir.dstu21.model.valuesets;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.dstu21.model.EnumFactory;
|
||||
|
||||
public class ConditionStateEnumFactory implements EnumFactory<ConditionState> {
|
||||
|
||||
public ConditionState fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("active".equals(codeString))
|
||||
return ConditionState.ACTIVE;
|
||||
if ("inactive".equals(codeString))
|
||||
return ConditionState.INACTIVE;
|
||||
if ("resolved".equals(codeString))
|
||||
return ConditionState.RESOLVED;
|
||||
throw new IllegalArgumentException("Unknown ConditionState code '"+codeString+"'");
|
||||
}
|
||||
|
||||
public String toCode(ConditionState code) {
|
||||
if (code == ConditionState.ACTIVE)
|
||||
return "active";
|
||||
if (code == ConditionState.INACTIVE)
|
||||
return "inactive";
|
||||
if (code == ConditionState.RESOLVED)
|
||||
return "resolved";
|
||||
return "?";
|
||||
}
|
||||
|
||||
public String toSystem(ConditionState code) {
|
||||
return code.getSystem();
|
||||
}
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue