Unit tests all passing

This commit is contained in:
James Agnew 2015-05-02 14:04:43 -07:00
parent aa2f2cee96
commit ae81ad29f6
42 changed files with 9127 additions and 1336 deletions

View File

@ -37,8 +37,8 @@ public abstract class BaseRuntimeElementCompositeDefinition<T extends IBase> ext
private List<BaseRuntimeChildDefinition> myChildrenAndExtensions;
private Map<String, BaseRuntimeChildDefinition> myNameToChild = new HashMap<String, BaseRuntimeChildDefinition>();
public BaseRuntimeElementCompositeDefinition(String theName, Class<? extends T> theImplementingClass) {
super(theName, theImplementingClass);
public BaseRuntimeElementCompositeDefinition(String theName, Class<? extends T> theImplementingClass, boolean theStandardType) {
super(theName, theImplementingClass, theStandardType);
}
public void addChild(BaseRuntimeChildDefinition theNext) {

View File

@ -35,27 +35,34 @@ import ca.uhn.fhir.model.api.IValueSetEnumBinder;
public abstract class BaseRuntimeElementDefinition<T extends IBase> {
private String myName;
private Class<? extends T> myImplementingClass;
private final String myName;
private final Class<? extends T> myImplementingClass;
private List<RuntimeChildDeclaredExtensionDefinition> myExtensions = new ArrayList<RuntimeChildDeclaredExtensionDefinition>();
private Map<String, RuntimeChildDeclaredExtensionDefinition> myUrlToExtension = new HashMap<String, RuntimeChildDeclaredExtensionDefinition>();
private List<RuntimeChildDeclaredExtensionDefinition> myExtensionsModifier = new ArrayList<RuntimeChildDeclaredExtensionDefinition>();
private List<RuntimeChildDeclaredExtensionDefinition> myExtensionsNonModifier = new ArrayList<RuntimeChildDeclaredExtensionDefinition>();
private final boolean myStandardType;
public BaseRuntimeElementDefinition(String theName, Class<? extends T> theImplementingClass) {
public BaseRuntimeElementDefinition(String theName, Class<? extends T> theImplementingClass, boolean theStandardType) {
assert StringUtils.isNotBlank(theName);
assert theImplementingClass != null;
myName = theName;
String name = theName;
// TODO: remove this and fix for the model
if (myName.endsWith("Dt")) {
myName = myName.substring(0, myName.length() - 2);
if (name.endsWith("Dt")) {
name = name.substring(0, name.length() - 2);
}
myName = name;
myStandardType = theStandardType;
myImplementingClass = theImplementingClass;
}
public boolean isStandardType() {
return myStandardType;
}
@Override
public String toString() {
return getClass().getSimpleName()+"[" + getName() + "]";

View File

@ -84,7 +84,6 @@ public class FhirContext {
private volatile IRestfulClientFactory myRestfulClientFactory;
private volatile RuntimeChildUndeclaredExtensionDefinition myRuntimeChildUndeclaredExtensionDefinition;
private final IFhirVersion myVersion;
private Map<FhirVersionEnum, Map<String, Class<? extends IBaseResource>>> myVersionToNameToResourceType = Collections.emptyMap();
/**

View File

@ -102,6 +102,7 @@ class ModelScanner {
private Set<Class<? extends ICodeEnum>> myScanAlsoCodeTable = new HashSet<Class<? extends ICodeEnum>>();
private FhirVersionEnum myVersion;
private Map<String, BaseRuntimeElementDefinition<?>> myNameToElementDefinitions = new HashMap<String, BaseRuntimeElementDefinition<?>>();
private Set<Class<? extends IBase>> myVersionTypes;
ModelScanner(FhirContext theContext, FhirVersionEnum theVersion, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theExistingDefinitions, Collection<Class<? extends IElement>> theResourceTypes) throws ConfigurationException {
myContext = theContext;
@ -182,7 +183,7 @@ class ModelScanner {
long start = System.currentTimeMillis();
Map<String, Class<? extends IBaseResource>> resourceTypes = myNameToResourceType;
scanVersionPropertyFile(theDatatypes, resourceTypes, myVersion);
myVersionTypes = scanVersionPropertyFile(theDatatypes, resourceTypes, myVersion);
// toScan.add(DateDt.class);
// toScan.add(CodeDt.class);
@ -323,7 +324,7 @@ class ModelScanner {
throw new ConfigurationException("Block type @" + Block.class.getSimpleName() + " annotation contains no name: " + theClass.getCanonicalName());
}
RuntimeResourceBlockDefinition resourceDef = new RuntimeResourceBlockDefinition(resourceName, theClass);
RuntimeResourceBlockDefinition resourceDef = new RuntimeResourceBlockDefinition(resourceName, theClass, isStandardType(theClass));
myClassToElementDefinitions.put(theClass, resourceDef);
scanCompositeElementForChildren(theClass, resourceDef);
@ -334,15 +335,19 @@ class ModelScanner {
RuntimeCompositeDatatypeDefinition resourceDef;
if (theClass.equals(ExtensionDt.class)) {
resourceDef = new RuntimeExtensionDtDefinition(theDatatypeDefinition, theClass);
resourceDef = new RuntimeExtensionDtDefinition(theDatatypeDefinition, theClass, true);
} else {
resourceDef = new RuntimeCompositeDatatypeDefinition(theDatatypeDefinition, theClass);
resourceDef = new RuntimeCompositeDatatypeDefinition(theDatatypeDefinition, theClass, isStandardType(theClass));
}
myClassToElementDefinitions.put(theClass, resourceDef);
myNameToElementDefinitions.put(resourceDef.getName(), resourceDef);
scanCompositeElementForChildren(theClass, resourceDef);
}
private boolean isStandardType(Class<? extends IBase> theClass) {
return myVersionTypes.contains(theClass);
}
@SuppressWarnings("unchecked")
private void scanCompositeElementForChildren(Class<? extends IBase> theClass, BaseRuntimeElementCompositeDefinition<?> theDefinition) {
Set<String> elementNames = new HashSet<String>();
@ -650,15 +655,15 @@ class ModelScanner {
if (theClass.equals(XhtmlDt.class)) {
@SuppressWarnings("unchecked")
Class<XhtmlDt> clazz = (Class<XhtmlDt>) theClass;
resourceDef = new RuntimePrimitiveDatatypeNarrativeDefinition(resourceName, clazz);
resourceDef = new RuntimePrimitiveDatatypeNarrativeDefinition(resourceName, clazz, isStandardType(clazz));
} else if (IBaseXhtml.class.isAssignableFrom(theClass)) {
@SuppressWarnings("unchecked")
Class<? extends IBaseXhtml> clazz = (Class<? extends IBaseXhtml>) theClass;
resourceDef = new RuntimePrimitiveDatatypeXhtmlHl7OrgDefinition(resourceName, clazz);
resourceDef = new RuntimePrimitiveDatatypeXhtmlHl7OrgDefinition(resourceName, clazz, isStandardType(clazz));
} else if (IIdType.class.isAssignableFrom(theClass)) {
resourceDef = new RuntimeIdDatatypeDefinition(theDatatypeDefinition, theClass);
resourceDef = new RuntimeIdDatatypeDefinition(theDatatypeDefinition, theClass, isStandardType(theClass));
} else {
resourceDef = new RuntimePrimitiveDatatypeDefinition(theDatatypeDefinition, theClass);
resourceDef = new RuntimePrimitiveDatatypeDefinition(theDatatypeDefinition, theClass, isStandardType(theClass));
}
myClassToElementDefinitions.put(theClass, resourceDef);
myNameToElementDefinitions.put(resourceName, resourceDef);
@ -693,7 +698,7 @@ class ModelScanner {
}
}
RuntimeResourceDefinition resourceDef = new RuntimeResourceDefinition(myContext, resourceName, theClass, resourceDefinition);
RuntimeResourceDefinition resourceDef = new RuntimeResourceDefinition(myContext, resourceName, theClass, resourceDefinition, isStandardType(theClass));
myClassToElementDefinitions.put(theClass, resourceDef);
if (primaryNameProvider) {
if (resourceDef.getStructureVersion() == myVersion) {
@ -763,7 +768,9 @@ class ModelScanner {
return type;
}
static void scanVersionPropertyFile(Set<Class<? extends IBase>> theDatatypes, Map<String, Class<? extends IBaseResource>> theResourceTypes, FhirVersionEnum version) {
static Set<Class<? extends IBase>> scanVersionPropertyFile(Set<Class<? extends IBase>> theDatatypes, Map<String, Class<? extends IBaseResource>> theResourceTypes, FhirVersionEnum version) {
Set<Class<? extends IBase>> retVal = new HashSet<Class<? extends IBase>>();
InputStream str = version.getVersionImplementation().getFhirVersionPropertiesFile();
Properties prop = new Properties();
try {
@ -776,7 +783,11 @@ class ModelScanner {
if (theDatatypes != null) {
try {
// Datatypes
Class<?> dtType = Class.forName(nextValue);
@SuppressWarnings("unchecked")
Class<? extends IBase> dtType = (Class<? extends IBase>) Class.forName(nextValue);
retVal.add(dtType);
if (IElement.class.isAssignableFrom(dtType)) {
@SuppressWarnings("unchecked")
Class<? extends IElement> nextClass = (Class<? extends IElement>) dtType;
@ -816,6 +827,8 @@ class ModelScanner {
} catch (IOException e) {
throw new ConfigurationException("Failed to load model property file from classpath: " + "/ca/uhn/fhir/model/dstu/model.properties");
}
return retVal;
}
public Map<String, BaseRuntimeElementDefinition<?>> getNameToElementDefinitions() {

View File

@ -90,7 +90,7 @@ public class RuntimeChildChoiceDefinition extends BaseRuntimeDeclaredChildDefini
elementName = getElementName() + StringUtils.capitalize(next.getSimpleName());
List<Class<? extends IBaseResource>> types = new ArrayList<Class<? extends IBaseResource>>();
types.add((Class<? extends IBaseResource>) next);
nextDef = new RuntimeResourceReferenceDefinition(elementName, types);
nextDef = new RuntimeResourceReferenceDefinition(elementName, types, false);
nextDef.sealAndInitialize(theContext, theClassToElementDefinitions);
myNameToChildDefinition.put(getElementName() + "Reference", nextDef);

View File

@ -68,9 +68,9 @@ public class RuntimeChildContainedResources extends BaseRuntimeDeclaredChildDefi
if (BaseContainedDt.class.isAssignableFrom(actualType)) {
@SuppressWarnings("unchecked")
Class<? extends BaseContainedDt> type = (Class<? extends BaseContainedDt>) actualType;
myElem = new RuntimeElemContainedResources(type);
myElem = new RuntimeElemContainedResources(type, false);
} else if (List.class.isAssignableFrom(actualType)) {
myElem = new RuntimeElemContainedResourceList(IBaseResource.class);
myElem = new RuntimeElemContainedResourceList(IBaseResource.class, false);
} else {
throw new ConfigurationException("Fhir Version definition returned invalid contained type: " + actualType);
}

View File

@ -166,7 +166,7 @@ public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclared
myDatatypeChildName = "valueResource";
List<Class<? extends IBaseResource>> types = new ArrayList<Class<? extends IBaseResource>>();
types.add(IResource.class);
myChildDef = new RuntimeResourceReferenceDefinition("valueResource", types);
myChildDef = new RuntimeResourceReferenceDefinition("valueResource", types, false);
} else {
myChildDef = elementDef;
}

View File

@ -43,7 +43,7 @@ public class RuntimeChildDirectResource extends BaseRuntimeDeclaredChildDefiniti
@Override
public BaseRuntimeElementDefinition<?> getChildByName(String theName) {
return new RuntimeElementDirectResource();
return new RuntimeElementDirectResource(false);
}
@SuppressWarnings("unchecked")

View File

@ -86,7 +86,7 @@ public class RuntimeChildResourceDefinition extends BaseRuntimeDeclaredChildDefi
@Override
void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
myRuntimeDef = new RuntimeResourceReferenceDefinition(getElementName(), myResourceTypes);
myRuntimeDef = new RuntimeResourceReferenceDefinition(getElementName(), myResourceTypes, false);
myRuntimeDef.sealAndInitialize(theContext, theClassToElementDefinitions);
myValidChildNames = new HashSet<String>();

View File

@ -118,6 +118,8 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
myDatatypeToAttributeName = new HashMap<Class<? extends IBase>, String>();
myDatatypeToDefinition = new HashMap<Class<? extends IBase>, BaseRuntimeElementDefinition<?>>();
// for (theContext.get)
for (BaseRuntimeElementDefinition<?> next : theClassToElementDefinitions.values()) {
if (next instanceof IRuntimeDatatypeDefinition) {
// if (next.getName().equals("CodeableConcept")) {
@ -127,6 +129,11 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
myDatatypeToDefinition.put(next.getImplementingClass(), next);
if (!((IRuntimeDatatypeDefinition) next).isSpecialization()) {
if (!next.isStandardType()) {
continue;
}
String qualifiedName = next.getImplementingClass().getName();
/*
@ -172,7 +179,7 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
private void addReferenceBinding(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions, String value) {
List<Class<? extends IBaseResource>> types = new ArrayList<Class<? extends IBaseResource>>();
types.add(IBaseResource.class);
RuntimeResourceReferenceDefinition def = new RuntimeResourceReferenceDefinition(value, types);
RuntimeResourceReferenceDefinition def = new RuntimeResourceReferenceDefinition(value, types, false);
def.sealAndInitialize(theContext, theClassToElementDefinitions);
myAttributeNameToDefinition.put(value, def);

View File

@ -31,8 +31,8 @@ public class RuntimeCompositeDatatypeDefinition extends BaseRuntimeElementCompos
private boolean mySpecialization;
public RuntimeCompositeDatatypeDefinition(DatatypeDef theDef, Class<? extends ICompositeType> theImplementingClass) {
super(theDef.name(), theImplementingClass);
public RuntimeCompositeDatatypeDefinition(DatatypeDef theDef, Class<? extends ICompositeType> theImplementingClass, boolean theStandardType) {
super(theDef.name(), theImplementingClass, theStandardType);
String resourceName = theDef.name();
if (isBlank(resourceName)) {

View File

@ -27,8 +27,8 @@ import org.hl7.fhir.instance.model.IBaseResource;
*/
public class RuntimeElemContainedResourceList extends BaseRuntimeElementDefinition<IBaseResource> {
public RuntimeElemContainedResourceList(Class<IBaseResource> theClass) {
super("contained", theClass);
public RuntimeElemContainedResourceList(Class<IBaseResource> theClass, boolean theStandardType) {
super("contained", theClass, theStandardType);
}
@Override

View File

@ -24,8 +24,8 @@ import ca.uhn.fhir.model.base.composite.BaseContainedDt;
public class RuntimeElemContainedResources extends BaseRuntimeElementDefinition<BaseContainedDt> {
public RuntimeElemContainedResources(Class<? extends BaseContainedDt> theClass) {
super("contained", theClass);
public RuntimeElemContainedResources(Class<? extends BaseContainedDt> theClass, boolean theStandardType) {
super("contained", theClass, theStandardType);
assert BaseContainedDt.class.isAssignableFrom(theClass);
}

View File

@ -24,8 +24,8 @@ import org.hl7.fhir.instance.model.IBaseResource;
public class RuntimeElementDirectResource extends BaseRuntimeElementDefinition<IBaseResource> {
public RuntimeElementDirectResource() {
super("DirectChildResource", IBaseResource.class);
public RuntimeElementDirectResource(boolean theStandardType) {
super("DirectChildResource", IBaseResource.class, theStandardType);
}
@Override

View File

@ -34,8 +34,8 @@ public class RuntimeExtensionDtDefinition extends RuntimeCompositeDatatypeDefini
private List<BaseRuntimeChildDefinition> myChildren;
public RuntimeExtensionDtDefinition(DatatypeDef theDef, Class<? extends ICompositeType> theImplementingClass) {
super(theDef, theImplementingClass);
public RuntimeExtensionDtDefinition(DatatypeDef theDef, Class<? extends ICompositeType> theImplementingClass, boolean theStandardType) {
super(theDef, theImplementingClass, theStandardType);
}
@Override

View File

@ -26,8 +26,8 @@ import ca.uhn.fhir.model.api.annotation.DatatypeDef;
public class RuntimeIdDatatypeDefinition extends RuntimePrimitiveDatatypeDefinition implements IRuntimeDatatypeDefinition {
public RuntimeIdDatatypeDefinition(DatatypeDef theDef, Class<? extends IPrimitiveType<?>> theImplementingClass) {
super(theDef, theImplementingClass);
public RuntimeIdDatatypeDefinition(DatatypeDef theDef, Class<? extends IPrimitiveType<?>> theImplementingClass, boolean theStandardType) {
super(theDef, theImplementingClass, theStandardType);
}
@Override

View File

@ -34,8 +34,8 @@ public class RuntimePrimitiveDatatypeDefinition extends BaseRuntimeElementDefini
private boolean mySpecialization;
public RuntimePrimitiveDatatypeDefinition(DatatypeDef theDef, Class<? extends IPrimitiveType<?>> theImplementingClass) {
super(theDef.name(), theImplementingClass);
public RuntimePrimitiveDatatypeDefinition(DatatypeDef theDef, Class<? extends IPrimitiveType<?>> theImplementingClass, boolean theStandardType) {
super(theDef.name(), theImplementingClass, theStandardType);
String resourceName = theDef.name();
if (isBlank(resourceName)) {

View File

@ -28,8 +28,8 @@ import ca.uhn.fhir.model.primitive.XhtmlDt;
public class RuntimePrimitiveDatatypeNarrativeDefinition extends BaseRuntimeElementDefinition<XhtmlDt> {
public RuntimePrimitiveDatatypeNarrativeDefinition(String theName, Class<XhtmlDt> theImplementingClass) {
super(theName, theImplementingClass);
public RuntimePrimitiveDatatypeNarrativeDefinition(String theName, Class<XhtmlDt> theImplementingClass, boolean theStandardType) {
super(theName, theImplementingClass, theStandardType);
}
@Override

View File

@ -27,8 +27,8 @@ import org.hl7.fhir.instance.model.api.IBaseXhtml;
public class RuntimePrimitiveDatatypeXhtmlHl7OrgDefinition extends BaseRuntimeElementDefinition<IBaseXhtml> {
public RuntimePrimitiveDatatypeXhtmlHl7OrgDefinition(String theName, Class<? extends IBaseXhtml> theImplementingClass) {
super(theName, theImplementingClass);
public RuntimePrimitiveDatatypeXhtmlHl7OrgDefinition(String theName, Class<? extends IBaseXhtml> theImplementingClass, boolean theStandardType) {
super(theName, theImplementingClass, theStandardType);
}
@Override

View File

@ -24,8 +24,8 @@ import org.hl7.fhir.instance.model.IBase;
public class RuntimeResourceBlockDefinition extends BaseRuntimeElementCompositeDefinition<IBase> {
public RuntimeResourceBlockDefinition(String theName, Class<? extends IBase> theImplementingClass) {
super(theName, theImplementingClass);
public RuntimeResourceBlockDefinition(String theName, Class<? extends IBase> theImplementingClass, boolean theStandardType) {
super(theName, theImplementingClass, theStandardType);
}
@Override

View File

@ -50,8 +50,8 @@ public class RuntimeResourceDefinition extends BaseRuntimeElementCompositeDefini
return myStructureVersion;
}
public RuntimeResourceDefinition(FhirContext theContext, String theResourceName, Class<? extends IBaseResource> theClass, ResourceDef theResourceAnnotation) {
super(theResourceName, theClass);
public RuntimeResourceDefinition(FhirContext theContext, String theResourceName, Class<? extends IBaseResource> theClass, ResourceDef theResourceAnnotation, boolean theStandardType) {
super(theResourceName, theClass, theStandardType);
myContext= theContext;
myResourceProfile = theResourceAnnotation.profile();
myId = theResourceAnnotation.id();

View File

@ -38,9 +38,10 @@ public class RuntimeResourceReferenceDefinition extends BaseRuntimeElementDefini
/**
* Constructor
* @param theStandardType
*/
public RuntimeResourceReferenceDefinition(String theName, List<Class<? extends IBaseResource>> theResourceTypes) {
super(theName, BaseResourceReferenceDt.class);
public RuntimeResourceReferenceDefinition(String theName, List<Class<? extends IBaseResource>> theResourceTypes, boolean theStandardType) {
super(theName, BaseResourceReferenceDt.class, theStandardType);
if (theResourceTypes == null || theResourceTypes.isEmpty()) {
throw new ConfigurationException("Element '" + theName + "' has no resource types noted");
}

View File

@ -270,22 +270,7 @@ public class FhirTerser {
childElementDef = nextChild.getChildElementDefinitionByDatatype(nextValue.getClass());
if (childElementDef == null) {
StringBuilder b = new StringBuilder();
b.append("Found value of type[");
b.append(nextValue.getClass().getSimpleName());
b.append("] which is not valid for field[");
b.append(nextChild.getElementName());
b.append("] in ");
b.append(childDef.getName());
b.append(" - Valid types: ");
for (Iterator<String> iter = new TreeSet<String>(nextChild.getValidChildNames()).iterator(); iter.hasNext();) {
BaseRuntimeElementDefinition<?> childByName = nextChild.getChildByName(iter.next());
b.append(childByName.getImplementingClass().getSimpleName());
if (iter.hasNext()) {
b.append(", ");
}
}
throw new DataFormatException(b.toString());
childElementDef = myContext.getElementDefinition(nextValue.getClass());
}
if (nextChild instanceof RuntimeChildDirectResource) {

View File

@ -122,7 +122,7 @@ public class ResourceProviderDstu2Test {
public void testCreateResourceWithNumericId() throws IOException {
String resource = "<Patient xmlns=\"http://hl7.org/fhir\"></Patient>";
HttpPost post = new HttpPost(ourServerBase + "/Patient");
HttpPost post = new HttpPost(ourServerBase + "/Patient/2");
post.setEntity(new StringEntity(resource, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
CloseableHttpResponse response = ourHttpClient.execute(post);

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Wed, Feb 18, 2015 12:09-0500 for FHIR v0.4.0
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
import java.util.*;
@ -41,7 +41,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef;
* There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.
*/
@DatatypeDef(name="Address")
public class AddressType extends Type implements ICompositeType {
public class Address extends Type implements ICompositeType {
public enum AddressUse {
/**
@ -106,10 +106,10 @@ public class AddressType extends Type implements ICompositeType {
}
public String getDisplay() {
switch (this) {
case HOME: return "home";
case WORK: return "work";
case TEMP: return "temp";
case OLD: return "old";
case HOME: return "Home";
case WORK: return "Work";
case TEMP: return "Temp";
case OLD: return "Old";
default: return "?";
}
}
@ -146,63 +146,63 @@ public class AddressType extends Type implements ICompositeType {
/**
* The purpose of this address.
*/
@Child(name = "use", type = {CodeType.class}, order = 0, min = 0, max = 1)
@Child(name ="use", type={CodeType.class}, order=0, min=0, max=1)
@Description(shortDefinition="home | work | temp | old - purpose of this address", formalDefinition="The purpose of this address." )
protected Enumeration<AddressUse> use;
/**
* A full text representation of the address.
*/
@Child(name = "text", type = {StringType.class}, order = 1, min = 0, max = 1)
@Child(name ="text", type={StringType.class}, order=1, min=0, max=1)
@Description(shortDefinition="Text representation of the address", formalDefinition="A full text representation of the address." )
protected StringType text;
/**
* This component contains the house number, apartment number, street name, street direction,
* This component contains the house number, apartment number, street name, street direction,
P.O. Box number, delivery hints, and similar address information.
*/
@Child(name = "line", type = {StringType.class}, order = 2, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="line", type={StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Street name, number, direction & P.O. Box etc", formalDefinition="This component contains the house number, apartment number, street name, street direction, \nP.O. Box number, delivery hints, and similar address information." )
protected List<StringType> line;
/**
* The name of the city, town, village or other community or delivery center.
*/
@Child(name = "city", type = {StringType.class}, order = 3, min = 0, max = 1)
@Child(name ="city", type={StringType.class}, order=3, min=0, max=1)
@Description(shortDefinition="Name of city, town etc.", formalDefinition="The name of the city, town, village or other community or delivery center." )
protected StringType city;
/**
* Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).
*/
@Child(name = "state", type = {StringType.class}, order = 4, min = 0, max = 1)
@Child(name ="state", type={StringType.class}, order=4, min=0, max=1)
@Description(shortDefinition="Sub-unit of country (abreviations ok)", formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)." )
protected StringType state;
/**
* A postal code designating a region defined by the postal service.
*/
@Child(name = "postalCode", type = {StringType.class}, order = 5, min = 0, max = 1)
@Child(name ="postalCode", type={StringType.class}, order=5, min=0, max=1)
@Description(shortDefinition="Postal code for area", formalDefinition="A postal code designating a region defined by the postal service." )
protected StringType postalCode;
/**
* Country - a nation as commonly understood or generally accepted.
*/
@Child(name = "country", type = {StringType.class}, order = 6, min = 0, max = 1)
@Child(name ="country", type={StringType.class}, order=6, min=0, max=1)
@Description(shortDefinition="Country (can be ISO 3166 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted." )
protected StringType country;
/**
* Time period when address was/is in use.
*/
@Child(name = "period", type = {Period.class}, order = 7, min = 0, max = 1)
@Child(name ="period", type={Period.class}, order=7, min=0, max=1)
@Description(shortDefinition="Time period when address was/is in use", formalDefinition="Time period when address was/is in use." )
protected Period period;
private static final long serialVersionUID = -470351694L;
public AddressType() {
public Address() {
super();
}
@ -229,7 +229,7 @@ P.O. Box number, delivery hints, and similar address information.
/**
* @param value {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value
*/
public AddressType setUseElement(Enumeration<AddressUse> value) {
public Address setUseElement(Enumeration<AddressUse> value) {
this.use = value;
return this;
}
@ -244,7 +244,7 @@ P.O. Box number, delivery hints, and similar address information.
/**
* @param value The purpose of this address.
*/
public AddressType setUse(AddressUse value) {
public Address setUse(AddressUse value) {
if (value == null)
this.use = null;
else {
@ -278,7 +278,7 @@ P.O. Box number, delivery hints, and similar address information.
/**
* @param value {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
*/
public AddressType setTextElement(StringType value) {
public Address setTextElement(StringType value) {
this.text = value;
return this;
}
@ -293,7 +293,7 @@ P.O. Box number, delivery hints, and similar address information.
/**
* @param value A full text representation of the address.
*/
public AddressType setText(String value) {
public Address setText(String value) {
if (Utilities.noString(value))
this.text = null;
else {
@ -305,7 +305,7 @@ P.O. Box number, delivery hints, and similar address information.
}
/**
* @return {@link #line} (This component contains the house number, apartment number, street name, street direction,
* @return {@link #line} (This component contains the house number, apartment number, street name, street direction,
P.O. Box number, delivery hints, and similar address information.)
*/
public List<StringType> getLine() {
@ -324,7 +324,7 @@ P.O. Box number, delivery hints, and similar address information.)
}
/**
* @return {@link #line} (This component contains the house number, apartment number, street name, street direction,
* @return {@link #line} (This component contains the house number, apartment number, street name, street direction,
P.O. Box number, delivery hints, and similar address information.)
*/
// syntactic sugar
@ -337,10 +337,10 @@ P.O. Box number, delivery hints, and similar address information.)
}
/**
* @param value {@link #line} (This component contains the house number, apartment number, street name, street direction,
* @param value {@link #line} (This component contains the house number, apartment number, street name, street direction,
P.O. Box number, delivery hints, and similar address information.)
*/
public AddressType addLine(String value) { //1
public Address addLine(String value) { //1
StringType t = new StringType();
t.setValue(value);
if (this.line == null)
@ -350,7 +350,7 @@ P.O. Box number, delivery hints, and similar address information.)
}
/**
* @param value {@link #line} (This component contains the house number, apartment number, street name, street direction,
* @param value {@link #line} (This component contains the house number, apartment number, street name, street direction,
P.O. Box number, delivery hints, and similar address information.)
*/
public boolean hasLine(String value) {
@ -385,7 +385,7 @@ P.O. Box number, delivery hints, and similar address information.)
/**
* @param value {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value
*/
public AddressType setCityElement(StringType value) {
public Address setCityElement(StringType value) {
this.city = value;
return this;
}
@ -400,7 +400,7 @@ P.O. Box number, delivery hints, and similar address information.)
/**
* @param value The name of the city, town, village or other community or delivery center.
*/
public AddressType setCity(String value) {
public Address setCity(String value) {
if (Utilities.noString(value))
this.city = null;
else {
@ -434,7 +434,7 @@ P.O. Box number, delivery hints, and similar address information.)
/**
* @param value {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value
*/
public AddressType setStateElement(StringType value) {
public Address setStateElement(StringType value) {
this.state = value;
return this;
}
@ -449,7 +449,7 @@ P.O. Box number, delivery hints, and similar address information.)
/**
* @param value Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).
*/
public AddressType setState(String value) {
public Address setState(String value) {
if (Utilities.noString(value))
this.state = null;
else {
@ -483,7 +483,7 @@ P.O. Box number, delivery hints, and similar address information.)
/**
* @param value {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value
*/
public AddressType setPostalCodeElement(StringType value) {
public Address setPostalCodeElement(StringType value) {
this.postalCode = value;
return this;
}
@ -498,7 +498,7 @@ P.O. Box number, delivery hints, and similar address information.)
/**
* @param value A postal code designating a region defined by the postal service.
*/
public AddressType setPostalCode(String value) {
public Address setPostalCode(String value) {
if (Utilities.noString(value))
this.postalCode = null;
else {
@ -532,7 +532,7 @@ P.O. Box number, delivery hints, and similar address information.)
/**
* @param value {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value
*/
public AddressType setCountryElement(StringType value) {
public Address setCountryElement(StringType value) {
this.country = value;
return this;
}
@ -547,7 +547,7 @@ P.O. Box number, delivery hints, and similar address information.)
/**
* @param value Country - a nation as commonly understood or generally accepted.
*/
public AddressType setCountry(String value) {
public Address setCountry(String value) {
if (Utilities.noString(value))
this.country = null;
else {
@ -577,7 +577,7 @@ P.O. Box number, delivery hints, and similar address information.)
/**
* @param value {@link #period} (Time period when address was/is in use.)
*/
public AddressType setPeriod(Period value) {
public Address setPeriod(Period value) {
this.period = value;
return this;
}
@ -594,8 +594,8 @@ P.O. Box number, delivery hints, and similar address information.)
childrenList.add(new Property("period", "Period", "Time period when address was/is in use.", 0, java.lang.Integer.MAX_VALUE, period));
}
public AddressType copy() {
AddressType dst = new AddressType();
public Address copy() {
Address dst = new Address();
copyValues(dst);
dst.use = use == null ? null : use.copy();
dst.text = text == null ? null : text.copy();
@ -612,7 +612,7 @@ P.O. Box number, delivery hints, and similar address information.)
return dst;
}
protected AddressType typedCopy() {
protected Address typedCopy() {
return copy();
}
@ -620,9 +620,9 @@ P.O. Box number, delivery hints, and similar address information.)
public boolean equalsDeep(Base other) {
if (!super.equalsDeep(other))
return false;
if (!(other instanceof AddressType))
if (!(other instanceof Address))
return false;
AddressType o = (AddressType) other;
Address o = (Address) other;
return compareDeep(use, o.use, true) && compareDeep(text, o.text, true) && compareDeep(line, o.line, true)
&& compareDeep(city, o.city, true) && compareDeep(state, o.state, true) && compareDeep(postalCode, o.postalCode, true)
&& compareDeep(country, o.country, true) && compareDeep(period, o.period, true);
@ -632,9 +632,9 @@ P.O. Box number, delivery hints, and similar address information.)
public boolean equalsShallow(Base other) {
if (!super.equalsShallow(other))
return false;
if (!(other instanceof AddressType))
if (!(other instanceof Address))
return false;
AddressType o = (AddressType) other;
Address o = (Address) other;
return compareValues(use, o.use, true) && compareValues(text, o.text, true) && compareValues(line, o.line, true)
&& compareValues(city, o.city, true) && compareValues(state, o.state, true) && compareValues(postalCode, o.postalCode, true)
&& compareValues(country, o.country, true);

View File

@ -0,0 +1,561 @@
package org.hl7.fhir.instance.model;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
import java.util.*;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
/**
* For referring to data content defined in other formats.
*/
@DatatypeDef(name="Attachment")
public class Attachment extends Type implements ICompositeType {
/**
* Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.
*/
@Child(name ="contentType", type={CodeType.class}, order=0, min=0, max=1)
@Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." )
protected CodeType contentType;
/**
* The human language of the content. The value can be any valid value according to BCP 47.
*/
@Child(name ="language", type={CodeType.class}, order=1, min=0, max=1)
@Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." )
protected CodeType language;
/**
* The actual data of the attachment - a sequence of bytes. In XML, represented using base64.
*/
@Child(name ="data", type={Base64BinaryType.class}, order=2, min=0, max=1)
@Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." )
protected Base64BinaryType data;
/**
* An alternative location where the data can be accessed.
*/
@Child(name ="url", type={UriType.class}, order=3, min=0, max=1)
@Description(shortDefinition="Uri where the data can be found", formalDefinition="An alternative location where the data can be accessed." )
protected UriType url;
/**
* The number of bytes of data that make up this attachment.
*/
@Child(name ="size", type={UnsignedIntType.class}, order=4, min=0, max=1)
@Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." )
protected UnsignedIntType size;
/**
* The calculated hash of the data using SHA-1. Represented using base64.
*/
@Child(name ="hash", type={Base64BinaryType.class}, order=5, min=0, max=1)
@Description(shortDefinition="Hash of the data (sha-1, base64ed )", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." )
protected Base64BinaryType hash;
/**
* A label or set of text to display in place of the data.
*/
@Child(name ="title", type={StringType.class}, order=6, min=0, max=1)
@Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." )
protected StringType title;
/**
* The date that the attachment was first created.
*/
@Child(name ="creation", type={DateTimeType.class}, order=7, min=0, max=1)
@Description(shortDefinition="Date attachment was first created", formalDefinition="The date that the attachment was first created." )
protected DateTimeType creation;
private static final long serialVersionUID = 581007080L;
public Attachment() {
super();
}
/**
* @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value
*/
public CodeType getContentTypeElement() {
if (this.contentType == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Attachment.contentType");
else if (Configuration.doAutoCreate())
this.contentType = new CodeType(); // bb
return this.contentType;
}
public boolean hasContentTypeElement() {
return this.contentType != null && !this.contentType.isEmpty();
}
public boolean hasContentType() {
return this.contentType != null && !this.contentType.isEmpty();
}
/**
* @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value
*/
public Attachment setContentTypeElement(CodeType value) {
this.contentType = value;
return this;
}
/**
* @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.
*/
public String getContentType() {
return this.contentType == null ? null : this.contentType.getValue();
}
/**
* @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.
*/
public Attachment setContentType(String value) {
if (Utilities.noString(value))
this.contentType = null;
else {
if (this.contentType == null)
this.contentType = new CodeType();
this.contentType.setValue(value);
}
return this;
}
/**
* @return {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
*/
public CodeType getLanguageElement() {
if (this.language == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Attachment.language");
else if (Configuration.doAutoCreate())
this.language = new CodeType(); // bb
return this.language;
}
public boolean hasLanguageElement() {
return this.language != null && !this.language.isEmpty();
}
public boolean hasLanguage() {
return this.language != null && !this.language.isEmpty();
}
/**
* @param value {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
*/
public Attachment setLanguageElement(CodeType value) {
this.language = value;
return this;
}
/**
* @return The human language of the content. The value can be any valid value according to BCP 47.
*/
public String getLanguage() {
return this.language == null ? null : this.language.getValue();
}
/**
* @param value The human language of the content. The value can be any valid value according to BCP 47.
*/
public Attachment setLanguage(String value) {
if (Utilities.noString(value))
this.language = null;
else {
if (this.language == null)
this.language = new CodeType();
this.language.setValue(value);
}
return this;
}
/**
* @return {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value
*/
public Base64BinaryType getDataElement() {
if (this.data == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Attachment.data");
else if (Configuration.doAutoCreate())
this.data = new Base64BinaryType(); // bb
return this.data;
}
public boolean hasDataElement() {
return this.data != null && !this.data.isEmpty();
}
public boolean hasData() {
return this.data != null && !this.data.isEmpty();
}
/**
* @param value {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value
*/
public Attachment setDataElement(Base64BinaryType value) {
this.data = value;
return this;
}
/**
* @return The actual data of the attachment - a sequence of bytes. In XML, represented using base64.
*/
public byte[] getData() {
return this.data == null ? null : this.data.getValue();
}
/**
* @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64.
*/
public Attachment setData(byte[] value) {
if (value == null)
this.data = null;
else {
if (this.data == null)
this.data = new Base64BinaryType();
this.data.setValue(value);
}
return this;
}
/**
* @return {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
*/
public UriType getUrlElement() {
if (this.url == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Attachment.url");
else if (Configuration.doAutoCreate())
this.url = new UriType(); // bb
return this.url;
}
public boolean hasUrlElement() {
return this.url != null && !this.url.isEmpty();
}
public boolean hasUrl() {
return this.url != null && !this.url.isEmpty();
}
/**
* @param value {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
*/
public Attachment setUrlElement(UriType value) {
this.url = value;
return this;
}
/**
* @return An alternative location where the data can be accessed.
*/
public String getUrl() {
return this.url == null ? null : this.url.getValue();
}
/**
* @param value An alternative location where the data can be accessed.
*/
public Attachment setUrl(String value) {
if (Utilities.noString(value))
this.url = null;
else {
if (this.url == null)
this.url = new UriType();
this.url.setValue(value);
}
return this;
}
/**
* @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value
*/
public UnsignedIntType getSizeElement() {
if (this.size == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Attachment.size");
else if (Configuration.doAutoCreate())
this.size = new UnsignedIntType(); // bb
return this.size;
}
public boolean hasSizeElement() {
return this.size != null && !this.size.isEmpty();
}
public boolean hasSize() {
return this.size != null && !this.size.isEmpty();
}
/**
* @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value
*/
public Attachment setSizeElement(UnsignedIntType value) {
this.size = value;
return this;
}
/**
* @return The number of bytes of data that make up this attachment.
*/
public int getSize() {
return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue();
}
/**
* @param value The number of bytes of data that make up this attachment.
*/
public Attachment setSize(int value) {
if (this.size == null)
this.size = new UnsignedIntType();
this.size.setValue(value);
return this;
}
/**
* @return {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value
*/
public Base64BinaryType getHashElement() {
if (this.hash == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Attachment.hash");
else if (Configuration.doAutoCreate())
this.hash = new Base64BinaryType(); // bb
return this.hash;
}
public boolean hasHashElement() {
return this.hash != null && !this.hash.isEmpty();
}
public boolean hasHash() {
return this.hash != null && !this.hash.isEmpty();
}
/**
* @param value {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value
*/
public Attachment setHashElement(Base64BinaryType value) {
this.hash = value;
return this;
}
/**
* @return The calculated hash of the data using SHA-1. Represented using base64.
*/
public byte[] getHash() {
return this.hash == null ? null : this.hash.getValue();
}
/**
* @param value The calculated hash of the data using SHA-1. Represented using base64.
*/
public Attachment setHash(byte[] value) {
if (value == null)
this.hash = null;
else {
if (this.hash == null)
this.hash = new Base64BinaryType();
this.hash.setValue(value);
}
return this;
}
/**
* @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
*/
public StringType getTitleElement() {
if (this.title == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Attachment.title");
else if (Configuration.doAutoCreate())
this.title = new StringType(); // bb
return this.title;
}
public boolean hasTitleElement() {
return this.title != null && !this.title.isEmpty();
}
public boolean hasTitle() {
return this.title != null && !this.title.isEmpty();
}
/**
* @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
*/
public Attachment setTitleElement(StringType value) {
this.title = value;
return this;
}
/**
* @return A label or set of text to display in place of the data.
*/
public String getTitle() {
return this.title == null ? null : this.title.getValue();
}
/**
* @param value A label or set of text to display in place of the data.
*/
public Attachment setTitle(String value) {
if (Utilities.noString(value))
this.title = null;
else {
if (this.title == null)
this.title = new StringType();
this.title.setValue(value);
}
return this;
}
/**
* @return {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value
*/
public DateTimeType getCreationElement() {
if (this.creation == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Attachment.creation");
else if (Configuration.doAutoCreate())
this.creation = new DateTimeType(); // bb
return this.creation;
}
public boolean hasCreationElement() {
return this.creation != null && !this.creation.isEmpty();
}
public boolean hasCreation() {
return this.creation != null && !this.creation.isEmpty();
}
/**
* @param value {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value
*/
public Attachment setCreationElement(DateTimeType value) {
this.creation = value;
return this;
}
/**
* @return The date that the attachment was first created.
*/
public Date getCreation() {
return this.creation == null ? null : this.creation.getValue();
}
/**
* @param value The date that the attachment was first created.
*/
public Attachment setCreation(Date value) {
if (value == null)
this.creation = null;
else {
if (this.creation == null)
this.creation = new DateTimeType();
this.creation.setValue(value);
}
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType));
childrenList.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, java.lang.Integer.MAX_VALUE, language));
childrenList.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.", 0, java.lang.Integer.MAX_VALUE, data));
childrenList.add(new Property("url", "uri", "An alternative location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url));
childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size));
childrenList.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, java.lang.Integer.MAX_VALUE, hash));
childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title));
childrenList.add(new Property("creation", "dateTime", "The date that the attachment was first created.", 0, java.lang.Integer.MAX_VALUE, creation));
}
public Attachment copy() {
Attachment dst = new Attachment();
copyValues(dst);
dst.contentType = contentType == null ? null : contentType.copy();
dst.language = language == null ? null : language.copy();
dst.data = data == null ? null : data.copy();
dst.url = url == null ? null : url.copy();
dst.size = size == null ? null : size.copy();
dst.hash = hash == null ? null : hash.copy();
dst.title = title == null ? null : title.copy();
dst.creation = creation == null ? null : creation.copy();
return dst;
}
protected Attachment typedCopy() {
return copy();
}
@Override
public boolean equalsDeep(Base other) {
if (!super.equalsDeep(other))
return false;
if (!(other instanceof Attachment))
return false;
Attachment o = (Attachment) other;
return compareDeep(contentType, o.contentType, true) && compareDeep(language, o.language, true)
&& compareDeep(data, o.data, true) && compareDeep(url, o.url, true) && compareDeep(size, o.size, true)
&& compareDeep(hash, o.hash, true) && compareDeep(title, o.title, true) && compareDeep(creation, o.creation, true)
;
}
@Override
public boolean equalsShallow(Base other) {
if (!super.equalsShallow(other))
return false;
if (!(other instanceof Attachment))
return false;
Attachment o = (Attachment) other;
return compareValues(contentType, o.contentType, true) && compareValues(language, o.language, true)
&& compareValues(data, o.data, true) && compareValues(url, o.url, true) && compareValues(size, o.size, true)
&& compareValues(hash, o.hash, true) && compareValues(title, o.title, true) && compareValues(creation, o.creation, true)
;
}
public boolean isEmpty() {
return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (language == null || language.isEmpty())
&& (data == null || data.isEmpty()) && (url == null || url.isEmpty()) && (size == null || size.isEmpty())
&& (hash == null || hash.isEmpty()) && (title == null || title.isEmpty()) && (creation == null || creation.isEmpty())
;
}
}

View File

@ -0,0 +1,521 @@
package org.hl7.fhir.instance.model;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
import java.util.*;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.instance.model.annotations.ResourceDef;
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
import org.hl7.fhir.instance.model.annotations.Block;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
/**
* Prospective warnings of potential issues when providing care to the patient.
*/
@ResourceDef(name="Flag", profile="http://hl7.org/fhir/Profile/Flag")
public class Flag extends DomainResource {
public enum FlagStatus {
/**
* A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag.
*/
ACTIVE,
/**
* The flag does not need to be displayed any more.
*/
INACTIVE,
/**
* The flag was added in error, and should no longer be displayed.
*/
ENTEREDINERROR,
/**
* added to help the parsers
*/
NULL;
public static FlagStatus fromCode(String codeString) throws Exception {
if (codeString == null || "".equals(codeString))
return null;
if ("active".equals(codeString))
return ACTIVE;
if ("inactive".equals(codeString))
return INACTIVE;
if ("entered-in-error".equals(codeString))
return ENTEREDINERROR;
throw new Exception("Unknown FlagStatus code '"+codeString+"'");
}
public String toCode() {
switch (this) {
case ACTIVE: return "active";
case INACTIVE: return "inactive";
case ENTEREDINERROR: return "entered-in-error";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case ACTIVE: return "";
case INACTIVE: return "";
case ENTEREDINERROR: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case ACTIVE: return "A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag.";
case INACTIVE: return "The flag does not need to be displayed any more.";
case ENTEREDINERROR: return "The flag was added in error, and should no longer be displayed.";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case ACTIVE: return "Active";
case INACTIVE: return "Inactive";
case ENTEREDINERROR: return "Entered In Error";
default: return "?";
}
}
}
public static class FlagStatusEnumFactory implements EnumFactory<FlagStatus> {
public FlagStatus fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("active".equals(codeString))
return FlagStatus.ACTIVE;
if ("inactive".equals(codeString))
return FlagStatus.INACTIVE;
if ("entered-in-error".equals(codeString))
return FlagStatus.ENTEREDINERROR;
throw new IllegalArgumentException("Unknown FlagStatus code '"+codeString+"'");
}
public String toCode(FlagStatus code) {
if (code == FlagStatus.ACTIVE)
return "active";
if (code == FlagStatus.INACTIVE)
return "inactive";
if (code == FlagStatus.ENTEREDINERROR)
return "entered-in-error";
return "?";
}
}
/**
* Identifier assigned to the flag for external use (outside the FHIR environment).
*/
@Child(name ="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the flag for external use (outside the FHIR environment)." )
protected List<Identifier> identifier;
/**
* Allows an flag to be divided into different categories like clinical, administrative etc.
*/
@Child(name ="category", type={CodeableConcept.class}, order=1, min=0, max=1)
@Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an flag to be divided into different categories like clinical, administrative etc." )
protected CodeableConcept category;
/**
* Supports basic workflow.
*/
@Child(name ="status", type={CodeType.class}, order=2, min=1, max=1)
@Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="Supports basic workflow." )
protected Enumeration<FlagStatus> status;
/**
* The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.
*/
@Child(name ="period", type={Period.class}, order=3, min=0, max=1)
@Description(shortDefinition="Time period when flag is active", formalDefinition="The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified." )
protected Period period;
/**
* The patient record this flag is associated with.
*/
@Child(name ="patient", type={Patient.class}, order=4, min=1, max=1)
@Description(shortDefinition="Who is flag about?", formalDefinition="The patient record this flag is associated with." )
protected Reference patient;
/**
* The actual object that is the target of the reference (The patient record this flag is associated with.)
*/
protected Patient patientTarget;
/**
* The person or device that created the flag.
*/
@Child(name ="author", type={Practitioner.class, Patient.class, Device.class}, order=5, min=0, max=1)
@Description(shortDefinition="Flag creator", formalDefinition="The person or device that created the flag." )
protected Reference author;
/**
* The actual object that is the target of the reference (The person or device that created the flag.)
*/
protected Resource authorTarget;
/**
* The coded value or textual component of the flag to display to the user.
*/
@Child(name ="code", type={CodeableConcept.class}, order=6, min=1, max=1)
@Description(shortDefinition="Partially deaf, Requires easy open caps, No permanent address, etc.", formalDefinition="The coded value or textual component of the flag to display to the user." )
protected CodeableConcept code;
private static final long serialVersionUID = 1117780761L;
public Flag() {
super();
}
public Flag(Enumeration<FlagStatus> status, Reference patient, CodeableConcept code) {
super();
this.status = status;
this.patient = patient;
this.code = code;
}
/**
* @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).)
*/
public List<Identifier> getIdentifier() {
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
return this.identifier;
}
public boolean hasIdentifier() {
if (this.identifier == null)
return false;
for (Identifier item : this.identifier)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).)
*/
// syntactic sugar
public Identifier addIdentifier() { //3
Identifier t = new Identifier();
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return t;
}
// syntactic sugar
public Flag addIdentifier(Identifier t) { //3
if (t == null)
return this;
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return this;
}
/**
* @return {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc.)
*/
public CodeableConcept getCategory() {
if (this.category == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Flag.category");
else if (Configuration.doAutoCreate())
this.category = new CodeableConcept(); // cc
return this.category;
}
public boolean hasCategory() {
return this.category != null && !this.category.isEmpty();
}
/**
* @param value {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc.)
*/
public Flag setCategory(CodeableConcept value) {
this.category = value;
return this;
}
/**
* @return {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public Enumeration<FlagStatus> getStatusElement() {
if (this.status == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Flag.status");
else if (Configuration.doAutoCreate())
this.status = new Enumeration<FlagStatus>(new FlagStatusEnumFactory()); // bb
return this.status;
}
public boolean hasStatusElement() {
return this.status != null && !this.status.isEmpty();
}
public boolean hasStatus() {
return this.status != null && !this.status.isEmpty();
}
/**
* @param value {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
public Flag setStatusElement(Enumeration<FlagStatus> value) {
this.status = value;
return this;
}
/**
* @return Supports basic workflow.
*/
public FlagStatus getStatus() {
return this.status == null ? null : this.status.getValue();
}
/**
* @param value Supports basic workflow.
*/
public Flag setStatus(FlagStatus value) {
if (this.status == null)
this.status = new Enumeration<FlagStatus>(new FlagStatusEnumFactory());
this.status.setValue(value);
return this;
}
/**
* @return {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.)
*/
public Period getPeriod() {
if (this.period == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Flag.period");
else if (Configuration.doAutoCreate())
this.period = new Period(); // cc
return this.period;
}
public boolean hasPeriod() {
return this.period != null && !this.period.isEmpty();
}
/**
* @param value {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.)
*/
public Flag setPeriod(Period value) {
this.period = value;
return this;
}
/**
* @return {@link #patient} (The patient record this flag is associated with.)
*/
public Reference getPatient() {
if (this.patient == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Flag.patient");
else if (Configuration.doAutoCreate())
this.patient = new Reference(); // cc
return this.patient;
}
public boolean hasPatient() {
return this.patient != null && !this.patient.isEmpty();
}
/**
* @param value {@link #patient} (The patient record this flag is associated with.)
*/
public Flag setPatient(Reference value) {
this.patient = value;
return this;
}
/**
* @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient record this flag is associated with.)
*/
public Patient getPatientTarget() {
if (this.patientTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Flag.patient");
else if (Configuration.doAutoCreate())
this.patientTarget = new Patient(); // aa
return this.patientTarget;
}
/**
* @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient record this flag is associated with.)
*/
public Flag setPatientTarget(Patient value) {
this.patientTarget = value;
return this;
}
/**
* @return {@link #author} (The person or device that created the flag.)
*/
public Reference getAuthor() {
if (this.author == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Flag.author");
else if (Configuration.doAutoCreate())
this.author = new Reference(); // cc
return this.author;
}
public boolean hasAuthor() {
return this.author != null && !this.author.isEmpty();
}
/**
* @param value {@link #author} (The person or device that created the flag.)
*/
public Flag setAuthor(Reference value) {
this.author = value;
return this;
}
/**
* @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or device that created the flag.)
*/
public Resource getAuthorTarget() {
return this.authorTarget;
}
/**
* @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or device that created the flag.)
*/
public Flag setAuthorTarget(Resource value) {
this.authorTarget = value;
return this;
}
/**
* @return {@link #code} (The coded value or textual component of the flag to display to the user.)
*/
public CodeableConcept getCode() {
if (this.code == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Flag.code");
else if (Configuration.doAutoCreate())
this.code = new CodeableConcept(); // cc
return this.code;
}
public boolean hasCode() {
return this.code != null && !this.code.isEmpty();
}
/**
* @param value {@link #code} (The coded value or textual component of the flag to display to the user.)
*/
public Flag setCode(CodeableConcept value) {
this.code = value;
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the flag for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("category", "CodeableConcept", "Allows an flag to be divided into different categories like clinical, administrative etc.", 0, java.lang.Integer.MAX_VALUE, category));
childrenList.add(new Property("status", "code", "Supports basic workflow.", 0, java.lang.Integer.MAX_VALUE, status));
childrenList.add(new Property("period", "Period", "The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.", 0, java.lang.Integer.MAX_VALUE, period));
childrenList.add(new Property("patient", "Reference(Patient)", "The patient record this flag is associated with.", 0, java.lang.Integer.MAX_VALUE, patient));
childrenList.add(new Property("author", "Reference(Practitioner|Patient|Device)", "The person or device that created the flag.", 0, java.lang.Integer.MAX_VALUE, author));
childrenList.add(new Property("code", "CodeableConcept", "The coded value or textual component of the flag to display to the user.", 0, java.lang.Integer.MAX_VALUE, code));
}
public Flag copy() {
Flag dst = new Flag();
copyValues(dst);
if (identifier != null) {
dst.identifier = new ArrayList<Identifier>();
for (Identifier i : identifier)
dst.identifier.add(i.copy());
};
dst.category = category == null ? null : category.copy();
dst.status = status == null ? null : status.copy();
dst.period = period == null ? null : period.copy();
dst.patient = patient == null ? null : patient.copy();
dst.author = author == null ? null : author.copy();
dst.code = code == null ? null : code.copy();
return dst;
}
protected Flag typedCopy() {
return copy();
}
@Override
public boolean equalsDeep(Base other) {
if (!super.equalsDeep(other))
return false;
if (!(other instanceof Flag))
return false;
Flag o = (Flag) other;
return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(status, o.status, true)
&& compareDeep(period, o.period, true) && compareDeep(patient, o.patient, true) && compareDeep(author, o.author, true)
&& compareDeep(code, o.code, true);
}
@Override
public boolean equalsShallow(Base other) {
if (!super.equalsShallow(other))
return false;
if (!(other instanceof Flag))
return false;
Flag o = (Flag) other;
return compareValues(status, o.status, true);
}
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty())
&& (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (patient == null || patient.isEmpty())
&& (author == null || author.isEmpty()) && (code == null || code.isEmpty());
}
@Override
public ResourceType getResourceType() {
return ResourceType.Flag;
}
@SearchParamDefinition(name="date", path="Flag.period", description="Time period when flag is active", type="date" )
public static final String SP_DATE = "date";
@SearchParamDefinition(name="subject", path="Flag.patient", description="The identity of a subject to list flags for", type="reference" )
public static final String SP_SUBJECT = "subject";
@SearchParamDefinition(name="patient", path="Flag.patient", description="The identity of a subject to list flags for", type="reference" )
public static final String SP_PATIENT = "patient";
@SearchParamDefinition(name="author", path="Flag.author", description="Flag creator", type="reference" )
public static final String SP_AUTHOR = "author";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Wed, Feb 18, 2015 12:09-0500 for FHIR v0.4.0
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
import java.util.*;
@ -46,6 +46,78 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Location", profile="http://hl7.org/fhir/Profile/Location")
public class Location extends DomainResource {
public enum LocationMode {
/**
* The Location resource represents a specific instance of a Location (e.g. Operating Theatre 1A).
*/
INSTANCE,
/**
* The Location represents a class of Locations (e.g. Any Operating Theatre). Although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc).
*/
KIND,
/**
* added to help the parsers
*/
NULL;
public static LocationMode fromCode(String codeString) throws Exception {
if (codeString == null || "".equals(codeString))
return null;
if ("instance".equals(codeString))
return INSTANCE;
if ("kind".equals(codeString))
return KIND;
throw new Exception("Unknown LocationMode code '"+codeString+"'");
}
public String toCode() {
switch (this) {
case INSTANCE: return "instance";
case KIND: return "kind";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case INSTANCE: return "";
case KIND: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case INSTANCE: return "The Location resource represents a specific instance of a Location (e.g. Operating Theatre 1A).";
case KIND: return "The Location represents a class of Locations (e.g. Any Operating Theatre). Although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc).";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case INSTANCE: return "Instance";
case KIND: return "Kind";
default: return "?";
}
}
}
public static class LocationModeEnumFactory implements EnumFactory<LocationMode> {
public LocationMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("instance".equals(codeString))
return LocationMode.INSTANCE;
if ("kind".equals(codeString))
return LocationMode.KIND;
throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'");
}
public String toCode(LocationMode code) {
if (code == LocationMode.INSTANCE)
return "instance";
if (code == LocationMode.KIND)
return "kind";
return "?";
}
}
public enum LocationStatus {
/**
* The location is operational.
@ -100,9 +172,9 @@ public class Location extends DomainResource {
}
public String getDisplay() {
switch (this) {
case ACTIVE: return "active";
case SUSPENDED: return "suspended";
case INACTIVE: return "inactive";
case ACTIVE: return "Active";
case SUSPENDED: return "Suspended";
case INACTIVE: return "Inactive";
default: return "?";
}
}
@ -132,99 +204,27 @@ public class Location extends DomainResource {
}
}
public enum LocationMode {
/**
* The Location resource represents a specific instance of a Location.
*/
INSTANCE,
/**
* The Location represents a class of Locations.
*/
KIND,
/**
* added to help the parsers
*/
NULL;
public static LocationMode fromCode(String codeString) throws Exception {
if (codeString == null || "".equals(codeString))
return null;
if ("instance".equals(codeString))
return INSTANCE;
if ("kind".equals(codeString))
return KIND;
throw new Exception("Unknown LocationMode code '"+codeString+"'");
}
public String toCode() {
switch (this) {
case INSTANCE: return "instance";
case KIND: return "kind";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case INSTANCE: return "";
case KIND: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case INSTANCE: return "The Location resource represents a specific instance of a Location.";
case KIND: return "The Location represents a class of Locations.";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case INSTANCE: return "instance";
case KIND: return "kind";
default: return "?";
}
}
}
public static class LocationModeEnumFactory implements EnumFactory<LocationMode> {
public LocationMode fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("instance".equals(codeString))
return LocationMode.INSTANCE;
if ("kind".equals(codeString))
return LocationMode.KIND;
throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'");
}
public String toCode(LocationMode code) {
if (code == LocationMode.INSTANCE)
return "instance";
if (code == LocationMode.KIND)
return "kind";
return "?";
}
}
@Block()
public static class LocationPositionComponent extends BackboneElement {
/**
* Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).
*/
@Child(name="longitude", type={DecimalType.class}, order=1, min=1, max=1)
@Description(shortDefinition="Longitude as expressed in KML", formalDefinition="Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)." )
@Child(name ="longitude", type={DecimalType.class}, order=1, min=1, max=1)
@Description(shortDefinition="Longitude with WGS84 datum", formalDefinition="Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)." )
protected DecimalType longitude;
/**
* Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).
*/
@Child(name="latitude", type={DecimalType.class}, order=2, min=1, max=1)
@Description(shortDefinition="Latitude as expressed in KML", formalDefinition="Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)." )
@Child(name ="latitude", type={DecimalType.class}, order=2, min=1, max=1)
@Description(shortDefinition="Latitude with WGS84 datum", formalDefinition="Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)." )
protected DecimalType latitude;
/**
* Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).
*/
@Child(name="altitude", type={DecimalType.class}, order=3, min=0, max=1)
@Description(shortDefinition="Altitude as expressed in KML", formalDefinition="Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)." )
@Child(name ="altitude", type={DecimalType.class}, order=3, min=0, max=1)
@Description(shortDefinition="Altitude with WGS84 datum", formalDefinition="Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)." )
protected DecimalType altitude;
private static final long serialVersionUID = -74276134L;
@ -426,63 +426,70 @@ public class Location extends DomainResource {
/**
* Unique code or number identifying the location to its users.
*/
@Child(name = "identifier", type = {Identifier.class}, order = 0, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Unique code or number identifying the location to its users", formalDefinition="Unique code or number identifying the location to its users." )
protected List<Identifier> identifier;
/**
* Name of the location as used by humans. Does not need to be unique.
*/
@Child(name = "name", type = {StringType.class}, order = 1, min = 0, max = 1)
@Child(name ="name", type={StringType.class}, order=1, min=0, max=1)
@Description(shortDefinition="Name of the location as used by humans", formalDefinition="Name of the location as used by humans. Does not need to be unique." )
protected StringType name;
/**
* Description of the Location, which helps in finding or referencing the place.
*/
@Child(name = "description", type = {StringType.class}, order = 2, min = 0, max = 1)
@Child(name ="description", type={StringType.class}, order=2, min=0, max=1)
@Description(shortDefinition="Description of the Location, which helps in finding or referencing the place", formalDefinition="Description of the Location, which helps in finding or referencing the place." )
protected StringType description;
/**
* Indicates whether a resource instance represents a specific location or a class of locations.
*/
@Child(name ="mode", type={CodeType.class}, order=3, min=0, max=1)
@Description(shortDefinition="instance | kind", formalDefinition="Indicates whether a resource instance represents a specific location or a class of locations." )
protected Enumeration<LocationMode> mode;
/**
* Indicates the type of function performed at the location.
*/
@Child(name = "type", type = {CodeableConcept.class}, order = 3, min = 0, max = 1)
@Child(name ="type", type={CodeableConcept.class}, order=4, min=0, max=1)
@Description(shortDefinition="Indicates the type of function performed at the location", formalDefinition="Indicates the type of function performed at the location." )
protected CodeableConcept type;
/**
* The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.
*/
@Child(name = "telecom", type = {ContactPoint.class}, order = 4, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="telecom", type={ContactPoint.class}, order=5, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Contact details of the location", formalDefinition="The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites." )
protected List<ContactPoint> telecom;
/**
* Physical location.
*/
@Child(name = "address", type = {AddressType.class}, order = 5, min = 0, max = 1)
@Child(name ="address", type={Address.class}, order=6, min=0, max=1)
@Description(shortDefinition="Physical location", formalDefinition="Physical location." )
protected AddressType address;
protected Address address;
/**
* Physical form of the location, e.g. building, room, vehicle, road.
*/
@Child(name = "physicalType", type = {CodeableConcept.class}, order = 6, min = 0, max = 1)
@Child(name ="physicalType", type={CodeableConcept.class}, order=7, min=0, max=1)
@Description(shortDefinition="Physical form of the location", formalDefinition="Physical form of the location, e.g. building, room, vehicle, road." )
protected CodeableConcept physicalType;
/**
* The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).
* The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).
*/
@Child(name = "position", type = {}, order = 7, min = 0, max = 1)
@Description(shortDefinition="The absolute geographic location", formalDefinition="The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML)." )
@Child(name ="position", type={}, order=8, min=0, max=1)
@Description(shortDefinition="The absolute geographic location", formalDefinition="The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML)." )
protected LocationPositionComponent position;
/**
* The organization that is responsible for the provisioning and upkeep of the location.
*/
@Child(name = "managingOrganization", type = {Organization.class}, order = 8, min = 0, max = 1)
@Child(name ="managingOrganization", type={Organization.class}, order=9, min=0, max=1)
@Description(shortDefinition="The organization that is responsible for the provisioning and upkeep of the location", formalDefinition="The organization that is responsible for the provisioning and upkeep of the location." )
protected Reference managingOrganization;
@ -491,17 +498,10 @@ public class Location extends DomainResource {
*/
protected Organization managingOrganizationTarget;
/**
* active | suspended | inactive.
*/
@Child(name = "status", type = {CodeType.class}, order = 9, min = 0, max = 1)
@Description(shortDefinition="active | suspended | inactive", formalDefinition="active | suspended | inactive." )
protected Enumeration<LocationStatus> status;
/**
* Another Location which this Location is physically part of.
*/
@Child(name = "partOf", type = {Location.class}, order = 10, min = 0, max = 1)
@Child(name ="partOf", type={Location.class}, order=10, min=0, max=1)
@Description(shortDefinition="Another Location which this Location is physically part of", formalDefinition="Another Location which this Location is physically part of." )
protected Reference partOf;
@ -511,13 +511,13 @@ public class Location extends DomainResource {
protected Location partOfTarget;
/**
* Indicates whether a resource instance represents a specific location or a class of locations.
* active | suspended | inactive.
*/
@Child(name = "mode", type = {CodeType.class}, order = 11, min = 0, max = 1)
@Description(shortDefinition="instance | kind", formalDefinition="Indicates whether a resource instance represents a specific location or a class of locations." )
protected Enumeration<LocationMode> mode;
@Child(name ="status", type={CodeType.class}, order=11, min=0, max=1)
@Description(shortDefinition="active | suspended | inactive", formalDefinition="active | suspended | inactive." )
protected Enumeration<LocationStatus> status;
private static final long serialVersionUID = -1202061661L;
private static final long serialVersionUID = -520735603L;
public Location() {
super();
@ -553,6 +553,16 @@ public class Location extends DomainResource {
return t;
}
// syntactic sugar
public Location addIdentifier(Identifier t) { //3
if (t == null)
return this;
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return this;
}
/**
* @return {@link #name} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
*/
@ -651,6 +661,55 @@ public class Location extends DomainResource {
return this;
}
/**
* @return {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
*/
public Enumeration<LocationMode> getModeElement() {
if (this.mode == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Location.mode");
else if (Configuration.doAutoCreate())
this.mode = new Enumeration<LocationMode>(new LocationModeEnumFactory()); // bb
return this.mode;
}
public boolean hasModeElement() {
return this.mode != null && !this.mode.isEmpty();
}
public boolean hasMode() {
return this.mode != null && !this.mode.isEmpty();
}
/**
* @param value {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
*/
public Location setModeElement(Enumeration<LocationMode> value) {
this.mode = value;
return this;
}
/**
* @return Indicates whether a resource instance represents a specific location or a class of locations.
*/
public LocationMode getMode() {
return this.mode == null ? null : this.mode.getValue();
}
/**
* @param value Indicates whether a resource instance represents a specific location or a class of locations.
*/
public Location setMode(LocationMode value) {
if (value == null)
this.mode = null;
else {
if (this.mode == null)
this.mode = new Enumeration<LocationMode>(new LocationModeEnumFactory());
this.mode.setValue(value);
}
return this;
}
/**
* @return {@link #type} (Indicates the type of function performed at the location.)
*/
@ -705,15 +764,25 @@ public class Location extends DomainResource {
return t;
}
// syntactic sugar
public Location addTelecom(ContactPoint t) { //3
if (t == null)
return this;
if (this.telecom == null)
this.telecom = new ArrayList<ContactPoint>();
this.telecom.add(t);
return this;
}
/**
* @return {@link #address} (Physical location.)
*/
public AddressType getAddress() {
public Address getAddress() {
if (this.address == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Location.address");
else if (Configuration.doAutoCreate())
this.address = new AddressType(); // cc
this.address = new Address(); // cc
return this.address;
}
@ -724,7 +793,7 @@ public class Location extends DomainResource {
/**
* @param value {@link #address} (Physical location.)
*/
public Location setAddress(AddressType value) {
public Location setAddress(Address value) {
this.address = value;
return this;
}
@ -754,7 +823,7 @@ public class Location extends DomainResource {
}
/**
* @return {@link #position} (The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).)
* @return {@link #position} (The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).)
*/
public LocationPositionComponent getPosition() {
if (this.position == null)
@ -770,7 +839,7 @@ public class Location extends DomainResource {
}
/**
* @param value {@link #position} (The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).)
* @param value {@link #position} (The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).)
*/
public Location setPosition(LocationPositionComponent value) {
this.position = value;
@ -821,6 +890,50 @@ public class Location extends DomainResource {
return this;
}
/**
* @return {@link #partOf} (Another Location which this Location is physically part of.)
*/
public Reference getPartOf() {
if (this.partOf == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Location.partOf");
else if (Configuration.doAutoCreate())
this.partOf = new Reference(); // cc
return this.partOf;
}
public boolean hasPartOf() {
return this.partOf != null && !this.partOf.isEmpty();
}
/**
* @param value {@link #partOf} (Another Location which this Location is physically part of.)
*/
public Location setPartOf(Reference value) {
this.partOf = value;
return this;
}
/**
* @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.)
*/
public Location getPartOfTarget() {
if (this.partOfTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Location.partOf");
else if (Configuration.doAutoCreate())
this.partOfTarget = new Location(); // aa
return this.partOfTarget;
}
/**
* @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.)
*/
public Location setPartOfTarget(Location value) {
this.partOfTarget = value;
return this;
}
/**
* @return {@link #status} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
*/
@ -870,113 +983,20 @@ public class Location extends DomainResource {
return this;
}
/**
* @return {@link #partOf} (Another Location which this Location is physically part of.)
*/
public Reference getPartOf() {
if (this.partOf == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Location.partOf");
else if (Configuration.doAutoCreate())
this.partOf = new Reference(); // cc
return this.partOf;
}
public boolean hasPartOf() {
return this.partOf != null && !this.partOf.isEmpty();
}
/**
* @param value {@link #partOf} (Another Location which this Location is physically part of.)
*/
public Location setPartOf(Reference value) {
this.partOf = value;
return this;
}
/**
* @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.)
*/
public Location getPartOfTarget() {
if (this.partOfTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Location.partOf");
else if (Configuration.doAutoCreate())
this.partOfTarget = new Location(); // aa
return this.partOfTarget;
}
/**
* @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.)
*/
public Location setPartOfTarget(Location value) {
this.partOfTarget = value;
return this;
}
/**
* @return {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
*/
public Enumeration<LocationMode> getModeElement() {
if (this.mode == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Location.mode");
else if (Configuration.doAutoCreate())
this.mode = new Enumeration<LocationMode>(new LocationModeEnumFactory()); // bb
return this.mode;
}
public boolean hasModeElement() {
return this.mode != null && !this.mode.isEmpty();
}
public boolean hasMode() {
return this.mode != null && !this.mode.isEmpty();
}
/**
* @param value {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
*/
public Location setModeElement(Enumeration<LocationMode> value) {
this.mode = value;
return this;
}
/**
* @return Indicates whether a resource instance represents a specific location or a class of locations.
*/
public LocationMode getMode() {
return this.mode == null ? null : this.mode.getValue();
}
/**
* @param value Indicates whether a resource instance represents a specific location or a class of locations.
*/
public Location setMode(LocationMode value) {
if (value == null)
this.mode = null;
else {
if (this.mode == null)
this.mode = new Enumeration<LocationMode>(new LocationModeEnumFactory());
this.mode.setValue(value);
}
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "Unique code or number identifying the location to its users.", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("name", "string", "Name of the location as used by humans. Does not need to be unique.", 0, java.lang.Integer.MAX_VALUE, name));
childrenList.add(new Property("description", "string", "Description of the Location, which helps in finding or referencing the place.", 0, java.lang.Integer.MAX_VALUE, description));
childrenList.add(new Property("mode", "code", "Indicates whether a resource instance represents a specific location or a class of locations.", 0, java.lang.Integer.MAX_VALUE, mode));
childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of function performed at the location.", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("telecom", "ContactPoint", "The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.", 0, java.lang.Integer.MAX_VALUE, telecom));
childrenList.add(new Property("address", "Address", "Physical location.", 0, java.lang.Integer.MAX_VALUE, address));
childrenList.add(new Property("physicalType", "CodeableConcept", "Physical form of the location, e.g. building, room, vehicle, road.", 0, java.lang.Integer.MAX_VALUE, physicalType));
childrenList.add(new Property("position", "", "The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).", 0, java.lang.Integer.MAX_VALUE, position));
childrenList.add(new Property("position", "", "The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML).", 0, java.lang.Integer.MAX_VALUE, position));
childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that is responsible for the provisioning and upkeep of the location.", 0, java.lang.Integer.MAX_VALUE, managingOrganization));
childrenList.add(new Property("status", "code", "active | suspended | inactive.", 0, java.lang.Integer.MAX_VALUE, status));
childrenList.add(new Property("partOf", "Reference(Location)", "Another Location which this Location is physically part of.", 0, java.lang.Integer.MAX_VALUE, partOf));
childrenList.add(new Property("mode", "code", "Indicates whether a resource instance represents a specific location or a class of locations.", 0, java.lang.Integer.MAX_VALUE, mode));
childrenList.add(new Property("status", "code", "active | suspended | inactive.", 0, java.lang.Integer.MAX_VALUE, status));
}
public Location copy() {
@ -989,6 +1009,7 @@ public class Location extends DomainResource {
};
dst.name = name == null ? null : name.copy();
dst.description = description == null ? null : description.copy();
dst.mode = mode == null ? null : mode.copy();
dst.type = type == null ? null : type.copy();
if (telecom != null) {
dst.telecom = new ArrayList<ContactPoint>();
@ -999,9 +1020,8 @@ public class Location extends DomainResource {
dst.physicalType = physicalType == null ? null : physicalType.copy();
dst.position = position == null ? null : position.copy();
dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy();
dst.status = status == null ? null : status.copy();
dst.partOf = partOf == null ? null : partOf.copy();
dst.mode = mode == null ? null : mode.copy();
dst.status = status == null ? null : status.copy();
return dst;
}
@ -1017,10 +1037,10 @@ public class Location extends DomainResource {
return false;
Location o = (Location) other;
return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true)
&& compareDeep(type, o.type, true) && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true)
&& compareDeep(physicalType, o.physicalType, true) && compareDeep(position, o.position, true) && compareDeep(managingOrganization, o.managingOrganization, true)
&& compareDeep(status, o.status, true) && compareDeep(partOf, o.partOf, true) && compareDeep(mode, o.mode, true)
;
&& compareDeep(mode, o.mode, true) && compareDeep(type, o.type, true) && compareDeep(telecom, o.telecom, true)
&& compareDeep(address, o.address, true) && compareDeep(physicalType, o.physicalType, true) && compareDeep(position, o.position, true)
&& compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(partOf, o.partOf, true)
&& compareDeep(status, o.status, true);
}
@Override
@ -1030,17 +1050,16 @@ public class Location extends DomainResource {
if (!(other instanceof Location))
return false;
Location o = (Location) other;
return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(status, o.status, true)
&& compareValues(mode, o.mode, true);
return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(mode, o.mode, true)
&& compareValues(status, o.status, true);
}
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty())
&& (description == null || description.isEmpty()) && (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty())
&& (address == null || address.isEmpty()) && (physicalType == null || physicalType.isEmpty())
&& (description == null || description.isEmpty()) && (mode == null || mode.isEmpty()) && (type == null || type.isEmpty())
&& (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (physicalType == null || physicalType.isEmpty())
&& (position == null || position.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty())
&& (status == null || status.isEmpty()) && (partOf == null || partOf.isEmpty()) && (mode == null || mode.isEmpty())
;
&& (partOf == null || partOf.isEmpty()) && (status == null || status.isEmpty());
}
@Override
@ -1048,24 +1067,24 @@ public class Location extends DomainResource {
return ResourceType.Location;
}
@SearchParamDefinition(name = "identifier", path = "Location.identifier", description = "Unique code or number identifying the location to its users", type = "token")
public static final String SP_IDENTIFIER = "identifier";
@SearchParamDefinition(name="identifier", path="Location.identifier", description="Unique code or number identifying the location to its users", type="token" )
public static final String SP_IDENTIFIER = "identifier";
@SearchParamDefinition(name="partof", path="Location.partOf", description="The location of which this location is a part", type="reference" )
public static final String SP_PARTOF = "partof";
@SearchParamDefinition(name = "near-distance", path = "", description = "A distance quantity to limit the near search to locations within a specific distance", type = "token")
public static final String SP_NEARDISTANCE = "near-distance";
@SearchParamDefinition(name="near-distance", path="", description="A distance quantity to limit the near search to locations within a specific distance", type="token" )
public static final String SP_NEARDISTANCE = "near-distance";
@SearchParamDefinition(name="address", path="Location.address", description="A (part of the) address of the location", type="string" )
public static final String SP_ADDRESS = "address";
@SearchParamDefinition(name = "organization", path = "Location.managingOrganization", description = "Searches for locations that are managed by the provided organization", type = "reference")
public static final String SP_ORGANIZATION = "organization";
@SearchParamDefinition(name="organization", path="Location.managingOrganization", description="Searches for locations that are managed by the provided organization", type="reference" )
public static final String SP_ORGANIZATION = "organization";
@SearchParamDefinition(name="name", path="Location.name", description="A (portion of the) name of the location", type="string" )
public static final String SP_NAME = "name";
@SearchParamDefinition(name = "near", path = "", description = "The coordinates expressed as [lat],[long] (using KML, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)", type = "token")
public static final String SP_NEAR = "near";
@SearchParamDefinition(name="near", path="", description="The coordinates expressed as [lat],[long] (using the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)", type="token" )
public static final String SP_NEAR = "near";
@SearchParamDefinition(name="type", path="Location.type", description="A code for the type of location", type="token" )
public static final String SP_TYPE = "type";
@SearchParamDefinition(name = "status", path = "Location.status", description = "Searches for locations with a specific kind of status", type = "token")
public static final String SP_STATUS = "status";
@SearchParamDefinition(name="status", path="Location.status", description="Searches for locations with a specific kind of status", type="token" )
public static final String SP_STATUS = "status";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Wed, Feb 18, 2015 12:09-0500 for FHIR v0.4.0
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
import java.util.*;
@ -45,144 +45,37 @@ import org.hl7.fhir.instance.model.annotations.Description;
@ResourceDef(name="Organization", profile="http://hl7.org/fhir/Profile/Organization")
public class Organization extends DomainResource {
public enum AdministrativeGender {
/**
* Male
*/
MALE,
/**
* Female
*/
FEMALE,
/**
* Other
*/
OTHER,
/**
* Unknown
*/
UNKNOWN,
/**
* added to help the parsers
*/
NULL;
public static AdministrativeGender fromCode(String codeString) throws Exception {
if (codeString == null || "".equals(codeString))
return null;
if ("male".equals(codeString))
return MALE;
if ("female".equals(codeString))
return FEMALE;
if ("other".equals(codeString))
return OTHER;
if ("unknown".equals(codeString))
return UNKNOWN;
throw new Exception("Unknown AdministrativeGender code '"+codeString+"'");
}
public String toCode() {
switch (this) {
case MALE: return "male";
case FEMALE: return "female";
case OTHER: return "other";
case UNKNOWN: return "unknown";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case MALE: return "";
case FEMALE: return "";
case OTHER: return "";
case UNKNOWN: return "";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case MALE: return "Male";
case FEMALE: return "Female";
case OTHER: return "Other";
case UNKNOWN: return "Unknown";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case MALE: return "male";
case FEMALE: return "female";
case OTHER: return "other";
case UNKNOWN: return "unknown";
default: return "?";
}
}
}
public static class AdministrativeGenderEnumFactory implements EnumFactory<AdministrativeGender> {
public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("male".equals(codeString))
return AdministrativeGender.MALE;
if ("female".equals(codeString))
return AdministrativeGender.FEMALE;
if ("other".equals(codeString))
return AdministrativeGender.OTHER;
if ("unknown".equals(codeString))
return AdministrativeGender.UNKNOWN;
throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'");
}
public String toCode(AdministrativeGender code) {
if (code == AdministrativeGender.MALE)
return "male";
if (code == AdministrativeGender.FEMALE)
return "female";
if (code == AdministrativeGender.OTHER)
return "other";
if (code == AdministrativeGender.UNKNOWN)
return "unknown";
return "?";
}
}
@Block()
public static class OrganizationContactComponent extends BackboneElement {
/**
* Indicates a purpose for which the contact can be reached.
*/
@Child(name="purpose", type={CodeableConcept.class}, order=1, min=0, max=1)
@Child(name ="purpose", type={CodeableConcept.class}, order=1, min=0, max=1)
@Description(shortDefinition="The type of contact", formalDefinition="Indicates a purpose for which the contact can be reached." )
protected CodeableConcept purpose;
/**
* A name associated with the contact.
*/
@Child(name="name", type={HumanName.class}, order=2, min=0, max=1)
@Child(name ="name", type={HumanName.class}, order=2, min=0, max=1)
@Description(shortDefinition="A name associated with the contact", formalDefinition="A name associated with the contact." )
protected HumanName name;
/**
* A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.
*/
@Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED)
@Child(name ="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Contact details (telephone, email, etc) for a contact", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the party may be contacted." )
protected List<ContactPoint> telecom;
/**
* Visiting or postal addresses for the contact.
*/
@Child(name="address", type={AddressType.class}, order=4, min=0, max=1)
@Child(name ="address", type={Address.class}, order=4, min=0, max=1)
@Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." )
protected AddressType address;
protected Address address;
/**
* Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
*/
@Child(name="gender", type={CodeType.class}, order=5, min=0, max=1)
@Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." )
protected Enumeration<AdministrativeGender> gender;
private static final long serialVersionUID = -1433864122L;
private static final long serialVersionUID = 1831121305L;
public OrganizationContactComponent() {
super();
@ -266,15 +159,25 @@ public class Organization extends DomainResource {
return t;
}
// syntactic sugar
public OrganizationContactComponent addTelecom(ContactPoint t) { //3
if (t == null)
return this;
if (this.telecom == null)
this.telecom = new ArrayList<ContactPoint>();
this.telecom.add(t);
return this;
}
/**
* @return {@link #address} (Visiting or postal addresses for the contact.)
*/
public AddressType getAddress() {
public Address getAddress() {
if (this.address == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OrganizationContactComponent.address");
else if (Configuration.doAutoCreate())
this.address = new AddressType(); // cc
this.address = new Address(); // cc
return this.address;
}
@ -285,67 +188,17 @@ public class Organization extends DomainResource {
/**
* @param value {@link #address} (Visiting or postal addresses for the contact.)
*/
public OrganizationContactComponent setAddress(AddressType value) {
public OrganizationContactComponent setAddress(Address value) {
this.address = value;
return this;
}
/**
* @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
*/
public Enumeration<AdministrativeGender> getGenderElement() {
if (this.gender == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create OrganizationContactComponent.gender");
else if (Configuration.doAutoCreate())
this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb
return this.gender;
}
public boolean hasGenderElement() {
return this.gender != null && !this.gender.isEmpty();
}
public boolean hasGender() {
return this.gender != null && !this.gender.isEmpty();
}
/**
* @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
*/
public OrganizationContactComponent setGenderElement(Enumeration<AdministrativeGender> value) {
this.gender = value;
return this;
}
/**
* @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
*/
public AdministrativeGender getGender() {
return this.gender == null ? null : this.gender.getValue();
}
/**
* @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
*/
public OrganizationContactComponent setGender(AdministrativeGender value) {
if (value == null)
this.gender = null;
else {
if (this.gender == null)
this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory());
this.gender.setValue(value);
}
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, java.lang.Integer.MAX_VALUE, purpose));
childrenList.add(new Property("name", "HumanName", "A name associated with the contact.", 0, java.lang.Integer.MAX_VALUE, name));
childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom));
childrenList.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, java.lang.Integer.MAX_VALUE, address));
childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender));
}
public OrganizationContactComponent copy() {
@ -359,7 +212,6 @@ public class Organization extends DomainResource {
dst.telecom.add(i.copy());
};
dst.address = address == null ? null : address.copy();
dst.gender = gender == null ? null : gender.copy();
return dst;
}
@ -371,7 +223,7 @@ public class Organization extends DomainResource {
return false;
OrganizationContactComponent o = (OrganizationContactComponent) other;
return compareDeep(purpose, o.purpose, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true)
&& compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true);
&& compareDeep(address, o.address, true);
}
@Override
@ -381,13 +233,12 @@ public class Organization extends DomainResource {
if (!(other instanceof OrganizationContactComponent))
return false;
OrganizationContactComponent o = (OrganizationContactComponent) other;
return compareValues(gender, o.gender, true);
return true;
}
public boolean isEmpty() {
return super.isEmpty() && (purpose == null || purpose.isEmpty()) && (name == null || name.isEmpty())
&& (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty())
;
&& (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty());
}
}
@ -395,42 +246,42 @@ public class Organization extends DomainResource {
/**
* Identifier for the organization that is used to identify the organization across multiple disparate systems.
*/
@Child(name = "identifier", type = {Identifier.class}, order = 0, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Identifies this organization across multiple systems", formalDefinition="Identifier for the organization that is used to identify the organization across multiple disparate systems." )
protected List<Identifier> identifier;
/**
* A name associated with the organization.
*/
@Child(name = "name", type = {StringType.class}, order = 1, min = 0, max = 1)
@Child(name ="name", type={StringType.class}, order=1, min=0, max=1)
@Description(shortDefinition="Name used for the organization", formalDefinition="A name associated with the organization." )
protected StringType name;
/**
* The kind of organization that this is.
*/
@Child(name = "type", type = {CodeableConcept.class}, order = 2, min = 0, max = 1)
@Child(name ="type", type={CodeableConcept.class}, order=2, min=0, max=1)
@Description(shortDefinition="Kind of organization", formalDefinition="The kind of organization that this is." )
protected CodeableConcept type;
/**
* A contact detail for the organization.
*/
@Child(name = "telecom", type = {ContactPoint.class}, order = 3, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="A contact detail for the organization", formalDefinition="A contact detail for the organization." )
protected List<ContactPoint> telecom;
/**
* An address for the organization.
*/
@Child(name = "address", type = {AddressType.class}, order = 4, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="address", type={Address.class}, order=4, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." )
protected List<AddressType> address;
protected List<Address> address;
/**
* The organization of which this organization forms a part.
*/
@Child(name = "partOf", type = {Organization.class}, order = 5, min = 0, max = 1)
@Child(name ="partOf", type={Organization.class}, order=5, min=0, max=1)
@Description(shortDefinition="The organization of which this organization forms a part", formalDefinition="The organization of which this organization forms a part." )
protected Reference partOf;
@ -442,30 +293,18 @@ public class Organization extends DomainResource {
/**
* Contact for the organization for a certain purpose.
*/
@Child(name = "contact", type = {}, order = 6, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="contact", type={}, order=6, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Contact for the organization for a certain purpose", formalDefinition="Contact for the organization for a certain purpose." )
protected List<OrganizationContactComponent> contact;
/**
* Location(s) the organization uses to provide services.
*/
@Child(name = "location", type = {Location.class}, order = 7, min = 0, max = Child.MAX_UNLIMITED)
@Description(shortDefinition="Location(s) the organization uses to provide services", formalDefinition="Location(s) the organization uses to provide services." )
protected List<Reference> location;
/**
* The actual objects that are the target of the reference (Location(s) the organization uses to provide services.)
*/
protected List<Location> locationTarget;
/**
* Whether the organization's record is still in active use.
*/
@Child(name = "active", type = {BooleanType.class}, order = 8, min = 0, max = 1)
@Child(name ="active", type={BooleanType.class}, order=7, min=0, max=1)
@Description(shortDefinition="Whether the organization's record is still in active use", formalDefinition="Whether the organization's record is still in active use." )
protected BooleanType active;
private static final long serialVersionUID = -75313696L;
private static final long serialVersionUID = 1766834739L;
public Organization() {
super();
@ -501,6 +340,16 @@ public class Organization extends DomainResource {
return t;
}
// syntactic sugar
public Organization addIdentifier(Identifier t) { //3
if (t == null)
return this;
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return this;
}
/**
* @return {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
*/
@ -604,19 +453,29 @@ public class Organization extends DomainResource {
return t;
}
// syntactic sugar
public Organization addTelecom(ContactPoint t) { //3
if (t == null)
return this;
if (this.telecom == null)
this.telecom = new ArrayList<ContactPoint>();
this.telecom.add(t);
return this;
}
/**
* @return {@link #address} (An address for the organization.)
*/
public List<AddressType> getAddress() {
public List<Address> getAddress() {
if (this.address == null)
this.address = new ArrayList<AddressType>();
this.address = new ArrayList<Address>();
return this.address;
}
public boolean hasAddress() {
if (this.address == null)
return false;
for (AddressType item : this.address)
for (Address item : this.address)
if (!item.isEmpty())
return true;
return false;
@ -626,14 +485,24 @@ public class Organization extends DomainResource {
* @return {@link #address} (An address for the organization.)
*/
// syntactic sugar
public AddressType addAddress() { //3
AddressType t = new AddressType();
public Address addAddress() { //3
Address t = new Address();
if (this.address == null)
this.address = new ArrayList<AddressType>();
this.address = new ArrayList<Address>();
this.address.add(t);
return t;
}
// syntactic sugar
public Organization addAddress(Address t) { //3
if (t == null)
return this;
if (this.address == null)
this.address = new ArrayList<Address>();
this.address.add(t);
return this;
}
/**
* @return {@link #partOf} (The organization of which this organization forms a part.)
*/
@ -708,55 +577,14 @@ public class Organization extends DomainResource {
return t;
}
/**
* @return {@link #location} (Location(s) the organization uses to provide services.)
*/
public List<Reference> getLocation() {
if (this.location == null)
this.location = new ArrayList<Reference>();
return this.location;
}
public boolean hasLocation() {
if (this.location == null)
return false;
for (Reference item : this.location)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #location} (Location(s) the organization uses to provide services.)
*/
// syntactic sugar
public Reference addLocation() { //3
Reference t = new Reference();
if (this.location == null)
this.location = new ArrayList<Reference>();
this.location.add(t);
return t;
}
/**
* @return {@link #location} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Location(s) the organization uses to provide services.)
*/
public List<Location> getLocationTarget() {
if (this.locationTarget == null)
this.locationTarget = new ArrayList<Location>();
return this.locationTarget;
}
// syntactic sugar
/**
* @return {@link #location} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Location(s) the organization uses to provide services.)
*/
public Location addLocationTarget() {
Location r = new Location();
if (this.locationTarget == null)
this.locationTarget = new ArrayList<Location>();
this.locationTarget.add(r);
return r;
public Organization addContact(OrganizationContactComponent t) { //3
if (t == null)
return this;
if (this.contact == null)
this.contact = new ArrayList<OrganizationContactComponent>();
this.contact.add(t);
return this;
}
/**
@ -791,7 +619,7 @@ public class Organization extends DomainResource {
* @return Whether the organization's record is still in active use.
*/
public boolean getActive() {
return this.active == null ? false : this.active.getValue();
return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
}
/**
@ -813,7 +641,6 @@ public class Organization extends DomainResource {
childrenList.add(new Property("address", "Address", "An address for the organization.", 0, java.lang.Integer.MAX_VALUE, address));
childrenList.add(new Property("partOf", "Reference(Organization)", "The organization of which this organization forms a part.", 0, java.lang.Integer.MAX_VALUE, partOf));
childrenList.add(new Property("contact", "", "Contact for the organization for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact));
childrenList.add(new Property("location", "Reference(Location)", "Location(s) the organization uses to provide services.", 0, java.lang.Integer.MAX_VALUE, location));
childrenList.add(new Property("active", "boolean", "Whether the organization's record is still in active use.", 0, java.lang.Integer.MAX_VALUE, active));
}
@ -833,8 +660,8 @@ public class Organization extends DomainResource {
dst.telecom.add(i.copy());
};
if (address != null) {
dst.address = new ArrayList<AddressType>();
for (AddressType i : address)
dst.address = new ArrayList<Address>();
for (Address i : address)
dst.address.add(i.copy());
};
dst.partOf = partOf == null ? null : partOf.copy();
@ -843,11 +670,6 @@ public class Organization extends DomainResource {
for (OrganizationContactComponent i : contact)
dst.contact.add(i.copy());
};
if (location != null) {
dst.location = new ArrayList<Reference>();
for (Reference i : location)
dst.location.add(i.copy());
};
dst.active = active == null ? null : active.copy();
return dst;
}
@ -865,8 +687,7 @@ public class Organization extends DomainResource {
Organization o = (Organization) other;
return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(type, o.type, true)
&& compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) && compareDeep(partOf, o.partOf, true)
&& compareDeep(contact, o.contact, true) && compareDeep(location, o.location, true) && compareDeep(active, o.active, true)
;
&& compareDeep(contact, o.contact, true) && compareDeep(active, o.active, true);
}
@Override
@ -882,8 +703,8 @@ public class Organization extends DomainResource {
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty())
&& (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty())
&& (partOf == null || partOf.isEmpty()) && (contact == null || contact.isEmpty()) && (location == null || location.isEmpty())
&& (active == null || active.isEmpty());
&& (partOf == null || partOf.isEmpty()) && (contact == null || contact.isEmpty()) && (active == null || active.isEmpty())
;
}
@Override
@ -891,12 +712,14 @@ public class Organization extends DomainResource {
return ResourceType.Organization;
}
@SearchParamDefinition(name = "identifier", path = "Organization.identifier", description = "Any identifier for the organization (not the accreditation issuer's identifier)", type = "token")
@SearchParamDefinition(name="identifier", path="Organization.identifier", description="Any identifier for the organization (not the accreditation issuer's identifier)", type="token" )
public static final String SP_IDENTIFIER = "identifier";
@SearchParamDefinition(name="partof", path="Organization.partOf", description="Search all organizations that are part of the given organization", type="reference" )
public static final String SP_PARTOF = "partof";
@SearchParamDefinition(name = "phonetic", path = "", description = "A portion of the organization's name using some kind of phonetic matching algorithm", type = "string")
@SearchParamDefinition(name="phonetic", path="", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" )
public static final String SP_PHONETIC = "phonetic";
@SearchParamDefinition(name="address", path="Organization.address", description="A (part of the) address of the Organization", type="string" )
public static final String SP_ADDRESS = "address";
@SearchParamDefinition(name="name", path="Organization.name", description="A portion of the organization's name", type="string" )
public static final String SP_NAME = "name";
@SearchParamDefinition(name="active", path="Organization.active", description="Whether the organization's record is active", type="token" )

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Wed, Feb 18, 2015 12:09-0500 for FHIR v0.4.0
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
import java.util.*;
@ -108,10 +108,10 @@ public class Person extends DomainResource {
}
public String getDisplay() {
switch (this) {
case MALE: return "male";
case FEMALE: return "female";
case OTHER: return "other";
case UNKNOWN: return "unknown";
case MALE: return "Male";
case FEMALE: return "Female";
case OTHER: return "Other";
case UNKNOWN: return "Unknown";
default: return "?";
}
}
@ -250,74 +250,74 @@ public class Person extends DomainResource {
/**
* The resource to which this actual person is associated.
*/
@Child(name="other", type={Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1)
@Child(name ="target", type={Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1)
@Description(shortDefinition="The resource to which this actual person is associated", formalDefinition="The resource to which this actual person is associated." )
protected Reference other;
protected Reference target;
/**
* The actual object that is the target of the reference (The resource to which this actual person is associated.)
*/
protected Resource otherTarget;
protected Resource targetTarget;
/**
* Level of assurance that this link is actually associated with the referenced record.
* Level of assurance that this link is actually associated with the target resource.
*/
@Child(name="assurance", type={CodeType.class}, order=2, min=0, max=1)
@Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the referenced record." )
@Child(name ="assurance", type={CodeType.class}, order=2, min=0, max=1)
@Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the target resource." )
protected Enumeration<IdentityAssuranceLevel> assurance;
private static final long serialVersionUID = -1417349007L;
private static final long serialVersionUID = 508763647L;
public PersonLinkComponent() {
super();
}
public PersonLinkComponent(Reference other) {
public PersonLinkComponent(Reference target) {
super();
this.other = other;
this.target = target;
}
/**
* @return {@link #other} (The resource to which this actual person is associated.)
* @return {@link #target} (The resource to which this actual person is associated.)
*/
public Reference getOther() {
if (this.other == null)
public Reference getTarget() {
if (this.target == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create PersonLinkComponent.other");
throw new Error("Attempt to auto-create PersonLinkComponent.target");
else if (Configuration.doAutoCreate())
this.other = new Reference(); // cc
return this.other;
this.target = new Reference(); // cc
return this.target;
}
public boolean hasOther() {
return this.other != null && !this.other.isEmpty();
public boolean hasTarget() {
return this.target != null && !this.target.isEmpty();
}
/**
* @param value {@link #other} (The resource to which this actual person is associated.)
* @param value {@link #target} (The resource to which this actual person is associated.)
*/
public PersonLinkComponent setOther(Reference value) {
this.other = value;
public PersonLinkComponent setTarget(Reference value) {
this.target = value;
return this;
}
/**
* @return {@link #other} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.)
* @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.)
*/
public Resource getOtherTarget() {
return this.otherTarget;
public Resource getTargetTarget() {
return this.targetTarget;
}
/**
* @param value {@link #other} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.)
* @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.)
*/
public PersonLinkComponent setOtherTarget(Resource value) {
this.otherTarget = value;
public PersonLinkComponent setTargetTarget(Resource value) {
this.targetTarget = value;
return this;
}
/**
* @return {@link #assurance} (Level of assurance that this link is actually associated with the referenced record.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value
* @return {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value
*/
public Enumeration<IdentityAssuranceLevel> getAssuranceElement() {
if (this.assurance == null)
@ -337,7 +337,7 @@ public class Person extends DomainResource {
}
/**
* @param value {@link #assurance} (Level of assurance that this link is actually associated with the referenced record.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value
* @param value {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value
*/
public PersonLinkComponent setAssuranceElement(Enumeration<IdentityAssuranceLevel> value) {
this.assurance = value;
@ -345,14 +345,14 @@ public class Person extends DomainResource {
}
/**
* @return Level of assurance that this link is actually associated with the referenced record.
* @return Level of assurance that this link is actually associated with the target resource.
*/
public IdentityAssuranceLevel getAssurance() {
return this.assurance == null ? null : this.assurance.getValue();
}
/**
* @param value Level of assurance that this link is actually associated with the referenced record.
* @param value Level of assurance that this link is actually associated with the target resource.
*/
public PersonLinkComponent setAssurance(IdentityAssuranceLevel value) {
if (value == null)
@ -367,14 +367,14 @@ public class Person extends DomainResource {
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("other", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, java.lang.Integer.MAX_VALUE, other));
childrenList.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the referenced record.", 0, java.lang.Integer.MAX_VALUE, assurance));
childrenList.add(new Property("target", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, java.lang.Integer.MAX_VALUE, target));
childrenList.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the target resource.", 0, java.lang.Integer.MAX_VALUE, assurance));
}
public PersonLinkComponent copy() {
PersonLinkComponent dst = new PersonLinkComponent();
copyValues(dst);
dst.other = other == null ? null : other.copy();
dst.target = target == null ? null : target.copy();
dst.assurance = assurance == null ? null : assurance.copy();
return dst;
}
@ -386,7 +386,7 @@ public class Person extends DomainResource {
if (!(other instanceof PersonLinkComponent))
return false;
PersonLinkComponent o = (PersonLinkComponent) other;
return compareDeep(other, o.other, true) && compareDeep(assurance, o.assurance, true);
return compareDeep(target, o.target, true) && compareDeep(assurance, o.assurance, true);
}
@Override
@ -400,7 +400,7 @@ public class Person extends DomainResource {
}
public boolean isEmpty() {
return super.isEmpty() && (other == null || other.isEmpty()) && (assurance == null || assurance.isEmpty())
return super.isEmpty() && (target == null || target.isEmpty()) && (assurance == null || assurance.isEmpty())
;
}
@ -409,56 +409,56 @@ public class Person extends DomainResource {
/**
* Identifier for a person within a particular scope.
*/
@Child(name = "identifier", type = {Identifier.class}, order = 0, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." )
protected List<Identifier> identifier;
/**
* A name associated with the person.
*/
@Child(name = "name", type = {HumanName.class}, order = 1, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="name", type={HumanName.class}, order=1, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." )
protected List<HumanName> name;
/**
* A contact detail for the person, e.g. a telephone number or an email address.
*/
@Child(name = "telecom", type = {ContactPoint.class}, order = 2, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="telecom", type={ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." )
protected List<ContactPoint> telecom;
/**
* Administrative Gender.
*/
@Child(name = "gender", type = {CodeType.class}, order = 3, min = 0, max = 1)
@Child(name ="gender", type={CodeType.class}, order=3, min=0, max=1)
@Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." )
protected Enumeration<AdministrativeGender> gender;
/**
* The birth date for the person.
*/
@Child(name = "birthDate", type = {DateTimeType.class}, order = 4, min = 0, max = 1)
@Child(name ="birthDate", type={DateTimeType.class}, order=4, min=0, max=1)
@Description(shortDefinition="The birth date for the person", formalDefinition="The birth date for the person." )
protected DateTimeType birthDate;
/**
* One or more addresses for the person.
*/
@Child(name = "address", type = {AddressType.class}, order = 5, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="address", type={Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." )
protected List<AddressType> address;
protected List<Address> address;
/**
* An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.
*/
@Child(name = "photo", type = {AttachmentType.class}, order = 6, min = 0, max = 1)
@Child(name ="photo", type={Attachment.class}, order=6, min=0, max=1)
@Description(shortDefinition="Image of the Person", formalDefinition="An image that can be displayed as a thumbnail of the person to enhance the identification of the individual." )
protected AttachmentType photo;
protected Attachment photo;
/**
* The Organization that is the custodian of the person record.
*/
@Child(name = "managingOrganization", type = {Organization.class}, order = 7, min = 0, max = 1)
@Child(name ="managingOrganization", type={Organization.class}, order=7, min=0, max=1)
@Description(shortDefinition="The Organization that is the custodian of the person record", formalDefinition="The Organization that is the custodian of the person record." )
protected Reference managingOrganization;
@ -470,15 +470,15 @@ public class Person extends DomainResource {
/**
* Whether this person's record is in active use.
*/
@Child(name = "active", type = {BooleanType.class}, order = 8, min = 0, max = 1)
@Child(name ="active", type={BooleanType.class}, order=8, min=0, max=1)
@Description(shortDefinition="This person's record is in active use", formalDefinition="Whether this person's record is in active use." )
protected BooleanType active;
/**
* Link to a resource that converns the same actual person.
* Link to a resource that concerns the same actual person.
*/
@Child(name = "link", type = {}, order = 9, min = 0, max = Child.MAX_UNLIMITED)
@Description(shortDefinition="Link to a resource that converns the same actual person", formalDefinition="Link to a resource that converns the same actual person." )
@Child(name ="link", type={}, order=9, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Link to a resource that concerns the same actual person", formalDefinition="Link to a resource that concerns the same actual person." )
protected List<PersonLinkComponent> link;
private static final long serialVersionUID = -2072707611L;
@ -517,6 +517,16 @@ public class Person extends DomainResource {
return t;
}
// syntactic sugar
public Person addIdentifier(Identifier t) { //3
if (t == null)
return this;
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return this;
}
/**
* @return {@link #name} (A name associated with the person.)
*/
@ -547,6 +557,16 @@ public class Person extends DomainResource {
return t;
}
// syntactic sugar
public Person addName(HumanName t) { //3
if (t == null)
return this;
if (this.name == null)
this.name = new ArrayList<HumanName>();
this.name.add(t);
return this;
}
/**
* @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.)
*/
@ -577,6 +597,16 @@ public class Person extends DomainResource {
return t;
}
// syntactic sugar
public Person addTelecom(ContactPoint t) { //3
if (t == null)
return this;
if (this.telecom == null)
this.telecom = new ArrayList<ContactPoint>();
this.telecom.add(t);
return this;
}
/**
* @return {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
*/
@ -678,16 +708,16 @@ public class Person extends DomainResource {
/**
* @return {@link #address} (One or more addresses for the person.)
*/
public List<AddressType> getAddress() {
public List<Address> getAddress() {
if (this.address == null)
this.address = new ArrayList<AddressType>();
this.address = new ArrayList<Address>();
return this.address;
}
public boolean hasAddress() {
if (this.address == null)
return false;
for (AddressType item : this.address)
for (Address item : this.address)
if (!item.isEmpty())
return true;
return false;
@ -697,23 +727,33 @@ public class Person extends DomainResource {
* @return {@link #address} (One or more addresses for the person.)
*/
// syntactic sugar
public AddressType addAddress() { //3
AddressType t = new AddressType();
public Address addAddress() { //3
Address t = new Address();
if (this.address == null)
this.address = new ArrayList<AddressType>();
this.address = new ArrayList<Address>();
this.address.add(t);
return t;
}
// syntactic sugar
public Person addAddress(Address t) { //3
if (t == null)
return this;
if (this.address == null)
this.address = new ArrayList<Address>();
this.address.add(t);
return this;
}
/**
* @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.)
*/
public AttachmentType getPhoto() {
public Attachment getPhoto() {
if (this.photo == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Person.photo");
else if (Configuration.doAutoCreate())
this.photo = new AttachmentType(); // cc
this.photo = new Attachment(); // cc
return this.photo;
}
@ -724,7 +764,7 @@ public class Person extends DomainResource {
/**
* @param value {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.)
*/
public Person setPhoto(AttachmentType value) {
public Person setPhoto(Attachment value) {
this.photo = value;
return this;
}
@ -805,7 +845,7 @@ public class Person extends DomainResource {
* @return Whether this person's record is in active use.
*/
public boolean getActive() {
return this.active == null ? false : this.active.getValue();
return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
}
/**
@ -819,7 +859,7 @@ public class Person extends DomainResource {
}
/**
* @return {@link #link} (Link to a resource that converns the same actual person.)
* @return {@link #link} (Link to a resource that concerns the same actual person.)
*/
public List<PersonLinkComponent> getLink() {
if (this.link == null)
@ -837,7 +877,7 @@ public class Person extends DomainResource {
}
/**
* @return {@link #link} (Link to a resource that converns the same actual person.)
* @return {@link #link} (Link to a resource that concerns the same actual person.)
*/
// syntactic sugar
public PersonLinkComponent addLink() { //3
@ -848,6 +888,16 @@ public class Person extends DomainResource {
return t;
}
// syntactic sugar
public Person addLink(PersonLinkComponent t) { //3
if (t == null)
return this;
if (this.link == null)
this.link = new ArrayList<PersonLinkComponent>();
this.link.add(t);
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier));
@ -859,7 +909,7 @@ public class Person extends DomainResource {
childrenList.add(new Property("photo", "Attachment", "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.", 0, java.lang.Integer.MAX_VALUE, photo));
childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The Organization that is the custodian of the person record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization));
childrenList.add(new Property("active", "boolean", "Whether this person's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active));
childrenList.add(new Property("link", "", "Link to a resource that converns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link));
childrenList.add(new Property("link", "", "Link to a resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link));
}
public Person copy() {
@ -883,8 +933,8 @@ public class Person extends DomainResource {
dst.gender = gender == null ? null : gender.copy();
dst.birthDate = birthDate == null ? null : birthDate.copy();
if (address != null) {
dst.address = new ArrayList<AddressType>();
for (AddressType i : address)
dst.address = new ArrayList<Address>();
for (Address i : address)
dst.address.add(i.copy());
};
dst.photo = photo == null ? null : photo.copy();
@ -938,8 +988,8 @@ public class Person extends DomainResource {
return ResourceType.Person;
}
@SearchParamDefinition(name = "identifier", path = "Person.identifier", description = "A person Identifier", type = "token")
public static final String SP_IDENTIFIER = "identifier";
@SearchParamDefinition(name="identifier", path="Person.identifier", description="A person Identifier", type="token" )
public static final String SP_IDENTIFIER = "identifier";
@SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" )
public static final String SP_PHONETIC = "phonetic";
@SearchParamDefinition(name="address", path="Person.address", description="An address in any kind of address/part", type="string" )
@ -948,12 +998,20 @@ public class Person extends DomainResource {
public static final String SP_BIRTHDATE = "birthdate";
@SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" )
public static final String SP_GENDER = "gender";
@SearchParamDefinition(name = "organization", path = "Person.managingOrganization", description = "The organization at which this person record is being managed", type = "reference")
public static final String SP_ORGANIZATION = "organization";
@SearchParamDefinition(name = "name", path = "Person.name", description = "A portion of name in any name part", type = "string")
public static final String SP_NAME = "name";
@SearchParamDefinition(name = "telecom", path = "Person.telecom", description = "The value in any kind of contact", type = "string")
public static final String SP_TELECOM = "telecom";
@SearchParamDefinition(name="practitioner", path="Person.link.target", description="The Person links to this Practitioner", type="reference" )
public static final String SP_PRACTITIONER = "practitioner";
@SearchParamDefinition(name="patient", path="Person.link.target", description="The Person links to this Patient", type="reference" )
public static final String SP_PATIENT = "patient";
@SearchParamDefinition(name="organization", path="Person.managingOrganization", description="The organization at which this person record is being managed", type="reference" )
public static final String SP_ORGANIZATION = "organization";
@SearchParamDefinition(name="name", path="Person.name", description="A portion of name in any name part", type="string" )
public static final String SP_NAME = "name";
@SearchParamDefinition(name="link", path="Person.link.target", description="Any link has this Patient, Person, RelatedPerson or Practitioner reference", type="reference" )
public static final String SP_LINK = "link";
@SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="token" )
public static final String SP_TELECOM = "telecom";
@SearchParamDefinition(name="relatedperson", path="Person.link.target", description="The Person links to this RelatedPerson", type="reference" )
public static final String SP_RELATEDPERSON = "relatedperson";
}

View File

@ -0,0 +1,889 @@
package org.hl7.fhir.instance.model;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
import java.util.*;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.instance.model.annotations.ResourceDef;
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
import org.hl7.fhir.instance.model.annotations.Block;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
/**
* This resource provides processing status, errors and notes from the processing of a resource.
*/
@ResourceDef(name="ProcessResponse", profile="http://hl7.org/fhir/Profile/ProcessResponse")
public class ProcessResponse extends DomainResource {
@Block()
public static class ProcessResponseNotesComponent extends BackboneElement {
/**
* The note purpose: Print/Display.
*/
@Child(name ="type", type={Coding.class}, order=1, min=0, max=1)
@Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." )
protected Coding type;
/**
* The note text.
*/
@Child(name ="text", type={StringType.class}, order=2, min=0, max=1)
@Description(shortDefinition="Notes text", formalDefinition="The note text." )
protected StringType text;
private static final long serialVersionUID = 129959202L;
public ProcessResponseNotesComponent() {
super();
}
/**
* @return {@link #type} (The note purpose: Print/Display.)
*/
public Coding getType() {
if (this.type == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponseNotesComponent.type");
else if (Configuration.doAutoCreate())
this.type = new Coding(); // cc
return this.type;
}
public boolean hasType() {
return this.type != null && !this.type.isEmpty();
}
/**
* @param value {@link #type} (The note purpose: Print/Display.)
*/
public ProcessResponseNotesComponent setType(Coding value) {
this.type = value;
return this;
}
/**
* @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
*/
public StringType getTextElement() {
if (this.text == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponseNotesComponent.text");
else if (Configuration.doAutoCreate())
this.text = new StringType(); // bb
return this.text;
}
public boolean hasTextElement() {
return this.text != null && !this.text.isEmpty();
}
public boolean hasText() {
return this.text != null && !this.text.isEmpty();
}
/**
* @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
*/
public ProcessResponseNotesComponent setTextElement(StringType value) {
this.text = value;
return this;
}
/**
* @return The note text.
*/
public String getText() {
return this.text == null ? null : this.text.getValue();
}
/**
* @param value The note text.
*/
public ProcessResponseNotesComponent setText(String value) {
if (Utilities.noString(value))
this.text = null;
else {
if (this.text == null)
this.text = new StringType();
this.text.setValue(value);
}
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text));
}
public ProcessResponseNotesComponent copy() {
ProcessResponseNotesComponent dst = new ProcessResponseNotesComponent();
copyValues(dst);
dst.type = type == null ? null : type.copy();
dst.text = text == null ? null : text.copy();
return dst;
}
@Override
public boolean equalsDeep(Base other) {
if (!super.equalsDeep(other))
return false;
if (!(other instanceof ProcessResponseNotesComponent))
return false;
ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other;
return compareDeep(type, o.type, true) && compareDeep(text, o.text, true);
}
@Override
public boolean equalsShallow(Base other) {
if (!super.equalsShallow(other))
return false;
if (!(other instanceof ProcessResponseNotesComponent))
return false;
ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other;
return compareValues(text, o.text, true);
}
public boolean isEmpty() {
return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty())
;
}
}
/**
* The Response Business Identifier.
*/
@Child(name ="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." )
protected List<Identifier> identifier;
/**
* Original request resource reference.
*/
@Child(name ="request", type={}, order=1, min=0, max=1)
@Description(shortDefinition="Request reference", formalDefinition="Original request resource reference." )
protected Reference request;
/**
* The actual object that is the target of the reference (Original request resource reference.)
*/
protected Resource requestTarget;
/**
* Transaction status: error, complete, held.
*/
@Child(name ="outcome", type={Coding.class}, order=2, min=0, max=1)
@Description(shortDefinition="Processing outcome", formalDefinition="Transaction status: error, complete, held." )
protected Coding outcome;
/**
* A description of the status of the adjudication or processing.
*/
@Child(name ="disposition", type={StringType.class}, order=3, min=0, max=1)
@Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication or processing." )
protected StringType disposition;
/**
* The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.
*/
@Child(name ="ruleset", type={Coding.class}, order=4, min=0, max=1)
@Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." )
protected Coding ruleset;
/**
* The style (standard) and version of the original material which was converted into this resource.
*/
@Child(name ="originalRuleset", type={Coding.class}, order=5, min=0, max=1)
@Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." )
protected Coding originalRuleset;
/**
* The date when the enclosed suite of services were performed or completed.
*/
@Child(name ="created", type={DateTimeType.class}, order=6, min=0, max=1)
@Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
protected DateTimeType created;
/**
* The organization who produced this adjudicated response.
*/
@Child(name ="organization", type={Organization.class}, order=7, min=0, max=1)
@Description(shortDefinition="Authoring Organization", formalDefinition="The organization who produced this adjudicated response." )
protected Reference organization;
/**
* The actual object that is the target of the reference (The organization who produced this adjudicated response.)
*/
protected Organization organizationTarget;
/**
* The practitioner who is responsible for the services rendered to the patient.
*/
@Child(name ="requestProvider", type={Practitioner.class}, order=8, min=0, max=1)
@Description(shortDefinition="Responsible Practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
protected Reference requestProvider;
/**
* The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.)
*/
protected Practitioner requestProviderTarget;
/**
* The organization which is responsible for the services rendered to the patient.
*/
@Child(name ="requestOrganization", type={Organization.class}, order=9, min=0, max=1)
@Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." )
protected Reference requestOrganization;
/**
* The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.)
*/
protected Organization requestOrganizationTarget;
/**
* The form to be used for printing the content.
*/
@Child(name ="form", type={Coding.class}, order=10, min=0, max=1)
@Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." )
protected Coding form;
/**
* Suite of processing note or additional requirements is the processing has been held.
*/
@Child(name ="notes", type={}, order=11, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Notes", formalDefinition="Suite of processing note or additional requirements is the processing has been held." )
protected List<ProcessResponseNotesComponent> notes;
/**
* Processing errors.
*/
@Child(name ="error", type={Coding.class}, order=12, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Error code", formalDefinition="Processing errors." )
protected List<Coding> error;
private static final long serialVersionUID = -1668062545L;
public ProcessResponse() {
super();
}
/**
* @return {@link #identifier} (The Response Business Identifier.)
*/
public List<Identifier> getIdentifier() {
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
return this.identifier;
}
public boolean hasIdentifier() {
if (this.identifier == null)
return false;
for (Identifier item : this.identifier)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #identifier} (The Response Business Identifier.)
*/
// syntactic sugar
public Identifier addIdentifier() { //3
Identifier t = new Identifier();
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return t;
}
// syntactic sugar
public ProcessResponse addIdentifier(Identifier t) { //3
if (t == null)
return this;
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return this;
}
/**
* @return {@link #request} (Original request resource reference.)
*/
public Reference getRequest() {
if (this.request == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.request");
else if (Configuration.doAutoCreate())
this.request = new Reference(); // cc
return this.request;
}
public boolean hasRequest() {
return this.request != null && !this.request.isEmpty();
}
/**
* @param value {@link #request} (Original request resource reference.)
*/
public ProcessResponse setRequest(Reference value) {
this.request = value;
return this;
}
/**
* @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.)
*/
public Resource getRequestTarget() {
return this.requestTarget;
}
/**
* @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.)
*/
public ProcessResponse setRequestTarget(Resource value) {
this.requestTarget = value;
return this;
}
/**
* @return {@link #outcome} (Transaction status: error, complete, held.)
*/
public Coding getOutcome() {
if (this.outcome == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.outcome");
else if (Configuration.doAutoCreate())
this.outcome = new Coding(); // cc
return this.outcome;
}
public boolean hasOutcome() {
return this.outcome != null && !this.outcome.isEmpty();
}
/**
* @param value {@link #outcome} (Transaction status: error, complete, held.)
*/
public ProcessResponse setOutcome(Coding value) {
this.outcome = value;
return this;
}
/**
* @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
*/
public StringType getDispositionElement() {
if (this.disposition == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.disposition");
else if (Configuration.doAutoCreate())
this.disposition = new StringType(); // bb
return this.disposition;
}
public boolean hasDispositionElement() {
return this.disposition != null && !this.disposition.isEmpty();
}
public boolean hasDisposition() {
return this.disposition != null && !this.disposition.isEmpty();
}
/**
* @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
*/
public ProcessResponse setDispositionElement(StringType value) {
this.disposition = value;
return this;
}
/**
* @return A description of the status of the adjudication or processing.
*/
public String getDisposition() {
return this.disposition == null ? null : this.disposition.getValue();
}
/**
* @param value A description of the status of the adjudication or processing.
*/
public ProcessResponse setDisposition(String value) {
if (Utilities.noString(value))
this.disposition = null;
else {
if (this.disposition == null)
this.disposition = new StringType();
this.disposition.setValue(value);
}
return this;
}
/**
* @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
*/
public Coding getRuleset() {
if (this.ruleset == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.ruleset");
else if (Configuration.doAutoCreate())
this.ruleset = new Coding(); // cc
return this.ruleset;
}
public boolean hasRuleset() {
return this.ruleset != null && !this.ruleset.isEmpty();
}
/**
* @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
*/
public ProcessResponse setRuleset(Coding value) {
this.ruleset = value;
return this;
}
/**
* @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
*/
public Coding getOriginalRuleset() {
if (this.originalRuleset == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.originalRuleset");
else if (Configuration.doAutoCreate())
this.originalRuleset = new Coding(); // cc
return this.originalRuleset;
}
public boolean hasOriginalRuleset() {
return this.originalRuleset != null && !this.originalRuleset.isEmpty();
}
/**
* @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
*/
public ProcessResponse setOriginalRuleset(Coding value) {
this.originalRuleset = value;
return this;
}
/**
* @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public DateTimeType getCreatedElement() {
if (this.created == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.created");
else if (Configuration.doAutoCreate())
this.created = new DateTimeType(); // bb
return this.created;
}
public boolean hasCreatedElement() {
return this.created != null && !this.created.isEmpty();
}
public boolean hasCreated() {
return this.created != null && !this.created.isEmpty();
}
/**
* @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
*/
public ProcessResponse setCreatedElement(DateTimeType value) {
this.created = value;
return this;
}
/**
* @return The date when the enclosed suite of services were performed or completed.
*/
public Date getCreated() {
return this.created == null ? null : this.created.getValue();
}
/**
* @param value The date when the enclosed suite of services were performed or completed.
*/
public ProcessResponse setCreated(Date value) {
if (value == null)
this.created = null;
else {
if (this.created == null)
this.created = new DateTimeType();
this.created.setValue(value);
}
return this;
}
/**
* @return {@link #organization} (The organization who produced this adjudicated response.)
*/
public Reference getOrganization() {
if (this.organization == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.organization");
else if (Configuration.doAutoCreate())
this.organization = new Reference(); // cc
return this.organization;
}
public boolean hasOrganization() {
return this.organization != null && !this.organization.isEmpty();
}
/**
* @param value {@link #organization} (The organization who produced this adjudicated response.)
*/
public ProcessResponse setOrganization(Reference value) {
this.organization = value;
return this;
}
/**
* @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization who produced this adjudicated response.)
*/
public Organization getOrganizationTarget() {
if (this.organizationTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.organization");
else if (Configuration.doAutoCreate())
this.organizationTarget = new Organization(); // aa
return this.organizationTarget;
}
/**
* @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who produced this adjudicated response.)
*/
public ProcessResponse setOrganizationTarget(Organization value) {
this.organizationTarget = value;
return this;
}
/**
* @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
*/
public Reference getRequestProvider() {
if (this.requestProvider == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.requestProvider");
else if (Configuration.doAutoCreate())
this.requestProvider = new Reference(); // cc
return this.requestProvider;
}
public boolean hasRequestProvider() {
return this.requestProvider != null && !this.requestProvider.isEmpty();
}
/**
* @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
*/
public ProcessResponse setRequestProvider(Reference value) {
this.requestProvider = value;
return this;
}
/**
* @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
*/
public Practitioner getRequestProviderTarget() {
if (this.requestProviderTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.requestProvider");
else if (Configuration.doAutoCreate())
this.requestProviderTarget = new Practitioner(); // aa
return this.requestProviderTarget;
}
/**
* @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
*/
public ProcessResponse setRequestProviderTarget(Practitioner value) {
this.requestProviderTarget = value;
return this;
}
/**
* @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
*/
public Reference getRequestOrganization() {
if (this.requestOrganization == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.requestOrganization");
else if (Configuration.doAutoCreate())
this.requestOrganization = new Reference(); // cc
return this.requestOrganization;
}
public boolean hasRequestOrganization() {
return this.requestOrganization != null && !this.requestOrganization.isEmpty();
}
/**
* @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
*/
public ProcessResponse setRequestOrganization(Reference value) {
this.requestOrganization = value;
return this;
}
/**
* @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.)
*/
public Organization getRequestOrganizationTarget() {
if (this.requestOrganizationTarget == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.requestOrganization");
else if (Configuration.doAutoCreate())
this.requestOrganizationTarget = new Organization(); // aa
return this.requestOrganizationTarget;
}
/**
* @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.)
*/
public ProcessResponse setRequestOrganizationTarget(Organization value) {
this.requestOrganizationTarget = value;
return this;
}
/**
* @return {@link #form} (The form to be used for printing the content.)
*/
public Coding getForm() {
if (this.form == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ProcessResponse.form");
else if (Configuration.doAutoCreate())
this.form = new Coding(); // cc
return this.form;
}
public boolean hasForm() {
return this.form != null && !this.form.isEmpty();
}
/**
* @param value {@link #form} (The form to be used for printing the content.)
*/
public ProcessResponse setForm(Coding value) {
this.form = value;
return this;
}
/**
* @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.)
*/
public List<ProcessResponseNotesComponent> getNotes() {
if (this.notes == null)
this.notes = new ArrayList<ProcessResponseNotesComponent>();
return this.notes;
}
public boolean hasNotes() {
if (this.notes == null)
return false;
for (ProcessResponseNotesComponent item : this.notes)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.)
*/
// syntactic sugar
public ProcessResponseNotesComponent addNotes() { //3
ProcessResponseNotesComponent t = new ProcessResponseNotesComponent();
if (this.notes == null)
this.notes = new ArrayList<ProcessResponseNotesComponent>();
this.notes.add(t);
return t;
}
// syntactic sugar
public ProcessResponse addNotes(ProcessResponseNotesComponent t) { //3
if (t == null)
return this;
if (this.notes == null)
this.notes = new ArrayList<ProcessResponseNotesComponent>();
this.notes.add(t);
return this;
}
/**
* @return {@link #error} (Processing errors.)
*/
public List<Coding> getError() {
if (this.error == null)
this.error = new ArrayList<Coding>();
return this.error;
}
public boolean hasError() {
if (this.error == null)
return false;
for (Coding item : this.error)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #error} (Processing errors.)
*/
// syntactic sugar
public Coding addError() { //3
Coding t = new Coding();
if (this.error == null)
this.error = new ArrayList<Coding>();
this.error.add(t);
return t;
}
// syntactic sugar
public ProcessResponse addError(Coding t) { //3
if (t == null)
return this;
if (this.error == null)
this.error = new ArrayList<Coding>();
this.error.add(t);
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
childrenList.add(new Property("request", "Reference(Any)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request));
childrenList.add(new Property("outcome", "Coding", "Transaction status: error, complete, held.", 0, java.lang.Integer.MAX_VALUE, outcome));
childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication or processing.", 0, java.lang.Integer.MAX_VALUE, disposition));
childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created));
childrenList.add(new Property("organization", "Reference(Organization)", "The organization who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization));
childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider));
childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization));
childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form));
childrenList.add(new Property("notes", "", "Suite of processing note or additional requirements is the processing has been held.", 0, java.lang.Integer.MAX_VALUE, notes));
childrenList.add(new Property("error", "Coding", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error));
}
public ProcessResponse copy() {
ProcessResponse dst = new ProcessResponse();
copyValues(dst);
if (identifier != null) {
dst.identifier = new ArrayList<Identifier>();
for (Identifier i : identifier)
dst.identifier.add(i.copy());
};
dst.request = request == null ? null : request.copy();
dst.outcome = outcome == null ? null : outcome.copy();
dst.disposition = disposition == null ? null : disposition.copy();
dst.ruleset = ruleset == null ? null : ruleset.copy();
dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
dst.created = created == null ? null : created.copy();
dst.organization = organization == null ? null : organization.copy();
dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy();
dst.form = form == null ? null : form.copy();
if (notes != null) {
dst.notes = new ArrayList<ProcessResponseNotesComponent>();
for (ProcessResponseNotesComponent i : notes)
dst.notes.add(i.copy());
};
if (error != null) {
dst.error = new ArrayList<Coding>();
for (Coding i : error)
dst.error.add(i.copy());
};
return dst;
}
protected ProcessResponse typedCopy() {
return copy();
}
@Override
public boolean equalsDeep(Base other) {
if (!super.equalsDeep(other))
return false;
if (!(other instanceof ProcessResponse))
return false;
ProcessResponse o = (ProcessResponse) other;
return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true)
&& compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true)
&& compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true)
&& compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(form, o.form, true)
&& compareDeep(notes, o.notes, true) && compareDeep(error, o.error, true);
}
@Override
public boolean equalsShallow(Base other) {
if (!super.equalsShallow(other))
return false;
if (!(other instanceof ProcessResponse))
return false;
ProcessResponse o = (ProcessResponse) other;
return compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true);
}
public boolean isEmpty() {
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty())
&& (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty())
&& (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty())
&& (created == null || created.isEmpty()) && (organization == null || organization.isEmpty())
&& (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty())
&& (form == null || form.isEmpty()) && (notes == null || notes.isEmpty()) && (error == null || error.isEmpty())
;
}
@Override
public ResourceType getResourceType() {
return ResourceType.ProcessResponse;
}
@SearchParamDefinition(name="identifier", path="ProcessResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" )
public static final String SP_IDENTIFIER = "identifier";
@SearchParamDefinition(name="request", path="ProcessResponse.request", description="The reference to the claim", type="reference" )
public static final String SP_REQUEST = "request";
@SearchParamDefinition(name="organization", path="ProcessResponse.organization", description="The organization who generated this resource", type="reference" )
public static final String SP_ORGANIZATION = "organization";
@SearchParamDefinition(name="requestprovider", path="ProcessResponse.requestProvider", description="The Provider who is responsible the request transaction", type="reference" )
public static final String SP_REQUESTPROVIDER = "requestprovider";
@SearchParamDefinition(name="requestorganization", path="ProcessResponse.requestOrganization", description="The Organization who is responsible the request transaction", type="reference" )
public static final String SP_REQUESTORGANIZATION = "requestorganization";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Wed, Feb 18, 2015 12:09-0500 for FHIR v0.4.0
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
import java.util.*;
@ -108,10 +108,10 @@ public class RelatedPerson extends DomainResource {
}
public String getDisplay() {
switch (this) {
case MALE: return "male";
case FEMALE: return "female";
case OTHER: return "other";
case UNKNOWN: return "unknown";
case MALE: return "Male";
case FEMALE: return "Female";
case OTHER: return "Other";
case UNKNOWN: return "Unknown";
default: return "?";
}
}
@ -148,14 +148,14 @@ public class RelatedPerson extends DomainResource {
/**
* Identifier for a person within a particular scope.
*/
@Child(name = "identifier", type = {Identifier.class}, order = 0, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." )
protected List<Identifier> identifier;
/**
* The patient this person is related to.
*/
@Child(name = "patient", type = {Patient.class}, order = 1, min = 1, max = 1)
@Child(name ="patient", type={Patient.class}, order=1, min=1, max=1)
@Description(shortDefinition="The patient this person is related to", formalDefinition="The patient this person is related to." )
protected Reference patient;
@ -167,49 +167,49 @@ public class RelatedPerson extends DomainResource {
/**
* The nature of the relationship between a patient and the related person.
*/
@Child(name = "relationship", type = {CodeableConcept.class}, order = 2, min = 0, max = 1)
@Child(name ="relationship", type={CodeableConcept.class}, order=2, min=0, max=1)
@Description(shortDefinition="The nature of the relationship", formalDefinition="The nature of the relationship between a patient and the related person." )
protected CodeableConcept relationship;
/**
* A name associated with the person.
*/
@Child(name = "name", type = {HumanName.class}, order = 3, min = 0, max = 1)
@Child(name ="name", type={HumanName.class}, order=3, min=0, max=1)
@Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." )
protected HumanName name;
/**
* A contact detail for the person, e.g. a telephone number or an email address.
*/
@Child(name = "telecom", type = {ContactPoint.class}, order = 4, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="telecom", type={ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." )
protected List<ContactPoint> telecom;
/**
* Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
*/
@Child(name = "gender", type = {CodeType.class}, order = 5, min = 0, max = 1)
@Child(name ="gender", type={CodeType.class}, order=5, min=0, max=1)
@Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." )
protected Enumeration<AdministrativeGender> gender;
/**
* Address where the related person can be contacted or visited.
*/
@Child(name = "address", type = {AddressType.class}, order = 6, min = 0, max = 1)
@Child(name ="address", type={Address.class}, order=6, min=0, max=1)
@Description(shortDefinition="Address where the related person can be contacted or visited", formalDefinition="Address where the related person can be contacted or visited." )
protected AddressType address;
protected Address address;
/**
* Image of the person.
*/
@Child(name = "photo", type = {AttachmentType.class}, order = 7, min = 0, max = Child.MAX_UNLIMITED)
@Child(name ="photo", type={Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Image of the person", formalDefinition="Image of the person." )
protected List<AttachmentType> photo;
protected List<Attachment> photo;
/**
* The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.
*/
@Child(name = "period", type = {Period.class}, order = 8, min = 0, max = 1)
@Child(name ="period", type={Period.class}, order=8, min=0, max=1)
@Description(shortDefinition="Period of time that this relationship is considered valid", formalDefinition="The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown." )
protected Period period;
@ -254,6 +254,16 @@ public class RelatedPerson extends DomainResource {
return t;
}
// syntactic sugar
public RelatedPerson addIdentifier(Identifier t) { //3
if (t == null)
return this;
if (this.identifier == null)
this.identifier = new ArrayList<Identifier>();
this.identifier.add(t);
return this;
}
/**
* @return {@link #patient} (The patient this person is related to.)
*/
@ -376,6 +386,16 @@ public class RelatedPerson extends DomainResource {
return t;
}
// syntactic sugar
public RelatedPerson addTelecom(ContactPoint t) { //3
if (t == null)
return this;
if (this.telecom == null)
this.telecom = new ArrayList<ContactPoint>();
this.telecom.add(t);
return this;
}
/**
* @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
*/
@ -428,12 +448,12 @@ public class RelatedPerson extends DomainResource {
/**
* @return {@link #address} (Address where the related person can be contacted or visited.)
*/
public AddressType getAddress() {
public Address getAddress() {
if (this.address == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create RelatedPerson.address");
else if (Configuration.doAutoCreate())
this.address = new AddressType(); // cc
this.address = new Address(); // cc
return this.address;
}
@ -444,7 +464,7 @@ public class RelatedPerson extends DomainResource {
/**
* @param value {@link #address} (Address where the related person can be contacted or visited.)
*/
public RelatedPerson setAddress(AddressType value) {
public RelatedPerson setAddress(Address value) {
this.address = value;
return this;
}
@ -452,16 +472,16 @@ public class RelatedPerson extends DomainResource {
/**
* @return {@link #photo} (Image of the person.)
*/
public List<AttachmentType> getPhoto() {
public List<Attachment> getPhoto() {
if (this.photo == null)
this.photo = new ArrayList<AttachmentType>();
this.photo = new ArrayList<Attachment>();
return this.photo;
}
public boolean hasPhoto() {
if (this.photo == null)
return false;
for (AttachmentType item : this.photo)
for (Attachment item : this.photo)
if (!item.isEmpty())
return true;
return false;
@ -471,14 +491,24 @@ public class RelatedPerson extends DomainResource {
* @return {@link #photo} (Image of the person.)
*/
// syntactic sugar
public AttachmentType addPhoto() { //3
AttachmentType t = new AttachmentType();
public Attachment addPhoto() { //3
Attachment t = new Attachment();
if (this.photo == null)
this.photo = new ArrayList<AttachmentType>();
this.photo = new ArrayList<Attachment>();
this.photo.add(t);
return t;
}
// syntactic sugar
public RelatedPerson addPhoto(Attachment t) { //3
if (t == null)
return this;
if (this.photo == null)
this.photo = new ArrayList<Attachment>();
this.photo.add(t);
return this;
}
/**
* @return {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.)
*/
@ -535,8 +565,8 @@ public class RelatedPerson extends DomainResource {
dst.gender = gender == null ? null : gender.copy();
dst.address = address == null ? null : address.copy();
if (photo != null) {
dst.photo = new ArrayList<AttachmentType>();
for (AttachmentType i : photo)
dst.photo = new ArrayList<Attachment>();
for (Attachment i : photo)
dst.photo.add(i.copy());
};
dst.period = period == null ? null : period.copy();
@ -582,19 +612,19 @@ public class RelatedPerson extends DomainResource {
return ResourceType.RelatedPerson;
}
@SearchParamDefinition(name = "identifier", path = "RelatedPerson.identifier", description = "A patient Identifier", type = "token")
@SearchParamDefinition(name="identifier", path="RelatedPerson.identifier", description="A patient Identifier", type="token" )
public static final String SP_IDENTIFIER = "identifier";
@SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" )
public static final String SP_PHONETIC = "phonetic";
@SearchParamDefinition(name="address", path="RelatedPerson.address", description="An address in any kind of address/part", type="string" )
public static final String SP_ADDRESS = "address";
@SearchParamDefinition(name = "gender", path = "RelatedPerson.gender", description = "Gender of the person", type = "token")
@SearchParamDefinition(name="gender", path="RelatedPerson.gender", description="Gender of the person", type="token" )
public static final String SP_GENDER = "gender";
@SearchParamDefinition(name = "patient", path = "RelatedPerson.patient", description = "The patient this person is related to", type = "reference")
@SearchParamDefinition(name="patient", path="RelatedPerson.patient", description="The patient this person is related to", type="reference" )
public static final String SP_PATIENT = "patient";
@SearchParamDefinition(name="name", path="RelatedPerson.name", description="A portion of name in any name part", type="string" )
public static final String SP_NAME = "name";
@SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="string" )
@SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="token" )
public static final String SP_TELECOM = "telecom";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model;
*/
// Generated on Wed, Feb 18, 2015 12:09-0500 for FHIR v0.4.0
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
public class ResourceFactory extends Factory {
@ -38,106 +38,62 @@ public class ResourceFactory extends Factory {
return new Appointment();
if ("ReferralRequest".equals(name))
return new ReferralRequest();
if ("DocumentManifest".equals(name))
return new DocumentManifest();
if ("Goal".equals(name))
return new Goal();
if ("EnrollmentRequest".equals(name))
return new EnrollmentRequest();
if ("Medication".equals(name))
return new Medication();
if ("Subscription".equals(name))
return new Subscription();
if ("DocumentReference".equals(name))
return new DocumentReference();
if ("Parameters".equals(name))
return new Parameters();
if ("Conformance".equals(name))
return new Conformance();
if ("RelatedPerson".equals(name))
return new RelatedPerson();
if ("Practitioner".equals(name))
return new Practitioner();
if ("Slot".equals(name))
return new Slot();
if ("Contraindication".equals(name))
return new Contraindication();
if ("Contract".equals(name))
return new Contract();
if ("Person".equals(name))
return new Person();
if ("RiskAssessment".equals(name))
return new RiskAssessment();
if ("Group".equals(name))
return new Group();
if ("PaymentNotice".equals(name))
return new PaymentNotice();
if ("Organization".equals(name))
return new Organization();
if ("Supply".equals(name))
return new Supply();
if ("ImagingStudy".equals(name))
return new ImagingStudy();
if ("DeviceComponent".equals(name))
return new DeviceComponent();
if ("Encounter".equals(name))
return new Encounter();
if ("Substance".equals(name))
return new Substance();
if ("SearchParameter".equals(name))
return new SearchParameter();
if ("Communication".equals(name))
return new Communication();
if ("OrderResponse".equals(name))
return new OrderResponse();
if ("DeviceUseStatement".equals(name))
return new DeviceUseStatement();
if ("MessageHeader".equals(name))
return new MessageHeader();
if ("ImmunizationRecommendation".equals(name))
return new ImmunizationRecommendation();
if ("BodySite".equals(name))
return new BodySite();
if ("Provenance".equals(name))
return new Provenance();
if ("Questionnaire".equals(name))
return new Questionnaire();
if ("ExplanationOfBenefit".equals(name))
return new ExplanationOfBenefit();
if ("DocumentManifest".equals(name))
return new DocumentManifest();
if ("Specimen".equals(name))
return new Specimen();
if ("AllergyIntolerance".equals(name))
return new AllergyIntolerance();
if ("CarePlan".equals(name))
return new CarePlan();
if ("Goal".equals(name))
return new Goal();
if ("StructureDefinition".equals(name))
return new StructureDefinition();
if ("EnrollmentRequest".equals(name))
return new EnrollmentRequest();
if ("EpisodeOfCare".equals(name))
return new EpisodeOfCare();
if ("MedicationPrescription".equals(name))
return new MedicationPrescription();
if ("OperationOutcome".equals(name))
return new OperationOutcome();
if ("Medication".equals(name))
return new Medication();
if ("Procedure".equals(name))
return new Procedure();
if ("List".equals(name))
return new List_();
if ("ConceptMap".equals(name))
return new ConceptMap();
if ("Subscription".equals(name))
return new Subscription();
if ("ValueSet".equals(name))
return new ValueSet();
if ("OperationDefinition".equals(name))
return new OperationDefinition();
if ("DocumentReference".equals(name))
return new DocumentReference();
if ("Order".equals(name))
return new Order();
if ("Immunization".equals(name))
return new Immunization();
if ("Parameters".equals(name))
return new Parameters();
if ("Device".equals(name))
return new Device();
if ("VisionPrescription".equals(name))
return new VisionPrescription();
if ("Media".equals(name))
return new Media();
if ("Conformance".equals(name))
return new Conformance();
if ("ProcedureRequest".equals(name))
return new ProcedureRequest();
if ("EligibilityResponse".equals(name))
@ -146,42 +102,84 @@ public class ResourceFactory extends Factory {
return new DeviceUseRequest();
if ("DeviceMetric".equals(name))
return new DeviceMetric();
if ("Flag".equals(name))
return new Flag();
if ("RelatedPerson".equals(name))
return new RelatedPerson();
if ("Practitioner".equals(name))
return new Practitioner();
if ("AppointmentResponse".equals(name))
return new AppointmentResponse();
if ("Observation".equals(name))
return new Observation();
if ("MedicationAdministration".equals(name))
return new MedicationAdministration();
if ("Slot".equals(name))
return new Slot();
if ("Contraindication".equals(name))
return new Contraindication();
if ("EnrollmentResponse".equals(name))
return new EnrollmentResponse();
if ("Binary".equals(name))
return new Binary();
if ("MedicationStatement".equals(name))
return new MedicationStatement();
if ("Contract".equals(name))
return new Contract();
if ("Person".equals(name))
return new Person();
if ("CommunicationRequest".equals(name))
return new CommunicationRequest();
if ("RiskAssessment".equals(name))
return new RiskAssessment();
if ("Basic".equals(name))
return new Basic();
if ("Group".equals(name))
return new Group();
if ("PaymentNotice".equals(name))
return new PaymentNotice();
if ("Organization".equals(name))
return new Organization();
if ("ClaimResponse".equals(name))
return new ClaimResponse();
if ("EligibilityRequest".equals(name))
return new EligibilityRequest();
if ("ProcessRequest".equals(name))
return new ProcessRequest();
if ("MedicationDispense".equals(name))
return new MedicationDispense();
if ("Supply".equals(name))
return new Supply();
if ("DiagnosticReport".equals(name))
return new DiagnosticReport();
if ("ImagingStudy".equals(name))
return new ImagingStudy();
if ("ImagingObjectSelection".equals(name))
return new ImagingObjectSelection();
if ("HealthcareService".equals(name))
return new HealthcareService();
if ("DataElement".equals(name))
return new DataElement();
if ("DeviceComponent".equals(name))
return new DeviceComponent();
if ("FamilyMemberHistory".equals(name))
return new FamilyMemberHistory();
if ("QuestionnaireAnswers".equals(name))
return new QuestionnaireAnswers();
if ("NutritionOrder".equals(name))
return new NutritionOrder();
if ("Encounter".equals(name))
return new Encounter();
if ("Substance".equals(name))
return new Substance();
if ("AuditEvent".equals(name))
return new AuditEvent();
if ("SearchParameter".equals(name))
return new SearchParameter();
if ("PaymentReconciliation".equals(name))
return new PaymentReconciliation();
if ("Communication".equals(name))
return new Communication();
if ("Condition".equals(name))
return new Condition();
if ("Composition".equals(name))
@ -192,14 +190,30 @@ public class ResourceFactory extends Factory {
return new DiagnosticOrder();
if ("Patient".equals(name))
return new Patient();
if ("OrderResponse".equals(name))
return new OrderResponse();
if ("Coverage".equals(name))
return new Coverage();
if ("DeviceUseStatement".equals(name))
return new DeviceUseStatement();
if ("ProcessResponse".equals(name))
return new ProcessResponse();
if ("NamingSystem".equals(name))
return new NamingSystem();
if ("Schedule".equals(name))
return new Schedule();
if ("ClinicalImpression".equals(name))
return new ClinicalImpression();
if ("MessageHeader".equals(name))
return new MessageHeader();
if ("Claim".equals(name))
return new Claim();
if ("ImmunizationRecommendation".equals(name))
return new ImmunizationRecommendation();
if ("Location".equals(name))
return new Location();
if ("BodySite".equals(name))
return new BodySite();
else
throw new Exception("Unknown Resource Name '"+name+"'");
}
@ -208,7 +222,7 @@ public class ResourceFactory extends Factory {
if ("Meta".equals(name))
return new Meta();
if ("Address".equals(name))
return new AddressType();
return new Address();
if ("Reference".equals(name))
return new Reference();
if ("Quantity".equals(name))
@ -216,7 +230,7 @@ public class ResourceFactory extends Factory {
if ("Period".equals(name))
return new Period();
if ("Attachment".equals(name))
return new AttachmentType();
return new Attachment();
if ("Duration".equals(name))
return new Duration();
if ("Count".equals(name))
@ -237,6 +251,8 @@ public class ResourceFactory extends Factory {
return new Narrative();
if ("Coding".equals(name))
return new Coding();
if ("Signature".equals(name))
return new Signature();
if ("SampledData".equals(name))
return new SampledData();
if ("Ratio".equals(name))

View File

@ -0,0 +1,307 @@
package org.hl7.fhir.instance.model;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Thu, Apr 2, 2015 10:47-0400 for FHIR v0.5.0
import java.util.*;
import org.hl7.fhir.instance.model.annotations.Child;
import org.hl7.fhir.instance.model.annotations.Description;
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
/**
* An XML digital signature along with supporting context.
*/
@DatatypeDef(name="Signature")
public class Signature extends Type {
/**
* An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.
*/
@Child(name ="type", type={Coding.class}, order=0, min=1, max=Child.MAX_UNLIMITED)
@Description(shortDefinition="Indication of the reason the entity signed the object(s)", formalDefinition="An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document." )
protected List<Coding> type;
/**
* When the digital signature was signed.
*/
@Child(name ="when", type={InstantType.class}, order=1, min=1, max=1)
@Description(shortDefinition="When the signature was created", formalDefinition="When the digital signature was signed." )
protected InstantType when;
/**
* A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).
*/
@Child(name ="who", type={UriType.class, Practitioner.class, RelatedPerson.class, Patient.class}, order=2, min=1, max=1)
@Description(shortDefinition="Who signed the signature", formalDefinition="A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key)." )
protected Type who;
/**
* The base64 encoding of the XML-Signature.
*/
@Child(name ="blob", type={Base64BinaryType.class}, order=3, min=1, max=1)
@Description(shortDefinition="The actual XML Dig-Sig", formalDefinition="The base64 encoding of the XML-Signature." )
protected Base64BinaryType blob;
private static final long serialVersionUID = 1072581988L;
public Signature() {
super();
}
public Signature(InstantType when, Type who, Base64BinaryType blob) {
super();
this.when = when;
this.who = who;
this.blob = blob;
}
/**
* @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.)
*/
public List<Coding> getType() {
if (this.type == null)
this.type = new ArrayList<Coding>();
return this.type;
}
public boolean hasType() {
if (this.type == null)
return false;
for (Coding item : this.type)
if (!item.isEmpty())
return true;
return false;
}
/**
* @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.)
*/
// syntactic sugar
public Coding addType() { //3
Coding t = new Coding();
if (this.type == null)
this.type = new ArrayList<Coding>();
this.type.add(t);
return t;
}
// syntactic sugar
public Signature addType(Coding t) { //3
if (t == null)
return this;
if (this.type == null)
this.type = new ArrayList<Coding>();
this.type.add(t);
return this;
}
/**
* @return {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value
*/
public InstantType getWhenElement() {
if (this.when == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Signature.when");
else if (Configuration.doAutoCreate())
this.when = new InstantType(); // bb
return this.when;
}
public boolean hasWhenElement() {
return this.when != null && !this.when.isEmpty();
}
public boolean hasWhen() {
return this.when != null && !this.when.isEmpty();
}
/**
* @param value {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value
*/
public Signature setWhenElement(InstantType value) {
this.when = value;
return this;
}
/**
* @return When the digital signature was signed.
*/
public Date getWhen() {
return this.when == null ? null : this.when.getValue();
}
/**
* @param value When the digital signature was signed.
*/
public Signature setWhen(Date value) {
if (this.when == null)
this.when = new InstantType();
this.when.setValue(value);
return this;
}
/**
* @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).)
*/
public Type getWho() {
return this.who;
}
/**
* @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).)
*/
public UriType getWhoUriType() throws Exception {
if (!(this.who instanceof UriType))
throw new Exception("Type mismatch: the type UriType was expected, but "+this.who.getClass().getName()+" was encountered");
return (UriType) this.who;
}
/**
* @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).)
*/
public Reference getWhoReference() throws Exception {
if (!(this.who instanceof Reference))
throw new Exception("Type mismatch: the type Reference was expected, but "+this.who.getClass().getName()+" was encountered");
return (Reference) this.who;
}
public boolean hasWho() {
return this.who != null && !this.who.isEmpty();
}
/**
* @param value {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).)
*/
public Signature setWho(Type value) {
this.who = value;
return this;
}
/**
* @return {@link #blob} (The base64 encoding of the XML-Signature.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value
*/
public Base64BinaryType getBlobElement() {
if (this.blob == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Signature.blob");
else if (Configuration.doAutoCreate())
this.blob = new Base64BinaryType(); // bb
return this.blob;
}
public boolean hasBlobElement() {
return this.blob != null && !this.blob.isEmpty();
}
public boolean hasBlob() {
return this.blob != null && !this.blob.isEmpty();
}
/**
* @param value {@link #blob} (The base64 encoding of the XML-Signature.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value
*/
public Signature setBlobElement(Base64BinaryType value) {
this.blob = value;
return this;
}
/**
* @return The base64 encoding of the XML-Signature.
*/
public byte[] getBlob() {
return this.blob == null ? null : this.blob.getValue();
}
/**
* @param value The base64 encoding of the XML-Signature.
*/
public Signature setBlob(byte[] value) {
if (this.blob == null)
this.blob = new Base64BinaryType();
this.blob.setValue(value);
return this;
}
protected void listChildren(List<Property> childrenList) {
super.listChildren(childrenList);
childrenList.add(new Property("type", "Coding", "An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.", 0, java.lang.Integer.MAX_VALUE, type));
childrenList.add(new Property("when", "instant", "When the digital signature was signed.", 0, java.lang.Integer.MAX_VALUE, when));
childrenList.add(new Property("who[x]", "uri|Reference(Practitioner|RelatedPerson|Patient)", "A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).", 0, java.lang.Integer.MAX_VALUE, who));
childrenList.add(new Property("blob", "base64Binary", "The base64 encoding of the XML-Signature.", 0, java.lang.Integer.MAX_VALUE, blob));
}
public Signature copy() {
Signature dst = new Signature();
copyValues(dst);
if (type != null) {
dst.type = new ArrayList<Coding>();
for (Coding i : type)
dst.type.add(i.copy());
};
dst.when = when == null ? null : when.copy();
dst.who = who == null ? null : who.copy();
dst.blob = blob == null ? null : blob.copy();
return dst;
}
protected Signature typedCopy() {
return copy();
}
@Override
public boolean equalsDeep(Base other) {
if (!super.equalsDeep(other))
return false;
if (!(other instanceof Signature))
return false;
Signature o = (Signature) other;
return compareDeep(type, o.type, true) && compareDeep(when, o.when, true) && compareDeep(who, o.who, true)
&& compareDeep(blob, o.blob, true);
}
@Override
public boolean equalsShallow(Base other) {
if (!super.equalsShallow(other))
return false;
if (!(other instanceof Signature))
return false;
Signature o = (Signature) other;
return compareValues(when, o.when, true) && compareValues(blob, o.blob, true);
}
public boolean isEmpty() {
return super.isEmpty() && (type == null || type.isEmpty()) && (when == null || when.isEmpty())
&& (who == null || who.isEmpty()) && (blob == null || blob.isEmpty());
}
}

View File

@ -97,6 +97,7 @@ datatype.Attachment=org.hl7.fhir.instance.model.Attachment
datatype.CodeableConcept=org.hl7.fhir.instance.model.CodeableConceptType
datatype.Coding=org.hl7.fhir.instance.model.CodingType
datatype.ContactPoint=org.hl7.fhir.instance.model.ContactPointType
datatype.enumeration=org.hl7.fhir.instance.model.Enumeration
datatype.ElementDefinition=org.hl7.fhir.instance.model.ElementDefinitionType
datatype.HumanName=org.hl7.fhir.instance.model.HumanNameType
datatype.Identifier=org.hl7.fhir.instance.model.IdentifierType

View File

@ -6,7 +6,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import org.hl7.fhir.instance.model.AddressType;
import org.hl7.fhir.instance.model.Address;
import org.hl7.fhir.instance.model.BackboneElement;
import org.hl7.fhir.instance.model.Base;
import org.hl7.fhir.instance.model.Binary;
@ -95,9 +95,25 @@ public class ModelInheritanceTest {
for (BaseRuntimeElementDefinition<?> next : ourCtx.getElementDefinitions()) {
if (next instanceof BaseRuntimeElementCompositeDefinition || next instanceof RuntimePrimitiveDatatypeDefinition) {
String name = next.getImplementingClass().getName();
// TODO: these are all badly named
if (name.endsWith(".Enumeration")) {
continue;
}
if (name.endsWith(".Reference")) {
continue;
}
if (name.endsWith(".Extension")) {
continue;
}
if (name.endsWith(".Attachment")) {
continue;
}
if (name.endsWith(".Period")) {
continue;
}
if (name.endsWith(".Address")) {
continue;
}
assertThat(name, endsWith("Type"));
}
@ -114,7 +130,7 @@ public class ModelInheritanceTest {
*/
@Test
public void testAddress() {
assertTrue(ICompositeType.class.isAssignableFrom(AddressType.class));
assertTrue(ICompositeType.class.isAssignableFrom(Address.class));
}
@Test

View File

@ -27,8 +27,8 @@ import org.custommonkey.xmlunit.Diff;
import org.hamcrest.core.IsNot;
import org.hamcrest.core.StringContains;
import org.hamcrest.text.StringContainsInOrder;
import org.hl7.fhir.instance.model.AddressType;
import org.hl7.fhir.instance.model.AddressType.AddressUse;
import org.hl7.fhir.instance.model.Address;
import org.hl7.fhir.instance.model.Address.AddressUse;
import org.hl7.fhir.instance.model.Binary;
import org.hl7.fhir.instance.model.Bundle;
import org.hl7.fhir.instance.model.Bundle.BundleEntryComponent;
@ -457,7 +457,7 @@ public class JsonParserHl7OrgTest {
MyPatientWithOneDeclaredAddressExtension patient = new MyPatientWithOneDeclaredAddressExtension();
patient.addAddress().setUse(AddressUse.HOME);
patient.setFoo(new AddressType().addLine("line1"));
patient.setFoo(new Address().addLine("line1"));
String val = parser.encodeResourceToString(patient);
ourLog.info(val);
@ -465,7 +465,7 @@ public class JsonParserHl7OrgTest {
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
AddressType ref = actual.getFoo();
Address ref = actual.getFoo();
assertEquals("line1", ref.getLine().get(0).getValue());
}
@ -722,7 +722,7 @@ public class JsonParserHl7OrgTest {
Patient patient = new Patient();
patient.addAddress().setUse(AddressUse.HOME);
patient.addExtension().setUrl("urn:foo").setValue(new AddressType().addLine("line1"));
patient.addExtension().setUrl("urn:foo").setValue(new Address().addLine("line1"));
String val = parser.encodeResourceToString(patient);
ourLog.info(val);
@ -730,7 +730,7 @@ public class JsonParserHl7OrgTest {
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
AddressType ref = actual.getFoo();
Address ref = actual.getFoo();
assertEquals("line1", ref.getLine().get(0).getValue());
}
@ -1246,13 +1246,13 @@ public class JsonParserHl7OrgTest {
@Child(order = 0, name = "foo")
@org.hl7.fhir.instance.model.annotations.Extension(url = "urn:foo", definedLocally = true, isModifier = false)
private AddressType myFoo;
private Address myFoo;
public AddressType getFoo() {
public Address getFoo() {
return myFoo;
}
public void setFoo(AddressType theFoo) {
public void setFoo(Address theFoo) {
myFoo = theFoo;
}

View File

@ -28,9 +28,9 @@ import org.custommonkey.xmlunit.XMLUnit;
import org.hamcrest.core.IsNot;
import org.hamcrest.core.StringContains;
import org.hamcrest.text.StringContainsInOrder;
import org.hl7.fhir.instance.model.AddressType;
import org.hl7.fhir.instance.model.AddressType.AddressUse;
import org.hl7.fhir.instance.model.AddressType.AddressUseEnumFactory;
import org.hl7.fhir.instance.model.Address;
import org.hl7.fhir.instance.model.Address.AddressUse;
import org.hl7.fhir.instance.model.Address.AddressUseEnumFactory;
import org.hl7.fhir.instance.model.Binary;
import org.hl7.fhir.instance.model.Bundle;
import org.hl7.fhir.instance.model.Bundle.BundleEntryComponent;
@ -811,7 +811,7 @@ public class XmlParserHl7OrgDstu2Test {
MyPatientWithOneDeclaredAddressExtension patient = new MyPatientWithOneDeclaredAddressExtension();
patient.addAddress().setUse(AddressUse.HOME);
patient.setFoo(new AddressType().addLine("line1"));
patient.setFoo(new Address().addLine("line1"));
String val = parser.encodeResourceToString(patient);
ourLog.info(val);
@ -819,7 +819,7 @@ public class XmlParserHl7OrgDstu2Test {
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
AddressType ref = actual.getFoo();
Address ref = actual.getFoo();
assertEquals("line1", ref.getLine().get(0).getValue());
}
@ -995,7 +995,7 @@ public class XmlParserHl7OrgDstu2Test {
Patient patient = new Patient();
patient.addAddress().setUse(AddressUse.HOME);
patient.addExtension().setUrl("urn:foo").setValue(new AddressType().addLine("line1"));
patient.addExtension().setUrl("urn:foo").setValue(new Address().addLine("line1"));
String val = parser.encodeResourceToString(patient);
ourLog.info(val);
@ -1003,7 +1003,7 @@ public class XmlParserHl7OrgDstu2Test {
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
AddressType ref = actual.getFoo();
Address ref = actual.getFoo();
assertEquals("line1", ref.getLine().get(0).getValue());
}