當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。