本文整理汇总了Java中ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy类的典型用法代码示例。如果您正苦于以下问题:Java HardcodedServerAddressStrategy类的具体用法?Java HardcodedServerAddressStrategy怎么用?Java HardcodedServerAddressStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HardcodedServerAddressStrategy类属于ca.uhn.fhir.rest.server包,在下文中一共展示了HardcodedServerAddressStrategy类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MyServlet
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy; //导入依赖的package包/类
/**
* Constructor
*/
public MyServlet() {
String serverBaseUrl = "http://foo.com/fhir";
setServerAddressStrategy(new HardcodedServerAddressStrategy(serverBaseUrl));
// ...add some resource providers, etc...
List<IResourceProvider> resourceProviders = new ArrayList<IResourceProvider>();
setResourceProviders(resourceProviders);
}
示例2: initialize
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy; //导入依赖的package包/类
@Override
protected void initialize() throws ServletException {
super.initialize();
setFhirContext(this.fhirContext);
setResourceProviders(this.resourceProviders);
setPagingProvider(this.pagingProvider);
setInterceptors(this.interceptors);
setServerAddressStrategy(new HardcodedServerAddressStrategy(this.properties.getServer().getPath()));
customize();
}
示例3: initialize
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void initialize() throws ServletException {
super.initialize();
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
FhirVersionEnum fhirVersion = FhirVersionEnum.DSTU3;
setFhirContext(new FhirContext(fhirVersion));
// Get the spring context from the web container (it's declared in web.xml)
myAppCtx = ContextLoaderListener.getCurrentWebApplicationContext();
if (serverBase != null && !serverBase.isEmpty()) {
setServerAddressStrategy(new HardcodedServerAddressStrategy(serverBase));
}
setResourceProviders(Arrays.asList(
myAppCtx.getBean(PatientResourceProvider.class)
,myAppCtx.getBean(OrganisationResourceProvider.class)
,myAppCtx.getBean(PractitionerResourceProvider.class)
,myAppCtx.getBean(LocationResourceProvider.class)
,myAppCtx.getBean(PractitionerRoleResourceProvider.class)
,myAppCtx.getBean(ObservationResourceProvider.class) // Sprint 4 addition KGM
,myAppCtx.getBean(EncounterResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(ConditionResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(ProcedureResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(AllergyIntoleranceResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(MedicationRequestResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(MedicationStatementResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(ImmunizationResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(BundleResourceProvider.class) // Bunlde upload mock
// ,myAppCtx.getBean(EpisodeOfCareResourceProvider.class) // TO DO Remove me for live KGM
));
// Replace built in conformance provider (CapabilityStatement)
setServerConformanceProvider(new CareConnectConformanceProvider( ));
setServerName(serverName);
setServerVersion(serverVersion);
// This is the format for each line. A number of substitution variables may
// be used here. See the JavaDoc for LoggingInterceptor for information on
// what is available.
ServerInterceptor gatewayInterceptor = new ServerInterceptor(log);
registerInterceptor(gatewayInterceptor);
//gatewayInterceptor.setLoggerName("ccri.FHIRGateway");
//gatewayInterceptor.setLogger(ourLog);
// This paging provider is not robust KGM 24/11/2017
// Mocking of a database Paging Provider is in server
FifoMemoryPagingProvider pp = new FifoMemoryPagingProvider(10);
pp.setDefaultPageSize(10);
pp.setMaximumPageSize(100);
setPagingProvider(pp);
setDefaultPrettyPrint(true);
setDefaultResponseEncoding(EncodingEnum.JSON);
FhirContext ctx = getFhirContext();
// Remove as believe due to issues on docker ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());
}
示例4: initialize
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void initialize() throws ServletException {
super.initialize();
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
// Get the spring context from the web container (it's declared in web.xml)
myAppCtx = ContextLoaderListener.getCurrentWebApplicationContext();
AutowireCapableBeanFactory autowireCapableBeanFactory = myAppCtx.getAutowireCapableBeanFactory();
autowireCapableBeanFactory.autowireBean(this);
ourLog.info("REST Servlet initialised with config: " + toString());
/*
* We want to support FHIR DSTU2 format. This means that the server
* will use the DSTU2 bundle format and other DSTU2 encoding changes.
*
* If you want to use DSTU1 instead, change the following line, and change the 2 occurrences of dstu2 in web.xml to dstu1
*/
if (serverBase != null && !serverBase.isEmpty()) {
setServerAddressStrategy(new HardcodedServerAddressStrategy(serverBase));
}
FhirVersionEnum fhirVersion = FhirVersionEnum.DSTU3;
setFhirContext(new FhirContext(fhirVersion));
/*
* The BaseJavaConfigDstu2.java class is a spring configuration
* file which is automatically generated as a part of hapi-fhir-jpaserver-base and
* contains bean definitions for a resource provider for each resource type
*/
setResourceProviders(Arrays.asList(
myAppCtx.getBean(PatientProvider.class),
myAppCtx.getBean(OrganizationProvider.class),
myAppCtx.getBean(PractitionerProvider.class),
myAppCtx.getBean(LocationProvider.class),
myAppCtx.getBean(ValueSetProvider.class),
myAppCtx.getBean(StructureDefinitionProvider.class),
myAppCtx.getBean(CodeSystemProvider.class),
myAppCtx.getBean(ObservationProvider.class),
myAppCtx.getBean(PractitionerRoleProvider.class)
,myAppCtx.getBean(EncounterProvider.class)
,myAppCtx.getBean(EpisodeOfCareProvider.class)
,myAppCtx.getBean(AllergyIntoleranceProvider.class)
,myAppCtx.getBean(ConditionProvider.class)
,myAppCtx.getBean(ProcedureProvider.class)
,myAppCtx.getBean(ImmunizationProvider.class)
,myAppCtx.getBean(MedicationRequestProvider.class)
,myAppCtx.getBean(MedicationStatementProvider.class)
// Basic implementation of reporting resources
,myAppCtx.getBean(CompositionProvider.class)
,myAppCtx.getBean(DocumentReferenceProvider.class)
,myAppCtx.getBean(DiagnosticReportProvider.class)
,myAppCtx.getBean(CarePlanProvider.class)
));
// Replace built in conformance provider (CapabilityStatement)
setServerConformanceProvider(new CareConnectServerConformanceProvider());
ServerInterceptor loggingInterceptor = new ServerInterceptor(ourLog);
registerInterceptor(loggingInterceptor);
// KGM 24/11/2017
// Mocked for exploration only setPagingProvider(myAppCtx.getBean(DatabaseBackedPagingProvider.class));
// not fully tested registerProvider(myAppCtx.getBean(TerminologyUploaderProvider.class));
setDefaultPrettyPrint(true);
setDefaultResponseEncoding(EncodingEnum.JSON);
ctx = getFhirContext();
// Remove as believe due to issues on docker ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());
}
示例5: initialize
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void initialize() throws ServletException {
super.initialize();
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
FhirVersionEnum fhirVersion = FhirVersionEnum.DSTU3;
setFhirContext(new FhirContext(fhirVersion));
// Get the spring context from the web container (it's declared in web.xml)
myAppCtx = ContextLoaderListener.getCurrentWebApplicationContext();
if (serverBase != null && !serverBase.isEmpty()) {
setServerAddressStrategy(new HardcodedServerAddressStrategy(serverBase));
}
setResourceProviders(Arrays.asList(
myAppCtx.getBean(PatientResourceProvider.class)
,myAppCtx.getBean(OrganisationResourceProvider.class)
,myAppCtx.getBean(PractitionerResourceProvider.class)
,myAppCtx.getBean(LocationResourceProvider.class)
,myAppCtx.getBean(PractitionerRoleResourceProvider.class)
,myAppCtx.getBean(ObservationResourceProvider.class) // Sprint 4 addition KGM
,myAppCtx.getBean(EncounterResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(ConditionResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(ProcedureResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(AllergyIntoleranceResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(MedicationRequestResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(MedicationStatementResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(ImmunizationResourceProvider.class) // R3 addition KGM
,myAppCtx.getBean(EpisodeOfCareResourceProvider.class) // TO DO Remove me for live KGM
));
// Replace built in conformance provider (CapabilityStatement)
setServerConformanceProvider(new CareConnectConformanceProvider(oauth2authorize
,oauth2token
,oauth2register));
setServerName(serverName);
setServerVersion(serverVersion);
// This is the format for each line. A number of substitution variables may
// be used here. See the JavaDoc for LoggingInterceptor for information on
// what is available.
ServerInterceptor gatewayInterceptor = new ServerInterceptor(ourLog);
registerInterceptor(new OAuth2Interceptor()); // Add OAuth2 Security Filter
registerInterceptor(gatewayInterceptor);
//gatewayInterceptor.setLoggerName("ccri.FHIRGateway");
//gatewayInterceptor.setLogger(ourLog);
setDefaultPrettyPrint(true);
setDefaultResponseEncoding(EncodingEnum.JSON);
FhirContext ctx = getFhirContext();
// Remove as believe due to issues on docker ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());
}