本文整理匯總了Java中ca.uhn.example.provider.PatientResourceProvider類的典型用法代碼示例。如果您正苦於以下問題:Java PatientResourceProvider類的具體用法?Java PatientResourceProvider怎麽用?Java PatientResourceProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PatientResourceProvider類屬於ca.uhn.example.provider包,在下文中一共展示了PatientResourceProvider類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initialize
import ca.uhn.example.provider.PatientResourceProvider; //導入依賴的package包/類
/**
* This method is called automatically when the
* servlet is initializing.
*/
@Override
public void initialize() {
/*
* Two resource providers are defined. Each one handles a specific
* type of resource.
*/
List<IResourceProvider> providers = new ArrayList<IResourceProvider>();
providers.add(new PatientResourceProvider());
providers.add(new OrganizationResourceProvider());
setResourceProviders(providers);
/*
* Use a narrative generator. This is a completely optional step,
* but can be useful as it causes HAPI to generate narratives for
* resources which don't otherwise have one.
*/
INarrativeGenerator narrativeGen = new DefaultThymeleafNarrativeGenerator();
getFhirContext().setNarrativeGenerator(narrativeGen);
/*
* Use nice coloured HTML when a browser is used to request the content
*/
registerInterceptor(new ResponseHighlighterInterceptor());
}
示例2: initialize
import ca.uhn.example.provider.PatientResourceProvider; //導入依賴的package包/類
/**
* This method is called automatically when the
* servlet is initializing.
*/
@Override
public void initialize() {
/*
* Two resource providers are defined. Each one handles a specific
* type of resource.
*/
List<IResourceProvider> providers = new ArrayList<IResourceProvider>();
providers.add(new PatientResourceProvider());
providers.add(new OrganizationResourceProvider());
setResourceProviders(providers);
/*
* Use a narrative generator. This is a completely optional step,
* but can be useful as it causes HAPI to generate narratives for
* resources which don't otherwise have one.
*/
INarrativeGenerator narrativeGen = new DefaultThymeleafNarrativeGenerator();
getFhirContext().setNarrativeGenerator(narrativeGen);
/*
* Tells HAPI to use content types which are not technically FHIR compliant when a browser is detected as the
* requesting client. This prevents browsers from trying to download resource responses instead of displaying them
* inline which can be handy for troubleshooting.
*/
setUseBrowserFriendlyContentTypes(true);
}
示例3: initialize
import ca.uhn.example.provider.PatientResourceProvider; //導入依賴的package包/類
/**
* This method is called automatically when the
* servlet is initializing.
*/
@Override
public void initialize() {
/*
* Two resource providers are defined. Each one handles a specific
* type of resource.
*/
List<IResourceProvider> providers = new ArrayList<IResourceProvider>();
providers.add(new PatientResourceProvider());
providers.add(new OrganizationResourceProvider());
setResourceProviders(providers);
/*
* Use a narrative generator. This is a completely optional step,
* but can be useful as it causes HAPI to generate narratives for
* resources which don't otherwise have one.
*/
INarrativeGenerator narrativeGen = new DefaultThymeleafNarrativeGenerator();
getFhirContext().setNarrativeGenerator(narrativeGen);
/*
* Enable CORS
*/
CorsConfiguration config = new CorsConfiguration();
CorsInterceptor corsInterceptor = new CorsInterceptor(config);
config.addAllowedHeader("Accept");
config.addAllowedHeader("Content-Type");
config.addAllowedOrigin("*");
config.addExposedHeader("Location");
config.addExposedHeader("Content-Location");
config.setAllowedMethods(Arrays.asList("GET","POST","PUT","DELETE","OPTIONS"));
registerInterceptor(corsInterceptor);
/*
* This server interceptor causes the server to return nicely
* formatter and coloured responses instead of plain JSON/XML if
* the request is coming from a browser window. It is optional,
* but can be nice for testing.
*/
registerInterceptor(new ResponseHighlighterInterceptor());
/*
* Tells the server to return pretty-printed responses by default
*/
setDefaultPrettyPrint(true);
}