mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-03-09 14:33:32 +00:00
More work on getting HL7org structs working
This commit is contained in:
parent
b222b76611
commit
147305b70e
@ -27,14 +27,12 @@ import java.util.Collections;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
import org.apache.commons.lang3.text.WordUtils;
|
import org.apache.commons.lang3.text.WordUtils;
|
||||||
import org.hl7.fhir.instance.model.IBase;
|
import org.hl7.fhir.instance.model.IBase;
|
||||||
import org.hl7.fhir.instance.model.IBaseResource;
|
import org.hl7.fhir.instance.model.IBaseResource;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.BaseRuntimeElementDefinition.ChildTypeEnum;
|
|
||||||
import ca.uhn.fhir.i18n.HapiLocalizer;
|
import ca.uhn.fhir.i18n.HapiLocalizer;
|
||||||
import ca.uhn.fhir.model.api.IElement;
|
import ca.uhn.fhir.model.api.IElement;
|
||||||
import ca.uhn.fhir.model.api.IFhirVersion;
|
import ca.uhn.fhir.model.api.IFhirVersion;
|
||||||
@ -511,4 +509,11 @@ public class FhirContext {
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all element definitions (resources, datatypes, etc.)
|
||||||
|
*/
|
||||||
|
public Collection<BaseRuntimeElementDefinition<?>> getElementDefinitions() {
|
||||||
|
return Collections.unmodifiableCollection(myClassToElementDefinition.values());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -536,12 +536,17 @@ class ModelScanner {
|
|||||||
*/
|
*/
|
||||||
Class<? extends IBase> et = (Class<? extends IBase>) nextElementType;
|
Class<? extends IBase> et = (Class<? extends IBase>) nextElementType;
|
||||||
|
|
||||||
IValueSetEnumBinder<Enum<?>> binder = null;
|
Object binder = null;
|
||||||
if (BoundCodeDt.class.isAssignableFrom(nextElementType) || IBoundCodeableConcept.class.isAssignableFrom(nextElementType)) {
|
if (BoundCodeDt.class.isAssignableFrom(nextElementType) || IBoundCodeableConcept.class.isAssignableFrom(nextElementType)) {
|
||||||
binder = getBoundCodeBinder(next);
|
binder = getBoundCodeBinder(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
RuntimeChildDeclaredExtensionDefinition def = new RuntimeChildDeclaredExtensionDefinition(next, childAnnotation, descriptionAnnotation, extensionAttr, elementName, extensionAttr.url(), et, binder);
|
RuntimeChildDeclaredExtensionDefinition def = new RuntimeChildDeclaredExtensionDefinition(next, childAnnotation, descriptionAnnotation, extensionAttr, elementName, extensionAttr.url(), et, binder);
|
||||||
|
|
||||||
|
if (IBaseEnumeration.class.isAssignableFrom(nextElementType)) {
|
||||||
|
def.setEnumerationType(ReflectionUtil.getGenericCollectionTypeOfField(next));
|
||||||
|
}
|
||||||
|
|
||||||
orderMap.put(order, def);
|
orderMap.put(order, def);
|
||||||
if (IBase.class.isAssignableFrom(nextElementType)) {
|
if (IBase.class.isAssignableFrom(nextElementType)) {
|
||||||
addScanAlso((Class<? extends IBase>) nextElementType);
|
addScanAlso((Class<? extends IBase>) nextElementType);
|
||||||
|
@ -29,6 +29,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.hl7.fhir.instance.model.IBase;
|
import org.hl7.fhir.instance.model.IBase;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseDatatype;
|
import org.hl7.fhir.instance.model.api.IBaseDatatype;
|
||||||
|
import org.hl7.fhir.instance.model.api.IReference;
|
||||||
|
|
||||||
import ca.uhn.fhir.model.api.IDatatype;
|
import ca.uhn.fhir.model.api.IDatatype;
|
||||||
import ca.uhn.fhir.model.api.IResource;
|
import ca.uhn.fhir.model.api.IResource;
|
||||||
@ -62,7 +63,7 @@ public class RuntimeChildAny extends RuntimeChildChoiceDefinition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IResource.class.isAssignableFrom(next) || IDatatype.class.isAssignableFrom(next) || IBaseDatatype.class.isAssignableFrom(next)) {
|
if (IResource.class.isAssignableFrom(next) || IDatatype.class.isAssignableFrom(next) || IBaseDatatype.class.isAssignableFrom(next) || IReference.class.isAssignableFrom(next)) {
|
||||||
choiceTypes.add(next);
|
choiceTypes.add(next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,9 +32,9 @@ import java.util.Set;
|
|||||||
|
|
||||||
import org.hl7.fhir.instance.model.IBase;
|
import org.hl7.fhir.instance.model.IBase;
|
||||||
import org.hl7.fhir.instance.model.IBaseResource;
|
import org.hl7.fhir.instance.model.IBaseResource;
|
||||||
|
import org.hl7.fhir.instance.model.api.IBaseEnumeration;
|
||||||
|
|
||||||
import ca.uhn.fhir.model.api.IResource;
|
import ca.uhn.fhir.model.api.IResource;
|
||||||
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
|
|
||||||
import ca.uhn.fhir.model.api.annotation.Child;
|
import ca.uhn.fhir.model.api.annotation.Child;
|
||||||
import ca.uhn.fhir.model.api.annotation.Description;
|
import ca.uhn.fhir.model.api.annotation.Description;
|
||||||
import ca.uhn.fhir.model.api.annotation.Extension;
|
import ca.uhn.fhir.model.api.annotation.Extension;
|
||||||
@ -48,7 +48,8 @@ public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclared
|
|||||||
private String myExtensionUrl;
|
private String myExtensionUrl;
|
||||||
private boolean myModifier;
|
private boolean myModifier;
|
||||||
private Map<String, RuntimeChildDeclaredExtensionDefinition> myUrlToChildExtension;
|
private Map<String, RuntimeChildDeclaredExtensionDefinition> myUrlToChildExtension;
|
||||||
private Object myInstanceConstructorArguments;
|
private volatile Object myInstanceConstructorArguments;
|
||||||
|
private Class<?> myEnumerationType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param theBoundTypeBinder
|
* @param theBoundTypeBinder
|
||||||
@ -57,7 +58,7 @@ public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclared
|
|||||||
* @param theDefinedLocally
|
* @param theDefinedLocally
|
||||||
* See {@link Extension#definedLocally()}
|
* See {@link Extension#definedLocally()}
|
||||||
*/
|
*/
|
||||||
RuntimeChildDeclaredExtensionDefinition(Field theField, Child theChild, Description theDescriptionAnnotation, Extension theExtension, String theElementName, String theExtensionUrl, Class<? extends IBase> theChildType, IValueSetEnumBinder<Enum<?>> theBoundTypeBinder)
|
RuntimeChildDeclaredExtensionDefinition(Field theField, Child theChild, Description theDescriptionAnnotation, Extension theExtension, String theElementName, String theExtensionUrl, Class<? extends IBase> theChildType, Object theBoundTypeBinder)
|
||||||
throws ConfigurationException {
|
throws ConfigurationException {
|
||||||
super(theField, theChild, theDescriptionAnnotation, theElementName);
|
super(theField, theChild, theDescriptionAnnotation, theElementName);
|
||||||
assert isNotBlank(theExtensionUrl);
|
assert isNotBlank(theExtensionUrl);
|
||||||
@ -70,7 +71,16 @@ public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclared
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getInstanceConstructorArguments() {
|
public Object getInstanceConstructorArguments() {
|
||||||
return myInstanceConstructorArguments;
|
Object retVal = myInstanceConstructorArguments;
|
||||||
|
if (retVal == null && myEnumerationType != null) {
|
||||||
|
retVal = RuntimeChildPrimitiveEnumerationDatatypeDefinition.toEnumFactory(myEnumerationType);
|
||||||
|
myInstanceConstructorArguments = retVal;
|
||||||
|
}
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnumerationType(Class<?> theEnumerationType) {
|
||||||
|
myEnumerationType = theEnumerationType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -147,7 +157,7 @@ public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclared
|
|||||||
@Override
|
@Override
|
||||||
void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
|
void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
|
||||||
myUrlToChildExtension = new HashMap<String, RuntimeChildDeclaredExtensionDefinition>();
|
myUrlToChildExtension = new HashMap<String, RuntimeChildDeclaredExtensionDefinition>();
|
||||||
|
|
||||||
BaseRuntimeElementDefinition<?> elementDef = theClassToElementDefinitions.get(myChildType);
|
BaseRuntimeElementDefinition<?> elementDef = theClassToElementDefinitions.get(myChildType);
|
||||||
if (elementDef instanceof RuntimePrimitiveDatatypeDefinition || elementDef instanceof RuntimeCompositeDatatypeDefinition) {
|
if (elementDef instanceof RuntimePrimitiveDatatypeDefinition || elementDef instanceof RuntimeCompositeDatatypeDefinition) {
|
||||||
myDatatypeChildName = "value" + elementDef.getName().substring(0, 1).toUpperCase() + elementDef.getName().substring(1);
|
myDatatypeChildName = "value" + elementDef.getName().substring(0, 1).toUpperCase() + elementDef.getName().substring(1);
|
||||||
|
@ -42,15 +42,21 @@ public class RuntimeChildPrimitiveEnumerationDatatypeDefinition extends RuntimeC
|
|||||||
public Object getInstanceConstructorArguments() {
|
public Object getInstanceConstructorArguments() {
|
||||||
Object retVal = myBinder;
|
Object retVal = myBinder;
|
||||||
if (retVal == null) {
|
if (retVal == null) {
|
||||||
Class<?> clazz;
|
retVal = toEnumFactory(myEnumerationType);
|
||||||
String className = myEnumerationType.getName() + "EnumFactory";
|
myBinder = retVal;
|
||||||
try {
|
}
|
||||||
clazz = Class.forName(className);
|
return retVal;
|
||||||
retVal = clazz.newInstance();
|
}
|
||||||
myBinder = retVal;
|
|
||||||
} catch (Exception e) {
|
static Object toEnumFactory(Class<?> theEnumerationType) {
|
||||||
throw new ConfigurationException("Failed to instantiate " + className, e);
|
Class<?> clazz;
|
||||||
}
|
String className = theEnumerationType.getName() + "EnumFactory";
|
||||||
|
Object retVal;
|
||||||
|
try {
|
||||||
|
clazz = Class.forName(className);
|
||||||
|
retVal = clazz.newInstance();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ConfigurationException("Failed to instantiate " + className, e);
|
||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ import java.util.Set;
|
|||||||
import org.apache.commons.lang3.text.WordUtils;
|
import org.apache.commons.lang3.text.WordUtils;
|
||||||
import org.hl7.fhir.instance.model.IBase;
|
import org.hl7.fhir.instance.model.IBase;
|
||||||
import org.hl7.fhir.instance.model.IBaseResource;
|
import org.hl7.fhir.instance.model.IBaseResource;
|
||||||
|
import org.hl7.fhir.instance.model.api.IReference;
|
||||||
|
|
||||||
import ca.uhn.fhir.model.api.ExtensionDt;
|
import ca.uhn.fhir.model.api.ExtensionDt;
|
||||||
import ca.uhn.fhir.model.api.IDatatype;
|
import ca.uhn.fhir.model.api.IDatatype;
|
||||||
@ -70,7 +71,9 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseRuntimeElementDefinition<?> getChildElementDefinitionByDatatype(Class<? extends IBase> theType) {
|
public BaseRuntimeElementDefinition<?> getChildElementDefinitionByDatatype(Class<? extends IBase> theType) {
|
||||||
return myDatatypeToDefinition.get(theType);
|
Class<? extends IBase> type = theType;
|
||||||
|
// if (IReference.type)
|
||||||
|
return myDatatypeToDefinition.get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -117,6 +120,7 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
|
|||||||
void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
|
void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
|
||||||
Map<String, BaseRuntimeElementDefinition<?>> datatypeAttributeNameToDefinition = new HashMap<String, BaseRuntimeElementDefinition<?>>();
|
Map<String, BaseRuntimeElementDefinition<?>> datatypeAttributeNameToDefinition = new HashMap<String, BaseRuntimeElementDefinition<?>>();
|
||||||
myDatatypeToAttributeName = new HashMap<Class<? extends IBase>, String>();
|
myDatatypeToAttributeName = new HashMap<Class<? extends IBase>, String>();
|
||||||
|
myDatatypeToDefinition = new HashMap<Class<? extends IBase>, BaseRuntimeElementDefinition<?>>();
|
||||||
|
|
||||||
for (BaseRuntimeElementDefinition<?> next : theClassToElementDefinitions.values()) {
|
for (BaseRuntimeElementDefinition<?> next : theClassToElementDefinitions.values()) {
|
||||||
if (next instanceof IRuntimeDatatypeDefinition) {
|
if (next instanceof IRuntimeDatatypeDefinition) {
|
||||||
@ -124,8 +128,13 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
|
|||||||
// System.out.println();
|
// System.out.println();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
myDatatypeToDefinition.put(next.getImplementingClass(), next);
|
||||||
|
|
||||||
if (!((IRuntimeDatatypeDefinition) next).isSpecialization()) {
|
if (!((IRuntimeDatatypeDefinition) next).isSpecialization()) {
|
||||||
String attrName = createExtensionChildName(next);
|
String attrName = createExtensionChildName(next);
|
||||||
|
if (datatypeAttributeNameToDefinition.containsKey(attrName)) {
|
||||||
|
throw new ConfigurationException("More than one child matches attribute name " + attrName);
|
||||||
|
}
|
||||||
datatypeAttributeNameToDefinition.put(attrName, next);
|
datatypeAttributeNameToDefinition.put(attrName, next);
|
||||||
datatypeAttributeNameToDefinition.put(attrName.toLowerCase(), next);
|
datatypeAttributeNameToDefinition.put(attrName.toLowerCase(), next);
|
||||||
myDatatypeToAttributeName.put(next.getImplementingClass(), attrName);
|
myDatatypeToAttributeName.put(next.getImplementingClass(), attrName);
|
||||||
@ -135,13 +144,12 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
|
|||||||
|
|
||||||
myAttributeNameToDefinition = datatypeAttributeNameToDefinition;
|
myAttributeNameToDefinition = datatypeAttributeNameToDefinition;
|
||||||
|
|
||||||
myDatatypeToDefinition = new HashMap<Class<? extends IBase>, BaseRuntimeElementDefinition<?>>();
|
|
||||||
|
|
||||||
for (Entry<String, BaseRuntimeElementDefinition<?>> next : myAttributeNameToDefinition.entrySet()) {
|
// for (Entry<String, BaseRuntimeElementDefinition<?>> next : myAttributeNameToDefinition.entrySet()) {
|
||||||
@SuppressWarnings("unchecked")
|
// @SuppressWarnings("unchecked")
|
||||||
Class<? extends IDatatype> type = (Class<? extends IDatatype>) next.getValue().getImplementingClass();
|
// Class<? extends IDatatype> type = (Class<? extends IDatatype>) next.getValue().getImplementingClass();
|
||||||
myDatatypeToDefinition.put(type, next.getValue());
|
// myDatatypeToDefinition.put(type, next.getValue());
|
||||||
}
|
// }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Resource reference - The correct name is 'valueReference' in DSTU2 and 'valueResource' in DSTU1
|
* Resource reference - The correct name is 'valueReference' in DSTU2 and 'valueResource' in DSTU1
|
||||||
|
@ -915,6 +915,9 @@ public class XmlParser extends BaseParser implements IParser {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
childDef = extDef.getChildElementDefinitionByDatatype(value.getClass());
|
childDef = extDef.getChildElementDefinitionByDatatype(value.getClass());
|
||||||
|
if (childDef == null) {
|
||||||
|
throw new ConfigurationException("Unable to encode extension, unrecognized child element type: " + value.getClass().getCanonicalName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
encodeChildElementToStreamWriter(theResource, theWriter, value, childName, childDef, null, theIncludedResource);
|
encodeChildElementToStreamWriter(theResource, theWriter, value, childName, childDef, null, theIncludedResource);
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,7 @@ public class XmlParserTest {
|
|||||||
private static FhirContext ourCtx;
|
private static FhirContext ourCtx;
|
||||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParserTest.class);
|
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParserTest.class);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* see #144 and #146
|
* see #144 and #146
|
||||||
*/
|
*/
|
||||||
|
@ -1,16 +1,7 @@
|
|||||||
package ca.uhn.fhir.parser;
|
package ca.uhn.fhir.parser;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.hamcrest.Matchers.emptyOrNullString;
|
import static org.junit.Assert.*;
|
||||||
import static org.hamcrest.Matchers.not;
|
|
||||||
import static org.hamcrest.Matchers.stringContainsInOrder;
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertSame;
|
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -21,6 +12,7 @@ import java.util.UUID;
|
|||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.custommonkey.xmlunit.Diff;
|
import org.custommonkey.xmlunit.Diff;
|
||||||
import org.custommonkey.xmlunit.XMLUnit;
|
import org.custommonkey.xmlunit.XMLUnit;
|
||||||
|
import org.hamcrest.core.StringContains;
|
||||||
import org.hamcrest.text.StringContainsInOrder;
|
import org.hamcrest.text.StringContainsInOrder;
|
||||||
import org.hl7.fhir.instance.model.IBaseResource;
|
import org.hl7.fhir.instance.model.IBaseResource;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
@ -53,6 +45,7 @@ import ca.uhn.fhir.model.dstu2.resource.MedicationPrescription;
|
|||||||
import ca.uhn.fhir.model.dstu2.resource.Observation;
|
import ca.uhn.fhir.model.dstu2.resource.Observation;
|
||||||
import ca.uhn.fhir.model.dstu2.resource.Organization;
|
import ca.uhn.fhir.model.dstu2.resource.Organization;
|
||||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||||
|
import ca.uhn.fhir.model.dstu2.valueset.AddressUseEnum;
|
||||||
import ca.uhn.fhir.model.dstu2.valueset.DocumentReferenceStatusEnum;
|
import ca.uhn.fhir.model.dstu2.valueset.DocumentReferenceStatusEnum;
|
||||||
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
|
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
|
||||||
import ca.uhn.fhir.model.primitive.DateDt;
|
import ca.uhn.fhir.model.primitive.DateDt;
|
||||||
@ -72,6 +65,27 @@ public class XmlParserDstu2Test {
|
|||||||
XMLUnit.setIgnoreWhitespace(true);
|
XMLUnit.setIgnoreWhitespace(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testEncodeExtensionWithResourceContent() {
|
||||||
|
IParser parser = ourCtx.newXmlParser();
|
||||||
|
|
||||||
|
Patient patient = new Patient();
|
||||||
|
patient.addAddress().setUse(AddressUseEnum.HOME);
|
||||||
|
patient.addUndeclaredExtension(false, "urn:foo", new ResourceReferenceDt("Organization/123"));
|
||||||
|
|
||||||
|
String val = parser.encodeResourceToString(patient);
|
||||||
|
ourLog.info(val);
|
||||||
|
assertThat(val, StringContains.containsString("<extension url=\"urn:foo\"><valueReference><reference value=\"Organization/123\"/></valueReference></extension>"));
|
||||||
|
|
||||||
|
Patient actual = parser.parseResource(Patient.class, val);
|
||||||
|
assertEquals(AddressUseEnum.HOME, patient.getAddress().get(0).getUse());
|
||||||
|
List<ExtensionDt> ext = actual.getUndeclaredExtensions();
|
||||||
|
assertEquals(1, ext.size());
|
||||||
|
ResourceReferenceDt ref = (ResourceReferenceDt) ext.get(0).getValue();
|
||||||
|
assertEquals("Organization/123", ref.getReference().getValue());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testContainedResourceInExtensionUndeclared() {
|
public void testContainedResourceInExtensionUndeclared() {
|
||||||
Patient p = new Patient();
|
Patient p = new Patient();
|
||||||
|
@ -28,11 +28,14 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.saxon</groupId>
|
<groupId>net.sf.saxon</groupId>
|
||||||
<artifactId>saxon</artifactId>
|
<artifactId>saxon</artifactId>
|
||||||
<version>8.7</version>
|
<version>8.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xpp3</groupId>
|
<groupId>xpp3</groupId>
|
||||||
|
@ -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.
|
* 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")
|
@DatatypeDef(name="Address")
|
||||||
public class Address extends Type implements ICompositeType {
|
public class AddressType extends Type implements ICompositeType {
|
||||||
|
|
||||||
public enum AddressUse {
|
public enum AddressUse {
|
||||||
/**
|
/**
|
||||||
@ -202,7 +202,7 @@ P.O. Box number, delivery hints, and similar address information.
|
|||||||
|
|
||||||
private static final long serialVersionUID = -470351694L;
|
private static final long serialVersionUID = -470351694L;
|
||||||
|
|
||||||
public Address() {
|
public AddressType() {
|
||||||
super();
|
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
|
* @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 Address setUseElement(Enumeration<AddressUse> value) {
|
public AddressType setUseElement(Enumeration<AddressUse> value) {
|
||||||
this.use = value;
|
this.use = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -244,7 +244,7 @@ P.O. Box number, delivery hints, and similar address information.
|
|||||||
/**
|
/**
|
||||||
* @param value The purpose of this address.
|
* @param value The purpose of this address.
|
||||||
*/
|
*/
|
||||||
public Address setUse(AddressUse value) {
|
public AddressType setUse(AddressUse value) {
|
||||||
if (value == null)
|
if (value == null)
|
||||||
this.use = null;
|
this.use = null;
|
||||||
else {
|
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
|
* @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 Address setTextElement(StringType value) {
|
public AddressType setTextElement(StringType value) {
|
||||||
this.text = value;
|
this.text = value;
|
||||||
return this;
|
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.
|
* @param value A full text representation of the address.
|
||||||
*/
|
*/
|
||||||
public Address setText(String value) {
|
public AddressType setText(String value) {
|
||||||
if (Utilities.noString(value))
|
if (Utilities.noString(value))
|
||||||
this.text = null;
|
this.text = null;
|
||||||
else {
|
else {
|
||||||
@ -340,7 +340,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.)
|
P.O. Box number, delivery hints, and similar address information.)
|
||||||
*/
|
*/
|
||||||
public Address addLine(String value) { //1
|
public AddressType addLine(String value) { //1
|
||||||
StringType t = new StringType();
|
StringType t = new StringType();
|
||||||
t.setValue(value);
|
t.setValue(value);
|
||||||
if (this.line == null)
|
if (this.line == null)
|
||||||
@ -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
|
* @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 Address setCityElement(StringType value) {
|
public AddressType setCityElement(StringType value) {
|
||||||
this.city = value;
|
this.city = value;
|
||||||
return this;
|
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.
|
* @param value The name of the city, town, village or other community or delivery center.
|
||||||
*/
|
*/
|
||||||
public Address setCity(String value) {
|
public AddressType setCity(String value) {
|
||||||
if (Utilities.noString(value))
|
if (Utilities.noString(value))
|
||||||
this.city = null;
|
this.city = null;
|
||||||
else {
|
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
|
* @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 Address setStateElement(StringType value) {
|
public AddressType setStateElement(StringType value) {
|
||||||
this.state = value;
|
this.state = value;
|
||||||
return this;
|
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).
|
* @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 Address setState(String value) {
|
public AddressType setState(String value) {
|
||||||
if (Utilities.noString(value))
|
if (Utilities.noString(value))
|
||||||
this.state = null;
|
this.state = null;
|
||||||
else {
|
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
|
* @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 Address setPostalCodeElement(StringType value) {
|
public AddressType setPostalCodeElement(StringType value) {
|
||||||
this.postalCode = value;
|
this.postalCode = value;
|
||||||
return this;
|
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.
|
* @param value A postal code designating a region defined by the postal service.
|
||||||
*/
|
*/
|
||||||
public Address setPostalCode(String value) {
|
public AddressType setPostalCode(String value) {
|
||||||
if (Utilities.noString(value))
|
if (Utilities.noString(value))
|
||||||
this.postalCode = null;
|
this.postalCode = null;
|
||||||
else {
|
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
|
* @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 Address setCountryElement(StringType value) {
|
public AddressType setCountryElement(StringType value) {
|
||||||
this.country = value;
|
this.country = value;
|
||||||
return this;
|
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.
|
* @param value Country - a nation as commonly understood or generally accepted.
|
||||||
*/
|
*/
|
||||||
public Address setCountry(String value) {
|
public AddressType setCountry(String value) {
|
||||||
if (Utilities.noString(value))
|
if (Utilities.noString(value))
|
||||||
this.country = null;
|
this.country = null;
|
||||||
else {
|
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.)
|
* @param value {@link #period} (Time period when address was/is in use.)
|
||||||
*/
|
*/
|
||||||
public Address setPeriod(Period value) {
|
public AddressType setPeriod(Period value) {
|
||||||
this.period = value;
|
this.period = value;
|
||||||
return this;
|
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));
|
childrenList.add(new Property("period", "Period", "Time period when address was/is in use.", 0, java.lang.Integer.MAX_VALUE, period));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Address copy() {
|
public AddressType copy() {
|
||||||
Address dst = new Address();
|
AddressType dst = new AddressType();
|
||||||
copyValues(dst);
|
copyValues(dst);
|
||||||
dst.use = use == null ? null : use.copy();
|
dst.use = use == null ? null : use.copy();
|
||||||
dst.text = text == null ? null : text.copy();
|
dst.text = text == null ? null : text.copy();
|
||||||
@ -612,7 +612,7 @@ P.O. Box number, delivery hints, and similar address information.)
|
|||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Address typedCopy() {
|
protected AddressType typedCopy() {
|
||||||
return copy();
|
return copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -620,9 +620,9 @@ P.O. Box number, delivery hints, and similar address information.)
|
|||||||
public boolean equalsDeep(Base other) {
|
public boolean equalsDeep(Base other) {
|
||||||
if (!super.equalsDeep(other))
|
if (!super.equalsDeep(other))
|
||||||
return false;
|
return false;
|
||||||
if (!(other instanceof Address))
|
if (!(other instanceof AddressType))
|
||||||
return false;
|
return false;
|
||||||
Address o = (Address) other;
|
AddressType o = (AddressType) other;
|
||||||
return compareDeep(use, o.use, true) && compareDeep(text, o.text, true) && compareDeep(line, o.line, true)
|
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(city, o.city, true) && compareDeep(state, o.state, true) && compareDeep(postalCode, o.postalCode, true)
|
||||||
&& compareDeep(country, o.country, true) && compareDeep(period, o.period, 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) {
|
public boolean equalsShallow(Base other) {
|
||||||
if (!super.equalsShallow(other))
|
if (!super.equalsShallow(other))
|
||||||
return false;
|
return false;
|
||||||
if (!(other instanceof Address))
|
if (!(other instanceof AddressType))
|
||||||
return false;
|
return false;
|
||||||
Address o = (Address) other;
|
AddressType o = (AddressType) other;
|
||||||
return compareValues(use, o.use, true) && compareValues(text, o.text, true) && compareValues(line, o.line, true)
|
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(city, o.city, true) && compareValues(state, o.state, true) && compareValues(postalCode, o.postalCode, true)
|
||||||
&& compareValues(country, o.country, true);
|
&& compareValues(country, o.country, true);
|
@ -41,7 +41,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
|||||||
* For referring to data content defined in other formats.
|
* For referring to data content defined in other formats.
|
||||||
*/
|
*/
|
||||||
@DatatypeDef(name="Attachment")
|
@DatatypeDef(name="Attachment")
|
||||||
public class Attachment extends Type implements ICompositeType {
|
public class AttachmentType 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.
|
* 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.
|
||||||
@ -94,7 +94,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 483430116L;
|
private static final long serialVersionUID = 483430116L;
|
||||||
|
|
||||||
public Attachment() {
|
public AttachmentType() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @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
|
* @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) {
|
public AttachmentType setContentTypeElement(CodeType value) {
|
||||||
this.contentType = value;
|
this.contentType = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @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.
|
* @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) {
|
public AttachmentType setContentType(String value) {
|
||||||
if (Utilities.noString(value))
|
if (Utilities.noString(value))
|
||||||
this.contentType = null;
|
this.contentType = null;
|
||||||
else {
|
else {
|
||||||
@ -170,7 +170,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @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
|
* @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) {
|
public AttachmentType setLanguageElement(CodeType value) {
|
||||||
this.language = value;
|
this.language = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -185,7 +185,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @param value The human language of the content. The value can be any valid value according to BCP 47.
|
* @param value The human language of the content. The value can be any valid value according to BCP 47.
|
||||||
*/
|
*/
|
||||||
public Attachment setLanguage(String value) {
|
public AttachmentType setLanguage(String value) {
|
||||||
if (Utilities.noString(value))
|
if (Utilities.noString(value))
|
||||||
this.language = null;
|
this.language = null;
|
||||||
else {
|
else {
|
||||||
@ -219,7 +219,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @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
|
* @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) {
|
public AttachmentType setDataElement(Base64BinaryType value) {
|
||||||
this.data = value;
|
this.data = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64.
|
* @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64.
|
||||||
*/
|
*/
|
||||||
public Attachment setData(byte[] value) {
|
public AttachmentType setData(byte[] value) {
|
||||||
if (value == null)
|
if (value == null)
|
||||||
this.data = null;
|
this.data = null;
|
||||||
else {
|
else {
|
||||||
@ -268,7 +268,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @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
|
* @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) {
|
public AttachmentType setUrlElement(UriType value) {
|
||||||
this.url = value;
|
this.url = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -283,7 +283,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @param value An alternative location where the data can be accessed.
|
* @param value An alternative location where the data can be accessed.
|
||||||
*/
|
*/
|
||||||
public Attachment setUrl(String value) {
|
public AttachmentType setUrl(String value) {
|
||||||
if (Utilities.noString(value))
|
if (Utilities.noString(value))
|
||||||
this.url = null;
|
this.url = null;
|
||||||
else {
|
else {
|
||||||
@ -317,7 +317,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @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
|
* @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(IntegerType value) {
|
public AttachmentType setSizeElement(IntegerType value) {
|
||||||
this.size = value;
|
this.size = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -332,7 +332,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @param value The number of bytes of data that make up this attachment.
|
* @param value The number of bytes of data that make up this attachment.
|
||||||
*/
|
*/
|
||||||
public Attachment setSize(int value) {
|
public AttachmentType setSize(int value) {
|
||||||
if (this.size == null)
|
if (this.size == null)
|
||||||
this.size = new IntegerType();
|
this.size = new IntegerType();
|
||||||
this.size.setValue(value);
|
this.size.setValue(value);
|
||||||
@ -362,7 +362,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @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
|
* @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) {
|
public AttachmentType setHashElement(Base64BinaryType value) {
|
||||||
this.hash = value;
|
this.hash = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -377,7 +377,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @param value The calculated hash of the data using SHA-1. Represented using base64.
|
* @param value The calculated hash of the data using SHA-1. Represented using base64.
|
||||||
*/
|
*/
|
||||||
public Attachment setHash(byte[] value) {
|
public AttachmentType setHash(byte[] value) {
|
||||||
if (value == null)
|
if (value == null)
|
||||||
this.hash = null;
|
this.hash = null;
|
||||||
else {
|
else {
|
||||||
@ -411,7 +411,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @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
|
* @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) {
|
public AttachmentType setTitleElement(StringType value) {
|
||||||
this.title = value;
|
this.title = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -426,7 +426,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
/**
|
/**
|
||||||
* @param value A label or set of text to display in place of the data.
|
* @param value A label or set of text to display in place of the data.
|
||||||
*/
|
*/
|
||||||
public Attachment setTitle(String value) {
|
public AttachmentType setTitle(String value) {
|
||||||
if (Utilities.noString(value))
|
if (Utilities.noString(value))
|
||||||
this.title = null;
|
this.title = null;
|
||||||
else {
|
else {
|
||||||
@ -448,8 +448,8 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
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("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Attachment copy() {
|
public AttachmentType copy() {
|
||||||
Attachment dst = new Attachment();
|
AttachmentType dst = new AttachmentType();
|
||||||
copyValues(dst);
|
copyValues(dst);
|
||||||
dst.contentType = contentType == null ? null : contentType.copy();
|
dst.contentType = contentType == null ? null : contentType.copy();
|
||||||
dst.language = language == null ? null : language.copy();
|
dst.language = language == null ? null : language.copy();
|
||||||
@ -461,7 +461,7 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Attachment typedCopy() {
|
protected AttachmentType typedCopy() {
|
||||||
return copy();
|
return copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,9 +469,9 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
public boolean equalsDeep(Base other) {
|
public boolean equalsDeep(Base other) {
|
||||||
if (!super.equalsDeep(other))
|
if (!super.equalsDeep(other))
|
||||||
return false;
|
return false;
|
||||||
if (!(other instanceof Attachment))
|
if (!(other instanceof AttachmentType))
|
||||||
return false;
|
return false;
|
||||||
Attachment o = (Attachment) other;
|
AttachmentType o = (AttachmentType) other;
|
||||||
return compareDeep(contentType, o.contentType, true) && compareDeep(language, o.language, true)
|
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(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(hash, o.hash, true) && compareDeep(title, o.title, true);
|
||||||
@ -481,9 +481,9 @@ public class Attachment extends Type implements ICompositeType {
|
|||||||
public boolean equalsShallow(Base other) {
|
public boolean equalsShallow(Base other) {
|
||||||
if (!super.equalsShallow(other))
|
if (!super.equalsShallow(other))
|
||||||
return false;
|
return false;
|
||||||
if (!(other instanceof Attachment))
|
if (!(other instanceof AttachmentType))
|
||||||
return false;
|
return false;
|
||||||
Attachment o = (Attachment) other;
|
AttachmentType o = (AttachmentType) other;
|
||||||
return compareValues(contentType, o.contentType, true) && compareValues(language, o.language, true)
|
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(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(hash, o.hash, true) && compareValues(title, o.title, true);
|
@ -421,9 +421,9 @@ public class BodySite extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Image or images used to identify a location.
|
* Image or images used to identify a location.
|
||||||
*/
|
*/
|
||||||
@Child(name = "image", type = {Attachment.class}, order = 4, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "image", type = {AttachmentType.class}, order = 4, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Attached images", formalDefinition="Image or images used to identify a location." )
|
@Description(shortDefinition="Attached images", formalDefinition="Image or images used to identify a location." )
|
||||||
protected List<Attachment> image;
|
protected List<AttachmentType> image;
|
||||||
|
|
||||||
private static final long serialVersionUID = -11708151L;
|
private static final long serialVersionUID = -11708151L;
|
||||||
|
|
||||||
@ -567,16 +567,16 @@ public class BodySite extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #image} (Image or images used to identify a location.)
|
* @return {@link #image} (Image or images used to identify a location.)
|
||||||
*/
|
*/
|
||||||
public List<Attachment> getImage() {
|
public List<AttachmentType> getImage() {
|
||||||
if (this.image == null)
|
if (this.image == null)
|
||||||
this.image = new ArrayList<Attachment>();
|
this.image = new ArrayList<AttachmentType>();
|
||||||
return this.image;
|
return this.image;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasImage() {
|
public boolean hasImage() {
|
||||||
if (this.image == null)
|
if (this.image == null)
|
||||||
return false;
|
return false;
|
||||||
for (Attachment item : this.image)
|
for (AttachmentType item : this.image)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -586,10 +586,10 @@ public class BodySite extends DomainResource {
|
|||||||
* @return {@link #image} (Image or images used to identify a location.)
|
* @return {@link #image} (Image or images used to identify a location.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Attachment addImage() { //3
|
public AttachmentType addImage() { //3
|
||||||
Attachment t = new Attachment();
|
AttachmentType t = new AttachmentType();
|
||||||
if (this.image == null)
|
if (this.image == null)
|
||||||
this.image = new ArrayList<Attachment>();
|
this.image = new ArrayList<AttachmentType>();
|
||||||
this.image.add(t);
|
this.image.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -619,8 +619,8 @@ public class BodySite extends DomainResource {
|
|||||||
};
|
};
|
||||||
dst.description = description == null ? null : description.copy();
|
dst.description = description == null ? null : description.copy();
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
dst.image = new ArrayList<Attachment>();
|
dst.image = new ArrayList<AttachmentType>();
|
||||||
for (Attachment i : image)
|
for (AttachmentType i : image)
|
||||||
dst.image.add(i.copy());
|
dst.image.add(i.copy());
|
||||||
};
|
};
|
||||||
return dst;
|
return dst;
|
||||||
|
@ -164,7 +164,7 @@ public class Communication extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* An individual message part for multi-part messages.
|
* An individual message part for multi-part messages.
|
||||||
*/
|
*/
|
||||||
@Child(name="content", type={StringType.class, Attachment.class}, order=1, min=1, max=1)
|
@Child(name="content", type={StringType.class, AttachmentType.class}, order=1, min=1, max=1)
|
||||||
@Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." )
|
@Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." )
|
||||||
protected Type content;
|
protected Type content;
|
||||||
|
|
||||||
@ -198,10 +198,10 @@ public class Communication extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #content} (An individual message part for multi-part messages.)
|
* @return {@link #content} (An individual message part for multi-part messages.)
|
||||||
*/
|
*/
|
||||||
public Attachment getContentAttachment() throws Exception {
|
public AttachmentType getContentAttachment() throws Exception {
|
||||||
if (!(this.content instanceof Attachment))
|
if (!(this.content instanceof AttachmentType))
|
||||||
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
|
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
|
||||||
return (Attachment) this.content;
|
return (AttachmentType) this.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -234,7 +234,7 @@ public class CommunicationRequest extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* An individual message part for multi-part messages.
|
* An individual message part for multi-part messages.
|
||||||
*/
|
*/
|
||||||
@Child(name="content", type={StringType.class, Attachment.class}, order=1, min=1, max=1)
|
@Child(name="content", type={StringType.class, AttachmentType.class}, order=1, min=1, max=1)
|
||||||
@Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." )
|
@Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." )
|
||||||
protected Type content;
|
protected Type content;
|
||||||
|
|
||||||
@ -268,10 +268,10 @@ public class CommunicationRequest extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #content} (An individual message part for multi-part messages.)
|
* @return {@link #content} (An individual message part for multi-part messages.)
|
||||||
*/
|
*/
|
||||||
public Attachment getContentAttachment() throws Exception {
|
public AttachmentType getContentAttachment() throws Exception {
|
||||||
if (!(this.content instanceof Attachment))
|
if (!(this.content instanceof AttachmentType))
|
||||||
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
|
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
|
||||||
return (Attachment) this.content;
|
return (AttachmentType) this.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -957,9 +957,9 @@ public class Contract extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Legally binding contract.
|
* Legally binding contract.
|
||||||
*/
|
*/
|
||||||
@Child(name = "binding", type = {Attachment.class}, order = 21, min = 0, max = 1)
|
@Child(name = "binding", type = {AttachmentType.class}, order = 21, min = 0, max = 1)
|
||||||
@Description(shortDefinition="Binding Contract", formalDefinition="Legally binding contract." )
|
@Description(shortDefinition="Binding Contract", formalDefinition="Legally binding contract." )
|
||||||
protected Attachment binding;
|
protected AttachmentType binding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relevant time/time-period when applicable.
|
* Relevant time/time-period when applicable.
|
||||||
@ -971,9 +971,9 @@ public class Contract extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Friendly Human readable form (might be a reference to the UI used to capture the contract).
|
* Friendly Human readable form (might be a reference to the UI used to capture the contract).
|
||||||
*/
|
*/
|
||||||
@Child(name = "friendly", type = {Attachment.class}, order = 23, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "friendly", type = {AttachmentType.class}, order = 23, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Human readable contract text", formalDefinition="Friendly Human readable form (might be a reference to the UI used to capture the contract)." )
|
@Description(shortDefinition="Human readable contract text", formalDefinition="Friendly Human readable form (might be a reference to the UI used to capture the contract)." )
|
||||||
protected List<Attachment> friendly;
|
protected List<AttachmentType> friendly;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relevant time/time-period when applicable.
|
* Relevant time/time-period when applicable.
|
||||||
@ -985,9 +985,9 @@ public class Contract extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Legal text in Human readable form.
|
* Legal text in Human readable form.
|
||||||
*/
|
*/
|
||||||
@Child(name = "legal", type = {Attachment.class}, order = 25, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "legal", type = {AttachmentType.class}, order = 25, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Legal contract text", formalDefinition="Legal text in Human readable form." )
|
@Description(shortDefinition="Legal contract text", formalDefinition="Legal text in Human readable form." )
|
||||||
protected List<Attachment> legal;
|
protected List<AttachmentType> legal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relevant time/time-period when applicable.
|
* Relevant time/time-period when applicable.
|
||||||
@ -999,9 +999,9 @@ public class Contract extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Computable Policy rules (e.g. XACML, DKAL, SecPal).
|
* Computable Policy rules (e.g. XACML, DKAL, SecPal).
|
||||||
*/
|
*/
|
||||||
@Child(name = "rule", type = {Attachment.class}, order = 27, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "rule", type = {AttachmentType.class}, order = 27, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Computable contract text", formalDefinition="Computable Policy rules (e.g. XACML, DKAL, SecPal)." )
|
@Description(shortDefinition="Computable contract text", formalDefinition="Computable Policy rules (e.g. XACML, DKAL, SecPal)." )
|
||||||
protected List<Attachment> rule;
|
protected List<AttachmentType> rule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relevant time/time-period when applicable.
|
* Relevant time/time-period when applicable.
|
||||||
@ -1781,12 +1781,12 @@ public class Contract extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #binding} (Legally binding contract.)
|
* @return {@link #binding} (Legally binding contract.)
|
||||||
*/
|
*/
|
||||||
public Attachment getBinding() {
|
public AttachmentType getBinding() {
|
||||||
if (this.binding == null)
|
if (this.binding == null)
|
||||||
if (Configuration.errorOnAutoCreate())
|
if (Configuration.errorOnAutoCreate())
|
||||||
throw new Error("Attempt to auto-create Contract.binding");
|
throw new Error("Attempt to auto-create Contract.binding");
|
||||||
else if (Configuration.doAutoCreate())
|
else if (Configuration.doAutoCreate())
|
||||||
this.binding = new Attachment(); // cc
|
this.binding = new AttachmentType(); // cc
|
||||||
return this.binding;
|
return this.binding;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1797,7 +1797,7 @@ public class Contract extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @param value {@link #binding} (Legally binding contract.)
|
* @param value {@link #binding} (Legally binding contract.)
|
||||||
*/
|
*/
|
||||||
public Contract setBinding(Attachment value) {
|
public Contract setBinding(AttachmentType value) {
|
||||||
this.binding = value;
|
this.binding = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -1854,16 +1854,16 @@ public class Contract extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).)
|
* @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).)
|
||||||
*/
|
*/
|
||||||
public List<Attachment> getFriendly() {
|
public List<AttachmentType> getFriendly() {
|
||||||
if (this.friendly == null)
|
if (this.friendly == null)
|
||||||
this.friendly = new ArrayList<Attachment>();
|
this.friendly = new ArrayList<AttachmentType>();
|
||||||
return this.friendly;
|
return this.friendly;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasFriendly() {
|
public boolean hasFriendly() {
|
||||||
if (this.friendly == null)
|
if (this.friendly == null)
|
||||||
return false;
|
return false;
|
||||||
for (Attachment item : this.friendly)
|
for (AttachmentType item : this.friendly)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -1873,10 +1873,10 @@ public class Contract extends DomainResource {
|
|||||||
* @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).)
|
* @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Attachment addFriendly() { //3
|
public AttachmentType addFriendly() { //3
|
||||||
Attachment t = new Attachment();
|
AttachmentType t = new AttachmentType();
|
||||||
if (this.friendly == null)
|
if (this.friendly == null)
|
||||||
this.friendly = new ArrayList<Attachment>();
|
this.friendly = new ArrayList<AttachmentType>();
|
||||||
this.friendly.add(t);
|
this.friendly.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -1933,16 +1933,16 @@ public class Contract extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #legal} (Legal text in Human readable form.)
|
* @return {@link #legal} (Legal text in Human readable form.)
|
||||||
*/
|
*/
|
||||||
public List<Attachment> getLegal() {
|
public List<AttachmentType> getLegal() {
|
||||||
if (this.legal == null)
|
if (this.legal == null)
|
||||||
this.legal = new ArrayList<Attachment>();
|
this.legal = new ArrayList<AttachmentType>();
|
||||||
return this.legal;
|
return this.legal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasLegal() {
|
public boolean hasLegal() {
|
||||||
if (this.legal == null)
|
if (this.legal == null)
|
||||||
return false;
|
return false;
|
||||||
for (Attachment item : this.legal)
|
for (AttachmentType item : this.legal)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -1952,10 +1952,10 @@ public class Contract extends DomainResource {
|
|||||||
* @return {@link #legal} (Legal text in Human readable form.)
|
* @return {@link #legal} (Legal text in Human readable form.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Attachment addLegal() { //3
|
public AttachmentType addLegal() { //3
|
||||||
Attachment t = new Attachment();
|
AttachmentType t = new AttachmentType();
|
||||||
if (this.legal == null)
|
if (this.legal == null)
|
||||||
this.legal = new ArrayList<Attachment>();
|
this.legal = new ArrayList<AttachmentType>();
|
||||||
this.legal.add(t);
|
this.legal.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -2012,16 +2012,16 @@ public class Contract extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).)
|
* @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).)
|
||||||
*/
|
*/
|
||||||
public List<Attachment> getRule() {
|
public List<AttachmentType> getRule() {
|
||||||
if (this.rule == null)
|
if (this.rule == null)
|
||||||
this.rule = new ArrayList<Attachment>();
|
this.rule = new ArrayList<AttachmentType>();
|
||||||
return this.rule;
|
return this.rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasRule() {
|
public boolean hasRule() {
|
||||||
if (this.rule == null)
|
if (this.rule == null)
|
||||||
return false;
|
return false;
|
||||||
for (Attachment item : this.rule)
|
for (AttachmentType item : this.rule)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -2031,10 +2031,10 @@ public class Contract extends DomainResource {
|
|||||||
* @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).)
|
* @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Attachment addRule() { //3
|
public AttachmentType addRule() { //3
|
||||||
Attachment t = new Attachment();
|
AttachmentType t = new AttachmentType();
|
||||||
if (this.rule == null)
|
if (this.rule == null)
|
||||||
this.rule = new ArrayList<Attachment>();
|
this.rule = new ArrayList<AttachmentType>();
|
||||||
this.rule.add(t);
|
this.rule.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -2200,20 +2200,20 @@ public class Contract extends DomainResource {
|
|||||||
dst.binding = binding == null ? null : binding.copy();
|
dst.binding = binding == null ? null : binding.copy();
|
||||||
dst.bindingDateTime = bindingDateTime == null ? null : bindingDateTime.copy();
|
dst.bindingDateTime = bindingDateTime == null ? null : bindingDateTime.copy();
|
||||||
if (friendly != null) {
|
if (friendly != null) {
|
||||||
dst.friendly = new ArrayList<Attachment>();
|
dst.friendly = new ArrayList<AttachmentType>();
|
||||||
for (Attachment i : friendly)
|
for (AttachmentType i : friendly)
|
||||||
dst.friendly.add(i.copy());
|
dst.friendly.add(i.copy());
|
||||||
};
|
};
|
||||||
dst.friendlyDateTime = friendlyDateTime == null ? null : friendlyDateTime.copy();
|
dst.friendlyDateTime = friendlyDateTime == null ? null : friendlyDateTime.copy();
|
||||||
if (legal != null) {
|
if (legal != null) {
|
||||||
dst.legal = new ArrayList<Attachment>();
|
dst.legal = new ArrayList<AttachmentType>();
|
||||||
for (Attachment i : legal)
|
for (AttachmentType i : legal)
|
||||||
dst.legal.add(i.copy());
|
dst.legal.add(i.copy());
|
||||||
};
|
};
|
||||||
dst.legalDateTime = legalDateTime == null ? null : legalDateTime.copy();
|
dst.legalDateTime = legalDateTime == null ? null : legalDateTime.copy();
|
||||||
if (rule != null) {
|
if (rule != null) {
|
||||||
dst.rule = new ArrayList<Attachment>();
|
dst.rule = new ArrayList<AttachmentType>();
|
||||||
for (Attachment i : rule)
|
for (AttachmentType i : rule)
|
||||||
dst.rule.add(i.copy());
|
dst.rule.add(i.copy());
|
||||||
};
|
};
|
||||||
dst.ruleDateTime = ruleDateTime == null ? null : ruleDateTime.copy();
|
dst.ruleDateTime = ruleDateTime == null ? null : ruleDateTime.copy();
|
||||||
|
@ -517,9 +517,9 @@ public class DiagnosticReport extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.
|
* Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.
|
||||||
*/
|
*/
|
||||||
@Child(name = "presentedForm", type = {Attachment.class}, order = 16, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "presentedForm", type = {AttachmentType.class}, order = 16, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Entire Report as issued", formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." )
|
@Description(shortDefinition="Entire Report as issued", formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." )
|
||||||
protected List<Attachment> presentedForm;
|
protected List<AttachmentType> presentedForm;
|
||||||
|
|
||||||
private static final long serialVersionUID = -1237974006L;
|
private static final long serialVersionUID = -1237974006L;
|
||||||
|
|
||||||
@ -1174,16 +1174,16 @@ public class DiagnosticReport extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.)
|
* @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.)
|
||||||
*/
|
*/
|
||||||
public List<Attachment> getPresentedForm() {
|
public List<AttachmentType> getPresentedForm() {
|
||||||
if (this.presentedForm == null)
|
if (this.presentedForm == null)
|
||||||
this.presentedForm = new ArrayList<Attachment>();
|
this.presentedForm = new ArrayList<AttachmentType>();
|
||||||
return this.presentedForm;
|
return this.presentedForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasPresentedForm() {
|
public boolean hasPresentedForm() {
|
||||||
if (this.presentedForm == null)
|
if (this.presentedForm == null)
|
||||||
return false;
|
return false;
|
||||||
for (Attachment item : this.presentedForm)
|
for (AttachmentType item : this.presentedForm)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -1193,10 +1193,10 @@ public class DiagnosticReport extends DomainResource {
|
|||||||
* @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.)
|
* @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Attachment addPresentedForm() { //3
|
public AttachmentType addPresentedForm() { //3
|
||||||
Attachment t = new Attachment();
|
AttachmentType t = new AttachmentType();
|
||||||
if (this.presentedForm == null)
|
if (this.presentedForm == null)
|
||||||
this.presentedForm = new ArrayList<Attachment>();
|
this.presentedForm = new ArrayList<AttachmentType>();
|
||||||
this.presentedForm.add(t);
|
this.presentedForm.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -1266,8 +1266,8 @@ public class DiagnosticReport extends DomainResource {
|
|||||||
dst.codedDiagnosis.add(i.copy());
|
dst.codedDiagnosis.add(i.copy());
|
||||||
};
|
};
|
||||||
if (presentedForm != null) {
|
if (presentedForm != null) {
|
||||||
dst.presentedForm = new ArrayList<Attachment>();
|
dst.presentedForm = new ArrayList<AttachmentType>();
|
||||||
for (Attachment i : presentedForm)
|
for (AttachmentType i : presentedForm)
|
||||||
dst.presentedForm.add(i.copy());
|
dst.presentedForm.add(i.copy());
|
||||||
};
|
};
|
||||||
return dst;
|
return dst;
|
||||||
|
@ -691,9 +691,9 @@ public class DocumentReference extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* The document or url to the document along with critical metadata to prove content has integrity.
|
* The document or url to the document along with critical metadata to prove content has integrity.
|
||||||
*/
|
*/
|
||||||
@Child(name = "content", type = {Attachment.class}, order = 17, min = 1, max = Child.MAX_UNLIMITED)
|
@Child(name = "content", type = {AttachmentType.class}, order = 17, min = 1, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Where to access the document", formalDefinition="The document or url to the document along with critical metadata to prove content has integrity." )
|
@Description(shortDefinition="Where to access the document", formalDefinition="The document or url to the document along with critical metadata to prove content has integrity." )
|
||||||
protected List<Attachment> content;
|
protected List<AttachmentType> content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The clinical context in which the document was prepared.
|
* The clinical context in which the document was prepared.
|
||||||
@ -1356,16 +1356,16 @@ public class DocumentReference extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #content} (The document or url to the document along with critical metadata to prove content has integrity.)
|
* @return {@link #content} (The document or url to the document along with critical metadata to prove content has integrity.)
|
||||||
*/
|
*/
|
||||||
public List<Attachment> getContent() {
|
public List<AttachmentType> getContent() {
|
||||||
if (this.content == null)
|
if (this.content == null)
|
||||||
this.content = new ArrayList<Attachment>();
|
this.content = new ArrayList<AttachmentType>();
|
||||||
return this.content;
|
return this.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasContent() {
|
public boolean hasContent() {
|
||||||
if (this.content == null)
|
if (this.content == null)
|
||||||
return false;
|
return false;
|
||||||
for (Attachment item : this.content)
|
for (AttachmentType item : this.content)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -1375,10 +1375,10 @@ public class DocumentReference extends DomainResource {
|
|||||||
* @return {@link #content} (The document or url to the document along with critical metadata to prove content has integrity.)
|
* @return {@link #content} (The document or url to the document along with critical metadata to prove content has integrity.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Attachment addContent() { //3
|
public AttachmentType addContent() { //3
|
||||||
Attachment t = new Attachment();
|
AttachmentType t = new AttachmentType();
|
||||||
if (this.content == null)
|
if (this.content == null)
|
||||||
this.content = new ArrayList<Attachment>();
|
this.content = new ArrayList<AttachmentType>();
|
||||||
this.content.add(t);
|
this.content.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -1471,8 +1471,8 @@ public class DocumentReference extends DomainResource {
|
|||||||
dst.confidentiality.add(i.copy());
|
dst.confidentiality.add(i.copy());
|
||||||
};
|
};
|
||||||
if (content != null) {
|
if (content != null) {
|
||||||
dst.content = new ArrayList<Attachment>();
|
dst.content = new ArrayList<AttachmentType>();
|
||||||
for (Attachment i : content)
|
for (AttachmentType i : content)
|
||||||
dst.content.add(i.copy());
|
dst.content.add(i.copy());
|
||||||
};
|
};
|
||||||
dst.context = context == null ? null : context.copy();
|
dst.context = context == null ? null : context.copy();
|
||||||
|
@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
* Primitive type "code" in FHIR, where the code is tied to an enumerated list of possible values
|
* Primitive type "code" in FHIR, where the code is tied to an enumerated list of possible values
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@DatatypeDef(name="enumeration")
|
@DatatypeDef(name="code", isSpecialization=true)
|
||||||
public class Enumeration<T extends Enum<?>> extends PrimitiveType<T> implements IBaseEnumeration<T> {
|
public class Enumeration<T extends Enum<?>> extends PrimitiveType<T> implements IBaseEnumeration<T> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -461,9 +461,9 @@ public class Location extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Physical location.
|
* Physical location.
|
||||||
*/
|
*/
|
||||||
@Child(name = "address", type = {Address.class}, order = 5, min = 0, max = 1)
|
@Child(name = "address", type = {AddressType.class}, order = 5, min = 0, max = 1)
|
||||||
@Description(shortDefinition="Physical location", formalDefinition="Physical location." )
|
@Description(shortDefinition="Physical location", formalDefinition="Physical location." )
|
||||||
protected Address address;
|
protected AddressType address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Physical form of the location, e.g. building, room, vehicle, road.
|
* Physical form of the location, e.g. building, room, vehicle, road.
|
||||||
@ -708,12 +708,12 @@ public class Location extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #address} (Physical location.)
|
* @return {@link #address} (Physical location.)
|
||||||
*/
|
*/
|
||||||
public Address getAddress() {
|
public AddressType getAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
if (Configuration.errorOnAutoCreate())
|
if (Configuration.errorOnAutoCreate())
|
||||||
throw new Error("Attempt to auto-create Location.address");
|
throw new Error("Attempt to auto-create Location.address");
|
||||||
else if (Configuration.doAutoCreate())
|
else if (Configuration.doAutoCreate())
|
||||||
this.address = new Address(); // cc
|
this.address = new AddressType(); // cc
|
||||||
return this.address;
|
return this.address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -724,7 +724,7 @@ public class Location extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @param value {@link #address} (Physical location.)
|
* @param value {@link #address} (Physical location.)
|
||||||
*/
|
*/
|
||||||
public Location setAddress(Address value) {
|
public Location setAddress(AddressType value) {
|
||||||
this.address = value;
|
this.address = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -228,9 +228,9 @@ public class Media extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* The actual content of the media - inline or by direct reference to the media source file.
|
* The actual content of the media - inline or by direct reference to the media source file.
|
||||||
*/
|
*/
|
||||||
@Child(name = "content", type = {Attachment.class}, order = 12, min = 1, max = 1)
|
@Child(name = "content", type = {AttachmentType.class}, order = 12, min = 1, max = 1)
|
||||||
@Description(shortDefinition="Actual Media - reference or data", formalDefinition="The actual content of the media - inline or by direct reference to the media source file." )
|
@Description(shortDefinition="Actual Media - reference or data", formalDefinition="The actual content of the media - inline or by direct reference to the media source file." )
|
||||||
protected Attachment content;
|
protected AttachmentType content;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1930988698L;
|
private static final long serialVersionUID = 1930988698L;
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ public class Media extends DomainResource {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Media(Enumeration<MediaType> type, Attachment content) {
|
public Media(Enumeration<MediaType> type, AttachmentType content) {
|
||||||
super();
|
super();
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.content = content;
|
this.content = content;
|
||||||
@ -731,12 +731,12 @@ public class Media extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #content} (The actual content of the media - inline or by direct reference to the media source file.)
|
* @return {@link #content} (The actual content of the media - inline or by direct reference to the media source file.)
|
||||||
*/
|
*/
|
||||||
public Attachment getContent() {
|
public AttachmentType getContent() {
|
||||||
if (this.content == null)
|
if (this.content == null)
|
||||||
if (Configuration.errorOnAutoCreate())
|
if (Configuration.errorOnAutoCreate())
|
||||||
throw new Error("Attempt to auto-create Media.content");
|
throw new Error("Attempt to auto-create Media.content");
|
||||||
else if (Configuration.doAutoCreate())
|
else if (Configuration.doAutoCreate())
|
||||||
this.content = new Attachment(); // cc
|
this.content = new AttachmentType(); // cc
|
||||||
return this.content;
|
return this.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,7 +747,7 @@ public class Media extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @param value {@link #content} (The actual content of the media - inline or by direct reference to the media source file.)
|
* @param value {@link #content} (The actual content of the media - inline or by direct reference to the media source file.)
|
||||||
*/
|
*/
|
||||||
public Media setContent(Attachment value) {
|
public Media setContent(AttachmentType value) {
|
||||||
this.content = value;
|
this.content = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -1026,7 +1026,7 @@ public class Observation extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* The information determined as a result of making the observation, if the information has a simple value.
|
* The information determined as a result of making the observation, if the information has a simple value.
|
||||||
*/
|
*/
|
||||||
@Child(name = "value", type = {Quantity.class, CodeableConcept.class, Attachment.class, Ratio.class, DateTimeType.class, Period.class, SampledData.class, StringType.class, TimeType.class}, order = 1, min = 0, max = 1)
|
@Child(name = "value", type = {Quantity.class, CodeableConcept.class, AttachmentType.class, Ratio.class, DateTimeType.class, Period.class, SampledData.class, StringType.class, TimeType.class}, order = 1, min = 0, max = 1)
|
||||||
@Description(shortDefinition="Actual result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." )
|
@Description(shortDefinition="Actual result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." )
|
||||||
protected Type value;
|
protected Type value;
|
||||||
|
|
||||||
@ -1240,10 +1240,10 @@ other observer (for example a relative or EMT), or any observation made about th
|
|||||||
/**
|
/**
|
||||||
* @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
|
* @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
|
||||||
*/
|
*/
|
||||||
public Attachment getValueAttachment() throws Exception {
|
public AttachmentType getValueAttachment() throws Exception {
|
||||||
if (!(this.value instanceof Attachment))
|
if (!(this.value instanceof AttachmentType))
|
||||||
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
|
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
|
||||||
return (Attachment) this.value;
|
return (AttachmentType) this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,9 +171,9 @@ public class Organization extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Visiting or postal addresses for the contact.
|
* Visiting or postal addresses for the contact.
|
||||||
*/
|
*/
|
||||||
@Child(name="address", type={Address.class}, order=4, min=0, max=1)
|
@Child(name="address", type={AddressType.class}, order=4, min=0, max=1)
|
||||||
@Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." )
|
@Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." )
|
||||||
protected Address address;
|
protected AddressType address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
|
* Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
|
||||||
@ -269,12 +269,12 @@ public class Organization extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #address} (Visiting or postal addresses for the contact.)
|
* @return {@link #address} (Visiting or postal addresses for the contact.)
|
||||||
*/
|
*/
|
||||||
public Address getAddress() {
|
public AddressType getAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
if (Configuration.errorOnAutoCreate())
|
if (Configuration.errorOnAutoCreate())
|
||||||
throw new Error("Attempt to auto-create OrganizationContactComponent.address");
|
throw new Error("Attempt to auto-create OrganizationContactComponent.address");
|
||||||
else if (Configuration.doAutoCreate())
|
else if (Configuration.doAutoCreate())
|
||||||
this.address = new Address(); // cc
|
this.address = new AddressType(); // cc
|
||||||
return this.address;
|
return this.address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ public class Organization extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @param value {@link #address} (Visiting or postal addresses for the contact.)
|
* @param value {@link #address} (Visiting or postal addresses for the contact.)
|
||||||
*/
|
*/
|
||||||
public OrganizationContactComponent setAddress(Address value) {
|
public OrganizationContactComponent setAddress(AddressType value) {
|
||||||
this.address = value;
|
this.address = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -423,9 +423,9 @@ public class Organization extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* An address for the organization.
|
* An address for the organization.
|
||||||
*/
|
*/
|
||||||
@Child(name = "address", type = {Address.class}, order = 4, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "address", type = {AddressType.class}, order = 4, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." )
|
@Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." )
|
||||||
protected List<Address> address;
|
protected List<AddressType> address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The organization of which this organization forms a part.
|
* The organization of which this organization forms a part.
|
||||||
@ -607,16 +607,16 @@ public class Organization extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #address} (An address for the organization.)
|
* @return {@link #address} (An address for the organization.)
|
||||||
*/
|
*/
|
||||||
public List<Address> getAddress() {
|
public List<AddressType> getAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
this.address = new ArrayList<Address>();
|
this.address = new ArrayList<AddressType>();
|
||||||
return this.address;
|
return this.address;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAddress() {
|
public boolean hasAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
return false;
|
return false;
|
||||||
for (Address item : this.address)
|
for (AddressType item : this.address)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -626,10 +626,10 @@ public class Organization extends DomainResource {
|
|||||||
* @return {@link #address} (An address for the organization.)
|
* @return {@link #address} (An address for the organization.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Address addAddress() { //3
|
public AddressType addAddress() { //3
|
||||||
Address t = new Address();
|
AddressType t = new AddressType();
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
this.address = new ArrayList<Address>();
|
this.address = new ArrayList<AddressType>();
|
||||||
this.address.add(t);
|
this.address.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -833,8 +833,8 @@ public class Organization extends DomainResource {
|
|||||||
dst.telecom.add(i.copy());
|
dst.telecom.add(i.copy());
|
||||||
};
|
};
|
||||||
if (address != null) {
|
if (address != null) {
|
||||||
dst.address = new ArrayList<Address>();
|
dst.address = new ArrayList<AddressType>();
|
||||||
for (Address i : address)
|
for (AddressType i : address)
|
||||||
dst.address.add(i.copy());
|
dst.address.add(i.copy());
|
||||||
};
|
};
|
||||||
dst.partOf = partOf == null ? null : partOf.copy();
|
dst.partOf = partOf == null ? null : partOf.copy();
|
||||||
|
@ -258,9 +258,9 @@ public class Patient extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Address for the contact person.
|
* Address for the contact person.
|
||||||
*/
|
*/
|
||||||
@Child(name="address", type={Address.class}, order=4, min=0, max=1)
|
@Child(name="address", type={AddressType.class}, order=4, min=0, max=1)
|
||||||
@Description(shortDefinition="Address for the contact person", formalDefinition="Address for the contact person." )
|
@Description(shortDefinition="Address for the contact person", formalDefinition="Address for the contact person." )
|
||||||
protected Address address;
|
protected AddressType address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
|
* Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
|
||||||
@ -381,12 +381,12 @@ public class Patient extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #address} (Address for the contact person.)
|
* @return {@link #address} (Address for the contact person.)
|
||||||
*/
|
*/
|
||||||
public Address getAddress() {
|
public AddressType getAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
if (Configuration.errorOnAutoCreate())
|
if (Configuration.errorOnAutoCreate())
|
||||||
throw new Error("Attempt to auto-create ContactComponent.address");
|
throw new Error("Attempt to auto-create ContactComponent.address");
|
||||||
else if (Configuration.doAutoCreate())
|
else if (Configuration.doAutoCreate())
|
||||||
this.address = new Address(); // cc
|
this.address = new AddressType(); // cc
|
||||||
return this.address;
|
return this.address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ public class Patient extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @param value {@link #address} (Address for the contact person.)
|
* @param value {@link #address} (Address for the contact person.)
|
||||||
*/
|
*/
|
||||||
public ContactComponent setAddress(Address value) {
|
public ContactComponent setAddress(AddressType value) {
|
||||||
this.address = value;
|
this.address = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -940,9 +940,9 @@ public class Patient extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Addresses for the individual.
|
* Addresses for the individual.
|
||||||
*/
|
*/
|
||||||
@Child(name = "address", type = {Address.class}, order = 6, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "address", type = {AddressType.class}, order = 6, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Addresses for the individual", formalDefinition="Addresses for the individual." )
|
@Description(shortDefinition="Addresses for the individual", formalDefinition="Addresses for the individual." )
|
||||||
protected List<Address> address;
|
protected List<AddressType> address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This field contains a patient's most recent marital (civil) status.
|
* This field contains a patient's most recent marital (civil) status.
|
||||||
@ -961,9 +961,9 @@ public class Patient extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Image of the person.
|
* Image of the person.
|
||||||
*/
|
*/
|
||||||
@Child(name = "photo", type = {Attachment.class}, order = 9, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "photo", type = {AttachmentType.class}, order = 9, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Image of the person", formalDefinition="Image of the person." )
|
@Description(shortDefinition="Image of the person", formalDefinition="Image of the person." )
|
||||||
protected List<Attachment> photo;
|
protected List<AttachmentType> photo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A contact party (e.g. guardian, partner, friend) for the patient.
|
* A contact party (e.g. guardian, partner, friend) for the patient.
|
||||||
@ -1258,16 +1258,16 @@ public class Patient extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #address} (Addresses for the individual.)
|
* @return {@link #address} (Addresses for the individual.)
|
||||||
*/
|
*/
|
||||||
public List<Address> getAddress() {
|
public List<AddressType> getAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
this.address = new ArrayList<Address>();
|
this.address = new ArrayList<AddressType>();
|
||||||
return this.address;
|
return this.address;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAddress() {
|
public boolean hasAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
return false;
|
return false;
|
||||||
for (Address item : this.address)
|
for (AddressType item : this.address)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -1277,10 +1277,10 @@ public class Patient extends DomainResource {
|
|||||||
* @return {@link #address} (Addresses for the individual.)
|
* @return {@link #address} (Addresses for the individual.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Address addAddress() { //3
|
public AddressType addAddress() { //3
|
||||||
Address t = new Address();
|
AddressType t = new AddressType();
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
this.address = new ArrayList<Address>();
|
this.address = new ArrayList<AddressType>();
|
||||||
this.address.add(t);
|
this.address.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -1349,16 +1349,16 @@ public class Patient extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #photo} (Image of the person.)
|
* @return {@link #photo} (Image of the person.)
|
||||||
*/
|
*/
|
||||||
public List<Attachment> getPhoto() {
|
public List<AttachmentType> getPhoto() {
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
this.photo = new ArrayList<Attachment>();
|
this.photo = new ArrayList<AttachmentType>();
|
||||||
return this.photo;
|
return this.photo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasPhoto() {
|
public boolean hasPhoto() {
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
return false;
|
return false;
|
||||||
for (Attachment item : this.photo)
|
for (AttachmentType item : this.photo)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -1368,10 +1368,10 @@ public class Patient extends DomainResource {
|
|||||||
* @return {@link #photo} (Image of the person.)
|
* @return {@link #photo} (Image of the person.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Attachment addPhoto() { //3
|
public AttachmentType addPhoto() { //3
|
||||||
Attachment t = new Attachment();
|
AttachmentType t = new AttachmentType();
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
this.photo = new ArrayList<Attachment>();
|
this.photo = new ArrayList<AttachmentType>();
|
||||||
this.photo.add(t);
|
this.photo.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -1661,15 +1661,15 @@ public class Patient extends DomainResource {
|
|||||||
dst.birthDate = birthDate == null ? null : birthDate.copy();
|
dst.birthDate = birthDate == null ? null : birthDate.copy();
|
||||||
dst.deceased = deceased == null ? null : deceased.copy();
|
dst.deceased = deceased == null ? null : deceased.copy();
|
||||||
if (address != null) {
|
if (address != null) {
|
||||||
dst.address = new ArrayList<Address>();
|
dst.address = new ArrayList<AddressType>();
|
||||||
for (Address i : address)
|
for (AddressType i : address)
|
||||||
dst.address.add(i.copy());
|
dst.address.add(i.copy());
|
||||||
};
|
};
|
||||||
dst.maritalStatus = maritalStatus == null ? null : maritalStatus.copy();
|
dst.maritalStatus = maritalStatus == null ? null : maritalStatus.copy();
|
||||||
dst.multipleBirth = multipleBirth == null ? null : multipleBirth.copy();
|
dst.multipleBirth = multipleBirth == null ? null : multipleBirth.copy();
|
||||||
if (photo != null) {
|
if (photo != null) {
|
||||||
dst.photo = new ArrayList<Attachment>();
|
dst.photo = new ArrayList<AttachmentType>();
|
||||||
for (Attachment i : photo)
|
for (AttachmentType i : photo)
|
||||||
dst.photo.add(i.copy());
|
dst.photo.add(i.copy());
|
||||||
};
|
};
|
||||||
if (contact != null) {
|
if (contact != null) {
|
||||||
|
@ -444,16 +444,16 @@ public class Person extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* One or more addresses for the person.
|
* One or more addresses for the person.
|
||||||
*/
|
*/
|
||||||
@Child(name = "address", type = {Address.class}, order = 5, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "address", type = {AddressType.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." )
|
@Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." )
|
||||||
protected List<Address> address;
|
protected List<AddressType> address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.
|
* An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.
|
||||||
*/
|
*/
|
||||||
@Child(name = "photo", type = {Attachment.class}, order = 6, min = 0, max = 1)
|
@Child(name = "photo", type = {AttachmentType.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." )
|
@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 Attachment photo;
|
protected AttachmentType photo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Organization that is the custodian of the person record.
|
* The Organization that is the custodian of the person record.
|
||||||
@ -678,16 +678,16 @@ public class Person extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #address} (One or more addresses for the person.)
|
* @return {@link #address} (One or more addresses for the person.)
|
||||||
*/
|
*/
|
||||||
public List<Address> getAddress() {
|
public List<AddressType> getAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
this.address = new ArrayList<Address>();
|
this.address = new ArrayList<AddressType>();
|
||||||
return this.address;
|
return this.address;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAddress() {
|
public boolean hasAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
return false;
|
return false;
|
||||||
for (Address item : this.address)
|
for (AddressType item : this.address)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -697,10 +697,10 @@ public class Person extends DomainResource {
|
|||||||
* @return {@link #address} (One or more addresses for the person.)
|
* @return {@link #address} (One or more addresses for the person.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Address addAddress() { //3
|
public AddressType addAddress() { //3
|
||||||
Address t = new Address();
|
AddressType t = new AddressType();
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
this.address = new ArrayList<Address>();
|
this.address = new ArrayList<AddressType>();
|
||||||
this.address.add(t);
|
this.address.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -708,12 +708,12 @@ public class Person extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.)
|
* @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.)
|
||||||
*/
|
*/
|
||||||
public Attachment getPhoto() {
|
public AttachmentType getPhoto() {
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
if (Configuration.errorOnAutoCreate())
|
if (Configuration.errorOnAutoCreate())
|
||||||
throw new Error("Attempt to auto-create Person.photo");
|
throw new Error("Attempt to auto-create Person.photo");
|
||||||
else if (Configuration.doAutoCreate())
|
else if (Configuration.doAutoCreate())
|
||||||
this.photo = new Attachment(); // cc
|
this.photo = new AttachmentType(); // cc
|
||||||
return this.photo;
|
return this.photo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -724,7 +724,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.)
|
* @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(Attachment value) {
|
public Person setPhoto(AttachmentType value) {
|
||||||
this.photo = value;
|
this.photo = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -883,8 +883,8 @@ public class Person extends DomainResource {
|
|||||||
dst.gender = gender == null ? null : gender.copy();
|
dst.gender = gender == null ? null : gender.copy();
|
||||||
dst.birthDate = birthDate == null ? null : birthDate.copy();
|
dst.birthDate = birthDate == null ? null : birthDate.copy();
|
||||||
if (address != null) {
|
if (address != null) {
|
||||||
dst.address = new ArrayList<Address>();
|
dst.address = new ArrayList<AddressType>();
|
||||||
for (Address i : address)
|
for (AddressType i : address)
|
||||||
dst.address.add(i.copy());
|
dst.address.add(i.copy());
|
||||||
};
|
};
|
||||||
dst.photo = photo == null ? null : photo.copy();
|
dst.photo = photo == null ? null : photo.copy();
|
||||||
|
@ -745,9 +745,9 @@ public class Practitioner extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* The postal address where the practitioner can be found or visited or to which mail can be delivered.
|
* The postal address where the practitioner can be found or visited or to which mail can be delivered.
|
||||||
*/
|
*/
|
||||||
@Child(name = "address", type = {Address.class}, order = 3, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "address", type = {AddressType.class}, order = 3, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Where practitioner can be found/visited", formalDefinition="The postal address where the practitioner can be found or visited or to which mail can be delivered." )
|
@Description(shortDefinition="Where practitioner can be found/visited", formalDefinition="The postal address where the practitioner can be found or visited or to which mail can be delivered." )
|
||||||
protected List<Address> address;
|
protected List<AddressType> address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
|
* Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
|
||||||
@ -766,9 +766,9 @@ public class Practitioner extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Image of the person.
|
* Image of the person.
|
||||||
*/
|
*/
|
||||||
@Child(name = "photo", type = {Attachment.class}, order = 6, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "photo", type = {AttachmentType.class}, order = 6, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition = "Image of the person", formalDefinition = "Image of the person.")
|
@Description(shortDefinition = "Image of the person", formalDefinition = "Image of the person.")
|
||||||
protected List<Attachment> photo;
|
protected List<AttachmentType> photo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The list of Roles/Organizations that the Practitioner is associated with.
|
* The list of Roles/Organizations that the Practitioner is associated with.
|
||||||
@ -884,16 +884,16 @@ public class Practitioner extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.)
|
* @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.)
|
||||||
*/
|
*/
|
||||||
public List<Address> getAddress() {
|
public List<AddressType> getAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
this.address = new ArrayList<Address>();
|
this.address = new ArrayList<AddressType>();
|
||||||
return this.address;
|
return this.address;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAddress() {
|
public boolean hasAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
return false;
|
return false;
|
||||||
for (Address item : this.address)
|
for (AddressType item : this.address)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -903,10 +903,10 @@ public class Practitioner extends DomainResource {
|
|||||||
* @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.)
|
* @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Address addAddress() { //3
|
public AddressType addAddress() { //3
|
||||||
Address t = new Address();
|
AddressType t = new AddressType();
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
this.address = new ArrayList<Address>();
|
this.address = new ArrayList<AddressType>();
|
||||||
this.address.add(t);
|
this.address.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -1012,16 +1012,16 @@ public class Practitioner extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #photo} (Image of the person.)
|
* @return {@link #photo} (Image of the person.)
|
||||||
*/
|
*/
|
||||||
public List<Attachment> getPhoto() {
|
public List<AttachmentType> getPhoto() {
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
this.photo = new ArrayList<Attachment>();
|
this.photo = new ArrayList<AttachmentType>();
|
||||||
return this.photo;
|
return this.photo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasPhoto() {
|
public boolean hasPhoto() {
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
return false;
|
return false;
|
||||||
for (Attachment item : this.photo)
|
for (AttachmentType item : this.photo)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -1031,10 +1031,10 @@ public class Practitioner extends DomainResource {
|
|||||||
* @return {@link #photo} (Image of the person.)
|
* @return {@link #photo} (Image of the person.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Attachment addPhoto() { //3
|
public AttachmentType addPhoto() { //3
|
||||||
Attachment t = new Attachment();
|
AttachmentType t = new AttachmentType();
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
this.photo = new ArrayList<Attachment>();
|
this.photo = new ArrayList<AttachmentType>();
|
||||||
this.photo.add(t);
|
this.photo.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -1158,15 +1158,15 @@ public class Practitioner extends DomainResource {
|
|||||||
dst.telecom.add(i.copy());
|
dst.telecom.add(i.copy());
|
||||||
};
|
};
|
||||||
if (address != null) {
|
if (address != null) {
|
||||||
dst.address = new ArrayList<Address>();
|
dst.address = new ArrayList<AddressType>();
|
||||||
for (Address i : address)
|
for (AddressType i : address)
|
||||||
dst.address.add(i.copy());
|
dst.address.add(i.copy());
|
||||||
};
|
};
|
||||||
dst.gender = gender == null ? null : gender.copy();
|
dst.gender = gender == null ? null : gender.copy();
|
||||||
dst.birthDate = birthDate == null ? null : birthDate.copy();
|
dst.birthDate = birthDate == null ? null : birthDate.copy();
|
||||||
if (photo != null) {
|
if (photo != null) {
|
||||||
dst.photo = new ArrayList<Attachment>();
|
dst.photo = new ArrayList<AttachmentType>();
|
||||||
for (Attachment i : photo)
|
for (AttachmentType i : photo)
|
||||||
dst.photo.add(i.copy());
|
dst.photo.add(i.copy());
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
@ -746,7 +746,7 @@ public class QuestionnaireAnswers extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* The answer (or one of the answers) provided by the respondant to the question.
|
* The answer (or one of the answers) provided by the respondant to the question.
|
||||||
*/
|
*/
|
||||||
@Child(name = "value", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order = 1, min = 0, max = 1)
|
@Child(name = "value", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, AttachmentType.class, Coding.class, Quantity.class}, order = 1, min = 0, max = 1)
|
||||||
@Description(shortDefinition = "Single-valued answer to the question", formalDefinition = "The answer (or one of the answers) provided by the respondant to the question.")
|
@Description(shortDefinition = "Single-valued answer to the question", formalDefinition = "The answer (or one of the answers) provided by the respondant to the question.")
|
||||||
protected Type value;
|
protected Type value;
|
||||||
|
|
||||||
@ -847,10 +847,10 @@ public class QuestionnaireAnswers extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.)
|
* @return {@link #value} (The answer (or one of the answers) provided by the respondant to the question.)
|
||||||
*/
|
*/
|
||||||
public Attachment getValueAttachment() throws Exception {
|
public AttachmentType getValueAttachment() throws Exception {
|
||||||
if (!(this.value instanceof Attachment))
|
if (!(this.value instanceof AttachmentType))
|
||||||
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
|
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
|
||||||
return (Attachment) this.value;
|
return (AttachmentType) this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -195,16 +195,16 @@ public class RelatedPerson extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* Address where the related person can be contacted or visited.
|
* Address where the related person can be contacted or visited.
|
||||||
*/
|
*/
|
||||||
@Child(name = "address", type = {Address.class}, order = 6, min = 0, max = 1)
|
@Child(name = "address", type = {AddressType.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." )
|
@Description(shortDefinition="Address where the related person can be contacted or visited", formalDefinition="Address where the related person can be contacted or visited." )
|
||||||
protected Address address;
|
protected AddressType address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Image of the person.
|
* Image of the person.
|
||||||
*/
|
*/
|
||||||
@Child(name = "photo", type = {Attachment.class}, order = 7, min = 0, max = Child.MAX_UNLIMITED)
|
@Child(name = "photo", type = {AttachmentType.class}, order = 7, min = 0, max = Child.MAX_UNLIMITED)
|
||||||
@Description(shortDefinition="Image of the person", formalDefinition="Image of the person." )
|
@Description(shortDefinition="Image of the person", formalDefinition="Image of the person." )
|
||||||
protected List<Attachment> photo;
|
protected List<AttachmentType> photo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.
|
* The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.
|
||||||
@ -428,12 +428,12 @@ public class RelatedPerson extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #address} (Address where the related person can be contacted or visited.)
|
* @return {@link #address} (Address where the related person can be contacted or visited.)
|
||||||
*/
|
*/
|
||||||
public Address getAddress() {
|
public AddressType getAddress() {
|
||||||
if (this.address == null)
|
if (this.address == null)
|
||||||
if (Configuration.errorOnAutoCreate())
|
if (Configuration.errorOnAutoCreate())
|
||||||
throw new Error("Attempt to auto-create RelatedPerson.address");
|
throw new Error("Attempt to auto-create RelatedPerson.address");
|
||||||
else if (Configuration.doAutoCreate())
|
else if (Configuration.doAutoCreate())
|
||||||
this.address = new Address(); // cc
|
this.address = new AddressType(); // cc
|
||||||
return this.address;
|
return this.address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,7 +444,7 @@ public class RelatedPerson extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @param value {@link #address} (Address where the related person can be contacted or visited.)
|
* @param value {@link #address} (Address where the related person can be contacted or visited.)
|
||||||
*/
|
*/
|
||||||
public RelatedPerson setAddress(Address value) {
|
public RelatedPerson setAddress(AddressType value) {
|
||||||
this.address = value;
|
this.address = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -452,16 +452,16 @@ public class RelatedPerson extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #photo} (Image of the person.)
|
* @return {@link #photo} (Image of the person.)
|
||||||
*/
|
*/
|
||||||
public List<Attachment> getPhoto() {
|
public List<AttachmentType> getPhoto() {
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
this.photo = new ArrayList<Attachment>();
|
this.photo = new ArrayList<AttachmentType>();
|
||||||
return this.photo;
|
return this.photo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasPhoto() {
|
public boolean hasPhoto() {
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
return false;
|
return false;
|
||||||
for (Attachment item : this.photo)
|
for (AttachmentType item : this.photo)
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -471,10 +471,10 @@ public class RelatedPerson extends DomainResource {
|
|||||||
* @return {@link #photo} (Image of the person.)
|
* @return {@link #photo} (Image of the person.)
|
||||||
*/
|
*/
|
||||||
// syntactic sugar
|
// syntactic sugar
|
||||||
public Attachment addPhoto() { //3
|
public AttachmentType addPhoto() { //3
|
||||||
Attachment t = new Attachment();
|
AttachmentType t = new AttachmentType();
|
||||||
if (this.photo == null)
|
if (this.photo == null)
|
||||||
this.photo = new ArrayList<Attachment>();
|
this.photo = new ArrayList<AttachmentType>();
|
||||||
this.photo.add(t);
|
this.photo.add(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -535,8 +535,8 @@ public class RelatedPerson extends DomainResource {
|
|||||||
dst.gender = gender == null ? null : gender.copy();
|
dst.gender = gender == null ? null : gender.copy();
|
||||||
dst.address = address == null ? null : address.copy();
|
dst.address = address == null ? null : address.copy();
|
||||||
if (photo != null) {
|
if (photo != null) {
|
||||||
dst.photo = new ArrayList<Attachment>();
|
dst.photo = new ArrayList<AttachmentType>();
|
||||||
for (Attachment i : photo)
|
for (AttachmentType i : photo)
|
||||||
dst.photo.add(i.copy());
|
dst.photo.add(i.copy());
|
||||||
};
|
};
|
||||||
dst.period = period == null ? null : period.copy();
|
dst.period = period == null ? null : period.copy();
|
||||||
|
@ -246,7 +246,7 @@ public class ResourceFactory extends Factory {
|
|||||||
if ("Meta".equals(name))
|
if ("Meta".equals(name))
|
||||||
return new Meta();
|
return new Meta();
|
||||||
if ("Address".equals(name))
|
if ("Address".equals(name))
|
||||||
return new Address();
|
return new AddressType();
|
||||||
if ("Reference".equals(name))
|
if ("Reference".equals(name))
|
||||||
return new Reference();
|
return new Reference();
|
||||||
if ("Quantity".equals(name))
|
if ("Quantity".equals(name))
|
||||||
@ -254,7 +254,7 @@ public class ResourceFactory extends Factory {
|
|||||||
if ("Period".equals(name))
|
if ("Period".equals(name))
|
||||||
return new Period();
|
return new Period();
|
||||||
if ("Attachment".equals(name))
|
if ("Attachment".equals(name))
|
||||||
return new Attachment();
|
return new AttachmentType();
|
||||||
if ("Duration".equals(name))
|
if ("Duration".equals(name))
|
||||||
return new Duration();
|
return new Duration();
|
||||||
if ("Count".equals(name))
|
if ("Count".equals(name))
|
||||||
|
@ -56,7 +56,7 @@ public class SupportingDocumentation extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* The attached content.
|
* The attached content.
|
||||||
*/
|
*/
|
||||||
@Child(name="content", type={Attachment.class}, order=2, min=1, max=1)
|
@Child(name="content", type={AttachmentType.class}, order=2, min=1, max=1)
|
||||||
@Description(shortDefinition="Content", formalDefinition="The attached content." )
|
@Description(shortDefinition="Content", formalDefinition="The attached content." )
|
||||||
protected Type content;
|
protected Type content;
|
||||||
|
|
||||||
@ -143,10 +143,10 @@ public class SupportingDocumentation extends DomainResource {
|
|||||||
/**
|
/**
|
||||||
* @return {@link #content} (The attached content.)
|
* @return {@link #content} (The attached content.)
|
||||||
*/
|
*/
|
||||||
public Attachment getContentAttachment() throws Exception {
|
public AttachmentType getContentAttachment() throws Exception {
|
||||||
if (!(this.content instanceof Attachment))
|
if (!(this.content instanceof AttachmentType))
|
||||||
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
|
throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered");
|
||||||
return (Attachment) this.content;
|
return (AttachmentType) this.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasContent() {
|
public boolean hasContent() {
|
||||||
|
@ -125,3 +125,6 @@ datatype.time=org.hl7.fhir.instance.model.TimeType
|
|||||||
datatype.unsignedInt=org.hl7.fhir.instance.model.UnsignedIntType
|
datatype.unsignedInt=org.hl7.fhir.instance.model.UnsignedIntType
|
||||||
datatype.uri=org.hl7.fhir.instance.model.UriType
|
datatype.uri=org.hl7.fhir.instance.model.UriType
|
||||||
datatype.xhtml=org.hl7.fhir.instance.model.XhtmlType
|
datatype.xhtml=org.hl7.fhir.instance.model.XhtmlType
|
||||||
|
|
||||||
|
datatype.reference=org.hl7.fhir.instance.model.Reference
|
||||||
|
datatype.enumeration=org.hl7.fhir.instance.model.Enumeration
|
@ -1,8 +1,9 @@
|
|||||||
package ca.uhn.fhir.model;
|
package ca.uhn.fhir.model;
|
||||||
|
|
||||||
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import org.hl7.fhir.instance.model.Address;
|
import org.hl7.fhir.instance.model.AddressType;
|
||||||
import org.hl7.fhir.instance.model.BackboneElement;
|
import org.hl7.fhir.instance.model.BackboneElement;
|
||||||
import org.hl7.fhir.instance.model.Base;
|
import org.hl7.fhir.instance.model.Base;
|
||||||
import org.hl7.fhir.instance.model.Binary;
|
import org.hl7.fhir.instance.model.Binary;
|
||||||
@ -32,6 +33,7 @@ import org.hl7.fhir.instance.model.Timing;
|
|||||||
import org.hl7.fhir.instance.model.Type;
|
import org.hl7.fhir.instance.model.Type;
|
||||||
import org.hl7.fhir.instance.model.annotations.Block;
|
import org.hl7.fhir.instance.model.annotations.Block;
|
||||||
import org.hl7.fhir.instance.model.annotations.Child;
|
import org.hl7.fhir.instance.model.annotations.Child;
|
||||||
|
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||||
import org.hl7.fhir.instance.model.api.IBackboneElement;
|
import org.hl7.fhir.instance.model.api.IBackboneElement;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseBinary;
|
import org.hl7.fhir.instance.model.api.IBaseBinary;
|
||||||
@ -56,7 +58,10 @@ import org.hl7.fhir.instance.model.api.IReference;
|
|||||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import ca.uhn.fhir.context.BaseRuntimeElementCompositeDefinition;
|
||||||
|
import ca.uhn.fhir.context.BaseRuntimeElementDefinition;
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
|
import ca.uhn.fhir.context.RuntimePrimitiveDatatypeDefinition;
|
||||||
|
|
||||||
public class ModelInheritanceTest {
|
public class ModelInheritanceTest {
|
||||||
/*
|
/*
|
||||||
@ -82,6 +87,20 @@ public class ModelInheritanceTest {
|
|||||||
|
|
||||||
private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org();
|
private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org();
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDatatypeNames() {
|
||||||
|
for (BaseRuntimeElementDefinition<?> next : ourCtx.getElementDefinitions()) {
|
||||||
|
if (next instanceof BaseRuntimeElementCompositeDefinition || next instanceof RuntimePrimitiveDatatypeDefinition) {
|
||||||
|
String name = next.getImplementingClass().getName();
|
||||||
|
if (name.endsWith(".Enumeration")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
assertThat(name, endsWith("Type"));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testList() {
|
public void testList() {
|
||||||
assertEquals("List", ourCtx.getResourceDefinition(List_.class).getName());
|
assertEquals("List", ourCtx.getResourceDefinition(List_.class).getName());
|
||||||
@ -92,7 +111,7 @@ public class ModelInheritanceTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testAddress() {
|
public void testAddress() {
|
||||||
assertTrue(ICompositeType.class.isAssignableFrom(Address.class));
|
assertTrue(ICompositeType.class.isAssignableFrom(AddressType.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -155,6 +174,9 @@ public class ModelInheritanceTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testEnumeration() {
|
public void testEnumeration() {
|
||||||
assertTrue(IBaseEnumeration.class.isAssignableFrom(Enumeration.class));
|
assertTrue(IBaseEnumeration.class.isAssignableFrom(Enumeration.class));
|
||||||
|
|
||||||
|
DatatypeDef def = Enumeration.class.getAnnotation(DatatypeDef.class);
|
||||||
|
assertTrue(def.isSpecialization());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,16 +29,18 @@ import org.slf4j.LoggerFactory;
|
|||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.model.api.Bundle;
|
import ca.uhn.fhir.model.api.Bundle;
|
||||||
import ca.uhn.fhir.model.api.IResource;
|
import ca.uhn.fhir.model.api.IResource;
|
||||||
|
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
|
||||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||||
|
import ca.uhn.fhir.rest.server.provider.dstu2hl7org.Dstu2Hl7OrgBundleFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initially contributed by Alexander Kley for bug #29
|
* Initially contributed by Alexander Kley for bug #29
|
||||||
*/
|
*/
|
||||||
public class ContainedResourceEncodingTest {
|
public class ContainedResourceEncodingDstu2Hl7OrgTest {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(ContainedResourceEncodingTest.class);
|
private static Logger logger = LoggerFactory.getLogger(ContainedResourceEncodingDstu2Hl7OrgTest.class);
|
||||||
|
|
||||||
private FhirContext ctx;
|
private FhirContext ourCtx;
|
||||||
|
|
||||||
private Composition comp;
|
private Composition comp;
|
||||||
|
|
||||||
@ -57,7 +59,7 @@ public class ContainedResourceEncodingTest {
|
|||||||
initPatient();
|
initPatient();
|
||||||
initAuthor();
|
initAuthor();
|
||||||
initComposition();
|
initComposition();
|
||||||
this.ctx = new FhirContext();
|
this.ourCtx = new FhirContext();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,9 +117,9 @@ public class ContainedResourceEncodingTest {
|
|||||||
/**
|
/**
|
||||||
* This works fine, although patient instance is modifing from encoder
|
* This works fine, although patient instance is modifing from encoder
|
||||||
*/
|
*/
|
||||||
final String expectedPatientXml = this.ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(this.patient);
|
final String expectedPatientXml = this.ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(this.patient);
|
||||||
logger.debug("[xmlEncoding] first encoding: {}", expectedPatientXml);
|
logger.debug("[xmlEncoding] first encoding: {}", expectedPatientXml);
|
||||||
final String actualPatientXml = this.ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(this.patient);
|
final String actualPatientXml = this.ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(this.patient);
|
||||||
// second encoding - xml is corrupt - i.e.: patient content 4 times! should be the same as after first encoding!
|
// second encoding - xml is corrupt - i.e.: patient content 4 times! should be the same as after first encoding!
|
||||||
logger.debug("[xmlEncoding] second encoding: {}", actualPatientXml);
|
logger.debug("[xmlEncoding] second encoding: {}", actualPatientXml);
|
||||||
|
|
||||||
@ -129,7 +131,7 @@ public class ContainedResourceEncodingTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testComposition() {
|
public void testComposition() {
|
||||||
|
|
||||||
IParser parser = this.ctx.newXmlParser().setPrettyPrint(true);
|
IParser parser = this.ourCtx.newXmlParser().setPrettyPrint(true);
|
||||||
|
|
||||||
assertEquals(0, this.comp.getContained().size());
|
assertEquals(0, this.comp.getContained().size());
|
||||||
|
|
||||||
@ -194,10 +196,13 @@ public class ContainedResourceEncodingTest {
|
|||||||
|
|
||||||
List<IBaseResource> list = new ArrayList<IBaseResource>();
|
List<IBaseResource> list = new ArrayList<IBaseResource>();
|
||||||
list.add(dr);
|
list.add(dr);
|
||||||
Bundle bundle = null; // RestfulServer.createBundleFromResourceList(new FhirContext(), null, list, null, null, 0);
|
|
||||||
|
Dstu2Hl7OrgBundleFactory bf = new Dstu2Hl7OrgBundleFactory(ourCtx);
|
||||||
|
bf.initializeBundleFromResourceList("Author", list, "http://foo", "http://foo", 100, BundleTypeEnum.COLLECTION);
|
||||||
|
org.hl7.fhir.instance.model.Bundle bundle = (org.hl7.fhir.instance.model.Bundle) bf.getResourceBundle(); // RestfulServer.createBundleFromResourceList(new FhirContext(), null, list, null, null, 0);
|
||||||
|
|
||||||
IParser parser = this.ctx.newXmlParser().setPrettyPrint(true);
|
IParser parser = this.ourCtx.newXmlParser().setPrettyPrint(true);
|
||||||
String xml = parser.encodeBundleToString(bundle);
|
String xml = parser.encodeResourceToString(bundle);
|
||||||
Assert.assertTrue(xml.contains("Mueller"));
|
Assert.assertTrue(xml.contains("Mueller"));
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -231,12 +236,15 @@ public class ContainedResourceEncodingTest {
|
|||||||
observation.getPerformer().addAll(performers);
|
observation.getPerformer().addAll(performers);
|
||||||
|
|
||||||
|
|
||||||
List<IAnyResource> list = new ArrayList<IAnyResource>();
|
List<IBaseResource> list = new ArrayList<IBaseResource>();
|
||||||
list.add(dr);
|
list.add(dr);
|
||||||
Bundle bundle = null; // RestfulServer.createBundleFromResourceList(new FhirContext(), null, list, null, null, 0);
|
|
||||||
|
Dstu2Hl7OrgBundleFactory bf = new Dstu2Hl7OrgBundleFactory(ourCtx);
|
||||||
|
bf.initializeBundleFromResourceList("Author", list, "http://foo", "http://foo", 100, BundleTypeEnum.COLLECTION);
|
||||||
|
org.hl7.fhir.instance.model.Bundle bundle = (org.hl7.fhir.instance.model.Bundle) bf.getResourceBundle(); // RestfulServer.createBundleFromResourceList(new FhirContext(), null, list, null, null, 0);
|
||||||
|
|
||||||
IParser parser = this.ctx.newXmlParser().setPrettyPrint(true);
|
IParser parser = this.ourCtx.newXmlParser().setPrettyPrint(true);
|
||||||
String xml = parser.encodeBundleToString(bundle);
|
String xml = parser.encodeResourceToString(bundle);
|
||||||
Assert.assertTrue(xml.contains("Mueller"));
|
Assert.assertTrue(xml.contains("Mueller"));
|
||||||
|
|
||||||
}
|
}
|
@ -27,8 +27,8 @@ import org.custommonkey.xmlunit.Diff;
|
|||||||
import org.hamcrest.core.IsNot;
|
import org.hamcrest.core.IsNot;
|
||||||
import org.hamcrest.core.StringContains;
|
import org.hamcrest.core.StringContains;
|
||||||
import org.hamcrest.text.StringContainsInOrder;
|
import org.hamcrest.text.StringContainsInOrder;
|
||||||
import org.hl7.fhir.instance.model.Address;
|
import org.hl7.fhir.instance.model.AddressType;
|
||||||
import org.hl7.fhir.instance.model.Address.AddressUse;
|
import org.hl7.fhir.instance.model.AddressType.AddressUse;
|
||||||
import org.hl7.fhir.instance.model.Binary;
|
import org.hl7.fhir.instance.model.Binary;
|
||||||
import org.hl7.fhir.instance.model.Bundle;
|
import org.hl7.fhir.instance.model.Bundle;
|
||||||
import org.hl7.fhir.instance.model.Bundle.BundleEntryComponent;
|
import org.hl7.fhir.instance.model.Bundle.BundleEntryComponent;
|
||||||
@ -37,6 +37,7 @@ import org.hl7.fhir.instance.model.DateTimeType;
|
|||||||
import org.hl7.fhir.instance.model.DateType;
|
import org.hl7.fhir.instance.model.DateType;
|
||||||
import org.hl7.fhir.instance.model.DecimalType;
|
import org.hl7.fhir.instance.model.DecimalType;
|
||||||
import org.hl7.fhir.instance.model.DiagnosticReport;
|
import org.hl7.fhir.instance.model.DiagnosticReport;
|
||||||
|
import org.hl7.fhir.instance.model.Enumeration;
|
||||||
import org.hl7.fhir.instance.model.Extension;
|
import org.hl7.fhir.instance.model.Extension;
|
||||||
import org.hl7.fhir.instance.model.HumanName;
|
import org.hl7.fhir.instance.model.HumanName;
|
||||||
import org.hl7.fhir.instance.model.IBaseResource;
|
import org.hl7.fhir.instance.model.IBaseResource;
|
||||||
@ -456,7 +457,7 @@ public class JsonParserHl7OrgTest {
|
|||||||
|
|
||||||
MyPatientWithOneDeclaredAddressExtension patient = new MyPatientWithOneDeclaredAddressExtension();
|
MyPatientWithOneDeclaredAddressExtension patient = new MyPatientWithOneDeclaredAddressExtension();
|
||||||
patient.addAddress().setUse(AddressUse.HOME);
|
patient.addAddress().setUse(AddressUse.HOME);
|
||||||
patient.setFoo(new Address().addLine("line1"));
|
patient.setFoo(new AddressType().addLine("line1"));
|
||||||
|
|
||||||
String val = parser.encodeResourceToString(patient);
|
String val = parser.encodeResourceToString(patient);
|
||||||
ourLog.info(val);
|
ourLog.info(val);
|
||||||
@ -464,7 +465,7 @@ public class JsonParserHl7OrgTest {
|
|||||||
|
|
||||||
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
|
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
|
||||||
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
||||||
Address ref = actual.getFoo();
|
AddressType ref = actual.getFoo();
|
||||||
assertEquals("line1", ref.getLine().get(0).getValue());
|
assertEquals("line1", ref.getLine().get(0).getValue());
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -721,7 +722,7 @@ public class JsonParserHl7OrgTest {
|
|||||||
|
|
||||||
Patient patient = new Patient();
|
Patient patient = new Patient();
|
||||||
patient.addAddress().setUse(AddressUse.HOME);
|
patient.addAddress().setUse(AddressUse.HOME);
|
||||||
patient.addExtension().setUrl("urn:foo").setValue(new Address().addLine("line1"));
|
patient.addExtension().setUrl("urn:foo").setValue(new AddressType().addLine("line1"));
|
||||||
|
|
||||||
String val = parser.encodeResourceToString(patient);
|
String val = parser.encodeResourceToString(patient);
|
||||||
ourLog.info(val);
|
ourLog.info(val);
|
||||||
@ -729,7 +730,7 @@ public class JsonParserHl7OrgTest {
|
|||||||
|
|
||||||
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
|
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
|
||||||
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
||||||
Address ref = actual.getFoo();
|
AddressType ref = actual.getFoo();
|
||||||
assertEquals("line1", ref.getLine().get(0).getValue());
|
assertEquals("line1", ref.getLine().get(0).getValue());
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1245,13 +1246,32 @@ public class JsonParserHl7OrgTest {
|
|||||||
|
|
||||||
@Child(order = 0, name = "foo")
|
@Child(order = 0, name = "foo")
|
||||||
@org.hl7.fhir.instance.model.annotations.Extension(url = "urn:foo", definedLocally = true, isModifier = false)
|
@org.hl7.fhir.instance.model.annotations.Extension(url = "urn:foo", definedLocally = true, isModifier = false)
|
||||||
private Address myFoo;
|
private AddressType myFoo;
|
||||||
|
|
||||||
public Address getFoo() {
|
public AddressType getFoo() {
|
||||||
return myFoo;
|
return myFoo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFoo(Address theFoo) {
|
public void setFoo(AddressType theFoo) {
|
||||||
|
myFoo = theFoo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResourceDef(name = "Patient")
|
||||||
|
public static class MyPatientWithOneDeclaredEnumerationExtension extends Patient {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Child(order = 0, name = "foo")
|
||||||
|
@org.hl7.fhir.instance.model.annotations.Extension(url = "urn:foo", definedLocally = true, isModifier = false)
|
||||||
|
private Enumeration<AddressUse> myFoo;
|
||||||
|
|
||||||
|
public Enumeration<AddressUse> getFoo() {
|
||||||
|
return myFoo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFoo(Enumeration<AddressUse> theFoo) {
|
||||||
myFoo = theFoo;
|
myFoo = theFoo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package ca.uhn.fhir.parser;
|
package ca.uhn.fhir.parser;
|
||||||
|
|
||||||
import org.hl7.fhir.instance.model.Attachment;
|
import org.hl7.fhir.instance.model.AttachmentType;
|
||||||
import org.hl7.fhir.instance.model.BackboneElement;
|
import org.hl7.fhir.instance.model.BackboneElement;
|
||||||
import org.hl7.fhir.instance.model.DateType;
|
import org.hl7.fhir.instance.model.DateType;
|
||||||
import org.hl7.fhir.instance.model.Patient;
|
import org.hl7.fhir.instance.model.Patient;
|
||||||
@ -19,7 +19,7 @@ public class MyObservationWithExtensions extends Patient {
|
|||||||
|
|
||||||
@Extension(url = "urn:patientext:att", definedLocally = false, isModifier = false)
|
@Extension(url = "urn:patientext:att", definedLocally = false, isModifier = false)
|
||||||
@Child(name = "extAtt", order = 0)
|
@Child(name = "extAtt", order = 0)
|
||||||
private Attachment myExtAtt;
|
private AttachmentType myExtAtt;
|
||||||
|
|
||||||
@Extension(url = "urn:patientext:moreext", definedLocally = false, isModifier = false)
|
@Extension(url = "urn:patientext:moreext", definedLocally = false, isModifier = false)
|
||||||
@Child(name = "moreExt", order = 1)
|
@Child(name = "moreExt", order = 1)
|
||||||
@ -29,7 +29,7 @@ public class MyObservationWithExtensions extends Patient {
|
|||||||
@Child(name = "modExt", order = 2)
|
@Child(name = "modExt", order = 2)
|
||||||
private DateType myModExt;
|
private DateType myModExt;
|
||||||
|
|
||||||
public Attachment getExtAtt() {
|
public AttachmentType getExtAtt() {
|
||||||
return myExtAtt;
|
return myExtAtt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ public class MyObservationWithExtensions extends Patient {
|
|||||||
myModExt = theModExt;
|
myModExt = theModExt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExtAtt(Attachment theExtAtt) {
|
public void setExtAtt(AttachmentType theExtAtt) {
|
||||||
myExtAtt = theExtAtt;
|
myExtAtt = theExtAtt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,8 +28,9 @@ import org.custommonkey.xmlunit.XMLUnit;
|
|||||||
import org.hamcrest.core.IsNot;
|
import org.hamcrest.core.IsNot;
|
||||||
import org.hamcrest.core.StringContains;
|
import org.hamcrest.core.StringContains;
|
||||||
import org.hamcrest.text.StringContainsInOrder;
|
import org.hamcrest.text.StringContainsInOrder;
|
||||||
import org.hl7.fhir.instance.model.Address;
|
import org.hl7.fhir.instance.model.AddressType;
|
||||||
import org.hl7.fhir.instance.model.Address.AddressUse;
|
import org.hl7.fhir.instance.model.AddressType.AddressUse;
|
||||||
|
import org.hl7.fhir.instance.model.AddressType.AddressUseEnumFactory;
|
||||||
import org.hl7.fhir.instance.model.Binary;
|
import org.hl7.fhir.instance.model.Binary;
|
||||||
import org.hl7.fhir.instance.model.Bundle;
|
import org.hl7.fhir.instance.model.Bundle;
|
||||||
import org.hl7.fhir.instance.model.Bundle.BundleEntryComponent;
|
import org.hl7.fhir.instance.model.Bundle.BundleEntryComponent;
|
||||||
@ -41,6 +42,8 @@ import org.hl7.fhir.instance.model.DecimalType;
|
|||||||
import org.hl7.fhir.instance.model.DiagnosticReport;
|
import org.hl7.fhir.instance.model.DiagnosticReport;
|
||||||
import org.hl7.fhir.instance.model.DocumentManifest;
|
import org.hl7.fhir.instance.model.DocumentManifest;
|
||||||
import org.hl7.fhir.instance.model.DocumentManifest.DocumentReferenceStatus;
|
import org.hl7.fhir.instance.model.DocumentManifest.DocumentReferenceStatus;
|
||||||
|
import org.hl7.fhir.instance.model.EnumFactory;
|
||||||
|
import org.hl7.fhir.instance.model.Enumeration;
|
||||||
import org.hl7.fhir.instance.model.Extension;
|
import org.hl7.fhir.instance.model.Extension;
|
||||||
import org.hl7.fhir.instance.model.HumanName;
|
import org.hl7.fhir.instance.model.HumanName;
|
||||||
import org.hl7.fhir.instance.model.IBaseResource;
|
import org.hl7.fhir.instance.model.IBaseResource;
|
||||||
@ -52,6 +55,7 @@ import org.hl7.fhir.instance.model.Narrative.NarrativeStatus;
|
|||||||
import org.hl7.fhir.instance.model.Observation;
|
import org.hl7.fhir.instance.model.Observation;
|
||||||
import org.hl7.fhir.instance.model.Organization;
|
import org.hl7.fhir.instance.model.Organization;
|
||||||
import org.hl7.fhir.instance.model.Patient;
|
import org.hl7.fhir.instance.model.Patient;
|
||||||
|
import org.hl7.fhir.instance.model.PrimitiveType;
|
||||||
import org.hl7.fhir.instance.model.Reference;
|
import org.hl7.fhir.instance.model.Reference;
|
||||||
import org.hl7.fhir.instance.model.Resource;
|
import org.hl7.fhir.instance.model.Resource;
|
||||||
import org.hl7.fhir.instance.model.Specimen;
|
import org.hl7.fhir.instance.model.Specimen;
|
||||||
@ -65,6 +69,7 @@ import ca.uhn.fhir.context.FhirContext;
|
|||||||
import ca.uhn.fhir.model.base.composite.BaseNarrativeDt;
|
import ca.uhn.fhir.model.base.composite.BaseNarrativeDt;
|
||||||
import ca.uhn.fhir.narrative.INarrativeGenerator;
|
import ca.uhn.fhir.narrative.INarrativeGenerator;
|
||||||
import ca.uhn.fhir.parser.JsonParserHl7OrgTest.MyPatientWithOneDeclaredAddressExtension;
|
import ca.uhn.fhir.parser.JsonParserHl7OrgTest.MyPatientWithOneDeclaredAddressExtension;
|
||||||
|
import ca.uhn.fhir.parser.JsonParserHl7OrgTest.MyPatientWithOneDeclaredEnumerationExtension;
|
||||||
import ca.uhn.fhir.parser.JsonParserHl7OrgTest.MyPatientWithOneDeclaredExtension;
|
import ca.uhn.fhir.parser.JsonParserHl7OrgTest.MyPatientWithOneDeclaredExtension;
|
||||||
|
|
||||||
public class XmlParserHl7OrgDstu2Test {
|
public class XmlParserHl7OrgDstu2Test {
|
||||||
@ -494,7 +499,7 @@ public class XmlParserHl7OrgDstu2Test {
|
|||||||
//@formatter:on
|
//@formatter:on
|
||||||
|
|
||||||
Patient p = ourCtx.newXmlParser().parseResource(Patient.class, res);
|
Patient p = ourCtx.newXmlParser().parseResource(Patient.class, res);
|
||||||
assertEquals(htmlNoNs, p.getText().getDivAsString());
|
assertEquals(htmlNs, p.getText().getDivAsString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -799,7 +804,7 @@ public class XmlParserHl7OrgDstu2Test {
|
|||||||
|
|
||||||
MyPatientWithOneDeclaredAddressExtension patient = new MyPatientWithOneDeclaredAddressExtension();
|
MyPatientWithOneDeclaredAddressExtension patient = new MyPatientWithOneDeclaredAddressExtension();
|
||||||
patient.addAddress().setUse(AddressUse.HOME);
|
patient.addAddress().setUse(AddressUse.HOME);
|
||||||
patient.setFoo(new Address().addLine("line1"));
|
patient.setFoo(new AddressType().addLine("line1"));
|
||||||
|
|
||||||
String val = parser.encodeResourceToString(patient);
|
String val = parser.encodeResourceToString(patient);
|
||||||
ourLog.info(val);
|
ourLog.info(val);
|
||||||
@ -807,7 +812,7 @@ public class XmlParserHl7OrgDstu2Test {
|
|||||||
|
|
||||||
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
|
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
|
||||||
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
||||||
Address ref = actual.getFoo();
|
AddressType ref = actual.getFoo();
|
||||||
assertEquals("line1", ref.getLine().get(0).getValue());
|
assertEquals("line1", ref.getLine().get(0).getValue());
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -841,7 +846,7 @@ public class XmlParserHl7OrgDstu2Test {
|
|||||||
|
|
||||||
String val = parser.encodeResourceToString(patient);
|
String val = parser.encodeResourceToString(patient);
|
||||||
ourLog.info(val);
|
ourLog.info(val);
|
||||||
assertThat(val, StringContains.containsString("<extension url=\"urn:foo\"><valueResource><reference value=\"Organization/123\"/></valueResource></extension>"));
|
assertThat(val, StringContains.containsString("<extension url=\"urn:foo\"><valueReference><reference value=\"Organization/123\"/></valueReference></extension>"));
|
||||||
|
|
||||||
Patient actual = parser.parseResource(Patient.class, val);
|
Patient actual = parser.parseResource(Patient.class, val);
|
||||||
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
||||||
@ -955,13 +960,35 @@ public class XmlParserHl7OrgDstu2Test {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testEncodeUndeclaredExtensionWithEnumerationContent() {
|
||||||
|
IParser parser = ourCtx.newXmlParser();
|
||||||
|
|
||||||
|
Patient patient = new Patient();
|
||||||
|
patient.addAddress().setUse(AddressUse.HOME);
|
||||||
|
EnumFactory<AddressUse> fact = new AddressUseEnumFactory();
|
||||||
|
PrimitiveType<AddressUse> enumeration = new Enumeration<AddressUse>(fact).setValue(AddressUse.HOME);
|
||||||
|
patient.addExtension().setUrl("urn:foo").setValue(enumeration);
|
||||||
|
|
||||||
|
String val = parser.encodeResourceToString(patient);
|
||||||
|
ourLog.info(val);
|
||||||
|
assertThat(val, StringContains.containsString("<extension url=\"urn:foo\"><valueCode value=\"home\"/></extension>"));
|
||||||
|
|
||||||
|
MyPatientWithOneDeclaredEnumerationExtension actual = parser.parseResource(MyPatientWithOneDeclaredEnumerationExtension.class, val);
|
||||||
|
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
||||||
|
Enumeration<AddressUse> ref = actual.getFoo();
|
||||||
|
assertEquals("home", ref.getValue().toCode());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEncodeUndeclaredExtensionWithAddressContent() {
|
public void testEncodeUndeclaredExtensionWithAddressContent() {
|
||||||
IParser parser = ourCtx.newXmlParser();
|
IParser parser = ourCtx.newXmlParser();
|
||||||
|
|
||||||
Patient patient = new Patient();
|
Patient patient = new Patient();
|
||||||
patient.addAddress().setUse(AddressUse.HOME);
|
patient.addAddress().setUse(AddressUse.HOME);
|
||||||
patient.addExtension().setUrl("urn:foo").setValue(new Address().addLine("line1"));
|
patient.addExtension().setUrl("urn:foo").setValue(new AddressType().addLine("line1"));
|
||||||
|
|
||||||
String val = parser.encodeResourceToString(patient);
|
String val = parser.encodeResourceToString(patient);
|
||||||
ourLog.info(val);
|
ourLog.info(val);
|
||||||
@ -969,7 +996,7 @@ public class XmlParserHl7OrgDstu2Test {
|
|||||||
|
|
||||||
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
|
MyPatientWithOneDeclaredAddressExtension actual = parser.parseResource(MyPatientWithOneDeclaredAddressExtension.class, val);
|
||||||
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
assertEquals(AddressUse.HOME, patient.getAddress().get(0).getUse());
|
||||||
Address ref = actual.getFoo();
|
AddressType ref = actual.getFoo();
|
||||||
assertEquals("line1", ref.getLine().get(0).getValue());
|
assertEquals("line1", ref.getLine().get(0).getValue());
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1070,6 +1097,10 @@ public class XmlParserHl7OrgDstu2Test {
|
|||||||
ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient));
|
ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient));
|
||||||
|
|
||||||
Diff d = new Diff(new StringReader(msg), new StringReader(encoded));
|
Diff d = new Diff(new StringReader(msg), new StringReader(encoded));
|
||||||
|
|
||||||
|
ourLog.info("Expected: {}", msg);
|
||||||
|
ourLog.info("Actual: {}", encoded);
|
||||||
|
|
||||||
assertTrue(d.toString(), d.identical());
|
assertTrue(d.toString(), d.identical());
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1494,9 +1525,8 @@ public class XmlParserHl7OrgDstu2Test {
|
|||||||
JSON actual = JSONSerializer.toJSON(encoded.trim());
|
JSON actual = JSONSerializer.toJSON(encoded.trim());
|
||||||
|
|
||||||
// The encoded escapes quote marks using XML escaping instead of JSON escaping, which is probably nicer anyhow...
|
// The encoded escapes quote marks using XML escaping instead of JSON escaping, which is probably nicer anyhow...
|
||||||
String exp = expected.toString().replace("\\\"Jim\\\"", ""Jim"");
|
String exp = expected.toString().replace("\\\"Jim\\\"", ""Jim"").replace(" xmlns=\\\"http://www.w3.org/1999/xhtml\\\"", "");
|
||||||
String act = actual.toString();
|
String act = actual.toString().replace(" xmlns=\\\"http://www.w3.org/1999/xhtml\\\"", "");
|
||||||
|
|
||||||
ourLog.info("Expected: {}", exp);
|
ourLog.info("Expected: {}", exp);
|
||||||
ourLog.info("Actual : {}", act);
|
ourLog.info("Actual : {}", act);
|
||||||
assertEquals(exp, act);
|
assertEquals(exp, act);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package ca.uhn.fhir.jpa.test;
|
package ca.uhn.fhir.jpa.test;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user