Update the examples
This commit is contained in:
@@ -1,18 +1,5 @@
|
|||||||
|
|
||||||
package ca.uhn.fhir.jpa.demo;
|
package ca.uhn.fhir.jpa.demo;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
|
|
||||||
import org.hl7.fhir.dstu3.model.Bundle;
|
|
||||||
import org.hl7.fhir.dstu3.model.Meta;
|
|
||||||
import org.springframework.web.context.ContextLoaderListener;
|
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||||
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
||||||
@@ -21,12 +8,25 @@ import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu2;
|
|||||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu2;
|
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu2;
|
||||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaConformanceProviderDstu3;
|
import ca.uhn.fhir.jpa.provider.dstu3.JpaConformanceProviderDstu3;
|
||||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3;
|
import ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3;
|
||||||
|
import ca.uhn.fhir.jpa.provider.dstu3.TerminologyUploaderProviderDstu3;
|
||||||
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
|
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
|
||||||
|
import ca.uhn.fhir.jpa.subscription.resthook.SubscriptionRestHookInterceptor;
|
||||||
import ca.uhn.fhir.model.dstu2.composite.MetaDt;
|
import ca.uhn.fhir.model.dstu2.composite.MetaDt;
|
||||||
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
|
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
|
||||||
import ca.uhn.fhir.rest.api.EncodingEnum;
|
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||||
import ca.uhn.fhir.rest.server.*;
|
import ca.uhn.fhir.rest.server.ETagSupportEnum;
|
||||||
|
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy;
|
||||||
|
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.IServerInterceptor;
|
||||||
|
import org.hl7.fhir.dstu3.model.Bundle;
|
||||||
|
import org.hl7.fhir.dstu3.model.Meta;
|
||||||
|
import org.springframework.web.context.ContextLoaderListener;
|
||||||
|
import org.springframework.web.context.WebApplicationContext;
|
||||||
|
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class JpaServerDemo extends RestfulServer {
|
public class JpaServerDemo extends RestfulServer {
|
||||||
|
|
||||||
@@ -142,7 +142,9 @@ public class JpaServerDemo extends RestfulServer {
|
|||||||
* this doesn't always work. If you are setting links in your search bundles that
|
* this doesn't always work. If you are setting links in your search bundles that
|
||||||
* just refer to "localhost", you might want to use a server address strategy:
|
* just refer to "localhost", you might want to use a server address strategy:
|
||||||
*/
|
*/
|
||||||
//setServerAddressStrategy(new HardcodedServerAddressStrategy("http://mydomain.com/fhir/baseDstu2"));
|
if (false) { // <-- DISABLED RIGHT NOW
|
||||||
|
setServerAddressStrategy(new HardcodedServerAddressStrategy("http://mydomain.com/fhir/baseDstu3"));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If you are using DSTU3+, you may want to add a terminology uploader, which allows
|
* If you are using DSTU3+, you may want to add a terminology uploader, which allows
|
||||||
@@ -151,9 +153,21 @@ public class JpaServerDemo extends RestfulServer {
|
|||||||
* so it is a potential security vulnerability. Consider using an AuthorizationInterceptor
|
* so it is a potential security vulnerability. Consider using an AuthorizationInterceptor
|
||||||
* with this feature.
|
* with this feature.
|
||||||
*/
|
*/
|
||||||
//if (fhirVersion == FhirVersionEnum.DSTU3) {
|
if (false) { // <-- DISABLED RIGHT NOW
|
||||||
// registerProvider(myAppCtx.getBean(TerminologyUploaderProviderDstu3.class));
|
if (fhirVersion == FhirVersionEnum.DSTU3) {
|
||||||
//}
|
registerProvider(myAppCtx.getBean(TerminologyUploaderProviderDstu3.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If you want to support subscriptions, you will want to register interceptors for
|
||||||
|
* any type of subscriptions you want to support.
|
||||||
|
*/
|
||||||
|
if (false) { // <-- DISABLED RIGHT NOW
|
||||||
|
SubscriptionRestHookInterceptor restHookInterceptor = myAppCtx.getBean(SubscriptionRestHookInterceptor.class);
|
||||||
|
registerInterceptor(restHookInterceptor);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user