当前位置: 首页>>代码示例>>Java>>正文


Java PatientResourceProvider类代码示例

本文整理汇总了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());
	
}
 
开发者ID:furore-fhir,项目名称:fhirstarters,代码行数:30,代码来源:ExampleRestfulServlet.java

示例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);
	
}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:33,代码来源:ExampleRestfulServlet.java

示例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);
	
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:51,代码来源:ExampleRestfulServlet.java


注:本文中的ca.uhn.example.provider.PatientResourceProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。