diff --git a/examples/src/main/java/example/CustomObservation.java b/examples/src/main/java/example/CustomObservation.java
new file mode 100644
index 00000000000..54269735c0e
--- /dev/null
+++ b/examples/src/main/java/example/CustomObservation.java
@@ -0,0 +1,7 @@
+package example;
+
+import org.hl7.fhir.dstu3.model.Observation;
+
+public class CustomObservation extends Observation {
+
+}
diff --git a/examples/src/main/java/example/Extensions.java b/examples/src/main/java/example/ExtensionsDstu2.java
similarity index 98%
rename from examples/src/main/java/example/Extensions.java
rename to examples/src/main/java/example/ExtensionsDstu2.java
index 3506f2af5a5..2cb26bcfbd8 100644
--- a/examples/src/main/java/example/Extensions.java
+++ b/examples/src/main/java/example/ExtensionsDstu2.java
@@ -12,7 +12,7 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.parser.DataFormatException;
-public class Extensions {
+public class ExtensionsDstu2 {
@SuppressWarnings("unused")
public static void main(String[] args) throws DataFormatException, IOException {
diff --git a/examples/src/main/java/example/ExtensionsDstu3.java b/examples/src/main/java/example/ExtensionsDstu3.java
new file mode 100644
index 00000000000..01df6c3fd56
--- /dev/null
+++ b/examples/src/main/java/example/ExtensionsDstu3.java
@@ -0,0 +1,140 @@
+package example;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.hl7.fhir.dstu3.model.DateTimeType;
+import org.hl7.fhir.dstu3.model.Extension;
+import org.hl7.fhir.dstu3.model.HumanName;
+import org.hl7.fhir.dstu3.model.Identifier.IdentifierUse;
+import org.hl7.fhir.dstu3.model.Patient;
+import org.hl7.fhir.dstu3.model.StringType;
+
+import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.parser.DataFormatException;
+import ca.uhn.fhir.rest.client.IGenericClient;
+
+public class ExtensionsDstu3 {
+
+ public void customType() {
+
+IGenericClient client = FhirContext.forDstu3().newRestfulGenericClient("http://foo");
+
+//START SNIPPET: customTypeClientSimple
+// Create an example patient
+MyPatient custPatient = new MyPatient();
+custPatient.addName().addFamily("Smith").addGiven("John");
+custPatient.setPetName(new StringType("Rover")); // populate the extension
+
+// Create the resource like normal
+client.create().resource(custPatient).execute();
+
+// You can also read the resource back like normal
+custPatient = client.read().resource(MyPatient.class).withId("123").execute();
+//END SNIPPET: customTypeClientSimple
+
+
+ }
+
+ public void customTypeDeclared() {
+
+
+//START SNIPPET: customTypeClientDeclared
+FhirContext ctx = FhirContext.forDstu3();
+
+// Instruct the context that if it receives a resource which
+// claims to conform to the given profile (by URL), it should
+// use the MyPatient type to parse this resource
+ctx.setDefaultTypeForProfile("http://example.com/StructureDefinition/mypatient", MyPatient.class);
+
+// You can declare as many default types as you like
+ctx.setDefaultTypeForProfile("http://foo.com/anotherProfile", CustomObservation.class);
+
+// Create a client
+IGenericClient client = ctx.newRestfulGenericClient("http://fhirtest.uhn.ca/baseDstu3");
+
+// You can also read the resource back like normal
+Patient patient = client.read().resource(Patient.class).withId("123").execute();
+if (patient instanceof MyPatient) {
+ // If the server supplied a resource which declared to conform
+ // to the given profile, MyPatient will have been returned so
+ // process it differently..
+}
+
+//END SNIPPET: customTypeClientDeclared
+
+
+ }
+
+@SuppressWarnings("unused")
+public static void main(String[] args) throws DataFormatException, IOException {
+
+
+// START SNIPPET: resourceExtension
+// Create an example patient
+Patient patient = new Patient();
+patient.addIdentifier().setUse(IdentifierUse.OFFICIAL).setSystem("urn:example").setValue("7000135");
+
+// Create an extension
+Extension ext = new Extension();
+ext.setUrl("http://example.com/extensions#someext");
+ext.setValue(new DateTimeType("2011-01-02T11:13:15"));
+
+// Add the extension to the resource
+patient.addExtension(ext);
+//END SNIPPET: resourceExtension
+
+
+//START SNIPPET: resourceStringExtension
+// Continuing the example from above, we will add a name to the patient, and then
+// add an extension to part of that name
+HumanName name = patient.addName();
+name.addFamily("Shmoe");
+
+// Add a new "given name", which is of type String
+StringType given = name.addGivenElement();
+given.setValue("Joe");
+
+// Create an extension and add it to the String
+Extension givenExt = new Extension("http://examples.com#moreext", new StringType("Hello"));
+given.addExtension(givenExt);
+//END SNIPPET: resourceStringExtension
+
+FhirContext ctx = FhirContext.forDstu3();
+String output = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient);
+System.out.println(output);
+
+
+//START SNIPPET: parseExtension
+// Get all extensions (modifier or not) for a given URL
+List resourceExts = patient.getExtensionsByUrl("http://fooextensions.com#exts");
+
+// Get all non-modifier extensions regardless of URL
+List nonModExts = patient.getExtension();
+
+//Get all non-modifier extensions regardless of URL
+List modExts = patient.getModifierExtension();
+//END SNIPPET: parseExtension
+
+}
+
+
+public void foo() {
+//START SNIPPET: subExtension
+Patient patient = new Patient();
+
+// Add an extension (initially with no contents) to the resource
+Extension parent = new Extension("http://example.com#parent");
+patient.addExtension(parent);
+
+// Add two extensions as children to the parent extension
+Extension child1 = new Extension("http://example.com#childOne", new StringType("value1"));
+parent.addExtension(child1);
+
+Extension child2 = new Extension("http://example.com#chilwo", new StringType("value1"));
+parent.addExtension(child2);
+//END SNIPPET: subExtension
+
+}
+
+}
diff --git a/examples/src/main/java/example/MyPatient.java b/examples/src/main/java/example/MyPatient.java
index 6ff45280e33..02248f0a81d 100644
--- a/examples/src/main/java/example/MyPatient.java
+++ b/examples/src/main/java/example/MyPatient.java
@@ -4,13 +4,14 @@ package example;
import java.util.ArrayList;
import java.util.List;
+import org.hl7.fhir.dstu3.model.DateTimeType;
+import org.hl7.fhir.dstu3.model.Patient;
+import org.hl7.fhir.dstu3.model.StringType;
+
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.api.annotation.Extension;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
-import ca.uhn.fhir.model.dstu2.resource.Patient;
-import ca.uhn.fhir.model.primitive.DateTimeDt;
-import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.util.ElementUtil;
/**
@@ -25,7 +26,9 @@ import ca.uhn.fhir.util.ElementUtil;
@ResourceDef(name="Patient", profile="http://example.com/StructureDefinition/mypatient")
public class MyPatient extends Patient {
- /**
+ private static final long serialVersionUID = 1L;
+
+ /**
* Each extension is defined in a field. Any valid HAPI Data Type
* can be used for the field type. Note that the [name=""] attribute
* in the @Child annotation needs to match the name for the bean accessor
@@ -34,7 +37,7 @@ public class MyPatient extends Patient {
@Child(name="petName")
@Extension(url="http://example.com/dontuse#petname", definedLocally=false, isModifier=false)
@Description(shortDefinition="The name of the patient's favourite pet")
- private StringDt myPetName;
+ private StringType myPetName;
/**
* The second example extension uses a List type to provide
@@ -46,7 +49,7 @@ public class MyPatient extends Patient {
@Child(name="importantDates", max=Child.MAX_UNLIMITED)
@Extension(url="http://example.com/dontuse#importantDates", definedLocally=false, isModifier=true)
@Description(shortDefinition="Some dates of note for this patient")
- private List myImportantDates;
+ private List myImportantDates;
/**
* It is important to override the isEmpty() method, adding a check for any
@@ -67,28 +70,28 @@ public class MyPatient extends Patient {
********/
/** Getter for important dates */
- public List getImportantDates() {
+ public List getImportantDates() {
if (myImportantDates==null) {
- myImportantDates = new ArrayList();
+ myImportantDates = new ArrayList();
}
return myImportantDates;
}
/** Getter for pet name */
- public StringDt getPetName() {
+ public StringType getPetName() {
if (myPetName == null) {
- myPetName = new StringDt();
+ myPetName = new StringType();
}
return myPetName;
}
/** Setter for important dates */
- public void setImportantDates(List theImportantDates) {
+ public void setImportantDates(List theImportantDates) {
myImportantDates = theImportantDates;
}
/** Setter for pet name */
- public void setPetName(StringDt thePetName) {
+ public void setPetName(StringType thePetName) {
myPetName = thePetName;
}
diff --git a/examples/src/main/java/example/MyPatientUse.java b/examples/src/main/java/example/MyPatientUse.java
index 548555eb4f5..d4068a86c7e 100644
--- a/examples/src/main/java/example/MyPatientUse.java
+++ b/examples/src/main/java/example/MyPatientUse.java
@@ -18,7 +18,7 @@ import ca.uhn.fhir.parser.IParser;
public class MyPatientUse {
- @ResourceDef
+ @ResourceDef()
public static class MyPatient extends Patient {
@Child(name="petName")
diff --git a/hapi-fhir-base-test-mindeps-server/.classpath b/hapi-fhir-base-test-mindeps-server/.classpath
index 75e8fd8df27..f8457d21055 100644
--- a/hapi-fhir-base-test-mindeps-server/.classpath
+++ b/hapi-fhir-base-test-mindeps-server/.classpath
@@ -6,22 +6,16 @@
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/hapi-fhir-base-test-mindeps-server/.project b/hapi-fhir-base-test-mindeps-server/.project
index eabe6c28a36..96459364cdd 100644
--- a/hapi-fhir-base-test-mindeps-server/.project
+++ b/hapi-fhir-base-test-mindeps-server/.project
@@ -5,6 +5,16 @@
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.wst.common.project.facet.core.builder
+
+
+ org.eclipse.m2e.core.maven2Builder
@@ -13,5 +23,7 @@
org.eclipse.m2e.core.maven2Nature
+ org.eclipse.wst.common.project.facet.core.nature
+ org.eclipse.jdt.core.javanature
diff --git a/hapi-fhir-base-test-mindeps-server/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-base-test-mindeps-server/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..f42de363afa
--- /dev/null
+++ b/hapi-fhir-base-test-mindeps-server/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/hapi-fhir-base-test-mindeps-server/.settings/org.eclipse.wst.common.project.facet.core.xml b/hapi-fhir-base-test-mindeps-server/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 00000000000..bc0009a4558
--- /dev/null
+++ b/hapi-fhir-base-test-mindeps-server/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/hapi-fhir-base-test-mindeps-server/src/test/java/ca/uhn/fhir/parser/MultiVersionJsonParserTest.java b/hapi-fhir-base-test-mindeps-server/src/test/java/ca/uhn/fhir/parser/MultiVersionJsonParserTest.java
index f11e483cad1..80c9309a928 100644
--- a/hapi-fhir-base-test-mindeps-server/src/test/java/ca/uhn/fhir/parser/MultiVersionJsonParserTest.java
+++ b/hapi-fhir-base-test-mindeps-server/src/test/java/ca/uhn/fhir/parser/MultiVersionJsonParserTest.java
@@ -1,5 +1,6 @@
package ca.uhn.fhir.parser;
+import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.Assert.assertThat;
import org.hamcrest.core.StringContains;
@@ -22,7 +23,10 @@ public class MultiVersionJsonParserTest {
String str = FhirContext.forDstu2().newJsonParser().encodeResourceToString(p);
ourLog.info(str);
- assertThat(str, StringContains.containsString("{\"resourceType\":\"Patient\",\"extension\":[{\"url\":\"http://foo#ext\",\"valueQuantity\":{\"value\":2.2}}],\"identifier\":[{\"system\":\"urn:sys\",\"value\":\"001\"}]}"));
+ assertThat(str, stringContainsInOrder(
+ "{\"resourceType\":\"Patient\"",
+ "\"extension\":[{\"url\":\"http://foo#ext\",\"valueQuantity\":{\"value\":2.2}}]",
+ "\"identifier\":[{\"system\":\"urn:sys\",\"value\":\"001\"}]"));
}
}
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java
index ec3aa00dcbc..f74fa42a7cd 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java
@@ -50,6 +50,7 @@ import ca.uhn.fhir.rest.client.IRestfulClientFactory;
import ca.uhn.fhir.rest.client.apache.ApacheRestfulClientFactory;
import ca.uhn.fhir.rest.client.api.IBasicClient;
import ca.uhn.fhir.rest.client.api.IRestfulClient;
+import ca.uhn.fhir.rest.server.AddProfileTagEnum;
import ca.uhn.fhir.rest.server.IVersionSpecificBundleFactory;
import ca.uhn.fhir.util.FhirTerser;
import ca.uhn.fhir.util.VersionUtil;
@@ -77,7 +78,9 @@ public class FhirContext {
private static final List> EMPTY_LIST = Collections.emptyList();
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirContext.class);
+ private AddProfileTagEnum myAddProfileTagWhenEncoding = AddProfileTagEnum.ONLY_FOR_CUSTOM;
private volatile Map, BaseRuntimeElementDefinition>> myClassToElementDefinition = Collections.emptyMap();
+ private Map> myDefaultTypeForProfile = new HashMap>();
private volatile Map myIdToResourceDefinition = Collections.emptyMap();
private HapiLocalizer myLocalizer = new HapiLocalizer();
private volatile Map> myNameToElementDefinition = Collections.emptyMap();
@@ -89,7 +92,7 @@ public class FhirContext {
private volatile RuntimeChildUndeclaredExtensionDefinition myRuntimeChildUndeclaredExtensionDefinition;
private final IFhirVersion myVersion;
private Map>> myVersionToNameToResourceType = Collections.emptyMap();
-
+
/**
* Default constructor. In most cases this is the right constructor to use.
*/
@@ -144,6 +147,26 @@ public class FhirContext {
return getLocalizer().getMessage(FhirContext.class, "unknownResourceName", theResourceName, theVersion);
}
+ /**
+ * When encoding resources, this setting configures the parser to include
+ * an entry in the resource's metadata section which indicates which profile(s) the
+ * resource claims to conform to. The default is {@link AddProfileTagEnum#ONLY_FOR_CUSTOM}.
+ *
+ * @see #setAddProfileTagWhenEncoding(AddProfileTagEnum) for more information
+ */
+ public AddProfileTagEnum getAddProfileTagWhenEncoding() {
+ return myAddProfileTagWhenEncoding;
+ }
+
+ /**
+ * Returns the default resource type for the given profile
+ *
+ * @see #setDefaultTypeForProfile(String, Class)
+ */
+ public Class extends IBaseResource> getDefaultTypeForProfile(String theProfile) {
+ return myDefaultTypeForProfile.get(theProfile);
+ }
+
/**
* Returns the scanned runtime model for the given type. This is an advanced feature which is generally only needed
* for extending the core library.
@@ -298,14 +321,6 @@ public class FhirContext {
return myIdToResourceDefinition.values();
}
- /**
- * Set the restful client factory
- * @param theRestfulClientFactory
- */
- public void setRestfulClientFactory(IRestfulClientFactory theRestfulClientFactory) {
- this.myRestfulClientFactory = theRestfulClientFactory;
- }
-
/**
* Get the restful client factory. If no factory has been set, this will be initialized with
* a new ApacheRestfulClientFactory.
@@ -326,6 +341,17 @@ public class FhirContext {
return myVersion;
}
+ /**
+ * Returns true if any default types for specific profiles have been defined
+ * within this context.
+ *
+ * @see #setDefaultTypeForProfile(String, Class)
+ * @see #getDefaultTypeForProfile(String)
+ */
+ public boolean hasDefaultTypeForProfile() {
+ return !myDefaultTypeForProfile.isEmpty();
+ }
+
/**
* This method should be considered experimental and will likely change in future releases
* of HAPI. Use with caution!
@@ -472,6 +498,50 @@ public class FhirContext {
return classToElementDefinition;
}
+
+ /**
+ * When encoding resources, this setting configures the parser to include
+ * an entry in the resource's metadata section which indicates which profile(s) the
+ * resource claims to conform to. The default is {@link AddProfileTagEnum#ONLY_FOR_CUSTOM}.
+ *
+ * This feature is intended for situations where custom resource types are being used,
+ * avoiding the need to manually add profile declarations for these custom types.
+ *
+ * Note that this feature automatically adds the profile, but leaves any profile tags
+ * which have been manually added in place as well.
+ *
+ *
+ * @param theAddProfileTagWhenEncoding
+ * The add profile mode (must not be null)
+ */
+ public void setAddProfileTagWhenEncoding(AddProfileTagEnum theAddProfileTagWhenEncoding) {
+ Validate.notNull(theAddProfileTagWhenEncoding, "theAddProfileTagWhenEncoding must not be null");
+ myAddProfileTagWhenEncoding = theAddProfileTagWhenEncoding;
+ }
+
+ /**
+ * Sets the default type which will be used when parsing a resource that is found to be
+ * of the given profile.
+ *
+ * For example, this method is invoked with the profile string of
+ * "http://example.com/some_patient_profile" and the type of MyPatient.class,
+ * if the parser is parsing a resource and finds that it declares that it conforms to that profile,
+ * the MyPatient type will be used unless otherwise specified.
+ *
+ *
+ * @param theProfile The profile string, e.g. "http://example.com/some_patient_profile". Must not be null or empty.
+ * @param theClass The resource type. Must not be null or empty.
+ */
+ public void setDefaultTypeForProfile(String theProfile, Class extends IBaseResource> theClass) {
+ Validate.notBlank(theProfile, "theProfile must not be null or empty");
+ Validate.notNull(theClass, "theProfile must not be null");
+ myDefaultTypeForProfile.put(theProfile, theClass);
+ }
/**
* This feature is not yet in its final state and should be considered an internal part of HAPI for now - use with
@@ -495,6 +565,14 @@ public class FhirContext {
myParserErrorHandler = theParserErrorHandler;
}
+ /**
+ * Set the restful client factory
+ * @param theRestfulClientFactory
+ */
+ public void setRestfulClientFactory(IRestfulClientFactory theRestfulClientFactory) {
+ this.myRestfulClientFactory = theRestfulClientFactory;
+ }
+
@SuppressWarnings({ "cast" })
private List> toElementList(Collection> theResourceTypes) {
if (theResourceTypes == null) {
@@ -508,21 +586,28 @@ public class FhirContext {
}
/**
- * Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU1}
+ * Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU1 DSTU1}
*/
public static FhirContext forDstu1() {
return new FhirContext(FhirVersionEnum.DSTU1);
}
/**
- * Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU2 DSTU 2}
+ * Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU2 DSTU2}
*/
public static FhirContext forDstu2() {
return new FhirContext(FhirVersionEnum.DSTU2);
}
/**
- * Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU3 DSTU 3}
+ * Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU2_HL7ORG DSTU2} (using the Reference Implementation Structures)
+ */
+ public static FhirContext forDstu2Hl7Org() {
+ return new FhirContext(FhirVersionEnum.DSTU2_HL7ORG);
+ }
+
+ /**
+ * Creates and returns a new FhirContext with version {@link FhirVersionEnum#DSTU3 DSTU3}
*
* @since 1.4
*/
@@ -530,10 +615,6 @@ public class FhirContext {
return new FhirContext(FhirVersionEnum.DSTU3);
}
- public static FhirContext forDstu2Hl7Org() {
- return new FhirContext(FhirVersionEnum.DSTU2_HL7ORG);
- }
-
private static Collection> toCollection(Class extends IBaseResource> theResourceType) {
ArrayList> retVal = new ArrayList>(1);
retVal.add(theResourceType);
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java
index 257e09a8751..5494fb73e3f 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java
@@ -683,6 +683,14 @@ class ModelScanner {
}
}
+ Class extends IBaseResource> builtInType = myNameToResourceType.get(resourceName.toLowerCase());
+ boolean standardType = builtInType != null && builtInType.equals(theClass) == true;
+ if (primaryNameProvider) {
+ if (builtInType != null && builtInType.equals(theClass) == false) {
+ primaryNameProvider = false;
+ }
+ }
+
String resourceId = resourceDefinition.id();
if (!isBlank(resourceId)) {
if (myIdToResourceDefinition.containsKey(resourceId)) {
@@ -691,7 +699,7 @@ class ModelScanner {
}
}
- RuntimeResourceDefinition resourceDef = new RuntimeResourceDefinition(myContext, resourceName, theClass, resourceDefinition, isStandardType(theClass));
+ RuntimeResourceDefinition resourceDef = new RuntimeResourceDefinition(myContext, resourceName, theClass, resourceDefinition, standardType);
myClassToElementDefinitions.put(theClass, resourceDef);
if (primaryNameProvider) {
if (resourceDef.getStructureVersion() == myVersion) {
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java
index 5da65435cf6..ca2423bed30 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java
@@ -155,10 +155,6 @@ public class RuntimeResourceDefinition extends BaseRuntimeElementCompositeDefini
return "Bundle".equals(getName());
}
- public boolean isStandardProfile() {
- return myResourceProfile.startsWith("http://hl7.org/fhir/profiles");
- }
-
@Override
public void sealAndInitialize(FhirContext theContext, Map, BaseRuntimeElementDefinition>> theClassToElementDefinitions) {
super.sealAndInitialize(theContext, theClassToElementDefinitions);
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java
index 5b7bdad7ffc..f53354a8714 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java
@@ -1,5 +1,7 @@
package ca.uhn.fhir.model.api;
+import org.hl7.fhir.instance.model.api.IBaseMetaType;
+
/*
* #%L
* HAPI FHIR - Core Library
@@ -62,6 +64,15 @@ public interface IResource extends ICompositeElement, org.hl7.fhir.instance.mode
*/
CodeDt getLanguage();
+ /**
+ * Returns a view of the {@link #getResourceMetadata() resource metadata} map.
+ * Note that getters from this map return immutable objects, but the addFoo()
+ * and setFoo() methods may be used to modify metadata.
+ *
+ * @since 1.5
+ */
+ IBaseMetaType getMeta();
+
/**
* Returns the metadata map for this object, creating it if neccesary. Metadata entries are used to get/set feed bundle entries, such as the resource version, or the last updated timestamp.
*
@@ -72,10 +83,23 @@ public interface IResource extends ICompositeElement, org.hl7.fhir.instance.mode
*/
ResourceMetadataMap getResourceMetadata();
+ /**
+ * Returns a String representing the name of this Resource. This return value is not used for anything by HAPI itself, but is provided as a convenience to developers using the API.
+ *
+ * @return the name of this resource, e.g. "Patient", or "Observation"
+ */
+ String getResourceName();
+
+ /**
+ * Returns the FHIR version represented by this structure
+ */
+ @Override
+ public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum();
+
/**
* Returns the narrative block for this resource
*/
- BaseNarrativeDt getText();
+ BaseNarrativeDt> getText();
/**
* Sets the ID of this resource. Note that this identifier is the URL (or a portion of the URL) used to access this resource, and is not the same thing as any business identifiers stored within the
@@ -99,16 +123,4 @@ public interface IResource extends ICompositeElement, org.hl7.fhir.instance.mode
*/
void setResourceMetadata(ResourceMetadataMap theMap);
- /**
- * Returns a String representing the name of this Resource. This return value is not used for anything by HAPI itself, but is provided as a convenience to developers using the API.
- *
- * @return the name of this resource, e.g. "Patient", or "Observation"
- */
- String getResourceName();
-
- /**
- * Returns the FHIR version represented by this structure
- */
- public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum();
-
}
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Tag.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Tag.java
index 1d6cc434055..0b8194850ee 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Tag.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Tag.java
@@ -26,6 +26,7 @@ import java.net.URI;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
+import org.hl7.fhir.instance.model.api.IBaseCoding;
/**
* A single tag
@@ -34,7 +35,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* {@link #getScheme() scheme} and
*
*/
-public class Tag extends BaseElement implements IElement {
+public class Tag extends BaseElement implements IElement, IBaseCoding {
private static final long serialVersionUID = 1L;
@@ -59,10 +60,6 @@ public class Tag extends BaseElement implements IElement {
private String myScheme;
private String myTerm;
- /**
- * @deprecated Tags will become immutable in a future release, so this constructor should not be used.
- */
- @Deprecated
public Tag() {
}
@@ -149,12 +146,7 @@ public class Tag extends BaseElement implements IElement {
/**
* Sets the label and returns a reference to this tag
- *
- * @deprecated Tags will become immutable in a future release of HAPI in order to facilitate
- * ensuring that the TagList acts as an unordered set. Use the constructor to set this field when creating a new
- * tag object
*/
- @Deprecated
public Tag setLabel(String theLabel) {
myLabel = theLabel;
return this;
@@ -162,12 +154,7 @@ public class Tag extends BaseElement implements IElement {
/**
* Sets the scheme and returns a reference to this tag
- *
- * @deprecated Tags will become immutable in a future release of HAPI in order to facilitate
- * ensuring that the TagList acts as an unordered set. Use the constructor to set this field when creating a new
- * tag object
*/
- @Deprecated
public Tag setScheme(String theScheme) {
myScheme = theScheme;
return this;
@@ -175,12 +162,7 @@ public class Tag extends BaseElement implements IElement {
/**
* Sets the term and returns a reference to this tag
- *
- * @deprecated Tags will become immutable in a future release of HAPI in order to facilitate
- * ensuring that the TagList acts as an unordered set. Use the constructor to set this field when creating a new
- * tag object
*/
- @Deprecated
public Tag setTerm(String theTerm) {
myTerm = theTerm;
return this;
@@ -207,4 +189,37 @@ public class Tag extends BaseElement implements IElement {
return b.toString();
}
+ @Override
+ public String getCode() {
+ return getTerm();
+ }
+
+ @Override
+ public String getDisplay() {
+ return getLabel();
+ }
+
+ @Override
+ public String getSystem() {
+ return getScheme();
+ }
+
+ @Override
+ public IBaseCoding setCode(String theTerm) {
+ setTerm(myTerm);
+ return this;
+ }
+
+ @Override
+ public IBaseCoding setDisplay(String theLabel) {
+ setLabel(theLabel);
+ return this;
+ }
+
+ @Override
+ public IBaseCoding setSystem(String theScheme) {
+ setScheme(theScheme);
+ return this;
+ }
+
}
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/ResourceDef.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/ResourceDef.java
index 2448198facc..6ab6988f0f9 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/ResourceDef.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/ResourceDef.java
@@ -46,13 +46,17 @@ public @interface ResourceDef {
* for the generated profile exported by the server. For example, if you set this value to
* "hello" on a custom resource class, your server will automatically export a profile with the
* identity: http://localhost:8080/fhir/Profile/hello (the base URL will be whatever
- * your server uses, not necessarily "http://localhost:8080/fhir")
+ * your server uses, not necessarily "http://localhost:8080/fhir")
*/
String id() default "";
/**
* The URL indicating the profile for this resource definition. If specified, this URL will be
* automatically added to the meta tag when the resource is serialized.
+ *
+ * This URL should be fully qualified to indicate the complete URL of
+ * the profile being used, e.g. http://example.com/fhir/StructureDefiniton/some_profile
+ *
*/
String profile() default "";
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java
index 0def8b3d987..61852608ab9 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java
@@ -78,12 +78,14 @@ public abstract class BaseParser implements IParser {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseParser.class);
- private IIdType myEncodeForceResourceId;
private ContainedResources myContainedResources;
private FhirContext myContext;
+ private Set myDontEncodeElements;
+ private boolean myDontEncodeElementsIncludesStars;
private Set myEncodeElements;
private Set myEncodeElementsAppliesToResourceTypes;
private boolean myEncodeElementsIncludesStars;
+ private IIdType myEncodeForceResourceId;
private IParserErrorHandler myErrorHandler;
private boolean myOmitResourceId;
private String myServerBaseUrl;
@@ -91,10 +93,6 @@ public abstract class BaseParser implements IParser {
private boolean mySummaryMode;
private boolean mySuppressNarratives;
- private Set myDontEncodeElements;
-
- private boolean myDontEncodeElementsIncludesStars;
-
/**
* Constructor
*
@@ -439,6 +437,47 @@ public abstract class BaseParser implements IParser {
return tags;
}
+ @SuppressWarnings("deprecation")
+ protected > List getProfileTagsForEncoding(IBaseResource theResource, List theProfiles) {
+ switch (myContext.getAddProfileTagWhenEncoding()) {
+ case NEVER:
+ return theProfiles;
+ case ONLY_FOR_CUSTOM:
+ RuntimeResourceDefinition resDef = myContext.getResourceDefinition(theResource);
+ if (resDef.isStandardType()) {
+ return theProfiles;
+ }
+ break;
+ case ALWAYS:
+ break;
+ }
+
+ if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) {
+ RuntimeResourceDefinition nextDef = myContext.getResourceDefinition(theResource);
+ String profile = nextDef.getResourceProfile(myServerBaseUrl);
+ if (isNotBlank(profile)) {
+ for (T next : theProfiles) {
+ if (profile.equals(next.getValue())) {
+ return theProfiles;
+ }
+ }
+
+ List newList = new ArrayList();
+ newList.addAll(theProfiles);
+
+ BaseRuntimeElementDefinition> idElement = myContext.getElementDefinition("id");
+ @SuppressWarnings("unchecked")
+ T newId = (T) idElement.newInstance();
+ newId.setValue(profile);
+
+ newList.add(newId);
+ return newList;
+ }
+ }
+
+ return theProfiles;
+ }
+
/**
* If set to true (default is false), narratives will not be included in the encoded
* values.
@@ -595,6 +634,17 @@ public abstract class BaseParser implements IParser {
filterCodingsWithNoCodeOrSystem(metaValue.getTag());
filterCodingsWithNoCodeOrSystem(metaValue.getSecurity());
+ List extends IPrimitiveType> newProfileList = getProfileTagsForEncoding(theResource, metaValue.getProfile());
+ List extends IPrimitiveType> oldProfileList = metaValue.getProfile();
+ if (oldProfileList != newProfileList) {
+ oldProfileList.clear();
+ for (IPrimitiveType next : newProfileList) {
+ if (isNotBlank(next.getValue())) {
+ metaValue.addProfile(next.getValue());
+ }
+ }
+ }
+
if (shouldAddSubsettedTag()) {
IBaseCoding coding = metaValue.addTag();
coding.setCode(Constants.TAG_SUBSETTED_CODE);
@@ -748,11 +798,11 @@ public abstract class BaseParser implements IParser {
}
protected static List extractMetadataListNotNull(IResource resource, ResourceMetadataKeyEnum> key) {
- List securityLabels = key.get(resource);
+ List extends T> securityLabels = key.get(resource);
if (securityLabels == null) {
securityLabels = Collections.emptyList();
}
- return securityLabels;
+ return new ArrayList(securityLabels);
}
static boolean hasExtensions(IBase theElement) {
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/IParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/IParser.java
index 2febfef1b11..fc1a0b69fc0 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/IParser.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/IParser.java
@@ -104,7 +104,7 @@ public interface IParser {
boolean isOmitResourceId();
/**
- * If set to true (which is the default), resource references containing a version
+ * If set to true (which is the default), resource references containing a version
* will have the version removed when the resource is encoded. This is generally good behaviour because
* in most situations, references from one resource to another should be to the resource by ID, not
* by ID and version. In some cases though, it may be desirable to preserve the version in resource
@@ -222,12 +222,13 @@ public interface IParser {
*
Patient - Don't encode patient and all its children
*
Patient.name - Don't encode the patient's name
*
Patient.name.family - Don't encode the patient's family name
- *
*.text - Don't encode the text element on any resource (only the very first position may contain a wildcard)
+ *
*.text - Don't encode the text element on any resource (only the very first position may contain a
+ * wildcard)
*
*
* DSTU2 note: Note that values including meta, such as Patient.meta
* will work for DSTU2 parsers, but values with subelements on meta such
- * as Patient.meta.lastUpdated will only work in
+ * as Patient.meta.lastUpdated will only work in
* DSTU3+ mode.
*
*
@@ -244,7 +245,8 @@ public interface IParser {
*
Patient - Encode patient and all its children
*
Patient.name - Encode only the patient's name
*
Patient.name.family - Encode only the patient's family name
- *
*.text - Encode the text element on any resource (only the very first position may contain a wildcard)
+ *
*.text - Encode the text element on any resource (only the very first position may contain a
+ * wildcard)
*
*
* @param theEncodeElements
@@ -308,7 +310,7 @@ public interface IParser {
IParser setServerBaseUrl(String theUrl);
/**
- * If set to true (which is the default), resource references containing a version
+ * If set to true (which is the default), resource references containing a version
* will have the version removed when the resource is encoded. This is generally good behaviour because
* in most situations, references from one resource to another should be to the resource by ID, not
* by ID and version. In some cases though, it may be desirable to preserve the version in resource
@@ -316,7 +318,7 @@ public interface IParser {
*
* @param theStripVersionsFromReferences
* Set this to false to prevent the parser from removing
- * resource versions from references.
+ * resource versions from references.
* @return Returns a reference to this parser so that method calls can be chained together
*/
IParser setStripVersionsFromReferences(boolean theStripVersionsFromReferences);
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java
index b3adfa8795e..7522f4b17f3 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java
@@ -838,7 +838,9 @@ public class JsonParser extends BaseParser implements IParser {
// Object securityLabelRawObj =
List securityLabels = extractMetadataListNotNull(resource, ResourceMetadataKeyEnum.SECURITY_LABELS);
- List profiles = extractMetadataListNotNull(resource, ResourceMetadataKeyEnum.PROFILES);
+ List extends IIdType> profiles = extractMetadataListNotNull(resource, ResourceMetadataKeyEnum.PROFILES);
+ profiles = super.getProfileTagsForEncoding(resource, profiles);
+
TagList tags = getMetaTagsForEncoding(resource);
InstantDt updated = (InstantDt) resource.getResourceMetadata().get(ResourceMetadataKeyEnum.UPDATED);
IdDt resourceId = resource.getId();
@@ -854,7 +856,7 @@ public class JsonParser extends BaseParser implements IParser {
if (profiles != null && profiles.isEmpty() == false) {
theEventWriter.writeStartArray("profile");
- for (IdDt profile : profiles) {
+ for (IIdType profile : profiles) {
if (profile != null && isNotBlank(profile.getValue())) {
theEventWriter.write(profile.getValue());
}
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java
index b5eb1057d63..12504caaf71 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java
@@ -43,6 +43,7 @@ import org.hl7.fhir.instance.model.api.IBaseElement;
import org.hl7.fhir.instance.model.api.IBaseExtension;
import org.hl7.fhir.instance.model.api.IBaseHasExtensions;
import org.hl7.fhir.instance.model.api.IBaseHasModifierExtensions;
+import org.hl7.fhir.instance.model.api.IBaseMetaType;
import org.hl7.fhir.instance.model.api.IBaseReference;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IBaseXhtml;
@@ -1433,6 +1434,11 @@ class ParserState {
}
+ @Override
+ protected void populateTarget() {
+ // nothing
+ }
+
}
private class ContainedResourcesStateHl7Org extends PreResourceState {
@@ -1464,6 +1470,11 @@ class ParserState {
def.getChildByName("contained").getMutator().addValue(preResCurrentElement, res);
}
+ @Override
+ protected void populateTarget() {
+ // nothing
+ }
+
}
private class DeclaredExtensionState extends BaseState {
@@ -1969,6 +1980,8 @@ class ParserState {
}
}
+ protected abstract void populateTarget();
+
public PreResourceState(PreResourceState thePreResourcesState, FhirVersionEnum theParentVersion) {
super(thePreResourcesState);
Validate.notNull(theParentVersion);
@@ -2045,6 +2058,40 @@ class ParserState {
public void wereBack() {
final boolean bundle = "Bundle".equals(myContext.getResourceDefinition(myInstance).getName());
+ if (myContext.hasDefaultTypeForProfile()) {
+ IBaseMetaType meta = myInstance.getMeta();
+ Class extends IBaseResource> wantedProfileType = null;
+ String usedProfile = null;
+ for (IPrimitiveType next : meta.getProfile()) {
+ if (isNotBlank(next.getValue())) {
+ wantedProfileType = myContext.getDefaultTypeForProfile(next.getValue());
+ if (wantedProfileType != null) {
+ usedProfile = next.getValue();
+ break;
+ }
+ }
+ }
+
+ if (wantedProfileType != null && !wantedProfileType.equals(myInstance.getClass())) {
+ if (myResourceType == null || myResourceType.isAssignableFrom(wantedProfileType)) {
+ ourLog.debug("Converting resource of type {} to type defined for profile \"{}\": {}", new Object[] {myInstance.getClass().getName(), usedProfile, wantedProfileType});
+
+ /*
+ * This isn't the most efficient thing really.. If we want a specific
+ * type we just re-parse into that type. The problem is that we don't know
+ * until we've parsed the resource which type we want to use because the
+ * profile declarations are in the text of the resource itself.
+ *
+ * At some point it would be good to write code which can present a view
+ * of one type backed by another type and use that.
+ */
+ IParser parser = myContext.newJsonParser();
+ String asString = parser.encodeResourceToString(myInstance);
+ myInstance = parser.parseResource(wantedProfileType, asString);
+ }
+ }
+ }
+
FhirTerser terser = myContext.newTerser();
terser.visit(myInstance, new IModelVisitor() {
@@ -2114,6 +2161,7 @@ class ParserState {
}
+ populateTarget();
}
}
@@ -2141,14 +2189,19 @@ class ParserState {
assert theResourceType == null || IResource.class.isAssignableFrom(theResourceType);
}
+// @Override
+// public void enteringNewElement(String theNamespaceUri, String theLocalPart) throws DataFormatException {
+// super.enteringNewElement(theNamespaceUri, theLocalPart);
+// populateTarget();
+// }
+
@Override
- public void enteringNewElement(String theNamespaceUri, String theLocalPart) throws DataFormatException {
- super.enteringNewElement(theNamespaceUri, theLocalPart);
+ protected void populateTarget() {
if (myEntry != null) {
myEntry.setResource((IResource) getCurrentElement());
}
if (myMutator != null) {
- myMutator.addValue(myTarget, getCurrentElement());
+ myMutator.setValue(myTarget, getCurrentElement());
}
}
@@ -2192,10 +2245,9 @@ class ParserState {
}
@Override
- public void enteringNewElement(String theNamespaceUri, String theLocalPart) throws DataFormatException {
- super.enteringNewElement(theNamespaceUri, theLocalPart);
+ protected void populateTarget() {
if (myMutator != null) {
- myMutator.addValue(myTarget, getCurrentElement());
+ myMutator.setValue(myTarget, getCurrentElement());
}
}
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java
index 1b87f3e46c2..aebe2ad0d1f 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java
@@ -132,16 +132,6 @@ public class XmlParser extends BaseParser implements IParser {
} catch (XMLStreamException e1) {
throw new DataFormatException(e1);
}
-
- // XMLEventReader streamReader;
- // try {
- // streamReader = myXmlInputFactory.createXMLEventReader(theReader);
- // } catch (XMLStreamException e) {
- // throw new DataFormatException(e);
- // } catch (FactoryConfigurationError e) {
- // throw new ConfigurationException("Failed to initialize STaX event factory", e);
- // }
- // return streamReader;
}
private XMLStreamWriter createXmlWriter(Writer theWriter) throws XMLStreamException {
@@ -433,8 +423,6 @@ public class XmlParser extends BaseParser implements IParser {
theEventWriter.writeEndElement();
}
- String bundleBaseUrl = theBundle.getLinkBase().getValue();
-
writeOptionalTagWithValue(theEventWriter, "type", theBundle.getType().getValue());
writeOptionalTagWithValue(theEventWriter, "total", theBundle.getTotalResults().getValueAsString());
@@ -841,7 +829,9 @@ public class XmlParser extends BaseParser implements IParser {
versionIdPart = ResourceMetadataKeyEnum.VERSION.get(resource);
}
List securityLabels = extractMetadataListNotNull(resource, ResourceMetadataKeyEnum.SECURITY_LABELS);
- List profiles = extractMetadataListNotNull(resource, ResourceMetadataKeyEnum.PROFILES);
+ List extends IIdType> profiles = extractMetadataListNotNull(resource, ResourceMetadataKeyEnum.PROFILES);
+ profiles = super.getProfileTagsForEncoding(resource, profiles);
+
TagList tags = getMetaTagsForEncoding((resource));
if (super.shouldEncodeResourceMeta(resource) && ElementUtil.isEmpty(versionIdPart, updated, securityLabels, tags, profiles) == false) {
@@ -851,7 +841,7 @@ public class XmlParser extends BaseParser implements IParser {
writeOptionalTagWithValue(theEventWriter, "lastUpdated", updated.getValueAsString());
}
- for (IdDt profile : profiles) {
+ for (IIdType profile : profiles) {
theEventWriter.writeStartElement("profile");
theEventWriter.writeAttribute("value", profile.getValue());
theEventWriter.writeEndElement();
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/AddProfileTagEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/AddProfileTagEnum.java
index 1d7f0c9d558..5c491d7f530 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/AddProfileTagEnum.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/AddProfileTagEnum.java
@@ -1,5 +1,7 @@
package ca.uhn.fhir.rest.server;
+import ca.uhn.fhir.context.FhirContext;
+
/*
* #%L
* HAPI FHIR - Core Library
@@ -21,9 +23,9 @@ package ca.uhn.fhir.rest.server;
*/
/**
- * RESTful server behaviour for automatically adding profile tags
+ * RESTful server behaviour for automatically adding profile tags when serializing resources
*
- * @see RestfulServer#setAddProfileTag(AddProfileTagEnum)
+ * @see FhirContext#setAddProfileTagWhenEncoding(AddProfileTagEnum)
*/
public enum AddProfileTagEnum {
/**
@@ -33,7 +35,13 @@ public enum AddProfileTagEnum {
/**
* Add any profile tags that returned resources appear to conform to
+ *
+ * @deprecated This mode causes even FHIR's default profiles to be exported in the
+ * resource metadata section. This is not generally expected behaviour from other
+ * systems and it offers no real benefit, so it will be removed at some point. This
+ * option was deprecated in HAPI 1.5
*/
+ @Deprecated
ALWAYS,
/**
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IRestfulServerDefaults.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IRestfulServerDefaults.java
index f42e8e76dcf..6df22aeeee0 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IRestfulServerDefaults.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IRestfulServerDefaults.java
@@ -48,7 +48,9 @@ public interface IRestfulServerDefaults {
/**
* @return Returns the setting for automatically adding profile tags
+ * @deprecated As of HAPI FHIR 1.5, this property has been moved to {@link FhirContext#setAddProfileTagWhenEncoding(AddProfileTagEnum)}
*/
+ @Deprecated
AddProfileTagEnum getAddProfileTag();
/**
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IVersionSpecificBundleFactory.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IVersionSpecificBundleFactory.java
index a6e29eb87d9..657297e7407 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IVersionSpecificBundleFactory.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IVersionSpecificBundleFactory.java
@@ -40,7 +40,7 @@ public interface IVersionSpecificBundleFactory {
void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, IPrimitiveType theLastUpdated);
- void initializeBundleFromBundleProvider(IRestfulServer theServer, IBundleProvider theResult, EncodingEnum theResponseEncoding, String theServerBase, String theCompleteUrl, boolean thePrettyPrint,
+ void initializeBundleFromBundleProvider(IRestfulServer> theServer, IBundleProvider theResult, EncodingEnum theResponseEncoding, String theServerBase, String theCompleteUrl, boolean thePrettyPrint,
int theOffset, Integer theCount, String theSearchId, BundleTypeEnum theBundleType, Set theIncludes);
Bundle getDstu1Bundle();
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java
index be0f9944315..4438d602487 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java
@@ -74,6 +74,7 @@ import ca.uhn.fhir.rest.server.interceptor.ExceptionHandlingInterceptor;
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
+import ca.uhn.fhir.util.CoverageIgnore;
import ca.uhn.fhir.util.ReflectionUtil;
import ca.uhn.fhir.util.UrlUtil;
import ca.uhn.fhir.util.VersionUtil;
@@ -93,7 +94,6 @@ public class RestfulServer extends HttpServlet implements IRestfulServer 0 && (nextString.charAt(0) == '_' || nextString.charAt(0) == '$' || nextString.equals(Constants.URL_TOKEN_METADATA));
}
+ /**
+ * @deprecated As of HAPI FHIR 1.5, this property has been moved to {@link FhirContext#setAddProfileTagWhenEncoding(AddProfileTagEnum)}
+ */
+ @Override
+ @Deprecated
+ public AddProfileTagEnum getAddProfileTag() {
+ return myFhirContext.getAddProfileTagWhenEncoding();
+ }
+
}
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java
index 52e3e84bffa..5cd377a204b 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServerUtils.java
@@ -26,7 +26,6 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.net.URLEncoder;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
@@ -49,15 +48,12 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import ca.uhn.fhir.context.FhirContext;
-import ca.uhn.fhir.context.FhirVersionEnum;
-import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
import ca.uhn.fhir.model.api.Tag;
import ca.uhn.fhir.model.api.TagList;
-import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
import ca.uhn.fhir.parser.IParser;
@@ -77,36 +73,6 @@ public class RestfulServerUtils {
private static final HashSet TEXT_ENCODE_ELEMENTS = new HashSet(Arrays.asList("Bundle", "*.text"));
- public static void addProfileToBundleEntry(FhirContext theContext, IBaseResource theResource, String theServerBase) {
- if (theResource instanceof IResource) {
- if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) {
- RuntimeResourceDefinition nextDef = theContext.getResourceDefinition(theResource);
- String profile = nextDef.getResourceProfile(theServerBase);
- if (isNotBlank(profile)) {
- List newList = new ArrayList();
- List existingList = ResourceMetadataKeyEnum.PROFILES.get((IResource) theResource);
- if (existingList != null) {
- newList.addAll(existingList);
- }
- newList.add(new IdDt(profile));
- ResourceMetadataKeyEnum.PROFILES.put((IResource) theResource, newList);
- }
- } else {
- TagList tl = ResourceMetadataKeyEnum.TAG_LIST.get((IResource) theResource);
- if (tl == null) {
- tl = new TagList();
- ResourceMetadataKeyEnum.TAG_LIST.put((IResource) theResource, tl);
- }
-
- RuntimeResourceDefinition nextDef = theContext.getResourceDefinition(theResource);
- String profile = nextDef.getResourceProfile(theServerBase);
- if (isNotBlank(profile)) {
- tl.add(new Tag(Tag.HL7_ORG_PROFILE_TAG, profile, null));
- }
- }
- }
- }
-
public static void configureResponseParser(RequestDetails theRequestDetails, IParser parser) {
// Pretty print
boolean prettyPrint = RestfulServerUtils.prettyPrintResponse(theRequestDetails.getServer(), theRequestDetails);
@@ -608,13 +574,6 @@ public class RestfulServerUtils {
}
}
- if (theServer.getAddProfileTag() != AddProfileTagEnum.NEVER) {
- RuntimeResourceDefinition def = theServer.getFhirContext().getResourceDefinition(theResource);
- if (theServer.getAddProfileTag() == AddProfileTagEnum.ALWAYS || !def.isStandardProfile()) {
- addProfileToBundleEntry(theServer.getFhirContext(), theResource, serverBase);
- }
- }
-
String contentType;
if (theResource instanceof IBaseBinary && responseEncoding == null) {
IBaseBinary bin = (IBaseBinary) theResource;
diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IAnyResource.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IAnyResource.java
index da06a0eebda..c36c8312ee0 100644
--- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IAnyResource.java
+++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IAnyResource.java
@@ -55,8 +55,6 @@ public interface IAnyResource extends IBaseResource {
IPrimitiveType getLanguageElement();
- IBaseMetaType getMeta();
-
public Object getUserData(String name);
@Override
diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseResource.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseResource.java
index 26553bd09d1..86deb2d4a0b 100644
--- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseResource.java
+++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseResource.java
@@ -39,6 +39,8 @@ import ca.uhn.fhir.model.api.Include;
*/
public interface IBaseResource extends IBase, IElement {
+ IBaseMetaType getMeta();
+
/**
* Include constant for * (return all includes)
*/
diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IIdType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IIdType.java
index 2da4f1eee73..99989b2ccfe 100644
--- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IIdType.java
+++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IIdType.java
@@ -32,7 +32,7 @@ package org.hl7.fhir.instance.model.api;
* which version of the strctures your application is using.
*
- */
- public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE);
-
- /**
- * Search parameter constant for message
- *
- * Description: The first resource in the bundle, if the bundle type is \"message\" - this is a message header, and this parameter provides access to search its contents
- * Type: reference
- * Path: Bundle.entry.resource(0)
- *
- */
- @SearchParamDefinition(name="message", path="Bundle.entry.resource(0)", description="The first resource in the bundle, if the bundle type is \"message\" - this is a message header, and this parameter provides access to search its contents", type="reference" )
- public static final String SP_MESSAGE = "message";
-
- /**
- * Fluent Client search parameter constant for message
- *
- * Description: The first resource in the bundle, if the bundle type is \"message\" - this is a message header, and this parameter provides access to search its contents
- * Type: reference
- * Path: Bundle.entry.resource(0)
- *
- */
- public static final ReferenceClientParam MESSAGE = new ReferenceClientParam(SP_MESSAGE);
-
- /**
- * Search parameter constant for composition
- *
- * Description: The first resource in the bundle, if the bundle type is \"document\" - this is a composition, and this parameter provides access to searches its contents
- * Type: reference
- * Path: Bundle.entry.resource(0)
- *
- */
- @SearchParamDefinition(name="composition", path="Bundle.entry.resource(0)", description="The first resource in the bundle, if the bundle type is \"document\" - this is a composition, and this parameter provides access to searches its contents", type="reference" )
- public static final String SP_COMPOSITION = "composition";
-
- /**
- * Fluent Client search parameter constant for composition
- *
- * Description: The first resource in the bundle, if the bundle type is \"document\" - this is a composition, and this parameter provides access to searches its contents
- * Type: reference
- * Path: Bundle.entry.resource(0)
- *
- */
- public static final ReferenceClientParam COMPOSITION = new ReferenceClientParam(SP_COMPOSITION);
-
-
- /**
- * Constant for fluent queries to be used to add include statements. Specifies
- * the path value of "Bundle:composition".
- */
- public static final Include INCLUDE_COMPOSITION = new Include("Bundle:composition");
-
- /**
- * Constant for fluent queries to be used to add include statements. Specifies
- * the path value of "Bundle:message".
- */
- public static final Include INCLUDE_MESSAGE = new Include("Bundle:message");
-
-
- @Child(name="type", type=CodeDt.class, order=0, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Indicates the purpose of this bundle- how it was intended to be used"
- )
- private BoundCodeDt myType;
-
- @Child(name="total", type=UnsignedIntDt.class, order=1, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)"
- )
- private UnsignedIntDt myTotal;
-
- @Child(name="link", order=2, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A series of links that provide context to this bundle"
- )
- private java.util.List myLink;
-
- @Child(name="entry", order=3, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)"
- )
- private java.util.List myEntry;
-
- @Child(name="signature", type=SignatureDt.class, order=4, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Digital Signature - base64 encoded. XML DigSIg or a JWT"
- )
- private SignatureDt mySignature;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myTotal, myLink, myEntry, mySignature);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myTotal, myLink, myEntry, mySignature);
- }
-
- /**
- * Gets the value(s) for type ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Indicates the purpose of this bundle- how it was intended to be used
- *
- */
- public BoundCodeDt getTypeElement() {
- if (myType == null) {
- myType = new BoundCodeDt(BundleTypeEnum.VALUESET_BINDER);
- }
- return myType;
- }
-
-
- /**
- * Gets the value(s) for type ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Indicates the purpose of this bundle- how it was intended to be used
- *
- */
- public String getType() {
- return getTypeElement().getValue();
- }
-
- /**
- * Sets the value(s) for type ()
- *
- *
- * Definition:
- * Indicates the purpose of this bundle- how it was intended to be used
- *
- */
- public Bundle setType(BoundCodeDt theValue) {
- myType = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value(s) for type ()
- *
- *
- * Definition:
- * Indicates the purpose of this bundle- how it was intended to be used
- *
- */
- public Bundle setType(BundleTypeEnum theValue) {
- getTypeElement().setValueAsEnum(theValue);
- return this;
- }
-
-
- /**
- * Gets the value(s) for total ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)
- *
- */
- public UnsignedIntDt getTotalElement() {
- if (myTotal == null) {
- myTotal = new UnsignedIntDt();
- }
- return myTotal;
- }
-
-
- /**
- * Gets the value(s) for total ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)
- *
- */
- public Integer getTotal() {
- return getTotalElement().getValue();
- }
-
- /**
- * Sets the value(s) for total ()
- *
- *
- * Definition:
- * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)
- *
- */
- public Bundle setTotal(UnsignedIntDt theValue) {
- myTotal = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for total ()
- *
- *
- * Definition:
- * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)
- *
- */
- public Bundle setTotal( int theInteger) {
- myTotal = new UnsignedIntDt(theInteger);
- return this;
- }
-
-
- /**
- * Gets the value(s) for link ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A series of links that provide context to this bundle
- *
- */
- public java.util.List getLink() {
- if (myLink == null) {
- myLink = new java.util.ArrayList();
- }
- return myLink;
- }
-
- /**
- * Sets the value(s) for link ()
- *
- *
- * Definition:
- * A series of links that provide context to this bundle
- *
- */
- public Bundle setLink(java.util.List theValue) {
- myLink = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for link ()
- *
- *
- * Definition:
- * A series of links that provide context to this bundle
- *
- */
- public Link addLink() {
- Link newType = new Link();
- getLink().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for link ()
- *
- *
- * Definition:
- * A series of links that provide context to this bundle
- *
- * @param theValue The link to add (must not be null)
- */
- public Bundle addLink(Link theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getLink().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for link (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * A series of links that provide context to this bundle
- *
- */
- public Link getLinkFirstRep() {
- if (getLink().isEmpty()) {
- return addLink();
- }
- return getLink().get(0);
- }
-
- /**
- * Gets the value(s) for entry ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
- *
- */
- public java.util.List getEntry() {
- if (myEntry == null) {
- myEntry = new java.util.ArrayList();
- }
- return myEntry;
- }
-
- /**
- * Sets the value(s) for entry ()
- *
- *
- * Definition:
- * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
- *
- */
- public Bundle setEntry(java.util.List theValue) {
- myEntry = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for entry ()
- *
- *
- * Definition:
- * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
- *
- */
- public Entry addEntry() {
- Entry newType = new Entry();
- getEntry().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for entry ()
- *
- *
- * Definition:
- * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
- *
- * @param theValue The entry to add (must not be null)
- */
- public Bundle addEntry(Entry theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getEntry().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for entry (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
- *
- */
- public Entry getEntryFirstRep() {
- if (getEntry().isEmpty()) {
- return addEntry();
- }
- return getEntry().get(0);
- }
-
- /**
- * Gets the value(s) for signature ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Digital Signature - base64 encoded. XML DigSIg or a JWT
- *
- */
- public SignatureDt getSignature() {
- if (mySignature == null) {
- mySignature = new SignatureDt();
- }
- return mySignature;
- }
-
- /**
- * Sets the value(s) for signature ()
- *
- *
- * Definition:
- * Digital Signature - base64 encoded. XML DigSIg or a JWT
- *
- * Definition:
- * A series of links that provide context to this bundle
- *
- */
- @Block()
- public static class Link
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="relation", type=StringDt.class, order=0, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]"
- )
- private StringDt myRelation;
-
- @Child(name="url", type=UriDt.class, order=1, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The reference details for the link"
- )
- private UriDt myUrl;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myRelation, myUrl);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRelation, myUrl);
- }
-
- /**
- * Gets the value(s) for relation ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]
- *
- */
- public StringDt getRelationElement() {
- if (myRelation == null) {
- myRelation = new StringDt();
- }
- return myRelation;
- }
-
-
- /**
- * Gets the value(s) for relation ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]
- *
- */
- public String getRelation() {
- return getRelationElement().getValue();
- }
-
- /**
- * Sets the value(s) for relation ()
- *
- *
- * Definition:
- * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]
- *
- */
- public Link setRelation(StringDt theValue) {
- myRelation = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for relation ()
- *
- *
- * Definition:
- * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]
- *
- */
- public Link setRelation( String theString) {
- myRelation = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for url ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The reference details for the link
- *
- */
- public UriDt getUrlElement() {
- if (myUrl == null) {
- myUrl = new UriDt();
- }
- return myUrl;
- }
-
-
- /**
- * Gets the value(s) for url ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The reference details for the link
- *
- */
- public String getUrl() {
- return getUrlElement().getValue();
- }
-
- /**
- * Sets the value(s) for url ()
- *
- *
- * Definition:
- * The reference details for the link
- *
- */
- public Link setUrl(UriDt theValue) {
- myUrl = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for url ()
- *
- *
- * Definition:
- * The reference details for the link
- *
- */
- public Link setUrl( String theUri) {
- myUrl = new UriDt(theUri);
- return this;
- }
-
-
-
-
- }
-
-
- /**
- * Block class for child element: Bundle.entry ()
- *
- *
- * Definition:
- * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
- *
- */
- @Block()
- public static class Entry
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="link", type=Link.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A series of links that provide context to this entry"
- )
- private java.util.List myLink;
-
- @Child(name="fullUrl", type=UriDt.class, order=1, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource"
- )
- private UriDt myFullUrl;
-
- @Child(name="resource", type=IResource.class, order=2, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The Resources for the entry"
- )
- private IResource myResource;
-
- @Child(name="search", order=3, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Information about the search process that lead to the creation of this entry"
- )
- private EntrySearch mySearch;
-
- @Child(name="request", order=4, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Additional information about how this entry should be processed as part of a transaction"
- )
- private EntryRequest myRequest;
-
- @Child(name="response", order=5, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Additional information about how this entry should be processed as part of a transaction"
- )
- private EntryResponse myResponse;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLink, myFullUrl, myResource, mySearch, myRequest, myResponse);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLink, myFullUrl, myResource, mySearch, myRequest, myResponse);
- }
-
- /**
- * Gets the value(s) for link ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A series of links that provide context to this entry
- *
- */
- public java.util.List getLink() {
- if (myLink == null) {
- myLink = new java.util.ArrayList();
- }
- return myLink;
- }
-
- /**
- * Sets the value(s) for link ()
- *
- *
- * Definition:
- * A series of links that provide context to this entry
- *
- */
- public Entry setLink(java.util.List theValue) {
- myLink = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for link ()
- *
- *
- * Definition:
- * A series of links that provide context to this entry
- *
- */
- public Link addLink() {
- Link newType = new Link();
- getLink().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for link ()
- *
- *
- * Definition:
- * A series of links that provide context to this entry
- *
- * @param theValue The link to add (must not be null)
- */
- public Entry addLink(Link theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getLink().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for link (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * A series of links that provide context to this entry
- *
- */
- public Link getLinkFirstRep() {
- if (getLink().isEmpty()) {
- return addLink();
- }
- return getLink().get(0);
- }
-
- /**
- * Gets the value(s) for fullUrl ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource
- *
- */
- public UriDt getFullUrlElement() {
- if (myFullUrl == null) {
- myFullUrl = new UriDt();
- }
- return myFullUrl;
- }
-
-
- /**
- * Gets the value(s) for fullUrl ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource
- *
- */
- public String getFullUrl() {
- return getFullUrlElement().getValue();
- }
-
- /**
- * Sets the value(s) for fullUrl ()
- *
- *
- * Definition:
- * The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource
- *
- */
- public Entry setFullUrl(UriDt theValue) {
- myFullUrl = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for fullUrl ()
- *
- *
- * Definition:
- * The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource
- *
- */
- public Entry setFullUrl( String theUri) {
- myFullUrl = new UriDt(theUri);
- return this;
- }
-
-
- /**
- * Gets the value(s) for resource ().
- *
- *
- * Definition:
- * The Resources for the entry
- *
- */
- public IResource getResource() {
- return myResource;
- }
-
-
- /**
- * Sets the value(s) for resource ()
- *
- *
- * Definition:
- * The Resources for the entry
- *
- */
- public Entry setResource(IResource theValue) {
- myResource = theValue;
- return this;
- }
-
-
-
-
- /**
- * Gets the value(s) for search ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Information about the search process that lead to the creation of this entry
- *
- */
- public EntrySearch getSearch() {
- if (mySearch == null) {
- mySearch = new EntrySearch();
- }
- return mySearch;
- }
-
- /**
- * Sets the value(s) for search ()
- *
- *
- * Definition:
- * Information about the search process that lead to the creation of this entry
- *
- */
- public Entry setSearch(EntrySearch theValue) {
- mySearch = theValue;
- return this;
- }
-
-
-
-
- /**
- * Gets the value(s) for request ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Additional information about how this entry should be processed as part of a transaction
- *
- */
- public EntryRequest getRequest() {
- if (myRequest == null) {
- myRequest = new EntryRequest();
- }
- return myRequest;
- }
-
- /**
- * Sets the value(s) for request ()
- *
- *
- * Definition:
- * Additional information about how this entry should be processed as part of a transaction
- *
- */
- public Entry setRequest(EntryRequest theValue) {
- myRequest = theValue;
- return this;
- }
-
-
-
-
- /**
- * Gets the value(s) for response ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Additional information about how this entry should be processed as part of a transaction
- *
- */
- public EntryResponse getResponse() {
- if (myResponse == null) {
- myResponse = new EntryResponse();
- }
- return myResponse;
- }
-
- /**
- * Sets the value(s) for response ()
- *
- *
- * Definition:
- * Additional information about how this entry should be processed as part of a transaction
- *
- * Definition:
- * Information about the search process that lead to the creation of this entry
- *
- */
- @Block()
- public static class EntrySearch
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="mode", type=CodeDt.class, order=0, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Why this entry is in the result set - whether it's included as a match or because of an _include requirement"
- )
- private BoundCodeDt myMode;
-
- @Child(name="score", type=DecimalDt.class, order=1, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="When searching, the server's search ranking score for the entry"
- )
- private DecimalDt myScore;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myMode, myScore);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMode, myScore);
- }
-
- /**
- * Gets the value(s) for mode ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Why this entry is in the result set - whether it's included as a match or because of an _include requirement
- *
- */
- public BoundCodeDt getModeElement() {
- if (myMode == null) {
- myMode = new BoundCodeDt(SearchEntryModeEnum.VALUESET_BINDER);
- }
- return myMode;
- }
-
-
- /**
- * Gets the value(s) for mode ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Why this entry is in the result set - whether it's included as a match or because of an _include requirement
- *
- */
- public String getMode() {
- return getModeElement().getValue();
- }
-
- /**
- * Sets the value(s) for mode ()
- *
- *
- * Definition:
- * Why this entry is in the result set - whether it's included as a match or because of an _include requirement
- *
- * Definition:
- * Why this entry is in the result set - whether it's included as a match or because of an _include requirement
- *
- */
- public EntrySearch setMode(SearchEntryModeEnum theValue) {
- getModeElement().setValueAsEnum(theValue);
- return this;
- }
-
-
- /**
- * Gets the value(s) for score ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * When searching, the server's search ranking score for the entry
- *
- */
- public DecimalDt getScoreElement() {
- if (myScore == null) {
- myScore = new DecimalDt();
- }
- return myScore;
- }
-
-
- /**
- * Gets the value(s) for score ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * When searching, the server's search ranking score for the entry
- *
- */
- public BigDecimal getScore() {
- return getScoreElement().getValue();
- }
-
- /**
- * Sets the value(s) for score ()
- *
- *
- * Definition:
- * When searching, the server's search ranking score for the entry
- *
- */
- public EntrySearch setScore(DecimalDt theValue) {
- myScore = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for score ()
- *
- *
- * Definition:
- * When searching, the server's search ranking score for the entry
- *
- */
- public EntrySearch setScore( long theValue) {
- myScore = new DecimalDt(theValue);
- return this;
- }
-
- /**
- * Sets the value for score ()
- *
- *
- * Definition:
- * When searching, the server's search ranking score for the entry
- *
- */
- public EntrySearch setScore( double theValue) {
- myScore = new DecimalDt(theValue);
- return this;
- }
-
- /**
- * Sets the value for score ()
- *
- *
- * Definition:
- * When searching, the server's search ranking score for the entry
- *
- * Definition:
- * Additional information about how this entry should be processed as part of a transaction
- *
- */
- @Block()
- public static class EntryRequest
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="method", type=CodeDt.class, order=0, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The HTTP verb for this entry in either a update history, or a transaction/ transaction response"
- )
- private BoundCodeDt myMethod;
-
- @Child(name="url", type=UriDt.class, order=1, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The URL for this entry, relative to the root (the address to which the request is posted)"
- )
- private UriDt myUrl;
-
- @Child(name="ifNoneMatch", type=StringDt.class, order=2, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation"
- )
- private StringDt myIfNoneMatch;
-
- @Child(name="ifMatch", type=StringDt.class, order=3, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Only perform the operation if the Etag value matches. For more information, see the API section \"Managing Resource Contention\""
- )
- private StringDt myIfMatch;
-
- @Child(name="ifModifiedSince", type=InstantDt.class, order=4, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Only perform the operation if the last updated date matches. For more information, see the API section \"Managing Resource Contention\""
- )
- private InstantDt myIfModifiedSince;
-
- @Child(name="ifNoneExist", type=StringDt.class, order=5, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Instruct the server not to perform the create if a specified resource already exists. For further information, see \"Conditional Create\". This is just the query portion of the URL - what follows the \"?\" (not including the \"?\")"
- )
- private StringDt myIfNoneExist;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myMethod, myUrl, myIfNoneMatch, myIfMatch, myIfModifiedSince, myIfNoneExist);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMethod, myUrl, myIfNoneMatch, myIfMatch, myIfModifiedSince, myIfNoneExist);
- }
-
- /**
- * Gets the value(s) for method ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The HTTP verb for this entry in either a update history, or a transaction/ transaction response
- *
- */
- public BoundCodeDt getMethodElement() {
- if (myMethod == null) {
- myMethod = new BoundCodeDt(HTTPVerbEnum.VALUESET_BINDER);
- }
- return myMethod;
- }
-
-
- /**
- * Gets the value(s) for method ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The HTTP verb for this entry in either a update history, or a transaction/ transaction response
- *
- */
- public String getMethod() {
- return getMethodElement().getValue();
- }
-
- /**
- * Sets the value(s) for method ()
- *
- *
- * Definition:
- * The HTTP verb for this entry in either a update history, or a transaction/ transaction response
- *
- * Definition:
- * The HTTP verb for this entry in either a update history, or a transaction/ transaction response
- *
- */
- public EntryRequest setMethod(HTTPVerbEnum theValue) {
- getMethodElement().setValueAsEnum(theValue);
- return this;
- }
-
-
- /**
- * Gets the value(s) for url ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The URL for this entry, relative to the root (the address to which the request is posted)
- *
- */
- public UriDt getUrlElement() {
- if (myUrl == null) {
- myUrl = new UriDt();
- }
- return myUrl;
- }
-
-
- /**
- * Gets the value(s) for url ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The URL for this entry, relative to the root (the address to which the request is posted)
- *
- */
- public String getUrl() {
- return getUrlElement().getValue();
- }
-
- /**
- * Sets the value(s) for url ()
- *
- *
- * Definition:
- * The URL for this entry, relative to the root (the address to which the request is posted)
- *
- */
- public EntryRequest setUrl(UriDt theValue) {
- myUrl = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for url ()
- *
- *
- * Definition:
- * The URL for this entry, relative to the root (the address to which the request is posted)
- *
- */
- public EntryRequest setUrl( String theUri) {
- myUrl = new UriDt(theUri);
- return this;
- }
-
-
- /**
- * Gets the value(s) for ifNoneMatch ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation
- *
- */
- public StringDt getIfNoneMatchElement() {
- if (myIfNoneMatch == null) {
- myIfNoneMatch = new StringDt();
- }
- return myIfNoneMatch;
- }
-
-
- /**
- * Gets the value(s) for ifNoneMatch ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation
- *
- */
- public String getIfNoneMatch() {
- return getIfNoneMatchElement().getValue();
- }
-
- /**
- * Sets the value(s) for ifNoneMatch ()
- *
- *
- * Definition:
- * If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation
- *
- */
- public EntryRequest setIfNoneMatch(StringDt theValue) {
- myIfNoneMatch = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for ifNoneMatch ()
- *
- *
- * Definition:
- * If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation
- *
- */
- public EntryRequest setIfNoneMatch( String theString) {
- myIfNoneMatch = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for ifMatch ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Only perform the operation if the Etag value matches. For more information, see the API section \"Managing Resource Contention\"
- *
- */
- public StringDt getIfMatchElement() {
- if (myIfMatch == null) {
- myIfMatch = new StringDt();
- }
- return myIfMatch;
- }
-
-
- /**
- * Gets the value(s) for ifMatch ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Only perform the operation if the Etag value matches. For more information, see the API section \"Managing Resource Contention\"
- *
- */
- public String getIfMatch() {
- return getIfMatchElement().getValue();
- }
-
- /**
- * Sets the value(s) for ifMatch ()
- *
- *
- * Definition:
- * Only perform the operation if the Etag value matches. For more information, see the API section \"Managing Resource Contention\"
- *
- */
- public EntryRequest setIfMatch(StringDt theValue) {
- myIfMatch = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for ifMatch ()
- *
- *
- * Definition:
- * Only perform the operation if the Etag value matches. For more information, see the API section \"Managing Resource Contention\"
- *
- */
- public EntryRequest setIfMatch( String theString) {
- myIfMatch = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for ifModifiedSince ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Only perform the operation if the last updated date matches. For more information, see the API section \"Managing Resource Contention\"
- *
- */
- public InstantDt getIfModifiedSinceElement() {
- if (myIfModifiedSince == null) {
- myIfModifiedSince = new InstantDt();
- }
- return myIfModifiedSince;
- }
-
-
- /**
- * Gets the value(s) for ifModifiedSince ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Only perform the operation if the last updated date matches. For more information, see the API section \"Managing Resource Contention\"
- *
- */
- public Date getIfModifiedSince() {
- return getIfModifiedSinceElement().getValue();
- }
-
- /**
- * Sets the value(s) for ifModifiedSince ()
- *
- *
- * Definition:
- * Only perform the operation if the last updated date matches. For more information, see the API section \"Managing Resource Contention\"
- *
- */
- public EntryRequest setIfModifiedSince(InstantDt theValue) {
- myIfModifiedSince = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for ifModifiedSince ()
- *
- *
- * Definition:
- * Only perform the operation if the last updated date matches. For more information, see the API section \"Managing Resource Contention\"
- *
- */
- public EntryRequest setIfModifiedSinceWithMillisPrecision( Date theDate) {
- myIfModifiedSince = new InstantDt(theDate);
- return this;
- }
-
- /**
- * Sets the value for ifModifiedSince ()
- *
- *
- * Definition:
- * Only perform the operation if the last updated date matches. For more information, see the API section \"Managing Resource Contention\"
- *
- */
- public EntryRequest setIfModifiedSince( Date theDate, TemporalPrecisionEnum thePrecision) {
- myIfModifiedSince = new InstantDt(theDate, thePrecision);
- return this;
- }
-
-
- /**
- * Gets the value(s) for ifNoneExist ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Instruct the server not to perform the create if a specified resource already exists. For further information, see \"Conditional Create\". This is just the query portion of the URL - what follows the \"?\" (not including the \"?\")
- *
- */
- public StringDt getIfNoneExistElement() {
- if (myIfNoneExist == null) {
- myIfNoneExist = new StringDt();
- }
- return myIfNoneExist;
- }
-
-
- /**
- * Gets the value(s) for ifNoneExist ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Instruct the server not to perform the create if a specified resource already exists. For further information, see \"Conditional Create\". This is just the query portion of the URL - what follows the \"?\" (not including the \"?\")
- *
- */
- public String getIfNoneExist() {
- return getIfNoneExistElement().getValue();
- }
-
- /**
- * Sets the value(s) for ifNoneExist ()
- *
- *
- * Definition:
- * Instruct the server not to perform the create if a specified resource already exists. For further information, see \"Conditional Create\". This is just the query portion of the URL - what follows the \"?\" (not including the \"?\")
- *
- */
- public EntryRequest setIfNoneExist(StringDt theValue) {
- myIfNoneExist = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for ifNoneExist ()
- *
- *
- * Definition:
- * Instruct the server not to perform the create if a specified resource already exists. For further information, see \"Conditional Create\". This is just the query portion of the URL - what follows the \"?\" (not including the \"?\")
- *
- * Definition:
- * Additional information about how this entry should be processed as part of a transaction
- *
- */
- @Block()
- public static class EntryResponse
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="status", type=StringDt.class, order=0, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The status code returned by processing this entry"
- )
- private StringDt myStatus;
-
- @Child(name="location", type=UriDt.class, order=1, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The location header created by processing this operation"
- )
- private UriDt myLocation;
-
- @Child(name="etag", type=StringDt.class, order=2, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource"
- )
- private StringDt myEtag;
-
- @Child(name="lastModified", type=InstantDt.class, order=3, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The date/time that the resource was modified on the server"
- )
- private InstantDt myLastModified;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myStatus, myLocation, myEtag, myLastModified);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStatus, myLocation, myEtag, myLastModified);
- }
-
- /**
- * Gets the value(s) for status ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The status code returned by processing this entry
- *
- */
- public StringDt getStatusElement() {
- if (myStatus == null) {
- myStatus = new StringDt();
- }
- return myStatus;
- }
-
-
- /**
- * Gets the value(s) for status ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The status code returned by processing this entry
- *
- */
- public String getStatus() {
- return getStatusElement().getValue();
- }
-
- /**
- * Sets the value(s) for status ()
- *
- *
- * Definition:
- * The status code returned by processing this entry
- *
- */
- public EntryResponse setStatus(StringDt theValue) {
- myStatus = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for status ()
- *
- *
- * Definition:
- * The status code returned by processing this entry
- *
- */
- public EntryResponse setStatus( String theString) {
- myStatus = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for location ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The location header created by processing this operation
- *
- */
- public UriDt getLocationElement() {
- if (myLocation == null) {
- myLocation = new UriDt();
- }
- return myLocation;
- }
-
-
- /**
- * Gets the value(s) for location ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The location header created by processing this operation
- *
- */
- public String getLocation() {
- return getLocationElement().getValue();
- }
-
- /**
- * Sets the value(s) for location ()
- *
- *
- * Definition:
- * The location header created by processing this operation
- *
- */
- public EntryResponse setLocation(UriDt theValue) {
- myLocation = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for location ()
- *
- *
- * Definition:
- * The location header created by processing this operation
- *
- */
- public EntryResponse setLocation( String theUri) {
- myLocation = new UriDt(theUri);
- return this;
- }
-
-
- /**
- * Gets the value(s) for etag ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The etag for the resource, it the operation for the entry produced a versioned resource
- *
- */
- public StringDt getEtagElement() {
- if (myEtag == null) {
- myEtag = new StringDt();
- }
- return myEtag;
- }
-
-
- /**
- * Gets the value(s) for etag ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The etag for the resource, it the operation for the entry produced a versioned resource
- *
- */
- public String getEtag() {
- return getEtagElement().getValue();
- }
-
- /**
- * Sets the value(s) for etag ()
- *
- *
- * Definition:
- * The etag for the resource, it the operation for the entry produced a versioned resource
- *
- */
- public EntryResponse setEtag(StringDt theValue) {
- myEtag = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for etag ()
- *
- *
- * Definition:
- * The etag for the resource, it the operation for the entry produced a versioned resource
- *
- */
- public EntryResponse setEtag( String theString) {
- myEtag = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for lastModified ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The date/time that the resource was modified on the server
- *
- */
- public InstantDt getLastModifiedElement() {
- if (myLastModified == null) {
- myLastModified = new InstantDt();
- }
- return myLastModified;
- }
-
-
- /**
- * Gets the value(s) for lastModified ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The date/time that the resource was modified on the server
- *
- */
- public Date getLastModified() {
- return getLastModifiedElement().getValue();
- }
-
- /**
- * Sets the value(s) for lastModified ()
- *
- *
- * Definition:
- * The date/time that the resource was modified on the server
- *
- */
- public EntryResponse setLastModified(InstantDt theValue) {
- myLastModified = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for lastModified ()
- *
- *
- * Definition:
- * The date/time that the resource was modified on the server
- *
- */
- public EntryResponse setLastModifiedWithMillisPrecision( Date theDate) {
- myLastModified = new InstantDt(theDate);
- return this;
- }
-
- /**
- * Sets the value for lastModified ()
- *
- *
- * Definition:
- * The date/time that the resource was modified on the server
- *
- */
- public EntryResponse setLastModified( Date theDate, TemporalPrecisionEnum thePrecision) {
- myLastModified = new InstantDt(theDate, thePrecision);
- return this;
- }
-
-
-
-
- }
-
-
-
-
-
- @Override
- public String getResourceName() {
- return "Bundle";
- }
-
- public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
- return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
- }
-
- /**
- * Returns the {@link #getLink() link} which matches a given {@link Link#getRelation() relation}.
- * If no link is found which matches the given relation, returns null. If more than one
- * link is found which matches the given relation, returns the first matching Link.
- *
- * @param theRelation
- * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}.
- * @return Returns a matching Link, or null
- * @see IBaseBundle#LINK_NEXT
- * @see IBaseBundle#LINK_PREV
- * @see IBaseBundle#LINK_SELF
- */
- public Link getLink(String theRelation) {
- org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
- for (Link next : getLink()) {
- if (theRelation.equals(next.getRelation())) {
- return next;
- }
- }
- return null;
- }
-
- /**
- * Returns the {@link #getLink() link} which matches a given {@link Link#getRelation() relation}.
- * If no link is found which matches the given relation, creates a new Link with the
- * given relation and adds it to this Bundle. If more than one
- * link is found which matches the given relation, returns the first matching Link.
- *
- * @param theRelation
- * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}.
- * @return Returns a matching Link, or null
- * @see IBaseBundle#LINK_NEXT
- * @see IBaseBundle#LINK_PREV
- * @see IBaseBundle#LINK_SELF
- */
- public Link getLinkOrCreate(String theRelation) {
- org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
- for (Link next : getLink()) {
- if (theRelation.equals(next.getRelation())) {
- return next;
- }
- }
- Link retVal = new Link();
- retVal.setRelation(theRelation);
- getLink().add(retVal);
- return retVal;
- }
-
-}
diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu2/resource/StructureDefinition.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu2/resource/StructureDefinition.java
deleted file mode 100644
index 29f0376a1b3..00000000000
--- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu2/resource/StructureDefinition.java
+++ /dev/null
@@ -1,3044 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-package ca.uhn.fhir.model.dstu2.resource;
-
-import java.util.Date;
-import java.util.List;
-
-import ca.uhn.fhir.model.api.BaseIdentifiableElement;
-import ca.uhn.fhir.model.api.IElement;
-import ca.uhn.fhir.model.api.IResource;
-import ca.uhn.fhir.model.api.IResourceBlock;
-import ca.uhn.fhir.model.api.Include;
-import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
-import ca.uhn.fhir.model.api.annotation.Block;
-import ca.uhn.fhir.model.api.annotation.Child;
-import ca.uhn.fhir.model.api.annotation.Description;
-import ca.uhn.fhir.model.api.annotation.ResourceDef;
-import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
-import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
-import ca.uhn.fhir.model.dstu2.composite.CodingDt;
-import ca.uhn.fhir.model.dstu2.composite.ContactPointDt;
-import ca.uhn.fhir.model.dstu2.composite.ElementDefinitionDt;
-import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
-import ca.uhn.fhir.model.dstu2.valueset.ConformanceResourceStatusEnum;
-import ca.uhn.fhir.model.dstu2.valueset.ExtensionContextEnum;
-import ca.uhn.fhir.model.dstu2.valueset.StructureDefinitionKindEnum;
-import ca.uhn.fhir.model.primitive.BooleanDt;
-import ca.uhn.fhir.model.primitive.BoundCodeDt;
-import ca.uhn.fhir.model.primitive.CodeDt;
-import ca.uhn.fhir.model.primitive.DateTimeDt;
-import ca.uhn.fhir.model.primitive.IdDt;
-import ca.uhn.fhir.model.primitive.StringDt;
-import ca.uhn.fhir.model.primitive.UriDt;
-import ca.uhn.fhir.rest.gclient.DateClientParam;
-import ca.uhn.fhir.rest.gclient.ReferenceClientParam;
-import ca.uhn.fhir.rest.gclient.StringClientParam;
-import ca.uhn.fhir.rest.gclient.TokenClientParam;
-import ca.uhn.fhir.rest.gclient.UriClientParam;
-
-
-/**
- * HAPI/FHIR StructureDefinition Resource
- * (conformance.content)
- *
- *
- * Definition:
- * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types
- *
- */
- public static final UriClientParam URL = new UriClientParam(SP_URL);
-
- /**
- * Search parameter constant for identifier
- *
- * Description: The identifier of the profile
- * Type: token
- * Path: StructureDefinition.identifier
- *
- */
- @SearchParamDefinition(name="identifier", path="StructureDefinition.identifier", description="The identifier of the profile", type="token" )
- public static final String SP_IDENTIFIER = "identifier";
-
- /**
- * Fluent Client search parameter constant for identifier
- *
- * Description: The identifier of the profile
- * Type: token
- * Path: StructureDefinition.identifier
- *
- */
- public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
-
- /**
- * Search parameter constant for version
- *
- * Description: The version identifier of the profile
- * Type: token
- * Path: StructureDefinition.version
- *
- */
- @SearchParamDefinition(name="version", path="StructureDefinition.version", description="The version identifier of the profile", type="token" )
- public static final String SP_VERSION = "version";
-
- /**
- * Fluent Client search parameter constant for version
- *
- * Description: The version identifier of the profile
- * Type: token
- * Path: StructureDefinition.version
- *
- */
- public static final TokenClientParam VERSION = new TokenClientParam(SP_VERSION);
-
- /**
- * Search parameter constant for name
- *
- * Description: Name of the profile
- * Type: string
- * Path: StructureDefinition.name
- *
- */
- @SearchParamDefinition(name="name", path="StructureDefinition.name", description="Name of the profile", type="string" )
- public static final String SP_NAME = "name";
-
- /**
- * Fluent Client search parameter constant for name
- *
- * Description: Name of the profile
- * Type: string
- * Path: StructureDefinition.name
- *
- */
- public static final StringClientParam NAME = new StringClientParam(SP_NAME);
-
- /**
- * Search parameter constant for publisher
- *
- * Description: Name of the publisher of the profile
- * Type: string
- * Path: StructureDefinition.publisher
- *
- */
- @SearchParamDefinition(name="publisher", path="StructureDefinition.publisher", description="Name of the publisher of the profile", type="string" )
- public static final String SP_PUBLISHER = "publisher";
-
- /**
- * Fluent Client search parameter constant for publisher
- *
- * Description: Name of the publisher of the profile
- * Type: string
- * Path: StructureDefinition.publisher
- *
- */
- public static final StringClientParam PUBLISHER = new StringClientParam(SP_PUBLISHER);
-
- /**
- * Search parameter constant for description
- *
- * Description: Text search in the description of the profile
- * Type: string
- * Path: StructureDefinition.description
- *
- */
- @SearchParamDefinition(name="description", path="StructureDefinition.description", description="Text search in the description of the profile", type="string" )
- public static final String SP_DESCRIPTION = "description";
-
- /**
- * Fluent Client search parameter constant for description
- *
- * Description: Text search in the description of the profile
- * Type: string
- * Path: StructureDefinition.description
- *
- */
- public static final StringClientParam DESCRIPTION = new StringClientParam(SP_DESCRIPTION);
-
- /**
- * Search parameter constant for status
- *
- * Description: The current status of the profile
- * Type: token
- * Path: StructureDefinition.status
- *
- */
- @SearchParamDefinition(name="status", path="StructureDefinition.status", description="The current status of the profile", type="token" )
- public static final String SP_STATUS = "status";
-
- /**
- * Fluent Client search parameter constant for status
- *
- * Description: The current status of the profile
- * Type: token
- * Path: StructureDefinition.status
- *
- */
- public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
-
- /**
- * Search parameter constant for date
- *
- * Description: The profile publication date
- * Type: date
- * Path: StructureDefinition.date
- *
- */
- @SearchParamDefinition(name="date", path="StructureDefinition.date", description="The profile publication date", type="date" )
- public static final String SP_DATE = "date";
-
- /**
- * Fluent Client search parameter constant for date
- *
- * Description: The profile publication date
- * Type: date
- * Path: StructureDefinition.date
- *
- */
- public static final DateClientParam DATE = new DateClientParam(SP_DATE);
-
- /**
- * Search parameter constant for code
- *
- * Description: A code for the profile
- * Type: token
- * Path: StructureDefinition.code
- *
- */
- @SearchParamDefinition(name="code", path="StructureDefinition.code", description="A code for the profile", type="token" )
- public static final String SP_CODE = "code";
-
- /**
- * Fluent Client search parameter constant for code
- *
- * Description: A code for the profile
- * Type: token
- * Path: StructureDefinition.code
- *
- */
- public static final TokenClientParam CODE = new TokenClientParam(SP_CODE);
-
- /**
- * Search parameter constant for valueset
- *
- */
- public static final TokenClientParam KIND = new TokenClientParam(SP_KIND);
-
- /**
- * Search parameter constant for path
- *
- * Description: A path that is constrained in the profile
- * Type: token
- * Path: StructureDefinition.snapshot.element.path | StructureDefinition.differential.element.path
- *
- */
- @SearchParamDefinition(name="path", path="StructureDefinition.snapshot.element.path | StructureDefinition.differential.element.path ", description="A path that is constrained in the profile", type="token" )
- public static final String SP_PATH = "path";
-
- /**
- * Fluent Client search parameter constant for path
- *
- * Description: A path that is constrained in the profile
- * Type: token
- * Path: StructureDefinition.snapshot.element.path | StructureDefinition.differential.element.path
- *
- */
- public static final TokenClientParam PATH = new TokenClientParam(SP_PATH);
-
- /**
- * Search parameter constant for context
- *
- * Description: A use context assigned to the structure
- * Type: token
- * Path: StructureDefinition.useContext
- *
- */
- @SearchParamDefinition(name="context", path="StructureDefinition.useContext", description="A use context assigned to the structure", type="token" )
- public static final String SP_CONTEXT = "context";
-
- /**
- * Fluent Client search parameter constant for context
- *
- * Description: A use context assigned to the structure
- * Type: token
- * Path: StructureDefinition.useContext
- *
- */
- public static final TokenClientParam CONTEXT = new TokenClientParam(SP_CONTEXT);
-
- /**
- * Search parameter constant for display
- *
- */
- public static final TokenClientParam BASE_PATH = new TokenClientParam(SP_BASE_PATH);
-
-
- /**
- * Constant for fluent queries to be used to add include statements. Specifies
- * the path value of "StructureDefinition:valueset".
- */
- public static final Include INCLUDE_VALUESET = new Include("StructureDefinition:valueset");
-
-
- @Child(name="url", type=UriDt.class, order=0, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="id",
- formalDefinition="An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published"
- )
- private UriDt myUrl;
-
- @Child(name="identifier", type=IdentifierDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
- @Description(
- shortDefinition="id",
- formalDefinition="Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)"
- )
- private java.util.List myIdentifier;
-
- @Child(name="version", type=StringDt.class, order=2, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="id.version",
- formalDefinition="The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually"
- )
- private StringDt myVersion;
-
- @Child(name="name", type=StringDt.class, order=3, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A free text natural language name identifying the StructureDefinition"
- )
- private StringDt myName;
-
- @Child(name="display", type=StringDt.class, order=4, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Defined so that applications can use this name when displaying the value of the extension to the user"
- )
- private StringDt myDisplay;
-
- @Child(name="status", type=CodeDt.class, order=5, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="status",
- formalDefinition="The status of the StructureDefinition"
- )
- private BoundCodeDt myStatus;
-
- @Child(name="experimental", type=BooleanDt.class, order=6, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="class",
- formalDefinition="This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage"
- )
- private BooleanDt myExperimental;
-
- @Child(name="publisher", type=StringDt.class, order=7, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="who.witness",
- formalDefinition="The name of the individual or organization that published the structure definition"
- )
- private StringDt myPublisher;
-
- @Child(name="contact", order=8, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Contacts to assist a user in finding and communicating with the publisher"
- )
- private java.util.List myContact;
-
- @Child(name="date", type=DateTimeDt.class, order=9, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="when.recorded",
- formalDefinition="The date that this version of the StructureDefinition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the structure definition changes"
- )
- private DateTimeDt myDate;
-
- @Child(name="description", type=StringDt.class, order=10, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A free text natural language description of the StructureDefinition and its use"
- )
- private StringDt myDescription;
-
- @Child(name="useContext", type=CodeableConceptDt.class, order=11, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions."
- )
- private java.util.List myUseContext;
-
- @Child(name="requirements", type=StringDt.class, order=12, min=0, max=1, summary=false, modifier=false)
- @Description(
- shortDefinition="why",
- formalDefinition="Explains why this structure definition is needed and why it's been constrained as it has"
- )
- private StringDt myRequirements;
-
- @Child(name="copyright", type=StringDt.class, order=13, min=0, max=1, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings"
- )
- private StringDt myCopyright;
-
- @Child(name="code", type=CodingDt.class, order=14, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates."
- )
- private java.util.List myCode;
-
- @Child(name="fhirVersion", type=IdDt.class, order=15, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is $version$ for this version"
- )
- private IdDt myFhirVersion;
-
- @Child(name="mapping", order=16, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="An external specification that the content is mapped to"
- )
- private java.util.List myMapping;
-
- @Child(name="kind", type=CodeDt.class, order=17, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Defines the kind of structure that this definition is describing"
- )
- private BoundCodeDt myKind;
-
- @Child(name="constrainedType", type=CodeDt.class, order=18, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The type of type that is being constrained - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is a constraint. If it is not present, then the structure definition is the definition of a base structure"
- )
- private CodeDt myConstrainedType;
-
- @Child(name="abstract", type=BooleanDt.class, order=19, min=1, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type"
- )
- private BooleanDt myAbstract;
-
- @Child(name="contextType", type=CodeDt.class, order=20, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="If this is an extension, Identifies the context within FHIR resources where the extension can be used"
- )
- private BoundCodeDt myContextType;
-
- @Child(name="context", type=StringDt.class, order=21, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Identifies the types of resource or data type elements to which the extension can be applied"
- )
- private java.util.List myContext;
-
- @Child(name="base", type=UriDt.class, order=22, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="An absolute URI that is the base structure from which this set of constraints is derived"
- )
- private UriDt myBase;
-
- @Child(name="snapshot", order=23, min=0, max=1, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition"
- )
- private Snapshot mySnapshot;
-
- @Child(name="differential", order=24, min=0, max=1, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies"
- )
- private Differential myDifferential;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUrl, myIdentifier, myVersion, myName, myDisplay, myStatus, myExperimental, myPublisher, myContact, myDate, myDescription, myUseContext, myRequirements, myCopyright, myCode, myFhirVersion, myMapping, myKind, myConstrainedType, myAbstract, myContextType, myContext, myBase, mySnapshot, myDifferential);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUrl, myIdentifier, myVersion, myName, myDisplay, myStatus, myExperimental, myPublisher, myContact, myDate, myDescription, myUseContext, myRequirements, myCopyright, myCode, myFhirVersion, myMapping, myKind, myConstrainedType, myAbstract, myContextType, myContext, myBase, mySnapshot, myDifferential);
- }
-
- /**
- * Gets the value(s) for url (id).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published
- *
- */
- public UriDt getUrlElement() {
- if (myUrl == null) {
- myUrl = new UriDt();
- }
- return myUrl;
- }
-
-
- /**
- * Gets the value(s) for url (id).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published
- *
- */
- public String getUrl() {
- return getUrlElement().getValue();
- }
-
- /**
- * Sets the value(s) for url (id)
- *
- *
- * Definition:
- * An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published
- *
- */
- public StructureDefinition setUrl(UriDt theValue) {
- myUrl = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for url (id)
- *
- *
- * Definition:
- * An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published
- *
- */
- public StructureDefinition setUrl( String theUri) {
- myUrl = new UriDt(theUri);
- return this;
- }
-
-
- /**
- * Gets the value(s) for identifier (id).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)
- *
- */
- public java.util.List getIdentifier() {
- if (myIdentifier == null) {
- myIdentifier = new java.util.ArrayList();
- }
- return myIdentifier;
- }
-
- /**
- * Sets the value(s) for identifier (id)
- *
- *
- * Definition:
- * Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)
- *
- */
- public StructureDefinition setIdentifier(java.util.List theValue) {
- myIdentifier = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for identifier (id)
- *
- *
- * Definition:
- * Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)
- *
- */
- public IdentifierDt addIdentifier() {
- IdentifierDt newType = new IdentifierDt();
- getIdentifier().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for identifier (id)
- *
- *
- * Definition:
- * Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)
- *
- * @param theValue The identifier to add (must not be null)
- */
- public StructureDefinition addIdentifier(IdentifierDt theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getIdentifier().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for identifier (id),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)
- *
- */
- public IdentifierDt getIdentifierFirstRep() {
- if (getIdentifier().isEmpty()) {
- return addIdentifier();
- }
- return getIdentifier().get(0);
- }
-
- /**
- * Gets the value(s) for version (id.version).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually
- *
- */
- public StringDt getVersionElement() {
- if (myVersion == null) {
- myVersion = new StringDt();
- }
- return myVersion;
- }
-
-
- /**
- * Gets the value(s) for version (id.version).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually
- *
- */
- public String getVersion() {
- return getVersionElement().getValue();
- }
-
- /**
- * Sets the value(s) for version (id.version)
- *
- *
- * Definition:
- * The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually
- *
- */
- public StructureDefinition setVersion(StringDt theValue) {
- myVersion = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for version (id.version)
- *
- *
- * Definition:
- * The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually
- *
- */
- public StructureDefinition setVersion( String theString) {
- myVersion = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for name ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A free text natural language name identifying the StructureDefinition
- *
- */
- public StringDt getNameElement() {
- if (myName == null) {
- myName = new StringDt();
- }
- return myName;
- }
-
-
- /**
- * Gets the value(s) for name ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A free text natural language name identifying the StructureDefinition
- *
- */
- public String getName() {
- return getNameElement().getValue();
- }
-
- /**
- * Sets the value(s) for name ()
- *
- *
- * Definition:
- * A free text natural language name identifying the StructureDefinition
- *
- */
- public StructureDefinition setName(StringDt theValue) {
- myName = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for name ()
- *
- *
- * Definition:
- * A free text natural language name identifying the StructureDefinition
- *
- */
- public StructureDefinition setName( String theString) {
- myName = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for display ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Defined so that applications can use this name when displaying the value of the extension to the user
- *
- */
- public StringDt getDisplayElement() {
- if (myDisplay == null) {
- myDisplay = new StringDt();
- }
- return myDisplay;
- }
-
-
- /**
- * Gets the value(s) for display ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Defined so that applications can use this name when displaying the value of the extension to the user
- *
- */
- public String getDisplay() {
- return getDisplayElement().getValue();
- }
-
- /**
- * Sets the value(s) for display ()
- *
- *
- * Definition:
- * Defined so that applications can use this name when displaying the value of the extension to the user
- *
- */
- public StructureDefinition setDisplay(StringDt theValue) {
- myDisplay = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for display ()
- *
- *
- * Definition:
- * Defined so that applications can use this name when displaying the value of the extension to the user
- *
- */
- public StructureDefinition setDisplay( String theString) {
- myDisplay = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for status (status).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The status of the StructureDefinition
- *
- */
- public BoundCodeDt getStatusElement() {
- if (myStatus == null) {
- myStatus = new BoundCodeDt(ConformanceResourceStatusEnum.VALUESET_BINDER);
- }
- return myStatus;
- }
-
-
- /**
- * Gets the value(s) for status (status).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The status of the StructureDefinition
- *
- */
- public String getStatus() {
- return getStatusElement().getValue();
- }
-
- /**
- * Sets the value(s) for status (status)
- *
- *
- * Definition:
- * The status of the StructureDefinition
- *
- */
- public StructureDefinition setStatus(BoundCodeDt theValue) {
- myStatus = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value(s) for status (status)
- *
- *
- * Definition:
- * The status of the StructureDefinition
- *
- */
- public StructureDefinition setStatus(ConformanceResourceStatusEnum theValue) {
- getStatusElement().setValueAsEnum(theValue);
- return this;
- }
-
-
- /**
- * Gets the value(s) for experimental (class).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public BooleanDt getExperimentalElement() {
- if (myExperimental == null) {
- myExperimental = new BooleanDt();
- }
- return myExperimental;
- }
-
-
- /**
- * Gets the value(s) for experimental (class).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public Boolean getExperimental() {
- return getExperimentalElement().getValue();
- }
-
- /**
- * Sets the value(s) for experimental (class)
- *
- *
- * Definition:
- * This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public StructureDefinition setExperimental(BooleanDt theValue) {
- myExperimental = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for experimental (class)
- *
- *
- * Definition:
- * This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public StructureDefinition setExperimental( boolean theBoolean) {
- myExperimental = new BooleanDt(theBoolean);
- return this;
- }
-
-
- /**
- * Gets the value(s) for publisher (who.witness).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The name of the individual or organization that published the structure definition
- *
- */
- public StringDt getPublisherElement() {
- if (myPublisher == null) {
- myPublisher = new StringDt();
- }
- return myPublisher;
- }
-
-
- /**
- * Gets the value(s) for publisher (who.witness).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The name of the individual or organization that published the structure definition
- *
- */
- public String getPublisher() {
- return getPublisherElement().getValue();
- }
-
- /**
- * Sets the value(s) for publisher (who.witness)
- *
- *
- * Definition:
- * The name of the individual or organization that published the structure definition
- *
- */
- public StructureDefinition setPublisher(StringDt theValue) {
- myPublisher = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for publisher (who.witness)
- *
- *
- * Definition:
- * The name of the individual or organization that published the structure definition
- *
- */
- public StructureDefinition setPublisher( String theString) {
- myPublisher = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for contact ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- public java.util.List getContact() {
- if (myContact == null) {
- myContact = new java.util.ArrayList();
- }
- return myContact;
- }
-
- /**
- * Sets the value(s) for contact ()
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- public StructureDefinition setContact(java.util.List theValue) {
- myContact = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for contact ()
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- public Contact addContact() {
- Contact newType = new Contact();
- getContact().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for contact ()
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- * @param theValue The contact to add (must not be null)
- */
- public StructureDefinition addContact(Contact theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getContact().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for contact (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- public Contact getContactFirstRep() {
- if (getContact().isEmpty()) {
- return addContact();
- }
- return getContact().get(0);
- }
-
- /**
- * Gets the value(s) for date (when.recorded).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The date that this version of the StructureDefinition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the structure definition changes
- *
- */
- public DateTimeDt getDateElement() {
- if (myDate == null) {
- myDate = new DateTimeDt();
- }
- return myDate;
- }
-
-
- /**
- * Gets the value(s) for date (when.recorded).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The date that this version of the StructureDefinition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the structure definition changes
- *
- */
- public Date getDate() {
- return getDateElement().getValue();
- }
-
- /**
- * Sets the value(s) for date (when.recorded)
- *
- *
- * Definition:
- * The date that this version of the StructureDefinition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the structure definition changes
- *
- */
- public StructureDefinition setDate(DateTimeDt theValue) {
- myDate = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for date (when.recorded)
- *
- *
- * Definition:
- * The date that this version of the StructureDefinition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the structure definition changes
- *
- */
- public StructureDefinition setDate( Date theDate, TemporalPrecisionEnum thePrecision) {
- myDate = new DateTimeDt(theDate, thePrecision);
- return this;
- }
-
- /**
- * Sets the value for date (when.recorded)
- *
- *
- * Definition:
- * The date that this version of the StructureDefinition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the structure definition changes
- *
- */
- public StructureDefinition setDateWithSecondsPrecision( Date theDate) {
- myDate = new DateTimeDt(theDate);
- return this;
- }
-
-
- /**
- * Gets the value(s) for description ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A free text natural language description of the StructureDefinition and its use
- *
- */
- public StringDt getDescriptionElement() {
- if (myDescription == null) {
- myDescription = new StringDt();
- }
- return myDescription;
- }
-
-
- /**
- * Gets the value(s) for description ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A free text natural language description of the StructureDefinition and its use
- *
- */
- public String getDescription() {
- return getDescriptionElement().getValue();
- }
-
- /**
- * Sets the value(s) for description ()
- *
- *
- * Definition:
- * A free text natural language description of the StructureDefinition and its use
- *
- */
- public StructureDefinition setDescription(StringDt theValue) {
- myDescription = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for description ()
- *
- *
- * Definition:
- * A free text natural language description of the StructureDefinition and its use
- *
- */
- public StructureDefinition setDescription( String theString) {
- myDescription = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for useContext ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.
- *
- */
- public java.util.List getUseContext() {
- if (myUseContext == null) {
- myUseContext = new java.util.ArrayList();
- }
- return myUseContext;
- }
-
- /**
- * Sets the value(s) for useContext ()
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.
- *
- */
- public StructureDefinition setUseContext(java.util.List theValue) {
- myUseContext = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for useContext ()
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.
- *
- */
- public CodeableConceptDt addUseContext() {
- CodeableConceptDt newType = new CodeableConceptDt();
- getUseContext().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for useContext ()
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.
- *
- * @param theValue The useContext to add (must not be null)
- */
- public StructureDefinition addUseContext(CodeableConceptDt theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getUseContext().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for useContext (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.
- *
- */
- public CodeableConceptDt getUseContextFirstRep() {
- if (getUseContext().isEmpty()) {
- return addUseContext();
- }
- return getUseContext().get(0);
- }
-
- /**
- * Gets the value(s) for requirements (why).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Explains why this structure definition is needed and why it's been constrained as it has
- *
- */
- public StringDt getRequirementsElement() {
- if (myRequirements == null) {
- myRequirements = new StringDt();
- }
- return myRequirements;
- }
-
-
- /**
- * Gets the value(s) for requirements (why).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Explains why this structure definition is needed and why it's been constrained as it has
- *
- */
- public String getRequirements() {
- return getRequirementsElement().getValue();
- }
-
- /**
- * Sets the value(s) for requirements (why)
- *
- *
- * Definition:
- * Explains why this structure definition is needed and why it's been constrained as it has
- *
- */
- public StructureDefinition setRequirements(StringDt theValue) {
- myRequirements = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for requirements (why)
- *
- *
- * Definition:
- * Explains why this structure definition is needed and why it's been constrained as it has
- *
- */
- public StructureDefinition setRequirements( String theString) {
- myRequirements = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for copyright ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings
- *
- */
- public StringDt getCopyrightElement() {
- if (myCopyright == null) {
- myCopyright = new StringDt();
- }
- return myCopyright;
- }
-
-
- /**
- * Gets the value(s) for copyright ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings
- *
- */
- public String getCopyright() {
- return getCopyrightElement().getValue();
- }
-
- /**
- * Sets the value(s) for copyright ()
- *
- *
- * Definition:
- * A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings
- *
- */
- public StructureDefinition setCopyright(StringDt theValue) {
- myCopyright = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for copyright ()
- *
- *
- * Definition:
- * A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings
- *
- */
- public StructureDefinition setCopyright( String theString) {
- myCopyright = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for code ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A set of terms from external terminologies that may be used to assist with indexing and searching of templates.
- *
- */
- public java.util.List getCode() {
- if (myCode == null) {
- myCode = new java.util.ArrayList();
- }
- return myCode;
- }
-
- /**
- * Sets the value(s) for code ()
- *
- *
- * Definition:
- * A set of terms from external terminologies that may be used to assist with indexing and searching of templates.
- *
- */
- public StructureDefinition setCode(java.util.List theValue) {
- myCode = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for code ()
- *
- *
- * Definition:
- * A set of terms from external terminologies that may be used to assist with indexing and searching of templates.
- *
- */
- public CodingDt addCode() {
- CodingDt newType = new CodingDt();
- getCode().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for code ()
- *
- *
- * Definition:
- * A set of terms from external terminologies that may be used to assist with indexing and searching of templates.
- *
- * @param theValue The code to add (must not be null)
- */
- public StructureDefinition addCode(CodingDt theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getCode().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for code (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * A set of terms from external terminologies that may be used to assist with indexing and searching of templates.
- *
- */
- public CodingDt getCodeFirstRep() {
- if (getCode().isEmpty()) {
- return addCode();
- }
- return getCode().get(0);
- }
-
- /**
- * Gets the value(s) for fhirVersion ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is $version$ for this version
- *
- */
- public IdDt getFhirVersionElement() {
- if (myFhirVersion == null) {
- myFhirVersion = new IdDt();
- }
- return myFhirVersion;
- }
-
-
- /**
- * Gets the value(s) for fhirVersion ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is $version$ for this version
- *
- */
- public String getFhirVersion() {
- return getFhirVersionElement().getValue();
- }
-
- /**
- * Sets the value(s) for fhirVersion ()
- *
- *
- * Definition:
- * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is $version$ for this version
- *
- */
- public StructureDefinition setFhirVersion(IdDt theValue) {
- myFhirVersion = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for fhirVersion ()
- *
- *
- * Definition:
- * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is $version$ for this version
- *
- */
- public StructureDefinition setFhirVersion( String theId) {
- myFhirVersion = new IdDt(theId);
- return this;
- }
-
-
- /**
- * Gets the value(s) for mapping ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An external specification that the content is mapped to
- *
- */
- public java.util.List getMapping() {
- if (myMapping == null) {
- myMapping = new java.util.ArrayList();
- }
- return myMapping;
- }
-
- /**
- * Sets the value(s) for mapping ()
- *
- *
- * Definition:
- * An external specification that the content is mapped to
- *
- */
- public StructureDefinition setMapping(java.util.List theValue) {
- myMapping = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for mapping ()
- *
- *
- * Definition:
- * An external specification that the content is mapped to
- *
- */
- public Mapping addMapping() {
- Mapping newType = new Mapping();
- getMapping().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for mapping ()
- *
- *
- * Definition:
- * An external specification that the content is mapped to
- *
- * @param theValue The mapping to add (must not be null)
- */
- public StructureDefinition addMapping(Mapping theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getMapping().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for mapping (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * An external specification that the content is mapped to
- *
- */
- public Mapping getMappingFirstRep() {
- if (getMapping().isEmpty()) {
- return addMapping();
- }
- return getMapping().get(0);
- }
-
- /**
- * Gets the value(s) for kind ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Defines the kind of structure that this definition is describing
- *
- */
- public BoundCodeDt getKindElement() {
- if (myKind == null) {
- myKind = new BoundCodeDt(StructureDefinitionKindEnum.VALUESET_BINDER);
- }
- return myKind;
- }
-
-
- /**
- * Gets the value(s) for kind ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Defines the kind of structure that this definition is describing
- *
- */
- public String getKind() {
- return getKindElement().getValue();
- }
-
- /**
- * Sets the value(s) for kind ()
- *
- *
- * Definition:
- * Defines the kind of structure that this definition is describing
- *
- * Definition:
- * Defines the kind of structure that this definition is describing
- *
- */
- public StructureDefinition setKind(StructureDefinitionKindEnum theValue) {
- getKindElement().setValueAsEnum(theValue);
- return this;
- }
-
-
- /**
- * Gets the value(s) for constrainedType ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The type of type that is being constrained - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is a constraint. If it is not present, then the structure definition is the definition of a base structure
- *
- */
- public CodeDt getConstrainedTypeElement() {
- if (myConstrainedType == null) {
- myConstrainedType = new CodeDt();
- }
- return myConstrainedType;
- }
-
-
- /**
- * Gets the value(s) for constrainedType ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The type of type that is being constrained - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is a constraint. If it is not present, then the structure definition is the definition of a base structure
- *
- */
- public String getConstrainedType() {
- return getConstrainedTypeElement().getValue();
- }
-
- /**
- * Sets the value(s) for constrainedType ()
- *
- *
- * Definition:
- * The type of type that is being constrained - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is a constraint. If it is not present, then the structure definition is the definition of a base structure
- *
- */
- public StructureDefinition setConstrainedType(CodeDt theValue) {
- myConstrainedType = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for constrainedType ()
- *
- *
- * Definition:
- * The type of type that is being constrained - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is a constraint. If it is not present, then the structure definition is the definition of a base structure
- *
- */
- public StructureDefinition setConstrainedType( String theCode) {
- myConstrainedType = new CodeDt(theCode);
- return this;
- }
-
-
- /**
- * Gets the value(s) for abstract ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type
- *
- */
- public BooleanDt getAbstractElement() {
- if (myAbstract == null) {
- myAbstract = new BooleanDt();
- }
- return myAbstract;
- }
-
-
- /**
- * Gets the value(s) for abstract ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type
- *
- */
- public Boolean getAbstract() {
- return getAbstractElement().getValue();
- }
-
- /**
- * Sets the value(s) for abstract ()
- *
- *
- * Definition:
- * Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type
- *
- */
- public StructureDefinition setAbstract(BooleanDt theValue) {
- myAbstract = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for abstract ()
- *
- *
- * Definition:
- * Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type
- *
- */
- public StructureDefinition setAbstract( boolean theBoolean) {
- myAbstract = new BooleanDt(theBoolean);
- return this;
- }
-
-
- /**
- * Gets the value(s) for contextType ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If this is an extension, Identifies the context within FHIR resources where the extension can be used
- *
- */
- public BoundCodeDt getContextTypeElement() {
- if (myContextType == null) {
- myContextType = new BoundCodeDt(ExtensionContextEnum.VALUESET_BINDER);
- }
- return myContextType;
- }
-
-
- /**
- * Gets the value(s) for contextType ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If this is an extension, Identifies the context within FHIR resources where the extension can be used
- *
- */
- public String getContextType() {
- return getContextTypeElement().getValue();
- }
-
- /**
- * Sets the value(s) for contextType ()
- *
- *
- * Definition:
- * If this is an extension, Identifies the context within FHIR resources where the extension can be used
- *
- * Definition:
- * If this is an extension, Identifies the context within FHIR resources where the extension can be used
- *
- */
- public StructureDefinition setContextType(ExtensionContextEnum theValue) {
- getContextTypeElement().setValueAsEnum(theValue);
- return this;
- }
-
-
- /**
- * Gets the value(s) for context ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Identifies the types of resource or data type elements to which the extension can be applied
- *
- */
- public java.util.List getContext() {
- if (myContext == null) {
- myContext = new java.util.ArrayList();
- }
- return myContext;
- }
-
- /**
- * Sets the value(s) for context ()
- *
- *
- * Definition:
- * Identifies the types of resource or data type elements to which the extension can be applied
- *
- */
- public StructureDefinition setContext(java.util.List theValue) {
- myContext = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for context ()
- *
- *
- * Definition:
- * Identifies the types of resource or data type elements to which the extension can be applied
- *
- */
- public StringDt addContext() {
- StringDt newType = new StringDt();
- getContext().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for context ()
- *
- *
- * Definition:
- * Identifies the types of resource or data type elements to which the extension can be applied
- *
- * @param theValue The context to add (must not be null)
- */
- public StructureDefinition addContext(StringDt theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getContext().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for context (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Identifies the types of resource or data type elements to which the extension can be applied
- *
- */
- public StringDt getContextFirstRep() {
- if (getContext().isEmpty()) {
- return addContext();
- }
- return getContext().get(0);
- }
- /**
- * Adds a new value for context ()
- *
- *
- * Definition:
- * Identifies the types of resource or data type elements to which the extension can be applied
- *
- *
- * @return Returns a reference to this object, to allow for simple chaining.
- */
- public StructureDefinition addContext( String theString) {
- if (myContext == null) {
- myContext = new java.util.ArrayList();
- }
- myContext.add(new StringDt(theString));
- return this;
- }
-
-
- /**
- * Gets the value(s) for base ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URI that is the base structure from which this set of constraints is derived
- *
- */
- public UriDt getBaseElement() {
- if (myBase == null) {
- myBase = new UriDt();
- }
- return myBase;
- }
-
-
- /**
- * Gets the value(s) for base ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URI that is the base structure from which this set of constraints is derived
- *
- */
- public String getBase() {
- return getBaseElement().getValue();
- }
-
- /**
- * Sets the value(s) for base ()
- *
- *
- * Definition:
- * An absolute URI that is the base structure from which this set of constraints is derived
- *
- */
- public StructureDefinition setBase(UriDt theValue) {
- myBase = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for base ()
- *
- *
- * Definition:
- * An absolute URI that is the base structure from which this set of constraints is derived
- *
- */
- public StructureDefinition setBase( String theUri) {
- myBase = new UriDt(theUri);
- return this;
- }
-
-
- /**
- * Gets the value(s) for snapshot ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition
- *
- */
- public Snapshot getSnapshot() {
- if (mySnapshot == null) {
- mySnapshot = new Snapshot();
- }
- return mySnapshot;
- }
-
- /**
- * Sets the value(s) for snapshot ()
- *
- *
- * Definition:
- * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition
- *
- */
- public StructureDefinition setSnapshot(Snapshot theValue) {
- mySnapshot = theValue;
- return this;
- }
-
-
-
-
- /**
- * Gets the value(s) for differential ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies
- *
- */
- public Differential getDifferential() {
- if (myDifferential == null) {
- myDifferential = new Differential();
- }
- return myDifferential;
- }
-
- /**
- * Sets the value(s) for differential ()
- *
- *
- * Definition:
- * A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- @Block()
- public static class Contact
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="name", type=StringDt.class, order=0, min=0, max=1, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="The name of an individual to contact regarding the structure definition"
- )
- private StringDt myName;
-
- @Child(name="telecom", type=ContactPointDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Contact details for individual (if a name was provided) or the publisher"
- )
- private java.util.List myTelecom;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myTelecom);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myTelecom);
- }
-
- /**
- * Gets the value(s) for name ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The name of an individual to contact regarding the structure definition
- *
- */
- public StringDt getNameElement() {
- if (myName == null) {
- myName = new StringDt();
- }
- return myName;
- }
-
-
- /**
- * Gets the value(s) for name ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The name of an individual to contact regarding the structure definition
- *
- */
- public String getName() {
- return getNameElement().getValue();
- }
-
- /**
- * Sets the value(s) for name ()
- *
- *
- * Definition:
- * The name of an individual to contact regarding the structure definition
- *
- */
- public Contact setName(StringDt theValue) {
- myName = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for name ()
- *
- *
- * Definition:
- * The name of an individual to contact regarding the structure definition
- *
- */
- public Contact setName( String theString) {
- myName = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for telecom ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- */
- public java.util.List getTelecom() {
- if (myTelecom == null) {
- myTelecom = new java.util.ArrayList();
- }
- return myTelecom;
- }
-
- /**
- * Sets the value(s) for telecom ()
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- */
- public Contact setTelecom(java.util.List theValue) {
- myTelecom = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for telecom ()
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- */
- public ContactPointDt addTelecom() {
- ContactPointDt newType = new ContactPointDt();
- getTelecom().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for telecom ()
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- * @param theValue The telecom to add (must not be null)
- */
- public Contact addTelecom(ContactPointDt theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getTelecom().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for telecom (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- * Definition:
- * An external specification that the content is mapped to
- *
- */
- @Block()
- public static class Mapping
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="identity", type=IdDt.class, order=0, min=1, max=1, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made"
- )
- private IdDt myIdentity;
-
- @Child(name="uri", type=UriDt.class, order=1, min=0, max=1, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to"
- )
- private UriDt myUri;
-
- @Child(name="name", type=StringDt.class, order=2, min=0, max=1, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="A name for the specification that is being mapped to"
- )
- private StringDt myName;
-
- @Child(name="comments", type=StringDt.class, order=3, min=0, max=1, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage"
- )
- private StringDt myComments;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentity, myUri, myName, myComments);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentity, myUri, myName, myComments);
- }
-
- /**
- * Gets the value(s) for identity ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An Internal id that is used to identify this mapping set when specific mappings are made
- *
- */
- public IdDt getIdentityElement() {
- if (myIdentity == null) {
- myIdentity = new IdDt();
- }
- return myIdentity;
- }
-
-
- /**
- * Gets the value(s) for identity ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An Internal id that is used to identify this mapping set when specific mappings are made
- *
- */
- public String getIdentity() {
- return getIdentityElement().getValue();
- }
-
- /**
- * Sets the value(s) for identity ()
- *
- *
- * Definition:
- * An Internal id that is used to identify this mapping set when specific mappings are made
- *
- */
- public Mapping setIdentity(IdDt theValue) {
- myIdentity = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for identity ()
- *
- *
- * Definition:
- * An Internal id that is used to identify this mapping set when specific mappings are made
- *
- */
- public Mapping setIdentity( String theId) {
- myIdentity = new IdDt(theId);
- return this;
- }
-
-
- /**
- * Gets the value(s) for uri ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URI that identifies the specification that this mapping is expressed to
- *
- */
- public UriDt getUriElement() {
- if (myUri == null) {
- myUri = new UriDt();
- }
- return myUri;
- }
-
-
- /**
- * Gets the value(s) for uri ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URI that identifies the specification that this mapping is expressed to
- *
- */
- public String getUri() {
- return getUriElement().getValue();
- }
-
- /**
- * Sets the value(s) for uri ()
- *
- *
- * Definition:
- * An absolute URI that identifies the specification that this mapping is expressed to
- *
- */
- public Mapping setUri(UriDt theValue) {
- myUri = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for uri ()
- *
- *
- * Definition:
- * An absolute URI that identifies the specification that this mapping is expressed to
- *
- */
- public Mapping setUri( String theUri) {
- myUri = new UriDt(theUri);
- return this;
- }
-
-
- /**
- * Gets the value(s) for name ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A name for the specification that is being mapped to
- *
- */
- public StringDt getNameElement() {
- if (myName == null) {
- myName = new StringDt();
- }
- return myName;
- }
-
-
- /**
- * Gets the value(s) for name ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A name for the specification that is being mapped to
- *
- */
- public String getName() {
- return getNameElement().getValue();
- }
-
- /**
- * Sets the value(s) for name ()
- *
- *
- * Definition:
- * A name for the specification that is being mapped to
- *
- */
- public Mapping setName(StringDt theValue) {
- myName = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for name ()
- *
- *
- * Definition:
- * A name for the specification that is being mapped to
- *
- */
- public Mapping setName( String theString) {
- myName = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for comments ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage
- *
- */
- public StringDt getCommentsElement() {
- if (myComments == null) {
- myComments = new StringDt();
- }
- return myComments;
- }
-
-
- /**
- * Gets the value(s) for comments ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage
- *
- */
- public String getComments() {
- return getCommentsElement().getValue();
- }
-
- /**
- * Sets the value(s) for comments ()
- *
- *
- * Definition:
- * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage
- *
- */
- public Mapping setComments(StringDt theValue) {
- myComments = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for comments ()
- *
- *
- * Definition:
- * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage
- *
- * Definition:
- * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition
- *
- */
- @Block()
- public static class Snapshot
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="element", type=ElementDefinitionDt.class, order=0, min=1, max=Child.MAX_UNLIMITED, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Captures constraints on each element within the resource"
- )
- private java.util.List myElement;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myElement);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myElement);
- }
-
- /**
- * Gets the value(s) for element ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- */
- public java.util.List getElement() {
- if (myElement == null) {
- myElement = new java.util.ArrayList();
- }
- return myElement;
- }
-
- /**
- * Sets the value(s) for element ()
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- */
- public Snapshot setElement(java.util.List theValue) {
- myElement = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for element ()
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- */
- public ElementDefinitionDt addElement() {
- ElementDefinitionDt newType = new ElementDefinitionDt();
- getElement().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for element ()
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- * @param theValue The element to add (must not be null)
- */
- public Snapshot addElement(ElementDefinitionDt theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getElement().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for element (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- * Definition:
- * A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies
- *
- */
- @Block()
- public static class Differential
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="element", type=ElementDefinitionDt.class, order=0, min=1, max=Child.MAX_UNLIMITED, summary=false, modifier=false)
- @Description(
- shortDefinition="",
- formalDefinition="Captures constraints on each element within the resource"
- )
- private java.util.List myElement;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myElement);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myElement);
- }
-
- /**
- * Gets the value(s) for element ().
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- */
- public java.util.List getElement() {
- if (myElement == null) {
- myElement = new java.util.ArrayList();
- }
- return myElement;
- }
-
- /**
- * Sets the value(s) for element ()
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- */
- public Differential setElement(java.util.List theValue) {
- myElement = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for element ()
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- */
- public ElementDefinitionDt addElement() {
- ElementDefinitionDt newType = new ElementDefinitionDt();
- getElement().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for element ()
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- * @param theValue The element to add (must not be null)
- */
- public Differential addElement(ElementDefinitionDt theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getElement().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for element (),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Captures constraints on each element within the resource
- *
- * Description: The logical url for the value set
- * Type: uri
- * Path: ValueSet.url
- *
- */
- @SearchParamDefinition(name="url", path="ValueSet.url", description="The logical url for the value set", type="uri" )
- public static final String SP_URL = "url";
-
- /**
- * Fluent Client search parameter constant for url
- *
- * Description: The logical url for the value set
- * Type: uri
- * Path: ValueSet.url
- *
- */
- public static final UriClientParam URL = new UriClientParam(SP_URL);
-
- /**
- * Search parameter constant for identifier
- *
- * Description: The identifier for the value set
- * Type: token
- * Path: ValueSet.identifier
- *
- */
- @SearchParamDefinition(name="identifier", path="ValueSet.identifier", description="The identifier for the value set", type="token" )
- public static final String SP_IDENTIFIER = "identifier";
-
- /**
- * Fluent Client search parameter constant for identifier
- *
- * Description: The identifier for the value set
- * Type: token
- * Path: ValueSet.identifier
- *
- */
- public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
-
- /**
- * Search parameter constant for version
- *
- * Description: The version identifier of the value set
- * Type: token
- * Path: ValueSet.version
- *
- */
- @SearchParamDefinition(name="version", path="ValueSet.version", description="The version identifier of the value set", type="token" )
- public static final String SP_VERSION = "version";
-
- /**
- * Fluent Client search parameter constant for version
- *
- * Description: The version identifier of the value set
- * Type: token
- * Path: ValueSet.version
- *
- */
- public static final TokenClientParam VERSION = new TokenClientParam(SP_VERSION);
-
- /**
- * Search parameter constant for name
- *
- * Description: The name of the value set
- * Type: string
- * Path: ValueSet.name
- *
- */
- @SearchParamDefinition(name="name", path="ValueSet.name", description="The name of the value set", type="string" )
- public static final String SP_NAME = "name";
-
- /**
- * Fluent Client search parameter constant for name
- *
- * Description: The name of the value set
- * Type: string
- * Path: ValueSet.name
- *
- */
- public static final StringClientParam NAME = new StringClientParam(SP_NAME);
-
- /**
- * Search parameter constant for publisher
- *
- * Description: Name of the publisher of the value set
- * Type: string
- * Path: ValueSet.publisher
- *
- */
- @SearchParamDefinition(name="publisher", path="ValueSet.publisher", description="Name of the publisher of the value set", type="string" )
- public static final String SP_PUBLISHER = "publisher";
-
- /**
- * Fluent Client search parameter constant for publisher
- *
- * Description: Name of the publisher of the value set
- * Type: string
- * Path: ValueSet.publisher
- *
- */
- public static final StringClientParam PUBLISHER = new StringClientParam(SP_PUBLISHER);
-
- /**
- * Search parameter constant for description
- *
- * Description: Text search in the description of the value set
- * Type: string
- * Path: ValueSet.description
- *
- */
- @SearchParamDefinition(name="description", path="ValueSet.description", description="Text search in the description of the value set", type="string" )
- public static final String SP_DESCRIPTION = "description";
-
- /**
- * Fluent Client search parameter constant for description
- *
- * Description: Text search in the description of the value set
- * Type: string
- * Path: ValueSet.description
- *
- */
- public static final StringClientParam DESCRIPTION = new StringClientParam(SP_DESCRIPTION);
-
- /**
- * Search parameter constant for status
- *
- * Description: The status of the value set
- * Type: token
- * Path: ValueSet.status
- *
- */
- @SearchParamDefinition(name="status", path="ValueSet.status", description="The status of the value set", type="token" )
- public static final String SP_STATUS = "status";
-
- /**
- * Fluent Client search parameter constant for status
- *
- * Description: The status of the value set
- * Type: token
- * Path: ValueSet.status
- *
- */
- public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
-
- /**
- * Search parameter constant for date
- *
- * Description: The value set publication date
- * Type: date
- * Path: ValueSet.date
- *
- */
- @SearchParamDefinition(name="date", path="ValueSet.date", description="The value set publication date", type="date" )
- public static final String SP_DATE = "date";
-
- /**
- * Fluent Client search parameter constant for date
- *
- * Description: The value set publication date
- * Type: date
- * Path: ValueSet.date
- *
- */
- public static final DateClientParam DATE = new DateClientParam(SP_DATE);
-
- /**
- * Search parameter constant for system
- *
- * Description: The system for any codes defined by this value set
- * Type: uri
- * Path: ValueSet.codeSystem.system
- *
- */
- @SearchParamDefinition(name="system", path="ValueSet.codeSystem.system", description="The system for any codes defined by this value set", type="uri" )
- public static final String SP_SYSTEM = "system";
-
- /**
- * Fluent Client search parameter constant for system
- *
- * Description: The system for any codes defined by this value set
- * Type: uri
- * Path: ValueSet.codeSystem.system
- *
- */
- public static final UriClientParam SYSTEM = new UriClientParam(SP_SYSTEM);
-
- /**
- * Search parameter constant for code
- *
- * Description: A code defined in the value set
- * Type: token
- * Path: ValueSet.codeSystem.concept.code
- *
- */
- @SearchParamDefinition(name="code", path="ValueSet.codeSystem.concept.code", description="A code defined in the value set", type="token" )
- public static final String SP_CODE = "code";
-
- /**
- * Fluent Client search parameter constant for code
- *
- * Description: A code defined in the value set
- * Type: token
- * Path: ValueSet.codeSystem.concept.code
- *
- */
- public static final TokenClientParam CODE = new TokenClientParam(SP_CODE);
-
- /**
- * Search parameter constant for reference
- *
- * Description: A code system included or excluded in the value set or an imported value set
- * Type: uri
- * Path: ValueSet.compose.include.system
- *
- */
- @SearchParamDefinition(name="reference", path="ValueSet.compose.include.system", description="A code system included or excluded in the value set or an imported value set", type="uri" )
- public static final String SP_REFERENCE = "reference";
-
- /**
- * Fluent Client search parameter constant for reference
- *
- * Description: A code system included or excluded in the value set or an imported value set
- * Type: uri
- * Path: ValueSet.compose.include.system
- *
- */
- public static final UriClientParam REFERENCE = new UriClientParam(SP_REFERENCE);
-
- /**
- * Search parameter constant for context
- *
- * Description: A use context assigned to the value set
- * Type: token
- * Path: ValueSet.useContext
- *
- */
- @SearchParamDefinition(name="context", path="ValueSet.useContext", description="A use context assigned to the value set", type="token" )
- public static final String SP_CONTEXT = "context";
-
- /**
- * Fluent Client search parameter constant for context
- *
- * Description: A use context assigned to the value set
- * Type: token
- * Path: ValueSet.useContext
- *
- */
- public static final TokenClientParam CONTEXT = new TokenClientParam(SP_CONTEXT);
-
- /**
- * Search parameter constant for expansion
- *
- */
- public static final UriClientParam EXPANSION = new UriClientParam(SP_EXPANSION);
-
-
-
- @Child(name="url", type=UriDt.class, order=0, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.url",
- formalDefinition="An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published"
- )
- private UriDt myUrl;
-
- @Child(name="identifier", type=IdentifierDt.class, order=1, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.identifier",
- formalDefinition="Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance."
- )
- private IdentifierDt myIdentifier;
-
- @Child(name="version", type=StringDt.class, order=2, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.version",
- formalDefinition="Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp"
- )
- private StringDt myVersion;
-
- @Child(name="name", type=StringDt.class, order=3, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.name",
- formalDefinition="A free text natural language name describing the value set"
- )
- private StringDt myName;
-
- @Child(name="status", type=CodeDt.class, order=4, min=1, max=1)
- @Description(
- shortDefinition="ValueSet.status",
- formalDefinition="The status of the value set"
- )
- private CodeDt myStatus;
-
- @Child(name="experimental", type=BooleanDt.class, order=5, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.experimental",
- formalDefinition="This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage"
- )
- private BooleanDt myExperimental;
-
- @Child(name="publisher", type=StringDt.class, order=6, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.publisher",
- formalDefinition="The name of the individual or organization that published the value set"
- )
- private StringDt myPublisher;
-
- @Child(name="contact", order=7, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="ValueSet.contact",
- formalDefinition="Contacts to assist a user in finding and communicating with the publisher"
- )
- private java.util.List myContact;
-
- @Child(name="date", type=DateTimeDt.class, order=8, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.date",
- formalDefinition="The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the implementation guide changes (e.g. the 'content logical definition')"
- )
- private DateTimeDt myDate;
-
- @Child(name="lockedDate", type=DateDt.class, order=9, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.lockedDate",
- formalDefinition="If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date"
- )
- private DateDt myLockedDate;
-
- @Child(name="description", type=StringDt.class, order=10, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.description",
- formalDefinition="A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set."
- )
- private StringDt myDescription;
-
- @Child(name="useContext", type=CodeableConceptDt.class, order=11, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="ValueSet.useContext",
- formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions."
- )
- private java.util.List myUseContext;
-
- @Child(name="immutable", type=BooleanDt.class, order=12, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.immutable",
- formalDefinition="If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change"
- )
- private BooleanDt myImmutable;
-
- @Child(name="requirements", type=StringDt.class, order=13, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.requirements",
- formalDefinition="Explains why this value set is needed and why it's been constrained as it has"
- )
- private StringDt myRequirements;
-
- @Child(name="copyright", type=StringDt.class, order=14, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.copyright",
- formalDefinition="A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set"
- )
- private StringDt myCopyright;
-
- @Child(name="extensible", type=BooleanDt.class, order=15, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.extensible",
- formalDefinition="Whether this is intended to be used with an extensible binding or not"
- )
- private BooleanDt myExtensible;
-
- @Child(name="codeSystem", order=16, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem",
- formalDefinition="A definition of an code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to it's (codeSystem.system) directly"
- )
- private CodeSystem myCodeSystem;
-
- @Child(name="compose", order=17, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.compose",
- formalDefinition="A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set"
- )
- private Compose myCompose;
-
- @Child(name="expansion", order=18, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.expansion",
- formalDefinition="A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed"
- )
- private Expansion myExpansion;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUrl, myIdentifier, myVersion, myName, myStatus, myExperimental, myPublisher, myContact, myDate, myLockedDate, myDescription, myUseContext, myImmutable, myRequirements, myCopyright, myExtensible, myCodeSystem, myCompose, myExpansion);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUrl, myIdentifier, myVersion, myName, myStatus, myExperimental, myPublisher, myContact, myDate, myLockedDate, myDescription, myUseContext, myImmutable, myRequirements, myCopyright, myExtensible, myCodeSystem, myCompose, myExpansion);
- }
-
- /**
- * Gets the value(s) for url (ValueSet.url).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published
- *
- */
- public UriDt getUrlElement() {
- if (myUrl == null) {
- myUrl = new UriDt();
- }
- return myUrl;
- }
-
-
- /**
- * Gets the value(s) for url (ValueSet.url).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published
- *
- */
- public String getUrl() {
- return getUrlElement().getValue();
- }
-
- /**
- * Sets the value(s) for url (ValueSet.url)
- *
- *
- * Definition:
- * An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published
- *
- */
- public ValueSet setUrl(UriDt theValue) {
- myUrl = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for url (ValueSet.url)
- *
- *
- * Definition:
- * An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published
- *
- */
- public ValueSet setUrl( String theUri) {
- myUrl = new UriDt(theUri);
- return this;
- }
-
-
- /**
- * Gets the value(s) for identifier (ValueSet.identifier).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.
- *
- */
- public IdentifierDt getIdentifier() {
- if (myIdentifier == null) {
- myIdentifier = new IdentifierDt();
- }
- return myIdentifier;
- }
-
- /**
- * Sets the value(s) for identifier (ValueSet.identifier)
- *
- *
- * Definition:
- * Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.
- *
- */
- public ValueSet setIdentifier(IdentifierDt theValue) {
- myIdentifier = theValue;
- return this;
- }
-
-
-
-
- /**
- * Gets the value(s) for version (ValueSet.version).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp
- *
- */
- public StringDt getVersionElement() {
- if (myVersion == null) {
- myVersion = new StringDt();
- }
- return myVersion;
- }
-
-
- /**
- * Gets the value(s) for version (ValueSet.version).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp
- *
- */
- public String getVersion() {
- return getVersionElement().getValue();
- }
-
- /**
- * Sets the value(s) for version (ValueSet.version)
- *
- *
- * Definition:
- * Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp
- *
- */
- public ValueSet setVersion(StringDt theValue) {
- myVersion = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for version (ValueSet.version)
- *
- *
- * Definition:
- * Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp
- *
- */
- public ValueSet setVersion( String theString) {
- myVersion = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for name (ValueSet.name).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A free text natural language name describing the value set
- *
- */
- public StringDt getNameElement() {
- if (myName == null) {
- myName = new StringDt();
- }
- return myName;
- }
-
-
- /**
- * Gets the value(s) for name (ValueSet.name).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A free text natural language name describing the value set
- *
- */
- public String getName() {
- return getNameElement().getValue();
- }
-
- /**
- * Sets the value(s) for name (ValueSet.name)
- *
- *
- * Definition:
- * A free text natural language name describing the value set
- *
- */
- public ValueSet setName(StringDt theValue) {
- myName = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for name (ValueSet.name)
- *
- *
- * Definition:
- * A free text natural language name describing the value set
- *
- */
- public ValueSet setName( String theString) {
- myName = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for status (ValueSet.status).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The status of the value set
- *
- */
- public CodeDt getStatusElement() {
- if (myStatus == null) {
- myStatus = new CodeDt();
- }
- return myStatus;
- }
-
-
- /**
- * Gets the value(s) for status (ValueSet.status).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The status of the value set
- *
- */
- public String getStatus() {
- return getStatusElement().getValue();
- }
-
- /**
- * Sets the value(s) for status (ValueSet.status)
- *
- *
- * Definition:
- * The status of the value set
- *
- */
- public ValueSet setStatus(CodeDt theValue) {
- myStatus = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for status (ValueSet.status)
- *
- *
- * Definition:
- * The status of the value set
- *
- */
- public ValueSet setStatus( String theCode) {
- myStatus = new CodeDt(theCode);
- return this;
- }
-
-
- /**
- * Gets the value(s) for experimental (ValueSet.experimental).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public BooleanDt getExperimentalElement() {
- if (myExperimental == null) {
- myExperimental = new BooleanDt();
- }
- return myExperimental;
- }
-
-
- /**
- * Gets the value(s) for experimental (ValueSet.experimental).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public Boolean getExperimental() {
- return getExperimentalElement().getValue();
- }
-
- /**
- * Sets the value(s) for experimental (ValueSet.experimental)
- *
- *
- * Definition:
- * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public ValueSet setExperimental(BooleanDt theValue) {
- myExperimental = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for experimental (ValueSet.experimental)
- *
- *
- * Definition:
- * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public ValueSet setExperimental( boolean theBoolean) {
- myExperimental = new BooleanDt(theBoolean);
- return this;
- }
-
-
- /**
- * Gets the value(s) for publisher (ValueSet.publisher).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The name of the individual or organization that published the value set
- *
- */
- public StringDt getPublisherElement() {
- if (myPublisher == null) {
- myPublisher = new StringDt();
- }
- return myPublisher;
- }
-
-
- /**
- * Gets the value(s) for publisher (ValueSet.publisher).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The name of the individual or organization that published the value set
- *
- */
- public String getPublisher() {
- return getPublisherElement().getValue();
- }
-
- /**
- * Sets the value(s) for publisher (ValueSet.publisher)
- *
- *
- * Definition:
- * The name of the individual or organization that published the value set
- *
- */
- public ValueSet setPublisher(StringDt theValue) {
- myPublisher = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for publisher (ValueSet.publisher)
- *
- *
- * Definition:
- * The name of the individual or organization that published the value set
- *
- */
- public ValueSet setPublisher( String theString) {
- myPublisher = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for contact (ValueSet.contact).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- public java.util.List getContact() {
- if (myContact == null) {
- myContact = new java.util.ArrayList();
- }
- return myContact;
- }
-
- /**
- * Sets the value(s) for contact (ValueSet.contact)
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- public ValueSet setContact(java.util.List theValue) {
- myContact = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for contact (ValueSet.contact)
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- public Contact addContact() {
- Contact newType = new Contact();
- getContact().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for contact (ValueSet.contact)
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- * @param theValue The contact to add (must not be null)
- */
- public ValueSet addContact(Contact theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getContact().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for contact (ValueSet.contact),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- public Contact getContactFirstRep() {
- if (getContact().isEmpty()) {
- return addContact();
- }
- return getContact().get(0);
- }
-
- /**
- * Gets the value(s) for date (ValueSet.date).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the implementation guide changes (e.g. the 'content logical definition')
- *
- */
- public DateTimeDt getDateElement() {
- if (myDate == null) {
- myDate = new DateTimeDt();
- }
- return myDate;
- }
-
-
- /**
- * Gets the value(s) for date (ValueSet.date).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the implementation guide changes (e.g. the 'content logical definition')
- *
- */
- public Date getDate() {
- return getDateElement().getValue();
- }
-
- /**
- * Sets the value(s) for date (ValueSet.date)
- *
- *
- * Definition:
- * The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the implementation guide changes (e.g. the 'content logical definition')
- *
- */
- public ValueSet setDate(DateTimeDt theValue) {
- myDate = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for date (ValueSet.date)
- *
- *
- * Definition:
- * The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the implementation guide changes (e.g. the 'content logical definition')
- *
- */
- public ValueSet setDate( Date theDate, TemporalPrecisionEnum thePrecision) {
- myDate = new DateTimeDt(theDate, thePrecision);
- return this;
- }
-
- /**
- * Sets the value for date (ValueSet.date)
- *
- *
- * Definition:
- * The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. in addition, it should change when the substantiative content of the implementation guide changes (e.g. the 'content logical definition')
- *
- */
- public ValueSet setDateWithSecondsPrecision( Date theDate) {
- myDate = new DateTimeDt(theDate);
- return this;
- }
-
-
- /**
- * Gets the value(s) for lockedDate (ValueSet.lockedDate).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date
- *
- */
- public DateDt getLockedDateElement() {
- if (myLockedDate == null) {
- myLockedDate = new DateDt();
- }
- return myLockedDate;
- }
-
-
- /**
- * Gets the value(s) for lockedDate (ValueSet.lockedDate).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date
- *
- */
- public Date getLockedDate() {
- return getLockedDateElement().getValue();
- }
-
- /**
- * Sets the value(s) for lockedDate (ValueSet.lockedDate)
- *
- *
- * Definition:
- * If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date
- *
- */
- public ValueSet setLockedDate(DateDt theValue) {
- myLockedDate = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for lockedDate (ValueSet.lockedDate)
- *
- *
- * Definition:
- * If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date
- *
- */
- public ValueSet setLockedDate( Date theDate, TemporalPrecisionEnum thePrecision) {
- myLockedDate = new DateDt(theDate, thePrecision);
- return this;
- }
-
- /**
- * Sets the value for lockedDate (ValueSet.lockedDate)
- *
- *
- * Definition:
- * If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date
- *
- */
- public ValueSet setLockedDateWithDayPrecision( Date theDate) {
- myLockedDate = new DateDt(theDate);
- return this;
- }
-
-
- /**
- * Gets the value(s) for description (ValueSet.description).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.
- *
- */
- public StringDt getDescriptionElement() {
- if (myDescription == null) {
- myDescription = new StringDt();
- }
- return myDescription;
- }
-
-
- /**
- * Gets the value(s) for description (ValueSet.description).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.
- *
- */
- public String getDescription() {
- return getDescriptionElement().getValue();
- }
-
- /**
- * Sets the value(s) for description (ValueSet.description)
- *
- *
- * Definition:
- * A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.
- *
- */
- public ValueSet setDescription(StringDt theValue) {
- myDescription = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for description (ValueSet.description)
- *
- *
- * Definition:
- * A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.
- *
- */
- public ValueSet setDescription( String theString) {
- myDescription = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for useContext (ValueSet.useContext).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.
- *
- */
- public java.util.List getUseContext() {
- if (myUseContext == null) {
- myUseContext = new java.util.ArrayList();
- }
- return myUseContext;
- }
-
- /**
- * Sets the value(s) for useContext (ValueSet.useContext)
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.
- *
- */
- public ValueSet setUseContext(java.util.List theValue) {
- myUseContext = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for useContext (ValueSet.useContext)
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.
- *
- */
- public CodeableConceptDt addUseContext() {
- CodeableConceptDt newType = new CodeableConceptDt();
- getUseContext().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for useContext (ValueSet.useContext)
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.
- *
- * @param theValue The useContext to add (must not be null)
- */
- public ValueSet addUseContext(CodeableConceptDt theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getUseContext().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for useContext (ValueSet.useContext),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.
- *
- */
- public CodeableConceptDt getUseContextFirstRep() {
- if (getUseContext().isEmpty()) {
- return addUseContext();
- }
- return getUseContext().get(0);
- }
-
- /**
- * Gets the value(s) for immutable (ValueSet.immutable).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change
- *
- */
- public BooleanDt getImmutableElement() {
- if (myImmutable == null) {
- myImmutable = new BooleanDt();
- }
- return myImmutable;
- }
-
-
- /**
- * Gets the value(s) for immutable (ValueSet.immutable).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change
- *
- */
- public Boolean getImmutable() {
- return getImmutableElement().getValue();
- }
-
- /**
- * Sets the value(s) for immutable (ValueSet.immutable)
- *
- *
- * Definition:
- * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change
- *
- */
- public ValueSet setImmutable(BooleanDt theValue) {
- myImmutable = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for immutable (ValueSet.immutable)
- *
- *
- * Definition:
- * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change
- *
- */
- public ValueSet setImmutable( boolean theBoolean) {
- myImmutable = new BooleanDt(theBoolean);
- return this;
- }
-
-
- /**
- * Gets the value(s) for requirements (ValueSet.requirements).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Explains why this value set is needed and why it's been constrained as it has
- *
- */
- public StringDt getRequirementsElement() {
- if (myRequirements == null) {
- myRequirements = new StringDt();
- }
- return myRequirements;
- }
-
-
- /**
- * Gets the value(s) for requirements (ValueSet.requirements).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Explains why this value set is needed and why it's been constrained as it has
- *
- */
- public String getRequirements() {
- return getRequirementsElement().getValue();
- }
-
- /**
- * Sets the value(s) for requirements (ValueSet.requirements)
- *
- *
- * Definition:
- * Explains why this value set is needed and why it's been constrained as it has
- *
- */
- public ValueSet setRequirements(StringDt theValue) {
- myRequirements = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for requirements (ValueSet.requirements)
- *
- *
- * Definition:
- * Explains why this value set is needed and why it's been constrained as it has
- *
- */
- public ValueSet setRequirements( String theString) {
- myRequirements = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for copyright (ValueSet.copyright).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set
- *
- */
- public StringDt getCopyrightElement() {
- if (myCopyright == null) {
- myCopyright = new StringDt();
- }
- return myCopyright;
- }
-
-
- /**
- * Gets the value(s) for copyright (ValueSet.copyright).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set
- *
- */
- public String getCopyright() {
- return getCopyrightElement().getValue();
- }
-
- /**
- * Sets the value(s) for copyright (ValueSet.copyright)
- *
- *
- * Definition:
- * A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set
- *
- */
- public ValueSet setCopyright(StringDt theValue) {
- myCopyright = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for copyright (ValueSet.copyright)
- *
- *
- * Definition:
- * A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set
- *
- */
- public ValueSet setCopyright( String theString) {
- myCopyright = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for extensible (ValueSet.extensible).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Whether this is intended to be used with an extensible binding or not
- *
- */
- public BooleanDt getExtensibleElement() {
- if (myExtensible == null) {
- myExtensible = new BooleanDt();
- }
- return myExtensible;
- }
-
-
- /**
- * Gets the value(s) for extensible (ValueSet.extensible).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Whether this is intended to be used with an extensible binding or not
- *
- */
- public Boolean getExtensible() {
- return getExtensibleElement().getValue();
- }
-
- /**
- * Sets the value(s) for extensible (ValueSet.extensible)
- *
- *
- * Definition:
- * Whether this is intended to be used with an extensible binding or not
- *
- */
- public ValueSet setExtensible(BooleanDt theValue) {
- myExtensible = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for extensible (ValueSet.extensible)
- *
- *
- * Definition:
- * Whether this is intended to be used with an extensible binding or not
- *
- */
- public ValueSet setExtensible( boolean theBoolean) {
- myExtensible = new BooleanDt(theBoolean);
- return this;
- }
-
-
- /**
- * Gets the value(s) for codeSystem (ValueSet.codeSystem).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A definition of an code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to it's (codeSystem.system) directly
- *
- */
- public CodeSystem getCodeSystem() {
- if (myCodeSystem == null) {
- myCodeSystem = new CodeSystem();
- }
- return myCodeSystem;
- }
-
- /**
- * Sets the value(s) for codeSystem (ValueSet.codeSystem)
- *
- *
- * Definition:
- * A definition of an code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to it's (codeSystem.system) directly
- *
- */
- public ValueSet setCodeSystem(CodeSystem theValue) {
- myCodeSystem = theValue;
- return this;
- }
-
-
-
-
- /**
- * Gets the value(s) for compose (ValueSet.compose).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set
- *
- */
- public Compose getCompose() {
- if (myCompose == null) {
- myCompose = new Compose();
- }
- return myCompose;
- }
-
- /**
- * Sets the value(s) for compose (ValueSet.compose)
- *
- *
- * Definition:
- * A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set
- *
- */
- public ValueSet setCompose(Compose theValue) {
- myCompose = theValue;
- return this;
- }
-
-
-
-
- /**
- * Gets the value(s) for expansion (ValueSet.expansion).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed
- *
- */
- public Expansion getExpansion() {
- if (myExpansion == null) {
- myExpansion = new Expansion();
- }
- return myExpansion;
- }
-
- /**
- * Sets the value(s) for expansion (ValueSet.expansion)
- *
- *
- * Definition:
- * A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed
- *
- * Definition:
- * Contacts to assist a user in finding and communicating with the publisher
- *
- */
- @Block()
- public static class Contact
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="name", type=StringDt.class, order=0, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.contact.name",
- formalDefinition="The name of an individual to contact regarding the value set"
- )
- private StringDt myName;
-
- @Child(name="telecom", type=ContactPointDt.class, order=1, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="ValueSet.contact.telecom",
- formalDefinition="Contact details for individual (if a name was provided) or the publisher"
- )
- private java.util.List myTelecom;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myTelecom);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myTelecom);
- }
-
- /**
- * Gets the value(s) for name (ValueSet.contact.name).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The name of an individual to contact regarding the value set
- *
- */
- public StringDt getNameElement() {
- if (myName == null) {
- myName = new StringDt();
- }
- return myName;
- }
-
-
- /**
- * Gets the value(s) for name (ValueSet.contact.name).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The name of an individual to contact regarding the value set
- *
- */
- public String getName() {
- return getNameElement().getValue();
- }
-
- /**
- * Sets the value(s) for name (ValueSet.contact.name)
- *
- *
- * Definition:
- * The name of an individual to contact regarding the value set
- *
- */
- public Contact setName(StringDt theValue) {
- myName = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for name (ValueSet.contact.name)
- *
- *
- * Definition:
- * The name of an individual to contact regarding the value set
- *
- */
- public Contact setName( String theString) {
- myName = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for telecom (ValueSet.contact.telecom).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- */
- public java.util.List getTelecom() {
- if (myTelecom == null) {
- myTelecom = new java.util.ArrayList();
- }
- return myTelecom;
- }
-
- /**
- * Sets the value(s) for telecom (ValueSet.contact.telecom)
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- */
- public Contact setTelecom(java.util.List theValue) {
- myTelecom = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for telecom (ValueSet.contact.telecom)
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- */
- public ContactPointDt addTelecom() {
- ContactPointDt newType = new ContactPointDt();
- getTelecom().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for telecom (ValueSet.contact.telecom)
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- * @param theValue The telecom to add (must not be null)
- */
- public Contact addTelecom(ContactPointDt theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getTelecom().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for telecom (ValueSet.contact.telecom),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Contact details for individual (if a name was provided) or the publisher
- *
- * Definition:
- * A definition of an code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to it's (codeSystem.system) directly
- *
- */
- @Block()
- public static class CodeSystem
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="system", type=UriDt.class, order=0, min=1, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.system",
- formalDefinition="An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system"
- )
- private UriDt mySystem;
-
- @Child(name="version", type=StringDt.class, order=1, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.version",
- formalDefinition="The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked"
- )
- private StringDt myVersion;
-
- @Child(name="caseSensitive", type=BooleanDt.class, order=2, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.caseSensitive",
- formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other"
- )
- private BooleanDt myCaseSensitive;
-
- @Child(name="concept", order=3, min=1, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept",
- formalDefinition="Concepts that are in the code system. The concept definitions are inherently heirarchical, but the definitions must be consulted to determine what the meaning of the heirachical relationships are"
- )
- private java.util.List myConcept;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCaseSensitive, myConcept);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myVersion, myCaseSensitive, myConcept);
- }
-
- /**
- * Gets the value(s) for system (ValueSet.codeSystem.system).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system
- *
- */
- public UriDt getSystemElement() {
- if (mySystem == null) {
- mySystem = new UriDt();
- }
- return mySystem;
- }
-
-
- /**
- * Gets the value(s) for system (ValueSet.codeSystem.system).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system
- *
- */
- public String getSystem() {
- return getSystemElement().getValue();
- }
-
- /**
- * Sets the value(s) for system (ValueSet.codeSystem.system)
- *
- *
- * Definition:
- * An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system
- *
- */
- public CodeSystem setSystem(UriDt theValue) {
- mySystem = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for system (ValueSet.codeSystem.system)
- *
- *
- * Definition:
- * An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system
- *
- */
- public CodeSystem setSystem( String theUri) {
- mySystem = new UriDt(theUri);
- return this;
- }
-
-
- /**
- * Gets the value(s) for version (ValueSet.codeSystem.version).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked
- *
- */
- public StringDt getVersionElement() {
- if (myVersion == null) {
- myVersion = new StringDt();
- }
- return myVersion;
- }
-
-
- /**
- * Gets the value(s) for version (ValueSet.codeSystem.version).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked
- *
- */
- public String getVersion() {
- return getVersionElement().getValue();
- }
-
- /**
- * Sets the value(s) for version (ValueSet.codeSystem.version)
- *
- *
- * Definition:
- * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked
- *
- */
- public CodeSystem setVersion(StringDt theValue) {
- myVersion = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for version (ValueSet.codeSystem.version)
- *
- *
- * Definition:
- * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked
- *
- */
- public CodeSystem setVersion( String theString) {
- myVersion = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for caseSensitive (ValueSet.codeSystem.caseSensitive).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If code comparison is case sensitive when codes within this system are compared to each other
- *
- */
- public BooleanDt getCaseSensitiveElement() {
- if (myCaseSensitive == null) {
- myCaseSensitive = new BooleanDt();
- }
- return myCaseSensitive;
- }
-
-
- /**
- * Gets the value(s) for caseSensitive (ValueSet.codeSystem.caseSensitive).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If code comparison is case sensitive when codes within this system are compared to each other
- *
- */
- public Boolean getCaseSensitive() {
- return getCaseSensitiveElement().getValue();
- }
-
- /**
- * Sets the value(s) for caseSensitive (ValueSet.codeSystem.caseSensitive)
- *
- *
- * Definition:
- * If code comparison is case sensitive when codes within this system are compared to each other
- *
- */
- public CodeSystem setCaseSensitive(BooleanDt theValue) {
- myCaseSensitive = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for caseSensitive (ValueSet.codeSystem.caseSensitive)
- *
- *
- * Definition:
- * If code comparison is case sensitive when codes within this system are compared to each other
- *
- */
- public CodeSystem setCaseSensitive( boolean theBoolean) {
- myCaseSensitive = new BooleanDt(theBoolean);
- return this;
- }
-
-
- /**
- * Gets the value(s) for concept (ValueSet.codeSystem.concept).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Concepts that are in the code system. The concept definitions are inherently heirarchical, but the definitions must be consulted to determine what the meaning of the heirachical relationships are
- *
- */
- public java.util.List getConcept() {
- if (myConcept == null) {
- myConcept = new java.util.ArrayList();
- }
- return myConcept;
- }
-
- /**
- * Sets the value(s) for concept (ValueSet.codeSystem.concept)
- *
- *
- * Definition:
- * Concepts that are in the code system. The concept definitions are inherently heirarchical, but the definitions must be consulted to determine what the meaning of the heirachical relationships are
- *
- */
- public CodeSystem setConcept(java.util.List theValue) {
- myConcept = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for concept (ValueSet.codeSystem.concept)
- *
- *
- * Definition:
- * Concepts that are in the code system. The concept definitions are inherently heirarchical, but the definitions must be consulted to determine what the meaning of the heirachical relationships are
- *
- */
- public CodeSystemConcept addConcept() {
- CodeSystemConcept newType = new CodeSystemConcept();
- getConcept().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for concept (ValueSet.codeSystem.concept)
- *
- *
- * Definition:
- * Concepts that are in the code system. The concept definitions are inherently heirarchical, but the definitions must be consulted to determine what the meaning of the heirachical relationships are
- *
- * @param theValue The concept to add (must not be null)
- */
- public CodeSystem addConcept(CodeSystemConcept theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getConcept().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for concept (ValueSet.codeSystem.concept),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Concepts that are in the code system. The concept definitions are inherently heirarchical, but the definitions must be consulted to determine what the meaning of the heirachical relationships are
- *
- * Definition:
- * Concepts that are in the code system. The concept definitions are inherently heirarchical, but the definitions must be consulted to determine what the meaning of the heirachical relationships are
- *
- */
- @Block()
- public static class CodeSystemConcept
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="code", type=CodeDt.class, order=0, min=1, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept.code",
- formalDefinition="A code - a text symbol - that uniquely identifies the concept within the code system"
- )
- private CodeDt myCode;
-
- @Child(name="abstract", type=BooleanDt.class, order=1, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept.abstract",
- formalDefinition="If this code is not for use as a real concept"
- )
- private BooleanDt myAbstract;
-
- @Child(name="display", type=StringDt.class, order=2, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept.display",
- formalDefinition="A human readable string that is the recommended default way to present this concept to a user"
- )
- private StringDt myDisplay;
-
- @Child(name="definition", type=StringDt.class, order=3, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept.definition",
- formalDefinition="The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, but they are highly recommended, as without them there is no formal meaning associated with the concept"
- )
- private StringDt myDefinition;
-
- @Child(name="designation", order=4, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept.designation",
- formalDefinition="Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc"
- )
- private java.util.List myDesignation;
-
- @Child(name="concept", type=CodeSystemConcept.class, order=5, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept.concept",
- formalDefinition="Child Concepts - a heirarchy of concepts. The nature of the relationships is variable (is-a / contains / categorises) and can only be determined by examining the definitions of the concepts"
- )
- private java.util.List myConcept;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myAbstract, myDisplay, myDefinition, myDesignation, myConcept);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myAbstract, myDisplay, myDefinition, myDesignation, myConcept);
- }
-
- /**
- * Gets the value(s) for code (ValueSet.codeSystem.concept.code).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A code - a text symbol - that uniquely identifies the concept within the code system
- *
- */
- public CodeDt getCodeElement() {
- if (myCode == null) {
- myCode = new CodeDt();
- }
- return myCode;
- }
-
-
- /**
- * Gets the value(s) for code (ValueSet.codeSystem.concept.code).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A code - a text symbol - that uniquely identifies the concept within the code system
- *
- */
- public String getCode() {
- return getCodeElement().getValue();
- }
-
- /**
- * Sets the value(s) for code (ValueSet.codeSystem.concept.code)
- *
- *
- * Definition:
- * A code - a text symbol - that uniquely identifies the concept within the code system
- *
- */
- public CodeSystemConcept setCode(CodeDt theValue) {
- myCode = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for code (ValueSet.codeSystem.concept.code)
- *
- *
- * Definition:
- * A code - a text symbol - that uniquely identifies the concept within the code system
- *
- */
- public CodeSystemConcept setCode( String theCode) {
- myCode = new CodeDt(theCode);
- return this;
- }
-
-
- /**
- * Gets the value(s) for abstract (ValueSet.codeSystem.concept.abstract).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If this code is not for use as a real concept
- *
- */
- public BooleanDt getAbstractElement() {
- if (myAbstract == null) {
- myAbstract = new BooleanDt();
- }
- return myAbstract;
- }
-
-
- /**
- * Gets the value(s) for abstract (ValueSet.codeSystem.concept.abstract).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * If this code is not for use as a real concept
- *
- */
- public Boolean getAbstract() {
- return getAbstractElement().getValue();
- }
-
- /**
- * Sets the value(s) for abstract (ValueSet.codeSystem.concept.abstract)
- *
- *
- * Definition:
- * If this code is not for use as a real concept
- *
- */
- public CodeSystemConcept setAbstract(BooleanDt theValue) {
- myAbstract = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for abstract (ValueSet.codeSystem.concept.abstract)
- *
- *
- * Definition:
- * If this code is not for use as a real concept
- *
- */
- public CodeSystemConcept setAbstract( boolean theBoolean) {
- myAbstract = new BooleanDt(theBoolean);
- return this;
- }
-
-
- /**
- * Gets the value(s) for display (ValueSet.codeSystem.concept.display).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A human readable string that is the recommended default way to present this concept to a user
- *
- */
- public StringDt getDisplayElement() {
- if (myDisplay == null) {
- myDisplay = new StringDt();
- }
- return myDisplay;
- }
-
-
- /**
- * Gets the value(s) for display (ValueSet.codeSystem.concept.display).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A human readable string that is the recommended default way to present this concept to a user
- *
- */
- public String getDisplay() {
- return getDisplayElement().getValue();
- }
-
- /**
- * Sets the value(s) for display (ValueSet.codeSystem.concept.display)
- *
- *
- * Definition:
- * A human readable string that is the recommended default way to present this concept to a user
- *
- */
- public CodeSystemConcept setDisplay(StringDt theValue) {
- myDisplay = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for display (ValueSet.codeSystem.concept.display)
- *
- *
- * Definition:
- * A human readable string that is the recommended default way to present this concept to a user
- *
- */
- public CodeSystemConcept setDisplay( String theString) {
- myDisplay = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for definition (ValueSet.codeSystem.concept.definition).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, but they are highly recommended, as without them there is no formal meaning associated with the concept
- *
- */
- public StringDt getDefinitionElement() {
- if (myDefinition == null) {
- myDefinition = new StringDt();
- }
- return myDefinition;
- }
-
-
- /**
- * Gets the value(s) for definition (ValueSet.codeSystem.concept.definition).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, but they are highly recommended, as without them there is no formal meaning associated with the concept
- *
- */
- public String getDefinition() {
- return getDefinitionElement().getValue();
- }
-
- /**
- * Sets the value(s) for definition (ValueSet.codeSystem.concept.definition)
- *
- *
- * Definition:
- * The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, but they are highly recommended, as without them there is no formal meaning associated with the concept
- *
- */
- public CodeSystemConcept setDefinition(StringDt theValue) {
- myDefinition = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for definition (ValueSet.codeSystem.concept.definition)
- *
- *
- * Definition:
- * The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, but they are highly recommended, as without them there is no formal meaning associated with the concept
- *
- */
- public CodeSystemConcept setDefinition( String theString) {
- myDefinition = new StringDt(theString);
- return this;
- }
-
-
- /**
- * Gets the value(s) for designation (ValueSet.codeSystem.concept.designation).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc
- *
- */
- public java.util.List getDesignation() {
- if (myDesignation == null) {
- myDesignation = new java.util.ArrayList();
- }
- return myDesignation;
- }
-
- /**
- * Sets the value(s) for designation (ValueSet.codeSystem.concept.designation)
- *
- *
- * Definition:
- * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc
- *
- */
- public CodeSystemConcept setDesignation(java.util.List theValue) {
- myDesignation = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for designation (ValueSet.codeSystem.concept.designation)
- *
- *
- * Definition:
- * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc
- *
- */
- public CodeSystemConceptDesignation addDesignation() {
- CodeSystemConceptDesignation newType = new CodeSystemConceptDesignation();
- getDesignation().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for designation (ValueSet.codeSystem.concept.designation)
- *
- *
- * Definition:
- * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc
- *
- * @param theValue The designation to add (must not be null)
- */
- public CodeSystemConcept addDesignation(CodeSystemConceptDesignation theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getDesignation().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for designation (ValueSet.codeSystem.concept.designation),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc
- *
- */
- public CodeSystemConceptDesignation getDesignationFirstRep() {
- if (getDesignation().isEmpty()) {
- return addDesignation();
- }
- return getDesignation().get(0);
- }
-
- /**
- * Gets the value(s) for concept (ValueSet.codeSystem.concept.concept).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Child Concepts - a heirarchy of concepts. The nature of the relationships is variable (is-a / contains / categorises) and can only be determined by examining the definitions of the concepts
- *
- */
- public java.util.List getConcept() {
- if (myConcept == null) {
- myConcept = new java.util.ArrayList();
- }
- return myConcept;
- }
-
- /**
- * Sets the value(s) for concept (ValueSet.codeSystem.concept.concept)
- *
- *
- * Definition:
- * Child Concepts - a heirarchy of concepts. The nature of the relationships is variable (is-a / contains / categorises) and can only be determined by examining the definitions of the concepts
- *
- */
- public CodeSystemConcept setConcept(java.util.List theValue) {
- myConcept = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for concept (ValueSet.codeSystem.concept.concept)
- *
- *
- * Definition:
- * Child Concepts - a heirarchy of concepts. The nature of the relationships is variable (is-a / contains / categorises) and can only be determined by examining the definitions of the concepts
- *
- */
- public CodeSystemConcept addConcept() {
- CodeSystemConcept newType = new CodeSystemConcept();
- getConcept().add(newType);
- return newType;
- }
-
- /**
- * Adds a given new value for concept (ValueSet.codeSystem.concept.concept)
- *
- *
- * Definition:
- * Child Concepts - a heirarchy of concepts. The nature of the relationships is variable (is-a / contains / categorises) and can only be determined by examining the definitions of the concepts
- *
- * @param theValue The concept to add (must not be null)
- */
- public CodeSystemConcept addConcept(CodeSystemConcept theValue) {
- if (theValue == null) {
- throw new NullPointerException("theValue must not be null");
- }
- getConcept().add(theValue);
- return this;
- }
-
- /**
- * Gets the first repetition for concept (ValueSet.codeSystem.concept.concept),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Child Concepts - a heirarchy of concepts. The nature of the relationships is variable (is-a / contains / categorises) and can only be determined by examining the definitions of the concepts
- *
- * Definition:
- * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc
- *
- */
- @Block()
- public static class CodeSystemConceptDesignation
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="language", type=CodeDt.class, order=0, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept.designation.language",
- formalDefinition="The language this designation is defined for"
- )
- private CodeDt myLanguage;
-
- @Child(name="use", type=CodingDt.class, order=1, min=0, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept.designation.use",
- formalDefinition="A code that details how this designation would be used"
- )
- private CodingDt myUse;
-
- @Child(name="value", type=StringDt.class, order=2, min=1, max=1)
- @Description(
- shortDefinition="ValueSet.codeSystem.concept.designation.value",
- formalDefinition="The text value for this designation"
- )
- private StringDt myValue;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLanguage, myUse, myValue);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLanguage, myUse, myValue);
- }
-
- /**
- * Gets the value(s) for language (ValueSet.codeSystem.concept.designation.language).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The language this designation is defined for
- *
- */
- public CodeDt getLanguageElement() {
- if (myLanguage == null) {
- myLanguage = new CodeDt();
- }
- return myLanguage;
- }
-
-
- /**
- * Gets the value(s) for language (ValueSet.codeSystem.concept.designation.language).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The language this designation is defined for
- *
- */
- public String getLanguage() {
- return getLanguageElement().getValue();
- }
-
- /**
- * Sets the value(s) for language (ValueSet.codeSystem.concept.designation.language)
- *
- *
- * Definition:
- * The language this designation is defined for
- *
- */
- public CodeSystemConceptDesignation setLanguage(CodeDt theValue) {
- myLanguage = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for language (ValueSet.codeSystem.concept.designation.language)
- *
- *
- * Definition:
- * The language this designation is defined for
- *
- */
- public CodeSystemConceptDesignation setLanguage( String theCode) {
- myLanguage = new CodeDt(theCode);
- return this;
- }
-
-
- /**
- * Gets the value(s) for use (ValueSet.codeSystem.concept.designation.use).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * A code that details how this designation would be used
- *
- */
- public CodingDt getUse() {
- if (myUse == null) {
- myUse = new CodingDt();
- }
- return myUse;
- }
-
- /**
- * Sets the value(s) for use (ValueSet.codeSystem.concept.designation.use)
- *
- *
- * Definition:
- * A code that details how this designation would be used
- *
- */
- public CodeSystemConceptDesignation setUse(CodingDt theValue) {
- myUse = theValue;
- return this;
- }
-
-
-
-
- /**
- * Gets the value(s) for value (ValueSet.codeSystem.concept.designation.value).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The text value for this designation
- *
- */
- public StringDt getValueElement() {
- if (myValue == null) {
- myValue = new StringDt();
- }
- return myValue;
- }
-
-
- /**
- * Gets the value(s) for value (ValueSet.codeSystem.concept.designation.value).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * The text value for this designation
- *
- */
- public String getValue() {
- return getValueElement().getValue();
- }
-
- /**
- * Sets the value(s) for value (ValueSet.codeSystem.concept.designation.value)
- *
- *
- * Definition:
- * The text value for this designation
- *
- */
- public CodeSystemConceptDesignation setValue(StringDt theValue) {
- myValue = theValue;
- return this;
- }
-
-
-
- /**
- * Sets the value for value (ValueSet.codeSystem.concept.designation.value)
- *
- *
- * Definition:
- * The text value for this designation
- *
- * Definition:
- * A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set
- *
- */
- @Block()
- public static class Compose
- extends BaseIdentifiableElement implements IResourceBlock {
-
- @Child(name="import", type=UriDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="ValueSet.compose.import",
- formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri"
- )
- private java.util.List myImport;
-
- @Child(name="include", order=1, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="ValueSet.compose.include",
- formalDefinition="Include one or more codes from a code system"
- )
- private java.util.List myInclude;
-
- @Child(name="exclude", type=ComposeInclude.class, order=2, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="ValueSet.compose.exclude",
- formalDefinition="Exclude one or more codes from the value set"
- )
- private java.util.List myExclude;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myImport, myInclude, myExclude);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myImport, myInclude, myExclude);
- }
-
- /**
- * Gets the value(s) for import (ValueSet.compose.import).
- * creating it if it does
- * not exist. Will not return null.
- *
- *
- * Definition:
- * Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri
- *
- */
- public java.util.List getImport() {
- if (myImport == null) {
- myImport = new java.util.ArrayList();
- }
- return myImport;
- }
-
- /**
- * Sets the value(s) for import (ValueSet.compose.import)
- *
- *
- * Definition:
- * Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri
- *
- */
- public Compose setImport(java.util.List theValue) {
- myImport = theValue;
- return this;
- }
-
-
-
- /**
- * Adds and returns a new value for import (ValueSet.compose.import)
- *
- *