当前位置: 首页>>代码示例>>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;未经允许,请勿转载。