當前位置: 首頁>>代碼示例>>Java>>正文


Java MyOrganization類代碼示例

本文整理匯總了Java中ca.uhn.example.model.MyOrganization的典型用法代碼示例。如果您正苦於以下問題:Java MyOrganization類的具體用法?Java MyOrganization怎麽用?Java MyOrganization使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MyOrganization類屬於ca.uhn.example.model包,在下文中一共展示了MyOrganization類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getResourceById

import ca.uhn.example.model.MyOrganization; //導入依賴的package包/類
/**
 * The "@Read" annotation indicates that this method supports the read operation. It takes one argument, the Resource type being returned.
 * 
 * @param theId
 *            The read operation takes one parameter, which must be of type IdDt and must be annotated with the "@Read.IdParam" annotation.
 * @return Returns a resource matching this identifier, or null if none exists.
 */
@Read()
public MyOrganization getResourceById(@IdParam IdType theId) {
	
	/*
	 * We only support one organization, so the follwing
	 * exception causes an HTTP 404 response if the 
	 * ID of "1" isn't used.
	 */
	if (!"1".equals(theId.getValue())) {
		throw new ResourceNotFoundException(theId);
	}
	
	MyOrganization retVal = new MyOrganization();
	retVal.setId("1");
	retVal.addIdentifier().setSystem("urn:example:orgs").setValue("FooOrganization");
	retVal.addAddress().addLine("123 Fake Street").setCity("Toronto");
	retVal.addTelecom().setUse(ContactPointUse.WORK).setValue("1-888-123-4567");
	
	// Populate the first, primitive extension
	retVal.setBillingCode(new CodeType("00102-1"));
	
	// The second extension is repeatable and takes a block type
	MyOrganization.EmergencyContact contact = new MyOrganization.EmergencyContact();
	contact.setActive(new BooleanType(true));
	contact.setContact(new ContactPoint());
	retVal.getEmergencyContact().add(contact);
	
	return retVal;
}
 
開發者ID:furore-fhir,項目名稱:fhirstarters,代碼行數:37,代碼來源:OrganizationResourceProvider.java

示例2: getResourceById

import ca.uhn.example.model.MyOrganization; //導入依賴的package包/類
/**
 * The "@Read" annotation indicates that this method supports the read operation. It takes one argument, the Resource type being returned.
 * 
 * @param theId
 *            The read operation takes one parameter, which must be of type IdDt and must be annotated with the "@Read.IdParam" annotation.
 * @return Returns a resource matching this identifier, or null if none exists.
 */
@Read()
public MyOrganization getResourceById(@IdParam IdDt theId) {
	
	/*
	 * We only support one organization, so the follwing
	 * exception causes an HTTP 404 response if the 
	 * ID of "1" isn't used.
	 */
	if (!"1".equals(theId.getValue())) {
		throw new ResourceNotFoundException(theId);
	}
	
	MyOrganization retVal = new MyOrganization();
	retVal.setId("1");
	retVal.addIdentifier("urn:example:orgs", "FooOrganization");
	retVal.addAddress().addLine("123 Fake Street").setCity("Toronto");
	retVal.addTelecom().setUse(ContactUseEnum.WORK).setValue("1-888-123-4567");
	
	// Populate the first, primitive extension
	retVal.setBillingCode(new CodeDt("00102-1"));
	
	// The second extension is repeatable and takes a block type
	MyOrganization.EmergencyContact contact = new MyOrganization.EmergencyContact();
	contact.setActive(new BooleanDt(true));
	contact.setContact(new ContactDt());
	retVal.getEmergencyContact().add(contact);
	
	return retVal;
}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:37,代碼來源:OrganizationResourceProvider.java

示例3: getResourceById

import ca.uhn.example.model.MyOrganization; //導入依賴的package包/類
/**
 * The "@Read" annotation indicates that this method supports the read operation. It takes one argument, the Resource type being returned.
 * 
 * @param theId
 *            The read operation takes one parameter, which must be of type IdDt and must be annotated with the "@Read.IdParam" annotation.
 * @return Returns a resource matching this identifier, or null if none exists.
 */
@Read()
public MyOrganization getResourceById(@IdParam IdDt theId) {
	
	/*
	 * We only support one organization, so the follwing
	 * exception causes an HTTP 404 response if the 
	 * ID of "1" isn't used.
	 */
	if (!"1".equals(theId.getValue())) {
		throw new ResourceNotFoundException(theId);
	}
	
	MyOrganization retVal = new MyOrganization();
	retVal.setId("1");
	retVal.addIdentifier().setSystem("urn:example:orgs").setValue("FooOrganization");
	retVal.addAddress().addLine("123 Fake Street").setCity("Toronto");
	retVal.addTelecom().setUse(ContactPointUseEnum.WORK).setValue("1-888-123-4567");
	
	// Populate the first, primitive extension
	retVal.setBillingCode(new CodeDt("00102-1"));
	
	// The second extension is repeatable and takes a block type
	MyOrganization.EmergencyContact contact = new MyOrganization.EmergencyContact();
	contact.setActive(new BooleanDt(true));
	contact.setContact(new ContactPointDt());
	retVal.getEmergencyContact().add(contact);
	
	return retVal;
}
 
開發者ID:jamesagnew,項目名稱:hapi-fhir,代碼行數:37,代碼來源:OrganizationResourceProvider.java

示例4: getResourceType

import ca.uhn.example.model.MyOrganization; //導入依賴的package包/類
/**
 * The getResourceType method comes from IResourceProvider, and must be overridden to indicate what type of resource this provider supplies.
 */
@Override
public Class<MyOrganization> getResourceType() {
	return MyOrganization.class;
}
 
開發者ID:furore-fhir,項目名稱:fhirstarters,代碼行數:8,代碼來源:OrganizationResourceProvider.java


注:本文中的ca.uhn.example.model.MyOrganization類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。