diff --git a/hapi-fhir-base/.classpath b/hapi-fhir-base/.classpath index 30e9b1948d4..58f84bd19da 100644 --- a/hapi-fhir-base/.classpath +++ b/hapi-fhir-base/.classpath @@ -1,14 +1,14 @@ - - - - + + + + - + @@ -29,6 +29,7 @@ + @@ -36,6 +37,11 @@ + + + + + @@ -43,6 +49,7 @@ + @@ -76,12 +83,14 @@ + + @@ -92,6 +101,6 @@ - - + + diff --git a/hapi-fhir-base/build.xml b/hapi-fhir-base/build.xml new file mode 100644 index 00000000000..5b89404eda2 --- /dev/null +++ b/hapi-fhir-base/build.xml @@ -0,0 +1,110 @@ + + + Adding Google analytics in target/site for <body> + + + + + ]]> + + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-1395874-5', 'sourceforge.net'); + ga('send', 'pageview'); + + + + ]]> + + Adding Google analytics in target/site for <BODY> + + + ]]> + + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-1395874-5', 'sourceforge.net'); + ga('send', 'pageview'); + + + + ]]> + + Adding Google analytics in target/site for <FRAMESET> + + + + + + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-1395874-5', 'sourceforge.net'); + ga('send', 'pageview'); + + + + + + Adding Google analytics in target/site for <frameset> + + + + + + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-1395874-5', 'sourceforge.net'); + ga('send', 'pageview'); + + + + + + Adding social plugins for HAPI + + + + +
+
+ + +

+ + +

+ + ]]>
+
+ +
+
diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index a2bda0af738..53934f82fae 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -1,5 +1,4 @@ - + 4.0.0 @@ -12,30 +11,32 @@ ca.uhn.hapi.fhir hapi-fhir-base jar + http://hl7api.sourceforge.net/hapi-fhir/ HAPI FHIR Base Library + + + hl7api.sf.net + scp://shell.sourceforge.net/home/project-web/hl7api/htdocs/hapi-fhir + + + - - com.google.code.gson - gson - 2.2.4 + javax.json + javax.json-api + 1.0 - --> - javax.json - javax.json-api - 1.0 - - - org.glassfish - javax.json - 1.0.4 - - + org.glassfish + javax.json + 1.0.4 + + org.codehaus.woodstox @@ -43,8 +44,14 @@ 4.2.0 - + + + + org.thymeleaf + thymeleaf + 2.1.2.RELEASE + true + @@ -128,18 +135,18 @@ test - net.sf.json-lib - json-lib - 2.4 - jdk15 - test + net.sf.json-lib + json-lib + 2.4 + jdk15 + test - net.sf.json-lib - json-lib - 2.4 - jdk15-sources - test + net.sf.json-lib + json-lib + 2.4 + jdk15-sources + test @@ -168,12 +175,12 @@ 0.8 test - - org.hamcrest - hamcrest-all - ${hamcrest_version} - test - + + org.hamcrest + hamcrest-all + ${hamcrest_version} + test + @@ -183,8 +190,6 @@ maven-site-plugin 3.3 - org.apache.maven.plugins maven-project-info-reports-plugin @@ -235,6 +239,123 @@ + + maven-antrun-plugin + 1.7 + + + post-site + + + Adding Google analytics in target/site for <body> + + + + + ]]> + + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-1395874-5', 'sourceforge.net'); + ga('send', 'pageview'); + + + + ]]> + + Adding Google analytics in target/site for <BODY> + + + ]]> + + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-1395874-5', 'sourceforge.net'); + ga('send', 'pageview'); + + + + ]]> + + Adding social plugins for HAPI + + + + +
+
+ + +

+ + +

+ + ]]>
+
+ + +
+
+ + run + +
+
+
+ + org.apache.maven.plugins + maven-javadoc-plugin + true + + 128m + 1g + true + false + false + + + + package + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + + + package + + jar-no-fork + + + +
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 a519c273846..24c23848597 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 @@ -10,26 +10,30 @@ import java.util.Map; import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.dstu.resource.Patient; +import ca.uhn.fhir.narrative.INarrativeGenerator; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.parser.JsonParser; import ca.uhn.fhir.parser.XmlParser; import ca.uhn.fhir.rest.client.IRestfulClientFactory; import ca.uhn.fhir.rest.client.RestfulClientFactory; +import ca.uhn.fhir.rest.client.api.IRestfulClient; public class FhirContext { private volatile Map, BaseRuntimeElementDefinition> myClassToElementDefinition = Collections.emptyMap(); private volatile Map myIdToResourceDefinition = Collections.emptyMap(); private volatile Map myNameToElementDefinition = Collections.emptyMap(); + private INarrativeGenerator myNarrativeGenerator; + private IRestfulClientFactory myRestfulClientFactory; private volatile RuntimeChildUndeclaredExtensionDefinition myRuntimeChildUndeclaredExtensionDefinition; + public FhirContext() { + } + public FhirContext(Class theResourceType) { this(toCollection(theResourceType)); } - public FhirContext() { - } - public FhirContext(Class... theResourceTypes) { this(toCollection(theResourceTypes)); } @@ -37,11 +41,15 @@ public class FhirContext { public FhirContext(Collection> theResourceTypes) { scanResourceTypes(theResourceTypes); } - + public BaseRuntimeElementDefinition getElementDefinition(Class theElementType) { return myClassToElementDefinition.get(theElementType); } - + + public INarrativeGenerator getNarrativeGenerator() { + return myNarrativeGenerator; + } + public RuntimeResourceDefinition getResourceDefinition(Class theResourceType) { RuntimeResourceDefinition retVal = (RuntimeResourceDefinition) myClassToElementDefinition.get(theResourceType); if (retVal == null) { @@ -49,7 +57,7 @@ public class FhirContext { } return retVal; } - + public RuntimeResourceDefinition getResourceDefinition(IResource theResource) { return getResourceDefinition(theResource.getClass()); } @@ -81,6 +89,13 @@ public class FhirContext { return myIdToResourceDefinition.values(); } + public IRestfulClientFactory getRestfulClientFactory() { + if (myRestfulClientFactory==null) { + myRestfulClientFactory = new RestfulClientFactory(this); + } + return myRestfulClientFactory; + } + public RuntimeChildUndeclaredExtensionDefinition getRuntimeChildUndeclaredExtensionDefinition() { return myRuntimeChildUndeclaredExtensionDefinition; } @@ -89,14 +104,29 @@ public class FhirContext { return new JsonParser(this); } - public IRestfulClientFactory newRestfulClientFactory() { - return new RestfulClientFactory(this); + /** + * Instantiates a new client instance + * + * @param theClientType + * The client type, which is an interface type to be instantiated + * @param theServerBase + * The URL of the base for the restful FHIR server to connect to + * @return A newly created client + * @throws ConfigurationException + * If the interface type is not an interface + */ + public T newRestfulClient(Class theClientType, String theServerBase) { + return getRestfulClientFactory().newClient(theClientType, theServerBase); } public IParser newXmlParser() { return new XmlParser(this); } + public void setNarrativeGenerator(INarrativeGenerator theNarrativeGenerator) { + myNarrativeGenerator = theNarrativeGenerator; + } + private RuntimeResourceDefinition scanResourceType(Class theResourceType) { ArrayList> resourceTypes = new ArrayList>(); resourceTypes.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 c26f527c507..a3aa0a5b0a5 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 @@ -36,6 +36,7 @@ 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.dstu.composite.ContainedDt; +import ca.uhn.fhir.model.dstu.composite.NarrativeDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; @@ -221,7 +222,7 @@ class ModelScanner { RuntimeResourceBlockDefinition resourceDef = new RuntimeResourceBlockDefinition(resourceName, theClass); myClassToElementDefinitions.put(theClass, resourceDef); - scanCompositeElementForChildren(theClass, resourceDef, null); + scanCompositeElementForChildren(theClass, resourceDef); } private String scanCodeTable(Class theCodeType, CodeTableDef theCodeTableDefinition) { @@ -233,11 +234,11 @@ class ModelScanner { RuntimeCompositeDatatypeDefinition resourceDef = new RuntimeCompositeDatatypeDefinition(theDatatypeDefinition, theClass); myClassToElementDefinitions.put(theClass, resourceDef); - scanCompositeElementForChildren(theClass, resourceDef, null); + scanCompositeElementForChildren(theClass, resourceDef); } @SuppressWarnings("unchecked") - private void scanCompositeElementForChildren(Class theClass, BaseRuntimeElementCompositeDefinition theDefinition, Integer theIdentifierOrder) { + private void scanCompositeElementForChildren(Class theClass, BaseRuntimeElementCompositeDefinition theDefinition) { Set elementNames = new HashSet(); TreeMap orderToElementDef = new TreeMap(); TreeMap orderToExtensionDef = new TreeMap(); @@ -302,7 +303,13 @@ class ModelScanner { Description descriptionAnnotation = next.getAnnotation(Description.class); String elementName = childAnnotation.name(); - int order = childAnnotation.order() + baseElementOrder; + int order = childAnnotation.order(); + if (order < 0 && order != Child.ORDER_UNKNOWN) { + throw new ConfigurationException("Invalid order '" + order +"' on @Child for field '" + next.getName()+ "' on target type: " + theClass); + } + if (order != Child.ORDER_UNKNOWN) { + order = order + baseElementOrder; + } int min = childAnnotation.min(); int max = childAnnotation.max(); TreeMap orderMap = theOrderToElementDef; @@ -370,7 +377,7 @@ class ModelScanner { List> refTypesList = new ArrayList>(); for (Class nextType : childAnnotation.type()) { if (IResource.class.isAssignableFrom(nextType) == false) { - throw new ConfigurationException("Field '" + next.getName() + "' in class '" + next.getDeclaringClass().getSimpleName() + "' is of type " + ResourceReferenceDt.class + " but contains a non-resource type: " + nextType.getCanonicalName()); + throw new ConfigurationException("Field '" + next.getName() + "' in class '" + next.getDeclaringClass().getCanonicalName() + "' is of type " + ResourceReferenceDt.class + " but contains a non-resource type: " + nextType.getCanonicalName()); } refTypesList.add((Class) nextType); addScanAlso(nextType); @@ -410,6 +417,8 @@ class ModelScanner { if (nextElementType.equals(BoundCodeableConceptDt.class)) { IValueSetEnumBinder> binder = getBoundCodeBinder(next); def = new RuntimeChildCompositeBoundDatatypeDefinition(next, elementName, childAnnotation, descriptionAnnotation, nextDatatype, binder); + } else if (NarrativeDt.class.getSimpleName().equals(nextElementType.getSimpleName())) { + def = new RuntimeChildNarrativeDefinition(next, elementName, childAnnotation, descriptionAnnotation, nextDatatype); } else { def = new RuntimeChildCompositeDatatypeDefinition(next, elementName, childAnnotation, descriptionAnnotation, nextDatatype); } @@ -495,7 +504,7 @@ class ModelScanner { myClassToElementDefinitions.put(theClass, resourceDef); myNameToResourceDefinitions.put(resourceName, resourceDef); - scanCompositeElementForChildren(theClass, resourceDef, resourceDefinition.identifierOrder()); + scanCompositeElementForChildren(theClass, resourceDef); myIdToResourceDefinition.put(resourceId, resourceDef); return resourceName; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeChildChoiceDefinition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeChildChoiceDefinition.java index 113cd42758b..4293c55dea2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeChildChoiceDefinition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeChildChoiceDefinition.java @@ -103,5 +103,9 @@ public class RuntimeChildChoiceDefinition extends BaseRuntimeDeclaredChildDefini return myDatatypeToElementDefinition.get(theDatatype); } + public Set> getValidChildTypes() { + return Collections.unmodifiableSet((myDatatypeToElementDefinition.keySet())); + } + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeChildNarrativeDefinition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeChildNarrativeDefinition.java new file mode 100644 index 00000000000..ac7b512b723 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeChildNarrativeDefinition.java @@ -0,0 +1,16 @@ +package ca.uhn.fhir.context; + +import java.lang.reflect.Field; + +import ca.uhn.fhir.model.api.IDatatype; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; + +public class RuntimeChildNarrativeDefinition extends RuntimeChildCompositeDatatypeDefinition { + + public RuntimeChildNarrativeDefinition(Field theField, String theElementName, Child theChildAnnotation, Description theDescriptionAnnotation, Class theDatatype) { + super(theField, theElementName, theChildAnnotation,theDescriptionAnnotation, theDatatype); + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseElement.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseElement.java index d6179448e17..be671e7b52e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseElement.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseElement.java @@ -6,7 +6,7 @@ import java.util.List; import ca.uhn.fhir.model.primitive.IdDt; -public abstract class BaseElement implements IElement, ISupportsUndeclaredExtensions { +public abstract class BaseElement implements IIdentifiableElement, ISupportsUndeclaredExtensions { private IdDt myId; private List myUndeclaredExtensions; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseResourceReference.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseResourceReference.java index 3907304827c..9ae6f410bbd 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseResourceReference.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseResourceReference.java @@ -61,7 +61,12 @@ public abstract class BaseResourceReference extends BaseElement { HttpClient httpClient = theClient.getHttpClient(); FhirContext context = theClient.getFhirContext(); - HttpGet get = new HttpGet(getResourceUrl()); + String resourceUrl = getResourceUrl(); + if (!resourceUrl.startsWith("http")) { + resourceUrl = theClient.getServerBase() + resourceUrl; + } + + HttpGet get = new HttpGet(resourceUrl); HttpResponse response = httpClient.execute(get); try { // TODO: choose appropriate parser based on response CT diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java index 8539b87abdb..b091654d854 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java @@ -8,7 +8,7 @@ import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.util.ElementUtil; -public class Bundle extends BaseBundle implements IElement { +public class Bundle extends BaseBundle /*implements IElement*/ { //@formatter:off /* **************************************************** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ICompositeElement.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ICompositeElement.java index 5d6cc993adf..7996c6caa8f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ICompositeElement.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ICompositeElement.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api; import java.util.List; -public interface ICompositeElement extends IElement { +public interface ICompositeElement extends IIdentifiableElement { /** * Returns a list containing all child elements diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IDatatype.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IDatatype.java index c939f231de8..e9a87cf2c85 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IDatatype.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IDatatype.java @@ -1,5 +1,5 @@ package ca.uhn.fhir.model.api; -public interface IDatatype extends IElement { +public interface IDatatype extends IIdentifiableElement { } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IElement.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IElement.java index 80a51f5b12c..5bd51fdd921 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IElement.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IElement.java @@ -1,14 +1,11 @@ package ca.uhn.fhir.model.api; -import ca.uhn.fhir.model.primitive.IdDt; public interface IElement { boolean isEmpty(); - public void setId(IdDt theId); - public IdDt getId(); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IIdentifiableElement.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IIdentifiableElement.java new file mode 100644 index 00000000000..f121c1cbd6f --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IIdentifiableElement.java @@ -0,0 +1,12 @@ +package ca.uhn.fhir.model.api; + +import ca.uhn.fhir.model.primitive.IdDt; + +public interface IIdentifiableElement extends IElement { + + public void setId(IdDt theId); + + public IdDt getId(); + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/Child.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/Child.java index 0070b9a7074..51c190b12e2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/Child.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/Child.java @@ -24,7 +24,7 @@ public @interface Child { String name(); - int order(); + int order() default ORDER_UNKNOWN; int min() default 0; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/Extension.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/Extension.java index 8ef187a4d40..46684ec372b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/Extension.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/annotation/Extension.java @@ -19,7 +19,6 @@ public @interface Extension { * this option for extension defintions that you have added locally (i.e. * within your own organization) *

- *

* *

* If set to false, the resource is taken to be a remote 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 5d706809600..88cde930cc2 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 @@ -9,14 +9,13 @@ import java.lang.annotation.Target; @Target(value= {ElementType.TYPE}) public @interface ResourceDef { - int ORDER_NOT_SPECIFIED = -1; - + /** + * The name of the resource (e.g. "Patient" or "DiagnosticReport") + */ String name(); String id() default ""; String profile() default ""; - int identifierOrder() default ORDER_NOT_SPECIFIED; - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java index 1f7b751a044..92a829edc90 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java @@ -16,33 +16,18 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** * HAPI/FHIR Address Datatype @@ -164,7 +149,6 @@ public class AddressDt myUse = theValue; } - /** * Sets the value(s) for use (home | work | temp | old - purpose of this address) * @@ -207,7 +191,6 @@ public class AddressDt myText = theValue; } - /** * Sets the value for text (Text representation of the address) * @@ -216,8 +199,9 @@ public class AddressDt * A full text representation of the address *

*/ - public void setText( String theString) { + public AddressDt setText( String theString) { myText = new StringDt(theString); + return this; } @@ -264,6 +248,21 @@ public class AddressDt return newType; } + /** + * Gets the first repetition for line (Street name, number, direction & P.O. Box etc), + * creating it if it does not already exist. + * + *

+ * Definition: + * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information + *

+ */ + public StringDt getLineFirstRep() { + if (getLine().isEmpty()) { + return addLine(); + } + return getLine().get(0); + } /** * Adds a new value for line (Street name, number, direction & P.O. Box etc) * @@ -271,12 +270,15 @@ public class AddressDt * Definition: * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addLine( String theString) { + public AddressDt addLine( String theString) { if (myLine == null) { myLine = new java.util.ArrayList(); } - myLine.add(new StringDt(theString)); + myLine.add(new StringDt(theString)); + return this; } @@ -309,7 +311,6 @@ public class AddressDt myCity = theValue; } - /** * Sets the value for city (Name of city, town etc.) * @@ -318,8 +319,9 @@ public class AddressDt * The name of the city, town, village or other community or delivery center. *

*/ - public void setCity( String theString) { + public AddressDt setCity( String theString) { myCity = new StringDt(theString); + return this; } @@ -352,7 +354,6 @@ public class AddressDt myState = theValue; } - /** * Sets the value for state (Sub-unit of country (abreviations ok)) * @@ -361,8 +362,9 @@ public class AddressDt * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). *

*/ - public void setState( String theString) { + public AddressDt setState( String theString) { myState = new StringDt(theString); + return this; } @@ -395,7 +397,6 @@ public class AddressDt myZip = theValue; } - /** * Sets the value for zip (Postal code for area) * @@ -404,8 +405,9 @@ public class AddressDt * A postal code designating a region defined by the postal service. *

*/ - public void setZip( String theString) { + public AddressDt setZip( String theString) { myZip = new StringDt(theString); + return this; } @@ -438,7 +440,6 @@ public class AddressDt myCountry = theValue; } - /** * Sets the value for country (Country (can be ISO 3166 3 letter code)) * @@ -447,8 +448,9 @@ public class AddressDt * Country - a nation as commonly understood or generally accepted *

*/ - public void setCountry( String theString) { + public AddressDt setCountry( String theString) { myCountry = new StringDt(theString); + return this; } @@ -481,7 +483,6 @@ public class AddressDt myPeriod = theValue; } - diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java index 56ca77ae96e..9abb6f43a23 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java @@ -16,30 +16,16 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -157,7 +143,6 @@ public class AttachmentDt myContentType = theValue; } - /** * Sets the value for contentType (Mime type of the content, with charset etc.) * @@ -166,8 +151,9 @@ public class AttachmentDt * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate *

*/ - public void setContentType( String theCode) { + public AttachmentDt setContentType( String theCode) { myContentType = new CodeDt(theCode); + return this; } @@ -200,7 +186,6 @@ public class AttachmentDt myLanguage = theValue; } - /** * Sets the value for language (Human language of the content (BCP-47)) * @@ -209,8 +194,9 @@ public class AttachmentDt * The human language of the content. The value can be any valid value according to BCP 47 *

*/ - public void setLanguage( String theCode) { + public AttachmentDt setLanguage( String theCode) { myLanguage = new CodeDt(theCode); + return this; } @@ -243,7 +229,6 @@ public class AttachmentDt myData = theValue; } - /** * Sets the value for data (Data inline, base64ed) * @@ -252,8 +237,9 @@ public class AttachmentDt * The actual data of the attachment - a sequence of bytes. In XML, represented using base64 *

*/ - public void setData( byte[] theBytes) { + public AttachmentDt setData( byte[] theBytes) { myData = new Base64BinaryDt(theBytes); + return this; } @@ -286,7 +272,6 @@ public class AttachmentDt myUrl = theValue; } - /** * Sets the value for url (Uri where the data can be found) * @@ -295,8 +280,9 @@ public class AttachmentDt * An alternative location where the data can be accessed *

*/ - public void setUrl( String theUri) { + public AttachmentDt setUrl( String theUri) { myUrl = new UriDt(theUri); + return this; } @@ -329,7 +315,6 @@ public class AttachmentDt mySize = theValue; } - /** * Sets the value for size (Number of bytes of content (if url provided)) * @@ -338,8 +323,9 @@ public class AttachmentDt * The number of bytes of data that make up this attachment. *

*/ - public void setSize( Integer theInteger) { + public AttachmentDt setSize( Integer theInteger) { mySize = new IntegerDt(theInteger); + return this; } @@ -372,7 +358,6 @@ public class AttachmentDt myHash = theValue; } - /** * Sets the value for hash (Hash of the data (sha-1, base64ed )) * @@ -381,8 +366,9 @@ public class AttachmentDt * The calculated hash of the data using SHA-1. Represented using base64 *

*/ - public void setHash( byte[] theBytes) { + public AttachmentDt setHash( byte[] theBytes) { myHash = new Base64BinaryDt(theBytes); + return this; } @@ -415,7 +401,6 @@ public class AttachmentDt myTitle = theValue; } - /** * Sets the value for title (Label to display in place of the data) * @@ -424,8 +409,9 @@ public class AttachmentDt * A label or set of text to display in place of the data *

*/ - public void setTitle( String theString) { + public AttachmentDt setTitle( String theString) { myTitle = new StringDt(theString); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java index 2206bbdd41a..99b94fe2fee 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java @@ -16,33 +16,15 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** * HAPI/FHIR CodeableConcept Datatype @@ -136,6 +118,21 @@ public class CodeableConceptDt return newType; } + /** + * Gets the first repetition for coding (Code defined by a terminology system), + * creating it if it does not already exist. + * + *

+ * Definition: + * A reference to a code defined by a terminology system + *

+ */ + public CodingDt getCodingFirstRep() { + if (getCoding().isEmpty()) { + return addCoding(); + } + return getCoding().get(0); + } /** * Gets the value(s) for text (Plain text representation of the concept). @@ -166,7 +163,6 @@ public class CodeableConceptDt myText = theValue; } - /** * Sets the value for text (Plain text representation of the concept) * @@ -175,8 +171,9 @@ public class CodeableConceptDt * A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user *

*/ - public void setText( String theString) { + public CodeableConceptDt setText( String theString) { myText = new StringDt(theString); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java index d3a58ee2b86..d11a565d8c1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java @@ -16,31 +16,17 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.IQueryParameterType; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; 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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -166,7 +152,6 @@ public class CodingDt mySystem = theValue; } - /** * Sets the value for system (Identity of the terminology system) * @@ -175,8 +160,9 @@ public class CodingDt * The identification of the code system that defines the meaning of the symbol in the code. *

*/ - public void setSystem( String theUri) { + public CodingDt setSystem( String theUri) { mySystem = new UriDt(theUri); + return this; } @@ -209,7 +195,6 @@ public class CodingDt myVersion = theValue; } - /** * Sets the value for version (Version of the system - if relevant) * @@ -218,8 +203,9 @@ public class CodingDt * The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged *

*/ - public void setVersion( String theString) { + public CodingDt setVersion( String theString) { myVersion = new StringDt(theString); + return this; } @@ -252,7 +238,6 @@ public class CodingDt myCode = theValue; } - /** * Sets the value for code (Symbol in syntax defined by the system) * @@ -261,8 +246,9 @@ public class CodingDt * A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination) *

*/ - public void setCode( String theCode) { + public CodingDt setCode( String theCode) { myCode = new CodeDt(theCode); + return this; } @@ -295,7 +281,6 @@ public class CodingDt myDisplay = theValue; } - /** * Sets the value for display (Representation defined by the system) * @@ -304,8 +289,9 @@ public class CodingDt * A representation of the meaning of the code in the system, following the rules of the system. *

*/ - public void setDisplay( String theString) { + public CodingDt setDisplay( String theString) { myDisplay = new StringDt(theString); + return this; } @@ -338,7 +324,6 @@ public class CodingDt myPrimary = theValue; } - /** * Sets the value for primary (If this code was chosen directly by the user) * @@ -347,8 +332,9 @@ public class CodingDt * Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays) *

*/ - public void setPrimary( Boolean theBoolean) { + public CodingDt setPrimary( Boolean theBoolean) { myPrimary = new BooleanDt(theBoolean); + return this; } @@ -381,7 +367,6 @@ public class CodingDt myValueSet = theValue; } - /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java index e5cc6f7a0df..1b6afea8073 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java @@ -16,33 +16,19 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** * HAPI/FHIR Contact Datatype @@ -136,7 +122,6 @@ public class ContactDt mySystem = theValue; } - /** * Sets the value(s) for system (phone | fax | email | url) * @@ -179,7 +164,6 @@ public class ContactDt myValue = theValue; } - /** * Sets the value for value (The actual contact details) * @@ -188,8 +172,9 @@ public class ContactDt * The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). *

*/ - public void setValue( String theString) { + public ContactDt setValue( String theString) { myValue = new StringDt(theString); + return this; } @@ -222,7 +207,6 @@ public class ContactDt myUse = theValue; } - /** * Sets the value(s) for use (home | work | temp | old | mobile - purpose of this address) * @@ -265,7 +249,6 @@ public class ContactDt myPeriod = theValue; } - diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContainedDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContainedDt.java index 736e1bb9499..45175872252 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContainedDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContainedDt.java @@ -3,14 +3,14 @@ package ca.uhn.fhir.model.dstu.composite; import java.util.ArrayList; import java.util.List; -import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.IDatatype; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.api.annotation.DatatypeDef; import ca.uhn.fhir.model.primitive.IdDt; @DatatypeDef(name = "duration") -public class ContainedDt implements IElement { +public class ContainedDt implements IDatatype { @Child(name = "resource", type = IResource.class, order = 0, min = 0, max = Child.MAX_UNLIMITED) private List myContainedResources; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java index f40fab876a5..b0ac0d548ee 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java @@ -16,33 +16,19 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; +import ca.uhn.fhir.util.DatatypeUtil; /** * HAPI/FHIR HumanName Datatype @@ -157,7 +143,6 @@ public class HumanNameDt myUse = theValue; } - /** * Sets the value(s) for use (usual | official | temp | nickname | anonymous | old | maiden) * @@ -200,7 +185,6 @@ public class HumanNameDt myText = theValue; } - /** * Sets the value for text (Text representation of the full name) * @@ -209,8 +193,9 @@ public class HumanNameDt * A full text representation of the name *

*/ - public void setText( String theString) { + public HumanNameDt setText( String theString) { myText = new StringDt(theString); + return this; } @@ -257,6 +242,21 @@ public class HumanNameDt return newType; } + /** + * Gets the first repetition for family (Family name (often called 'Surname')), + * creating it if it does not already exist. + * + *

+ * Definition: + * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. + *

+ */ + public StringDt getFamilyFirstRep() { + if (getFamily().isEmpty()) { + return addFamily(); + } + return getFamily().get(0); + } /** * Adds a new value for family (Family name (often called 'Surname')) * @@ -264,12 +264,15 @@ public class HumanNameDt * Definition: * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addFamily( String theString) { + public HumanNameDt addFamily( String theString) { if (myFamily == null) { myFamily = new java.util.ArrayList(); } - myFamily.add(new StringDt(theString)); + myFamily.add(new StringDt(theString)); + return this; } @@ -316,6 +319,21 @@ public class HumanNameDt return newType; } + /** + * Gets the first repetition for given (Given names (not always 'first'). Includes middle names), + * creating it if it does not already exist. + * + *

+ * Definition: + * Given name + *

+ */ + public StringDt getGivenFirstRep() { + if (getGiven().isEmpty()) { + return addGiven(); + } + return getGiven().get(0); + } /** * Adds a new value for given (Given names (not always 'first'). Includes middle names) * @@ -323,12 +341,15 @@ public class HumanNameDt * Definition: * Given name *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addGiven( String theString) { + public HumanNameDt addGiven( String theString) { if (myGiven == null) { myGiven = new java.util.ArrayList(); } - myGiven.add(new StringDt(theString)); + myGiven.add(new StringDt(theString)); + return this; } @@ -375,6 +396,21 @@ public class HumanNameDt return newType; } + /** + * Gets the first repetition for prefix (Parts that come before the name), + * creating it if it does not already exist. + * + *

+ * Definition: + * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name + *

+ */ + public StringDt getPrefixFirstRep() { + if (getPrefix().isEmpty()) { + return addPrefix(); + } + return getPrefix().get(0); + } /** * Adds a new value for prefix (Parts that come before the name) * @@ -382,12 +418,15 @@ public class HumanNameDt * Definition: * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addPrefix( String theString) { + public HumanNameDt addPrefix( String theString) { if (myPrefix == null) { myPrefix = new java.util.ArrayList(); } - myPrefix.add(new StringDt(theString)); + myPrefix.add(new StringDt(theString)); + return this; } @@ -434,6 +473,21 @@ public class HumanNameDt return newType; } + /** + * Gets the first repetition for suffix (Parts that come after the name), + * creating it if it does not already exist. + * + *

+ * Definition: + * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name + *

+ */ + public StringDt getSuffixFirstRep() { + if (getSuffix().isEmpty()) { + return addSuffix(); + } + return getSuffix().get(0); + } /** * Adds a new value for suffix (Parts that come after the name) * @@ -441,12 +495,15 @@ public class HumanNameDt * Definition: * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addSuffix( String theString) { + public HumanNameDt addSuffix( String theString) { if (mySuffix == null) { mySuffix = new java.util.ArrayList(); } - mySuffix.add(new StringDt(theString)); + mySuffix.add(new StringDt(theString)); + return this; } @@ -479,9 +536,43 @@ public class HumanNameDt myPeriod = theValue; } - + /** + * Returns all repetitions of {@link #getFamily() family name} as a space separated string + * + * @see DatatypeUtil#joinStringsSpaceSeparated(List) + */ + public String getFamilyAsSingleString() { + return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getFamily()); + } + + /** + * Returns all repetitions of {@link #getGiven() given name} as a space separated string + * + * @see DatatypeUtil#joinStringsSpaceSeparated(List) + */ + public String getGivenAsSingleString() { + return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getGiven()); + } + + /** + * Returns all repetitions of {@link #getPrefix() prefix name} as a space separated string + * + * @see DatatypeUtil#joinStringsSpaceSeparated(List) + */ + public String getPrefixAsSingleString() { + return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getPrefix()); + } + + /** + * Returns all repetitions of {@link #Suffix() suffix} as a space separated string + * + * @see DatatypeUtil#joinStringsSpaceSeparated(List) + */ + public String getSuffixAsSingleString() { + return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getSuffix()); + } } \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java index 6ed993021e8..103a2aac35c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java @@ -16,31 +16,18 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.IQueryParameterType; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -166,7 +153,6 @@ public class IdentifierDt myUse = theValue; } - /** * Sets the value(s) for use (usual | official | temp | secondary (If known)) * @@ -209,7 +195,6 @@ public class IdentifierDt myLabel = theValue; } - /** * Sets the value for label (Description of identifier) * @@ -218,8 +203,9 @@ public class IdentifierDt * A text string for the identifier that can be displayed to a human so they can recognize the identifier *

*/ - public void setLabel( String theString) { + public IdentifierDt setLabel( String theString) { myLabel = new StringDt(theString); + return this; } @@ -252,7 +238,6 @@ public class IdentifierDt mySystem = theValue; } - /** * Sets the value for system (The namespace for the identifier) * @@ -261,8 +246,9 @@ public class IdentifierDt * Establishes the namespace in which set of possible id values is unique. *

*/ - public void setSystem( String theUri) { + public IdentifierDt setSystem( String theUri) { mySystem = new UriDt(theUri); + return this; } @@ -295,7 +281,6 @@ public class IdentifierDt myValue = theValue; } - /** * Sets the value for value (The value that is unique) * @@ -304,8 +289,9 @@ public class IdentifierDt * The portion of the identifier typically displayed to the user and which is unique within the context of the system. *

*/ - public void setValue( String theString) { + public IdentifierDt setValue( String theString) { myValue = new StringDt(theString); + return this; } @@ -338,7 +324,6 @@ public class IdentifierDt myPeriod = theValue; } - /** * Gets the value(s) for assigner (Organization that issued id (may be just text)). @@ -369,7 +354,6 @@ public class IdentifierDt myAssigner = theValue; } - /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java index 5ecd1b429cc..fd5d0a7097f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java @@ -51,6 +51,15 @@ public class NarrativeDt extends BaseElement implements ICompositeDatatype { @Child(name="div", type=XhtmlDt.class, order=1, min=1, max=1) private XhtmlDt myDiv; + public NarrativeDt() { + // nothing + } + + public NarrativeDt(XhtmlDt theDiv, NarrativeStatusEnum theStatus) { + setDiv(theDiv); + setStatus(theStatus); + } + @Override public boolean isEmpty() { return ca.uhn.fhir.util.ElementUtil.isEmpty( myStatus, myDiv ); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java index 9f2c8509688..ddf326485ea 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java @@ -16,33 +16,17 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.TemporalPrecisionEnum; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** * HAPI/FHIR Period Datatype @@ -122,7 +106,6 @@ public class PeriodDt myStart = theValue; } - /** * Sets the value for start (Starting time with inclusive boundary) * @@ -131,8 +114,9 @@ public class PeriodDt * The start of the period. The boundary is inclusive. *

*/ - public void setStart( Date theDate, TemporalPrecisionEnum thePrecision) { + public PeriodDt setStart( Date theDate, TemporalPrecisionEnum thePrecision) { myStart = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -143,8 +127,9 @@ public class PeriodDt * The start of the period. The boundary is inclusive. *

*/ - public void setStartWithSecondsPrecision( Date theDate) { + public PeriodDt setStartWithSecondsPrecision( Date theDate) { myStart = new DateTimeDt(theDate); + return this; } @@ -177,7 +162,6 @@ public class PeriodDt myEnd = theValue; } - /** * Sets the value for end (End time with inclusive boundary, if not ongoing) * @@ -186,8 +170,9 @@ public class PeriodDt * The end of the period. If the end of the period is missing, it means that the period is ongoing *

*/ - public void setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { + public PeriodDt setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { myEnd = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -198,8 +183,9 @@ public class PeriodDt * The end of the period. If the end of the period is missing, it means that the period is ongoing *

*/ - public void setEndWithSecondsPrecision( Date theDate) { + public PeriodDt setEndWithSecondsPrecision( Date theDate) { myEnd = new DateTimeDt(theDate); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java index c8dcb567716..8f85251cef4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java @@ -16,31 +16,18 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -143,7 +130,6 @@ public class QuantityDt myValue = theValue; } - /** * Sets the value for value (Numerical value (with implicit precision)) * @@ -152,8 +138,9 @@ public class QuantityDt * The value of the measured amount. The value includes an implicit precision in the presentation of the value *

*/ - public void setValue( long theValue) { + public QuantityDt setValue( long theValue) { myValue = new DecimalDt(theValue); + return this; } /** @@ -164,8 +151,9 @@ public class QuantityDt * The value of the measured amount. The value includes an implicit precision in the presentation of the value *

*/ - public void setValue( double theValue) { + public QuantityDt setValue( double theValue) { myValue = new DecimalDt(theValue); + return this; } /** @@ -176,8 +164,9 @@ public class QuantityDt * The value of the measured amount. The value includes an implicit precision in the presentation of the value *

*/ - public void setValue( java.math.BigDecimal theValue) { + public QuantityDt setValue( java.math.BigDecimal theValue) { myValue = new DecimalDt(theValue); + return this; } @@ -210,7 +199,6 @@ public class QuantityDt myComparator = theValue; } - /** * Sets the value(s) for comparator (< | <= | >= | > - how to understand the value) * @@ -253,7 +241,6 @@ public class QuantityDt myUnits = theValue; } - /** * Sets the value for units (Unit representation) * @@ -262,8 +249,9 @@ public class QuantityDt * A human-readable form of the units *

*/ - public void setUnits( String theString) { + public QuantityDt setUnits( String theString) { myUnits = new StringDt(theString); + return this; } @@ -296,7 +284,6 @@ public class QuantityDt mySystem = theValue; } - /** * Sets the value for system (System that defines coded unit form) * @@ -305,8 +292,9 @@ public class QuantityDt * The identification of the system that provides the coded form of the unit *

*/ - public void setSystem( String theUri) { + public QuantityDt setSystem( String theUri) { mySystem = new UriDt(theUri); + return this; } @@ -339,7 +327,6 @@ public class QuantityDt myCode = theValue; } - /** * Sets the value for code (Coded form of the unit) * @@ -348,8 +335,9 @@ public class QuantityDt * A computer processable form of the units in some unit representation system *

*/ - public void setCode( String theCode) { + public QuantityDt setCode( String theCode) { myCode = new CodeDt(theCode); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java index 6cc6db2e5a1..0c2e28f88d4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java @@ -16,33 +16,14 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; /** * HAPI/FHIR Range Datatype @@ -122,7 +103,6 @@ public class RangeDt myLow = theValue; } - /** * Gets the value(s) for high (High limit). @@ -153,7 +133,6 @@ public class RangeDt myHigh = theValue; } - diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java index 08e920a2614..69c18fb484c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java @@ -16,33 +16,14 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; /** * HAPI/FHIR Ratio Datatype @@ -122,7 +103,6 @@ public class RatioDt myNumerator = theValue; } - /** * Gets the value(s) for denominator (Denominator value). @@ -153,7 +133,6 @@ public class RatioDt myDenominator = theValue; } - diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java index a79fb9317c8..692ce34918c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java @@ -16,33 +16,15 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; +import ca.uhn.fhir.model.api.BaseResourceReference; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** * HAPI/FHIR ResourceReference Datatype @@ -122,7 +104,6 @@ public class ResourceReferenceDt myReference = theValue; } - /** * Sets the value for reference (Relative, internal or absolute URL reference) * @@ -131,8 +112,9 @@ public class ResourceReferenceDt * A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources *

*/ - public void setReference( String theString) { + public ResourceReferenceDt setReference( String theString) { myReference = new StringDt(theString); + return this; } @@ -165,7 +147,6 @@ public class ResourceReferenceDt myDisplay = theValue; } - /** * Sets the value for display (Text alternative for the resource) * @@ -174,8 +155,9 @@ public class ResourceReferenceDt * Plain text narrative that identifies the resource in addition to the resource reference *

*/ - public void setDisplay( String theString) { + public ResourceReferenceDt setDisplay( String theString) { myDisplay = new StringDt(theString); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java index 82d0e59d55c..01e87458db9 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java @@ -16,33 +16,17 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.primitive.DecimalDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** * HAPI/FHIR SampledData Datatype @@ -157,7 +141,6 @@ public class SampledDataDt myOrigin = theValue; } - /** * Gets the value(s) for period (Number of milliseconds between samples). @@ -188,7 +171,6 @@ public class SampledDataDt myPeriod = theValue; } - /** * Sets the value for period (Number of milliseconds between samples) * @@ -197,8 +179,9 @@ public class SampledDataDt * The length of time between sampling times, measured in milliseconds *

*/ - public void setPeriod( long theValue) { + public SampledDataDt setPeriod( long theValue) { myPeriod = new DecimalDt(theValue); + return this; } /** @@ -209,8 +192,9 @@ public class SampledDataDt * The length of time between sampling times, measured in milliseconds *

*/ - public void setPeriod( double theValue) { + public SampledDataDt setPeriod( double theValue) { myPeriod = new DecimalDt(theValue); + return this; } /** @@ -221,8 +205,9 @@ public class SampledDataDt * The length of time between sampling times, measured in milliseconds *

*/ - public void setPeriod( java.math.BigDecimal theValue) { + public SampledDataDt setPeriod( java.math.BigDecimal theValue) { myPeriod = new DecimalDt(theValue); + return this; } @@ -255,7 +240,6 @@ public class SampledDataDt myFactor = theValue; } - /** * Sets the value for factor (Multiply data by this before adding to origin) * @@ -264,8 +248,9 @@ public class SampledDataDt * A correction factor that is applied to the sampled data points before they are added to the origin *

*/ - public void setFactor( long theValue) { + public SampledDataDt setFactor( long theValue) { myFactor = new DecimalDt(theValue); + return this; } /** @@ -276,8 +261,9 @@ public class SampledDataDt * A correction factor that is applied to the sampled data points before they are added to the origin *

*/ - public void setFactor( double theValue) { + public SampledDataDt setFactor( double theValue) { myFactor = new DecimalDt(theValue); + return this; } /** @@ -288,8 +274,9 @@ public class SampledDataDt * A correction factor that is applied to the sampled data points before they are added to the origin *

*/ - public void setFactor( java.math.BigDecimal theValue) { + public SampledDataDt setFactor( java.math.BigDecimal theValue) { myFactor = new DecimalDt(theValue); + return this; } @@ -322,7 +309,6 @@ public class SampledDataDt myLowerLimit = theValue; } - /** * Sets the value for lowerLimit (Lower limit of detection) * @@ -331,8 +317,9 @@ public class SampledDataDt * The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit) *

*/ - public void setLowerLimit( long theValue) { + public SampledDataDt setLowerLimit( long theValue) { myLowerLimit = new DecimalDt(theValue); + return this; } /** @@ -343,8 +330,9 @@ public class SampledDataDt * The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit) *

*/ - public void setLowerLimit( double theValue) { + public SampledDataDt setLowerLimit( double theValue) { myLowerLimit = new DecimalDt(theValue); + return this; } /** @@ -355,8 +343,9 @@ public class SampledDataDt * The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit) *

*/ - public void setLowerLimit( java.math.BigDecimal theValue) { + public SampledDataDt setLowerLimit( java.math.BigDecimal theValue) { myLowerLimit = new DecimalDt(theValue); + return this; } @@ -389,7 +378,6 @@ public class SampledDataDt myUpperLimit = theValue; } - /** * Sets the value for upperLimit (Upper limit of detection) * @@ -398,8 +386,9 @@ public class SampledDataDt * The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit) *

*/ - public void setUpperLimit( long theValue) { + public SampledDataDt setUpperLimit( long theValue) { myUpperLimit = new DecimalDt(theValue); + return this; } /** @@ -410,8 +399,9 @@ public class SampledDataDt * The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit) *

*/ - public void setUpperLimit( double theValue) { + public SampledDataDt setUpperLimit( double theValue) { myUpperLimit = new DecimalDt(theValue); + return this; } /** @@ -422,8 +412,9 @@ public class SampledDataDt * The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit) *

*/ - public void setUpperLimit( java.math.BigDecimal theValue) { + public SampledDataDt setUpperLimit( java.math.BigDecimal theValue) { myUpperLimit = new DecimalDt(theValue); + return this; } @@ -456,7 +447,6 @@ public class SampledDataDt myDimensions = theValue; } - /** * Sets the value for dimensions (Number of sample points at each time point) * @@ -465,8 +455,9 @@ public class SampledDataDt * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once *

*/ - public void setDimensions( Integer theInteger) { + public SampledDataDt setDimensions( Integer theInteger) { myDimensions = new IntegerDt(theInteger); + return this; } @@ -499,7 +490,6 @@ public class SampledDataDt myData = theValue; } - /** * Sets the value for data (Decimal values with spaces, or \"E\" | \"U\" | \"L\") * @@ -508,8 +498,9 @@ public class SampledDataDt * A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value *

*/ - public void setData( String theString) { + public SampledDataDt setData( String theString) { myData = new StringDt(theString); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ScheduleDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ScheduleDt.java index 23f838a835a..429eef4c46f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ScheduleDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ScheduleDt.java @@ -16,33 +16,25 @@ package ca.uhn.fhir.model.dstu.composite; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.IResourceBlock; +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.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -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.DecimalDt; import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** * HAPI/FHIR Schedule Datatype @@ -136,6 +128,21 @@ public class ScheduleDt return newType; } + /** + * Gets the first repetition for event (When the event occurs), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifies specific time periods when the event should occur + *

+ */ + public PeriodDt getEventFirstRep() { + if (getEvent().isEmpty()) { + return addEvent(); + } + return getEvent().get(0); + } /** * Gets the value(s) for repeat (Only if there is none or one event). @@ -166,7 +173,6 @@ public class ScheduleDt myRepeat = theValue; } - /** * Block class for child element: Schedule.repeat (Only if there is none or one event) @@ -266,7 +272,6 @@ public class ScheduleDt myFrequency = theValue; } - /** * Sets the value for frequency (Event occurs frequency times per duration) * @@ -275,8 +280,9 @@ public class ScheduleDt * Indicates how often the event should occur. *

*/ - public void setFrequency( Integer theInteger) { + public Repeat setFrequency( Integer theInteger) { myFrequency = new IntegerDt(theInteger); + return this; } @@ -309,7 +315,6 @@ public class ScheduleDt myWhen = theValue; } - /** * Sets the value(s) for when (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events) * @@ -352,7 +357,6 @@ public class ScheduleDt myDuration = theValue; } - /** * Sets the value for duration (Repeating or event-related duration) * @@ -361,8 +365,9 @@ public class ScheduleDt * How long each repetition should last *

*/ - public void setDuration( long theValue) { + public Repeat setDuration( long theValue) { myDuration = new DecimalDt(theValue); + return this; } /** @@ -373,8 +378,9 @@ public class ScheduleDt * How long each repetition should last *

*/ - public void setDuration( double theValue) { + public Repeat setDuration( double theValue) { myDuration = new DecimalDt(theValue); + return this; } /** @@ -385,8 +391,9 @@ public class ScheduleDt * How long each repetition should last *

*/ - public void setDuration( java.math.BigDecimal theValue) { + public Repeat setDuration( java.math.BigDecimal theValue) { myDuration = new DecimalDt(theValue); + return this; } @@ -419,7 +426,6 @@ public class ScheduleDt myUnits = theValue; } - /** * Sets the value(s) for units (s | min | h | d | wk | mo | a - unit of time (UCUM)) * @@ -462,7 +468,6 @@ public class ScheduleDt myCount = theValue; } - /** * Sets the value for count (Number of times to repeat) * @@ -471,8 +476,9 @@ public class ScheduleDt * A total count of the desired number of repetitions *

*/ - public void setCount( Integer theInteger) { + public Repeat setCount( Integer theInteger) { myCount = new IntegerDt(theInteger); + return this; } @@ -505,7 +511,6 @@ public class ScheduleDt myEnd = theValue; } - /** * Sets the value for end (When to stop repeats) * @@ -514,8 +519,9 @@ public class ScheduleDt * When to stop repeating the schedule *

*/ - public void setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { + public Repeat setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { myEnd = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -526,8 +532,9 @@ public class ScheduleDt * When to stop repeating the schedule *

*/ - public void setEndWithSecondsPrecision( Date theDate) { + public Repeat setEndWithSecondsPrecision( Date theDate) { myEnd = new DateTimeDt(theDate); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java index bf946c230c9..c533aebc29f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java @@ -17,111 +17,41 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +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.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.dstu.composite.CodeableConceptDt; import ca.uhn.fhir.model.dstu.composite.CodingDt; +import ca.uhn.fhir.model.dstu.composite.ContactDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; import ca.uhn.fhir.model.primitive.Base64BinaryDt; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -477,7 +407,6 @@ public class Conformance extends BaseResource implements IResource { myIdentifier = theValue; } - /** * Sets the value for identifier (Logical id to reference this statement) * @@ -486,8 +415,9 @@ public class Conformance extends BaseResource implements IResource { * The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI) *

*/ - public void setIdentifier( String theString) { + public Conformance setIdentifier( String theString) { myIdentifier = new StringDt(theString); + return this; } @@ -520,7 +450,6 @@ public class Conformance extends BaseResource implements IResource { myVersion = theValue; } - /** * Sets the value for version (Logical id for this version of the statement) * @@ -529,8 +458,9 @@ public class Conformance extends BaseResource implements IResource { * The identifier that is used to identify this version of the conformance statement 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 void setVersion( String theString) { + public Conformance setVersion( String theString) { myVersion = new StringDt(theString); + return this; } @@ -563,7 +493,6 @@ public class Conformance extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Informal name for this conformance statement) * @@ -572,8 +501,9 @@ public class Conformance extends BaseResource implements IResource { * A free text natural language name identifying the conformance statement *

*/ - public void setName( String theString) { + public Conformance setName( String theString) { myName = new StringDt(theString); + return this; } @@ -606,7 +536,6 @@ public class Conformance extends BaseResource implements IResource { myPublisher = theValue; } - /** * Sets the value for publisher (Publishing Organization) * @@ -615,8 +544,9 @@ public class Conformance extends BaseResource implements IResource { * Name of Organization publishing this conformance statement *

*/ - public void setPublisher( String theString) { + public Conformance setPublisher( String theString) { myPublisher = new StringDt(theString); + return this; } @@ -663,6 +593,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (Contacts for Organization), + * creating it if it does not already exist. + * + *

+ * Definition: + * Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc. + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for description (Human description of the conformance statement). @@ -693,7 +638,6 @@ public class Conformance extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Human description of the conformance statement) * @@ -702,8 +646,9 @@ public class Conformance extends BaseResource implements IResource { * A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP *

*/ - public void setDescription( String theString) { + public Conformance setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -736,7 +681,6 @@ public class Conformance extends BaseResource implements IResource { myStatus = theValue; } - /** * Sets the value(s) for status (draft | active | retired) * @@ -779,7 +723,6 @@ public class Conformance extends BaseResource implements IResource { myExperimental = theValue; } - /** * Sets the value for experimental (If for testing purposes, not real usage) * @@ -788,8 +731,9 @@ public class Conformance extends BaseResource implements IResource { * A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage *

*/ - public void setExperimental( Boolean theBoolean) { + public Conformance setExperimental( Boolean theBoolean) { myExperimental = new BooleanDt(theBoolean); + return this; } @@ -822,7 +766,6 @@ public class Conformance extends BaseResource implements IResource { myDate = theValue; } - /** * Sets the value for date (Publication Date) * @@ -831,8 +774,9 @@ public class Conformance extends BaseResource implements IResource { * The date when the conformance statement was published *

*/ - public void setDate( Date theDate, TemporalPrecisionEnum thePrecision) { + public Conformance setDate( Date theDate, TemporalPrecisionEnum thePrecision) { myDate = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -843,8 +787,9 @@ public class Conformance extends BaseResource implements IResource { * The date when the conformance statement was published *

*/ - public void setDateWithSecondsPrecision( Date theDate) { + public Conformance setDateWithSecondsPrecision( Date theDate) { myDate = new DateTimeDt(theDate); + return this; } @@ -877,7 +822,6 @@ public class Conformance extends BaseResource implements IResource { mySoftware = theValue; } - /** * Gets the value(s) for implementation (If this describes a specific instance). @@ -908,7 +852,6 @@ public class Conformance extends BaseResource implements IResource { myImplementation = theValue; } - /** * Gets the value(s) for fhirVersion (FHIR Version). @@ -939,7 +882,6 @@ public class Conformance extends BaseResource implements IResource { myFhirVersion = theValue; } - /** * Sets the value for fhirVersion (FHIR Version) * @@ -948,8 +890,9 @@ public class Conformance extends BaseResource implements IResource { * The version of the FHIR specification on which this conformance statement is based *

*/ - public void setFhirVersion( String theId) { + public Conformance setFhirVersion( String theId) { myFhirVersion = new IdDt(theId); + return this; } @@ -982,7 +925,6 @@ public class Conformance extends BaseResource implements IResource { myAcceptUnknown = theValue; } - /** * Sets the value for acceptUnknown (True if application accepts unknown elements) * @@ -991,8 +933,9 @@ public class Conformance extends BaseResource implements IResource { * A flag that indicates whether the application accepts unknown elements as part of a resource. *

*/ - public void setAcceptUnknown( Boolean theBoolean) { + public Conformance setAcceptUnknown( Boolean theBoolean) { myAcceptUnknown = new BooleanDt(theBoolean); + return this; } @@ -1039,6 +982,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for format (formats supported (xml | json | mime type)), + * creating it if it does not already exist. + * + *

+ * Definition: + * A list of the formats supported by this implementation + *

+ */ + public CodeDt getFormatFirstRep() { + if (getFormat().isEmpty()) { + return addFormat(); + } + return getFormat().get(0); + } /** * Adds a new value for format (formats supported (xml | json | mime type)) * @@ -1046,12 +1004,15 @@ public class Conformance extends BaseResource implements IResource { * Definition: * A list of the formats supported by this implementation *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addFormat( String theCode) { + public Conformance addFormat( String theCode) { if (myFormat == null) { myFormat = new java.util.ArrayList(); } - myFormat.add(new CodeDt(theCode)); + myFormat.add(new CodeDt(theCode)); + return this; } @@ -1084,7 +1045,19 @@ public class Conformance extends BaseResource implements IResource { myProfile = theValue; } - + /** + * Adds and returns a new value for profile (Profiles supported by the system) + * + *

+ * Definition: + * A list of profiles supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of recourses, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. + *

+ */ + public ResourceReferenceDt addProfile() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getProfile().add(newType); + return newType; + } /** * Gets the value(s) for rest (If the endpoint is a RESTful one). @@ -1129,6 +1102,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for rest (If the endpoint is a RESTful one), + * creating it if it does not already exist. + * + *

+ * Definition: + * A definition of the restful capabilities of the solution, if any + *

+ */ + public Rest getRestFirstRep() { + if (getRest().isEmpty()) { + return addRest(); + } + return getRest().get(0); + } /** * Gets the value(s) for messaging (If messaging is supported). @@ -1173,6 +1161,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for messaging (If messaging is supported), + * creating it if it does not already exist. + * + *

+ * Definition: + * A description of the messaging capabilities of the solution + *

+ */ + public Messaging getMessagingFirstRep() { + if (getMessaging().isEmpty()) { + return addMessaging(); + } + return getMessaging().get(0); + } /** * Gets the value(s) for document (Document definition). @@ -1217,6 +1220,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for document (Document definition), + * creating it if it does not already exist. + * + *

+ * Definition: + * A document definition + *

+ */ + public Document getDocumentFirstRep() { + if (getDocument().isEmpty()) { + return addDocument(); + } + return getDocument().get(0); + } /** * Block class for child element: Conformance.software (Software that is covered by this conformance statement) @@ -1295,7 +1313,6 @@ public class Conformance extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (A name the software is known by) * @@ -1304,8 +1321,9 @@ public class Conformance extends BaseResource implements IResource { * Name software is known by *

*/ - public void setName( String theString) { + public Software setName( String theString) { myName = new StringDt(theString); + return this; } @@ -1338,7 +1356,6 @@ public class Conformance extends BaseResource implements IResource { myVersion = theValue; } - /** * Sets the value for version (Version covered by this statement) * @@ -1347,8 +1364,9 @@ public class Conformance extends BaseResource implements IResource { * The version identifier for the software covered by this statement *

*/ - public void setVersion( String theString) { + public Software setVersion( String theString) { myVersion = new StringDt(theString); + return this; } @@ -1381,7 +1399,6 @@ public class Conformance extends BaseResource implements IResource { myReleaseDate = theValue; } - /** * Sets the value for releaseDate (Date this version released) * @@ -1390,8 +1407,9 @@ public class Conformance extends BaseResource implements IResource { * Date this version of the software released *

*/ - public void setReleaseDate( Date theDate, TemporalPrecisionEnum thePrecision) { + public Software setReleaseDate( Date theDate, TemporalPrecisionEnum thePrecision) { myReleaseDate = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -1402,8 +1420,9 @@ public class Conformance extends BaseResource implements IResource { * Date this version of the software released *

*/ - public void setReleaseDateWithSecondsPrecision( Date theDate) { + public Software setReleaseDateWithSecondsPrecision( Date theDate) { myReleaseDate = new DateTimeDt(theDate); + return this; } @@ -1481,7 +1500,6 @@ public class Conformance extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Describes this specific instance) * @@ -1490,8 +1508,9 @@ public class Conformance extends BaseResource implements IResource { * Information about the specific installation that this conformance statement relates to *

*/ - public void setDescription( String theString) { + public Implementation setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -1524,7 +1543,6 @@ public class Conformance extends BaseResource implements IResource { myUrl = theValue; } - /** * Sets the value for url (Base URL for the installation) * @@ -1533,8 +1551,9 @@ public class Conformance extends BaseResource implements IResource { * A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. *

*/ - public void setUrl( String theUri) { + public Implementation setUrl( String theUri) { myUrl = new UriDt(theUri); + return this; } @@ -1647,7 +1666,6 @@ public class Conformance extends BaseResource implements IResource { myMode = theValue; } - /** * Sets the value(s) for mode (client | server) * @@ -1690,7 +1708,6 @@ public class Conformance extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (General description of implementation) * @@ -1699,8 +1716,9 @@ public class Conformance extends BaseResource implements IResource { * Information about the system's restful capabilities that apply across all applications, such as security *

*/ - public void setDocumentation( String theString) { + public Rest setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } @@ -1733,7 +1751,6 @@ public class Conformance extends BaseResource implements IResource { mySecurity = theValue; } - /** * Gets the value(s) for resource (Resource served on the REST interface). @@ -1778,6 +1795,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for resource (Resource served on the REST interface), + * creating it if it does not already exist. + * + *

+ * Definition: + * A specification of the restful capabilities of the solution for a specific resource type + *

+ */ + public RestResource getResourceFirstRep() { + if (getResource().isEmpty()) { + return addResource(); + } + return getResource().get(0); + } /** * Gets the value(s) for operation (What operations are supported?). @@ -1822,6 +1854,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for operation (What operations are supported?), + * creating it if it does not already exist. + * + *

+ * Definition: + * A specification of restful operations supported by the system + *

+ */ + public RestOperation getOperationFirstRep() { + if (getOperation().isEmpty()) { + return addOperation(); + } + return getOperation().get(0); + } /** * Gets the value(s) for query (Definition of a named query). @@ -1866,6 +1913,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for query (Definition of a named query), + * creating it if it does not already exist. + * + *

+ * Definition: + * Definition of a named query and its parameters and their meaning + *

+ */ + public RestQuery getQueryFirstRep() { + if (getQuery().isEmpty()) { + return addQuery(); + } + return getQuery().get(0); + } /** * Gets the value(s) for documentMailbox (How documents are accepted in /Mailbox). @@ -1910,6 +1972,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for documentMailbox (How documents are accepted in /Mailbox), + * creating it if it does not already exist. + * + *

+ * Definition: + * A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier \"http://hl7.org/fhir/documents/mailbox\". Other specifications can declare their own identifier for this purpose + *

+ */ + public UriDt getDocumentMailboxFirstRep() { + if (getDocumentMailbox().isEmpty()) { + return addDocumentMailbox(); + } + return getDocumentMailbox().get(0); + } /** * Adds a new value for documentMailbox (How documents are accepted in /Mailbox) * @@ -1917,12 +1994,15 @@ public class Conformance extends BaseResource implements IResource { * Definition: * A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier \"http://hl7.org/fhir/documents/mailbox\". Other specifications can declare their own identifier for this purpose *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addDocumentMailbox( String theUri) { + public Rest addDocumentMailbox( String theUri) { if (myDocumentMailbox == null) { myDocumentMailbox = new java.util.ArrayList(); } - myDocumentMailbox.add(new UriDt(theUri)); + myDocumentMailbox.add(new UriDt(theUri)); + return this; } @@ -2013,7 +2093,6 @@ public class Conformance extends BaseResource implements IResource { myCors = theValue; } - /** * Sets the value for cors (Adds CORS Headers (http://enable-cors.org/)) * @@ -2022,8 +2101,9 @@ public class Conformance extends BaseResource implements IResource { * Server adds CORS headers when responding to requests - this enables javascript applications to yuse the server *

*/ - public void setCors( Boolean theBoolean) { + public RestSecurity setCors( Boolean theBoolean) { myCors = new BooleanDt(theBoolean); + return this; } @@ -2056,7 +2136,6 @@ public class Conformance extends BaseResource implements IResource { myService = theValue; } - /** * Add a value for service (OAuth | OAuth2 | NTLM | Basic | Kerberos) * @@ -2112,7 +2191,6 @@ public class Conformance extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (General description of how security works) * @@ -2121,8 +2199,9 @@ public class Conformance extends BaseResource implements IResource { * General description of how security works *

*/ - public void setDescription( String theString) { + public RestSecurity setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -2169,6 +2248,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for certificate (Certificates associated with security profiles), + * creating it if it does not already exist. + * + *

+ * Definition: + * Certificates associated with security profiles + *

+ */ + public RestSecurityCertificate getCertificateFirstRep() { + if (getCertificate().isEmpty()) { + return addCertificate(); + } + return getCertificate().get(0); + } } @@ -2243,7 +2337,6 @@ public class Conformance extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value for type (Mime type for certificate) * @@ -2252,8 +2345,9 @@ public class Conformance extends BaseResource implements IResource { * Mime type for certificate *

*/ - public void setType( String theCode) { + public RestSecurityCertificate setType( String theCode) { myType = new CodeDt(theCode); + return this; } @@ -2286,7 +2380,6 @@ public class Conformance extends BaseResource implements IResource { myBlob = theValue; } - /** * Sets the value for blob (Actual certificate) * @@ -2295,8 +2388,9 @@ public class Conformance extends BaseResource implements IResource { * Actual certificate *

*/ - public void setBlob( byte[] theBytes) { + public RestSecurityCertificate setBlob( byte[] theBytes) { myBlob = new Base64BinaryDt(theBytes); + return this; } @@ -2412,7 +2506,6 @@ public class Conformance extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (A resource type that is supported) * @@ -2455,7 +2548,6 @@ public class Conformance extends BaseResource implements IResource { myProfile = theValue; } - /** * Gets the value(s) for operation (What operations are supported?). @@ -2500,6 +2592,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for operation (What operations are supported?), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifies a restful operation supported by the solution + *

+ */ + public RestResourceOperation getOperationFirstRep() { + if (getOperation().isEmpty()) { + return addOperation(); + } + return getOperation().get(0); + } /** * Gets the value(s) for readHistory (Whether vRead can return past versions). @@ -2530,7 +2637,6 @@ public class Conformance extends BaseResource implements IResource { myReadHistory = theValue; } - /** * Sets the value for readHistory (Whether vRead can return past versions) * @@ -2539,8 +2645,9 @@ public class Conformance extends BaseResource implements IResource { * A flag for whether the server is able to return past versions as part of the vRead operation *

*/ - public void setReadHistory( Boolean theBoolean) { + public RestResource setReadHistory( Boolean theBoolean) { myReadHistory = new BooleanDt(theBoolean); + return this; } @@ -2573,7 +2680,6 @@ public class Conformance extends BaseResource implements IResource { myUpdateCreate = theValue; } - /** * Sets the value for updateCreate (If allows/uses update to a new location) * @@ -2582,8 +2688,9 @@ public class Conformance extends BaseResource implements IResource { * A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server *

*/ - public void setUpdateCreate( Boolean theBoolean) { + public RestResource setUpdateCreate( Boolean theBoolean) { myUpdateCreate = new BooleanDt(theBoolean); + return this; } @@ -2630,6 +2737,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for searchInclude (_include values supported by the server), + * creating it if it does not already exist. + * + *

+ * Definition: + * A list of _include values supported by the server + *

+ */ + public StringDt getSearchIncludeFirstRep() { + if (getSearchInclude().isEmpty()) { + return addSearchInclude(); + } + return getSearchInclude().get(0); + } /** * Adds a new value for searchInclude (_include values supported by the server) * @@ -2637,12 +2759,15 @@ public class Conformance extends BaseResource implements IResource { * Definition: * A list of _include values supported by the server *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addSearchInclude( String theString) { + public RestResource addSearchInclude( String theString) { if (mySearchInclude == null) { mySearchInclude = new java.util.ArrayList(); } - mySearchInclude.add(new StringDt(theString)); + mySearchInclude.add(new StringDt(theString)); + return this; } @@ -2689,6 +2814,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for searchParam (Additional search params defined), + * creating it if it does not already exist. + * + *

+ * Definition: + * Additional search parameters for implementations to support and/or make use of + *

+ */ + public RestResourceSearchParam getSearchParamFirstRep() { + if (getSearchParam().isEmpty()) { + return addSearchParam(); + } + return getSearchParam().get(0); + } } @@ -2763,7 +2903,6 @@ public class Conformance extends BaseResource implements IResource { myCode = theValue; } - /** * Sets the value(s) for code (read | vread | update | delete | history-instance | validate | history-type | create | search-type) * @@ -2806,7 +2945,6 @@ public class Conformance extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (Anything special about operation behavior) * @@ -2815,8 +2953,9 @@ public class Conformance extends BaseResource implements IResource { * Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only' *

*/ - public void setDocumentation( String theString) { + public RestResourceOperation setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } @@ -2922,7 +3061,6 @@ public class Conformance extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Name of search parameter) * @@ -2931,8 +3069,9 @@ public class Conformance extends BaseResource implements IResource { * The name of the search parameter used in the interface *

*/ - public void setName( String theString) { + public RestResourceSearchParam setName( String theString) { myName = new StringDt(theString); + return this; } @@ -2965,7 +3104,6 @@ public class Conformance extends BaseResource implements IResource { myDefinition = theValue; } - /** * Sets the value for definition (Source of definition for parameter) * @@ -2974,8 +3112,9 @@ public class Conformance extends BaseResource implements IResource { * A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter *

*/ - public void setDefinition( String theUri) { + public RestResourceSearchParam setDefinition( String theUri) { myDefinition = new UriDt(theUri); + return this; } @@ -3008,7 +3147,6 @@ public class Conformance extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (number | date | string | token | reference | composite | quantity) * @@ -3051,7 +3189,6 @@ public class Conformance extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (Server-specific usage) * @@ -3060,8 +3197,9 @@ public class Conformance extends BaseResource implements IResource { * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. *

*/ - public void setDocumentation( String theString) { + public RestResourceSearchParam setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } @@ -3094,7 +3232,6 @@ public class Conformance extends BaseResource implements IResource { myTarget = theValue; } - /** * Add a value for target (Types of resource (if a resource reference)) * @@ -3164,6 +3301,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for chain (Chained names supported), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public StringDt getChainFirstRep() { + if (getChain().isEmpty()) { + return addChain(); + } + return getChain().get(0); + } /** * Adds a new value for chain (Chained names supported) * @@ -3171,12 +3323,15 @@ public class Conformance extends BaseResource implements IResource { * Definition: * *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addChain( String theString) { + public RestResourceSearchParam addChain( String theString) { if (myChain == null) { myChain = new java.util.ArrayList(); } - myChain.add(new StringDt(theString)); + myChain.add(new StringDt(theString)); + return this; } @@ -3255,7 +3410,6 @@ public class Conformance extends BaseResource implements IResource { myCode = theValue; } - /** * Sets the value(s) for code (transaction | search-system | history-system) * @@ -3298,7 +3452,6 @@ public class Conformance extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (Anything special about operation behavior) * @@ -3307,8 +3460,9 @@ public class Conformance extends BaseResource implements IResource { * Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented *

*/ - public void setDocumentation( String theString) { + public RestOperation setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } @@ -3350,7 +3504,7 @@ public class Conformance extends BaseResource implements IResource { @Child(name="parameter", type=RestResourceSearchParam.class, order=3, min=0, max=Child.MAX_UNLIMITED) @Description( - shortDefinition="SearchParameter for the named query", + shortDefinition="Parameter for the named query", formalDefinition="Identifies which of the parameters for the named query are supported" ) private java.util.List myParameter; @@ -3400,7 +3554,6 @@ public class Conformance extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Special named queries (_query=)) * @@ -3409,8 +3562,9 @@ public class Conformance extends BaseResource implements IResource { * The name of a query, which is used in the _query parameter when the query is called *

*/ - public void setName( String theString) { + public RestQuery setName( String theString) { myName = new StringDt(theString); + return this; } @@ -3443,7 +3597,6 @@ public class Conformance extends BaseResource implements IResource { myDefinition = theValue; } - /** * Sets the value for definition (Where query is defined) * @@ -3452,8 +3605,9 @@ public class Conformance extends BaseResource implements IResource { * Identifies the custom query, defined either in FHIR core or another profile *

*/ - public void setDefinition( String theUri) { + public RestQuery setDefinition( String theUri) { myDefinition = new UriDt(theUri); + return this; } @@ -3486,7 +3640,6 @@ public class Conformance extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (Additional usage guidance) * @@ -3495,13 +3648,14 @@ public class Conformance extends BaseResource implements IResource { * Additional information about how the query functions in this particular implementation *

*/ - public void setDocumentation( String theString) { + public RestQuery setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } /** - * Gets the value(s) for parameter (SearchParameter for the named query). + * Gets the value(s) for parameter (Parameter for the named query). * creating it if it does * not exist. Will not return null. * @@ -3518,7 +3672,7 @@ public class Conformance extends BaseResource implements IResource { } /** - * Sets the value(s) for parameter (SearchParameter for the named query) + * Sets the value(s) for parameter (Parameter for the named query) * *

* Definition: @@ -3530,7 +3684,7 @@ public class Conformance extends BaseResource implements IResource { } /** - * Adds and returns a new value for parameter (SearchParameter for the named query) + * Adds and returns a new value for parameter (Parameter for the named query) * *

* Definition: @@ -3543,6 +3697,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for parameter (Parameter for the named query), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifies which of the parameters for the named query are supported + *

+ */ + public RestResourceSearchParam getParameterFirstRep() { + if (getParameter().isEmpty()) { + return addParameter(); + } + return getParameter().get(0); + } } @@ -3633,7 +3802,6 @@ public class Conformance extends BaseResource implements IResource { myEndpoint = theValue; } - /** * Sets the value for endpoint (Actual endpoint being described) * @@ -3642,8 +3810,9 @@ public class Conformance extends BaseResource implements IResource { * An address to which messages and/or replies are to be sent. *

*/ - public void setEndpoint( String theUri) { + public Messaging setEndpoint( String theUri) { myEndpoint = new UriDt(theUri); + return this; } @@ -3676,7 +3845,6 @@ public class Conformance extends BaseResource implements IResource { myReliableCache = theValue; } - /** * Sets the value for reliableCache (Reliable Message Cache Length) * @@ -3685,8 +3853,9 @@ public class Conformance extends BaseResource implements IResource { * Length if the receiver's reliable messaging cache (if a receiver) or how long the cache length on the receiver should be (if a sender) *

*/ - public void setReliableCache( Integer theInteger) { + public Messaging setReliableCache( Integer theInteger) { myReliableCache = new IntegerDt(theInteger); + return this; } @@ -3719,7 +3888,6 @@ public class Conformance extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (Messaging interface behavior details) * @@ -3728,8 +3896,9 @@ public class Conformance extends BaseResource implements IResource { * Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. *

*/ - public void setDocumentation( String theString) { + public Messaging setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } @@ -3776,6 +3945,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for event (Declare support for this event), + * creating it if it does not already exist. + * + *

+ * Definition: + * A description of the solution's support for an event at this end point. + *

+ */ + public MessagingEvent getEventFirstRep() { + if (getEvent().isEmpty()) { + return addEvent(); + } + return getEvent().get(0); + } } @@ -3896,7 +4080,6 @@ public class Conformance extends BaseResource implements IResource { myCode = theValue; } - /** * Gets the value(s) for category (Consequence | Currency | Notification). @@ -3927,7 +4110,6 @@ public class Conformance extends BaseResource implements IResource { myCategory = theValue; } - /** * Sets the value(s) for category (Consequence | Currency | Notification) * @@ -3970,7 +4152,6 @@ public class Conformance extends BaseResource implements IResource { myMode = theValue; } - /** * Sets the value(s) for mode (sender | receiver) * @@ -4027,6 +4208,21 @@ public class Conformance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for protocol (http | ftp | mllp +), + * creating it if it does not already exist. + * + *

+ * Definition: + * A list of the messaging transport protocol(s) identifiers, supported by this endpoint + *

+ */ + public CodingDt getProtocolFirstRep() { + if (getProtocol().isEmpty()) { + return addProtocol(); + } + return getProtocol().get(0); + } /** * Gets the value(s) for focus (Resource that's focus of message). @@ -4057,7 +4253,6 @@ public class Conformance extends BaseResource implements IResource { myFocus = theValue; } - /** * Sets the value(s) for focus (Resource that's focus of message) * @@ -4100,7 +4295,6 @@ public class Conformance extends BaseResource implements IResource { myRequest = theValue; } - /** * Gets the value(s) for response (Profile that describes the response). @@ -4131,7 +4325,6 @@ public class Conformance extends BaseResource implements IResource { myResponse = theValue; } - /** * Gets the value(s) for documentation (Endpoint-specific event documentation). @@ -4162,7 +4355,6 @@ public class Conformance extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (Endpoint-specific event documentation) * @@ -4171,8 +4363,9 @@ public class Conformance extends BaseResource implements IResource { * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. *

*/ - public void setDocumentation( String theString) { + public MessagingEvent setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } @@ -4260,7 +4453,6 @@ public class Conformance extends BaseResource implements IResource { myMode = theValue; } - /** * Sets the value(s) for mode (producer | consumer) * @@ -4303,7 +4495,6 @@ public class Conformance extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (Description of document support) * @@ -4312,8 +4503,9 @@ public class Conformance extends BaseResource implements IResource { * A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. *

*/ - public void setDocumentation( String theString) { + public Document setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } @@ -4346,7 +4538,6 @@ public class Conformance extends BaseResource implements IResource { myProfile = theValue; } - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java index 613fdaa9313..2aec4abf576 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java @@ -17,111 +17,21 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.api.TemporalPrecisionEnum; +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.dstu.composite.CodeableConceptDt; +import ca.uhn.fhir.model.dstu.composite.ContactDt; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -380,6 +290,21 @@ public class Device extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (Instance id from manufacturer, owner and others), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for type (What kind of device this is). @@ -410,7 +335,6 @@ public class Device extends BaseResource implements IResource { myType = theValue; } - /** * Gets the value(s) for manufacturer (Name of device manufacturer). @@ -441,7 +365,6 @@ public class Device extends BaseResource implements IResource { myManufacturer = theValue; } - /** * Sets the value for manufacturer (Name of device manufacturer) * @@ -450,8 +373,9 @@ public class Device extends BaseResource implements IResource { * A name of the manufacturer *

*/ - public void setManufacturer( String theString) { + public Device setManufacturer( String theString) { myManufacturer = new StringDt(theString); + return this; } @@ -484,7 +408,6 @@ public class Device extends BaseResource implements IResource { myModel = theValue; } - /** * Sets the value for model (Model id assigned by the manufacturer) * @@ -493,8 +416,9 @@ public class Device extends BaseResource implements IResource { * The \"model\" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type *

*/ - public void setModel( String theString) { + public Device setModel( String theString) { myModel = new StringDt(theString); + return this; } @@ -527,7 +451,6 @@ public class Device extends BaseResource implements IResource { myVersion = theValue; } - /** * Sets the value for version (Version number (i.e. software)) * @@ -536,8 +459,9 @@ public class Device extends BaseResource implements IResource { * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware *

*/ - public void setVersion( String theString) { + public Device setVersion( String theString) { myVersion = new StringDt(theString); + return this; } @@ -570,7 +494,6 @@ public class Device extends BaseResource implements IResource { myExpiry = theValue; } - /** * Sets the value for expiry (Date of expiry of this device (if applicable)) * @@ -579,8 +502,9 @@ public class Device extends BaseResource implements IResource { * Date of expiry of this device (if applicable) *

*/ - public void setExpiryWithDayPrecision( Date theDate) { - myExpiry = new DateDt(theDate); + public Device setExpiry( Date theDate, TemporalPrecisionEnum thePrecision) { + myExpiry = new DateDt(theDate, thePrecision); + return this; } /** @@ -591,8 +515,9 @@ public class Device extends BaseResource implements IResource { * Date of expiry of this device (if applicable) *

*/ - public void setExpiry( Date theDate, TemporalPrecisionEnum thePrecision) { - myExpiry = new DateDt(theDate, thePrecision); + public Device setExpiryWithDayPrecision( Date theDate) { + myExpiry = new DateDt(theDate); + return this; } @@ -625,7 +550,6 @@ public class Device extends BaseResource implements IResource { myUdi = theValue; } - /** * Sets the value for udi (FDA Mandated Unique Device Identifier) * @@ -634,8 +558,9 @@ public class Device extends BaseResource implements IResource { * FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm *

*/ - public void setUdi( String theString) { + public Device setUdi( String theString) { myUdi = new StringDt(theString); + return this; } @@ -668,7 +593,6 @@ public class Device extends BaseResource implements IResource { myLotNumber = theValue; } - /** * Sets the value for lotNumber (Lot number of manufacture) * @@ -677,8 +601,9 @@ public class Device extends BaseResource implements IResource { * Lot number assigned by the manufacturer *

*/ - public void setLotNumber( String theString) { + public Device setLotNumber( String theString) { myLotNumber = new StringDt(theString); + return this; } @@ -711,7 +636,6 @@ public class Device extends BaseResource implements IResource { myOwner = theValue; } - /** * Gets the value(s) for location (Where the resource is found). @@ -742,7 +666,6 @@ public class Device extends BaseResource implements IResource { myLocation = theValue; } - /** * Gets the value(s) for patient (If the resource is affixed to a person). @@ -773,7 +696,6 @@ public class Device extends BaseResource implements IResource { myPatient = theValue; } - /** * Gets the value(s) for contact (Details for human/organization for support). @@ -818,6 +740,21 @@ public class Device extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for contact (Details for human/organization for support), + * creating it if it does not already exist. + * + *

+ * Definition: + * Contact details for an organization or a particular human that is responsible for the device + *

+ */ + public ContactDt getContactFirstRep() { + if (getContact().isEmpty()) { + return addContact(); + } + return getContact().get(0); + } /** * Gets the value(s) for url (Network address to contact device). @@ -848,7 +785,6 @@ public class Device extends BaseResource implements IResource { myUrl = theValue; } - /** * Sets the value for url (Network address to contact device) * @@ -857,8 +793,9 @@ public class Device extends BaseResource implements IResource { * A network address on which the device may be contacted directly *

*/ - public void setUrl( String theUri) { + public Device setUrl( String theUri) { myUrl = new UriDt(theUri); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java index 39a1c923e4c..eef1b2c87c3 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java @@ -17,113 +17,28 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +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.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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -427,7 +342,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { mySubject = theValue; } - /** * Gets the value(s) for orderer (Who ordered the test). @@ -458,7 +372,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myOrderer = theValue; } - /** * Gets the value(s) for identifier (Identifiers assigned to this order). @@ -503,6 +416,21 @@ public class DiagnosticOrder extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (Identifiers assigned to this order), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifiers assigned to this order by the order or by the receiver + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for encounter (The encounter that this diagnostic order is associated with). @@ -533,7 +461,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myEncounter = theValue; } - /** * Gets the value(s) for clinicalNotes (Explanation/Justification for test). @@ -564,7 +491,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myClinicalNotes = theValue; } - /** * Sets the value for clinicalNotes (Explanation/Justification for test) * @@ -573,8 +499,9 @@ public class DiagnosticOrder extends BaseResource implements IResource { * An explanation or justification for why this diagnostic investigation is being requested *

*/ - public void setClinicalNotes( String theString) { + public DiagnosticOrder setClinicalNotes( String theString) { myClinicalNotes = new StringDt(theString); + return this; } @@ -607,7 +534,19 @@ public class DiagnosticOrder extends BaseResource implements IResource { mySpecimen = theValue; } - + /** + * Adds and returns a new value for specimen (If the whole order relates to specific specimens) + * + *

+ * Definition: + * One or more specimens that the diagnostic investigation is about + *

+ */ + public ResourceReferenceDt addSpecimen() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getSpecimen().add(newType); + return newType; + } /** * Gets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed). @@ -638,7 +577,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myStatus = theValue; } - /** * Sets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed) * @@ -681,7 +619,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myPriority = theValue; } - /** * Sets the value(s) for priority (routine | urgent | stat | asap) * @@ -738,6 +675,21 @@ public class DiagnosticOrder extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for event (A list of events of interest in the lifecycle), + * creating it if it does not already exist. + * + *

+ * Definition: + * A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed + *

+ */ + public Event getEventFirstRep() { + if (getEvent().isEmpty()) { + return addEvent(); + } + return getEvent().get(0); + } /** * Gets the value(s) for item (The items the orderer requested). @@ -782,6 +734,21 @@ public class DiagnosticOrder extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for item (The items the orderer requested), + * creating it if it does not already exist. + * + *

+ * Definition: + * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested + *

+ */ + public Item getItemFirstRep() { + if (getItem().isEmpty()) { + return addItem(); + } + return getItem().get(0); + } /** * Block class for child element: DiagnosticOrder.event (A list of events of interest in the lifecycle) @@ -870,7 +837,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myStatus = theValue; } - /** * Sets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed) * @@ -913,7 +879,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myDescription = theValue; } - /** * Gets the value(s) for dateTime (The date at which the event happened). @@ -944,7 +909,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myDateTime = theValue; } - /** * Sets the value for dateTime (The date at which the event happened) * @@ -953,8 +917,9 @@ public class DiagnosticOrder extends BaseResource implements IResource { * The date/time at which the event occurred *

*/ - public void setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { + public Event setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { myDateTime = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -965,8 +930,9 @@ public class DiagnosticOrder extends BaseResource implements IResource { * The date/time at which the event occurred *

*/ - public void setDateTimeWithSecondsPrecision( Date theDate) { + public Event setDateTimeWithSecondsPrecision( Date theDate) { myDateTime = new DateTimeDt(theDate); + return this; } @@ -996,7 +962,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myActor = theValue; } - } @@ -1095,7 +1060,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myCode = theValue; } - /** * Gets the value(s) for specimen (If this item relates to specific specimens). @@ -1126,7 +1090,19 @@ public class DiagnosticOrder extends BaseResource implements IResource { mySpecimen = theValue; } - + /** + * Adds and returns a new value for specimen (If this item relates to specific specimens) + * + *

+ * Definition: + * If the item is related to a specific speciment + *

+ */ + public ResourceReferenceDt addSpecimen() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getSpecimen().add(newType); + return newType; + } /** * Gets the value(s) for bodySite (Location of requested test (if applicable)). @@ -1157,7 +1133,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myBodySite = theValue; } - /** * Gets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed). @@ -1188,7 +1163,6 @@ public class DiagnosticOrder extends BaseResource implements IResource { myStatus = theValue; } - /** * Sets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed) * @@ -1245,6 +1219,21 @@ public class DiagnosticOrder extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for event (Events specific to this item), + * creating it if it does not already exist. + * + *

+ * Definition: + * A summary of the events of interest that have occurred as this item of the request is processed + *

+ */ + public Event getEventFirstRep() { + if (getEvent().isEmpty()) { + return addEvent(); + } + return getEvent().get(0); + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java index 4af544c50a3..0f9d1d5daa0 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java @@ -17,113 +17,30 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IDatatype; +import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; +import ca.uhn.fhir.model.api.IResourceBlock; +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.dstu.composite.AttachmentDt; +import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.composite.PeriodDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -296,10 +213,10 @@ public class DiagnosticReport extends BaseResource implements IResource { private DateTimeDt myIssued; @Child(name="subject", order=3, min=1, max=1, type={ - Patient.class, - Group.class, - Device.class, - Location.class, + ca.uhn.fhir.model.dstu.resource.Patient.class, + ca.uhn.fhir.model.dstu.resource.Group.class, + ca.uhn.fhir.model.dstu.resource.Device.class, + ca.uhn.fhir.model.dstu.resource.Location.class, }) @Description( shortDefinition="The subject of the report, usually, but not always, the patient", @@ -308,8 +225,8 @@ public class DiagnosticReport extends BaseResource implements IResource { private ResourceReferenceDt mySubject; @Child(name="performer", order=4, min=1, max=1, type={ - Practitioner.class, - Organization.class, + ca.uhn.fhir.model.dstu.resource.Practitioner.class, + ca.uhn.fhir.model.dstu.resource.Organization.class, }) @Description( shortDefinition="Responsible Diagnostic Service", @@ -325,7 +242,7 @@ public class DiagnosticReport extends BaseResource implements IResource { private IdentifierDt myIdentifier; @Child(name="requestDetail", order=6, min=0, max=Child.MAX_UNLIMITED, type={ - DiagnosticOrder.class, + ca.uhn.fhir.model.dstu.resource.DiagnosticOrder.class, }) @Description( shortDefinition="What was requested", @@ -351,7 +268,7 @@ public class DiagnosticReport extends BaseResource implements IResource { private IDatatype myDiagnostic; @Child(name="specimen", order=9, min=0, max=Child.MAX_UNLIMITED, type={ - Specimen.class, + ca.uhn.fhir.model.dstu.resource.Specimen.class, }) @Description( shortDefinition="Specimens this report is based on", @@ -360,7 +277,7 @@ public class DiagnosticReport extends BaseResource implements IResource { private java.util.List mySpecimen; @Child(name="result", order=10, min=0, max=Child.MAX_UNLIMITED, type={ - Observation.class, + ca.uhn.fhir.model.dstu.resource.Observation.class, }) @Description( shortDefinition="Observations - simple, or complex nested groups", @@ -369,7 +286,7 @@ public class DiagnosticReport extends BaseResource implements IResource { private java.util.List myResult; @Child(name="imagingStudy", order=11, min=0, max=Child.MAX_UNLIMITED, type={ - ImagingStudy.class, + ca.uhn.fhir.model.dstu.resource.ImagingStudy.class, }) @Description( shortDefinition="Reference to full details of imaging associated with the diagnostic report", @@ -530,8 +447,9 @@ public class DiagnosticReport extends BaseResource implements IResource { * The date and/or time that this version of the report was released from the source diagnostic service *

*/ - public void setIssuedWithSecondsPrecision( Date theDate) { - myIssued = new DateTimeDt(theDate); + public DiagnosticReport setIssued( Date theDate, TemporalPrecisionEnum thePrecision) { + myIssued = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -542,8 +460,9 @@ public class DiagnosticReport extends BaseResource implements IResource { * The date and/or time that this version of the report was released from the source diagnostic service *

*/ - public void setIssued( Date theDate, TemporalPrecisionEnum thePrecision) { - myIssued = new DateTimeDt(theDate, thePrecision); + public DiagnosticReport setIssuedWithSecondsPrecision( Date theDate) { + myIssued = new DateTimeDt(theDate); + return this; } @@ -902,6 +821,22 @@ public class DiagnosticReport extends BaseResource implements IResource { getImage().add(newType); return newType; } + + /** + * Gets the first repetition for image (Key images associated with this report), + * creating it if it does not already exist. + * + *

+ * Definition: + * A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest) + *

+ */ + public Image getImageFirstRep() { + if (getImage().isEmpty()) { + return addImage(); + } + return getImage().get(0); + } /** * Gets the value(s) for conclusion (Clinical Interpretation of test results). @@ -940,8 +875,9 @@ public class DiagnosticReport extends BaseResource implements IResource { * Concise and clinically contextualized narrative interpretation of the diagnostic report *

*/ - public void setConclusion( String theString) { + public DiagnosticReport setConclusion( String theString) { myConclusion = new StringDt(theString); + return this; } @@ -987,6 +923,22 @@ public class DiagnosticReport extends BaseResource implements IResource { getCodedDiagnosis().add(newType); return newType; } + + /** + * Gets the first repetition for codedDiagnosis (Codes for the conclusion), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public CodeableConceptDt getCodedDiagnosisFirstRep() { + if (getCodedDiagnosis().isEmpty()) { + return addCodedDiagnosis(); + } + return getCodedDiagnosis().get(0); + } /** * Gets the value(s) for presentedForm (Entire Report as issued). @@ -1030,6 +982,22 @@ public class DiagnosticReport extends BaseResource implements IResource { getPresentedForm().add(newType); return newType; } + + /** + * Gets the first repetition for presentedForm (Entire Report as issued), + * creating it if it does not already exist. + * + *

+ * Definition: + * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. + *

+ */ + public AttachmentDt getPresentedFormFirstRep() { + if (getPresentedForm().isEmpty()) { + return addPresentedForm(); + } + return getPresentedForm().get(0); + } /** * Block class for child element: DiagnosticReport.image (Key images associated with this report) @@ -1050,7 +1018,7 @@ public class DiagnosticReport extends BaseResource implements IResource { private StringDt myComment; @Child(name="link", order=1, min=1, max=1, type={ - Media.class, + ca.uhn.fhir.model.dstu.resource.Media.class, }) @Description( shortDefinition="Reference to the image source", @@ -1111,8 +1079,9 @@ public class DiagnosticReport extends BaseResource implements IResource { * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features *

*/ - public void setComment( String theString) { + public Image setComment( String theString) { myComment = new StringDt(theString); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java index acdb57ef498..705d56ab7a2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java @@ -17,113 +17,32 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +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.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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; +import ca.uhn.fhir.model.dstu.composite.DurationDt; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.composite.PeriodDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -406,6 +325,21 @@ public class Encounter extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (Identifier(s) by which this encounter is known), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for status (planned | in progress | onleave | finished | cancelled). @@ -436,7 +370,6 @@ public class Encounter extends BaseResource implements IResource { myStatus = theValue; } - /** * Sets the value(s) for status (planned | in progress | onleave | finished | cancelled) * @@ -479,7 +412,6 @@ public class Encounter extends BaseResource implements IResource { myClassElement = theValue; } - /** * Sets the value(s) for class (inpatient | outpatient | ambulatory | emergency +) * @@ -522,7 +454,6 @@ public class Encounter extends BaseResource implements IResource { myType = theValue; } - /** * Add a value for type (Specific type of encounter) * @@ -578,7 +509,6 @@ public class Encounter extends BaseResource implements IResource { mySubject = theValue; } - /** * Gets the value(s) for participant (List of participants involved in the encounter). @@ -623,6 +553,21 @@ public class Encounter extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for participant (List of participants involved in the encounter), + * creating it if it does not already exist. + * + *

+ * Definition: + * The main practitioner responsible for providing the service + *

+ */ + public Participant getParticipantFirstRep() { + if (getParticipant().isEmpty()) { + return addParticipant(); + } + return getParticipant().get(0); + } /** * Gets the value(s) for period (The start and end time of the encounter). @@ -653,7 +598,6 @@ public class Encounter extends BaseResource implements IResource { myPeriod = theValue; } - /** * Gets the value(s) for length (Quantity of time the encounter lasted). @@ -684,7 +628,6 @@ public class Encounter extends BaseResource implements IResource { myLength = theValue; } - /** * Gets the value(s) for reason (Reason the encounter takes place (code)). @@ -715,7 +658,6 @@ public class Encounter extends BaseResource implements IResource { myReason = theValue; } - /** * Sets the value(s) for reason (Reason the encounter takes place (code)) * @@ -758,7 +700,6 @@ public class Encounter extends BaseResource implements IResource { myIndication = theValue; } - /** * Gets the value(s) for priority (Indicates the urgency of the encounter). @@ -789,7 +730,6 @@ public class Encounter extends BaseResource implements IResource { myPriority = theValue; } - /** * Gets the value(s) for hospitalization (Details about an admission to a clinic). @@ -820,7 +760,6 @@ public class Encounter extends BaseResource implements IResource { myHospitalization = theValue; } - /** * Gets the value(s) for location (List of locations the patient has been at). @@ -865,6 +804,21 @@ public class Encounter extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for location (List of locations the patient has been at), + * creating it if it does not already exist. + * + *

+ * Definition: + * List of locations at which the patient has been + *

+ */ + public Location getLocationFirstRep() { + if (getLocation().isEmpty()) { + return addLocation(); + } + return getLocation().get(0); + } /** * Gets the value(s) for serviceProvider (Department or team providing care). @@ -895,7 +849,6 @@ public class Encounter extends BaseResource implements IResource { myServiceProvider = theValue; } - /** * Gets the value(s) for partOf (Another Encounter this encounter is part of). @@ -926,7 +879,6 @@ public class Encounter extends BaseResource implements IResource { myPartOf = theValue; } - /** * Block class for child element: Encounter.participant (List of participants involved in the encounter) @@ -1001,7 +953,6 @@ public class Encounter extends BaseResource implements IResource { myType = theValue; } - /** * Add a value for type (Role of participant in encounter) * @@ -1054,7 +1005,6 @@ public class Encounter extends BaseResource implements IResource { myIndividual = theValue; } - } @@ -1206,7 +1156,6 @@ public class Encounter extends BaseResource implements IResource { myPreAdmissionIdentifier = theValue; } - /** * Gets the value(s) for origin (The location from which the patient came before admission). @@ -1237,7 +1186,6 @@ public class Encounter extends BaseResource implements IResource { myOrigin = theValue; } - /** * Gets the value(s) for admitSource (From where patient was admitted (physician referral, transfer)). @@ -1268,7 +1216,6 @@ public class Encounter extends BaseResource implements IResource { myAdmitSource = theValue; } - /** * Sets the value(s) for admitSource (From where patient was admitted (physician referral, transfer)) * @@ -1311,7 +1258,6 @@ public class Encounter extends BaseResource implements IResource { myPeriod = theValue; } - /** * Gets the value(s) for accomodation (Where the patient stays during this encounter). @@ -1356,6 +1302,21 @@ public class Encounter extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for accomodation (Where the patient stays during this encounter), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public HospitalizationAccomodation getAccomodationFirstRep() { + if (getAccomodation().isEmpty()) { + return addAccomodation(); + } + return getAccomodation().get(0); + } /** * Gets the value(s) for diet (Dietary restrictions for the patient). @@ -1386,7 +1347,6 @@ public class Encounter extends BaseResource implements IResource { myDiet = theValue; } - /** * Gets the value(s) for specialCourtesy (Special courtesies (VIP, board member)). @@ -1431,6 +1391,21 @@ public class Encounter extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for specialCourtesy (Special courtesies (VIP, board member)), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public CodeableConceptDt getSpecialCourtesyFirstRep() { + if (getSpecialCourtesy().isEmpty()) { + return addSpecialCourtesy(); + } + return getSpecialCourtesy().get(0); + } /** * Gets the value(s) for specialArrangement (Wheelchair, translator, stretcher, etc). @@ -1475,6 +1450,21 @@ public class Encounter extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for specialArrangement (Wheelchair, translator, stretcher, etc), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public CodeableConceptDt getSpecialArrangementFirstRep() { + if (getSpecialArrangement().isEmpty()) { + return addSpecialArrangement(); + } + return getSpecialArrangement().get(0); + } /** * Gets the value(s) for destination (Location to which the patient is discharged). @@ -1505,7 +1495,6 @@ public class Encounter extends BaseResource implements IResource { myDestination = theValue; } - /** * Gets the value(s) for dischargeDisposition (Category or kind of location after discharge). @@ -1536,7 +1525,6 @@ public class Encounter extends BaseResource implements IResource { myDischargeDisposition = theValue; } - /** * Gets the value(s) for dischargeDiagnosis (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete). @@ -1567,7 +1555,6 @@ public class Encounter extends BaseResource implements IResource { myDischargeDiagnosis = theValue; } - /** * Gets the value(s) for reAdmission (Is this hospitalization a readmission?). @@ -1598,7 +1585,6 @@ public class Encounter extends BaseResource implements IResource { myReAdmission = theValue; } - /** * Sets the value for reAdmission (Is this hospitalization a readmission?) * @@ -1607,8 +1593,9 @@ public class Encounter extends BaseResource implements IResource { * Whether this hospitalization is a readmission *

*/ - public void setReAdmission( Boolean theBoolean) { + public Hospitalization setReAdmission( Boolean theBoolean) { myReAdmission = new BooleanDt(theBoolean); + return this; } @@ -1687,7 +1674,6 @@ public class Encounter extends BaseResource implements IResource { myBed = theValue; } - /** * Gets the value(s) for period (Period during which the patient was assigned the bed). @@ -1718,7 +1704,6 @@ public class Encounter extends BaseResource implements IResource { myPeriod = theValue; } - } @@ -1797,7 +1782,6 @@ public class Encounter extends BaseResource implements IResource { myLocation = theValue; } - /** * Gets the value(s) for period (Time period during which the patient was present at the location). @@ -1828,7 +1812,6 @@ public class Encounter extends BaseResource implements IResource { myPeriod = theValue; } - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java index 3f4dbfc4710..27fd90b1390 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java @@ -17,113 +17,29 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IDatatype; +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.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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; import ca.uhn.fhir.model.dstu.composite.QuantityDt; import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; +import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -341,7 +257,6 @@ public class Group extends BaseResource implements IResource { myIdentifier = theValue; } - /** * Gets the value(s) for type (person | animal | practitioner | device | medication | substance). @@ -372,7 +287,6 @@ public class Group extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (person | animal | practitioner | device | medication | substance) * @@ -415,7 +329,6 @@ public class Group extends BaseResource implements IResource { myActual = theValue; } - /** * Sets the value for actual (Descriptive or actual) * @@ -424,8 +337,9 @@ public class Group extends BaseResource implements IResource { * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals *

*/ - public void setActual( Boolean theBoolean) { + public Group setActual( Boolean theBoolean) { myActual = new BooleanDt(theBoolean); + return this; } @@ -458,7 +372,6 @@ public class Group extends BaseResource implements IResource { myCode = theValue; } - /** * Gets the value(s) for name (Label for Group). @@ -489,7 +402,6 @@ public class Group extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Label for Group) * @@ -498,8 +410,9 @@ public class Group extends BaseResource implements IResource { * A label assigned to the group for human identification and communication *

*/ - public void setName( String theString) { + public Group setName( String theString) { myName = new StringDt(theString); + return this; } @@ -532,7 +445,6 @@ public class Group extends BaseResource implements IResource { myQuantity = theValue; } - /** * Sets the value for quantity (Number of members) * @@ -541,8 +453,9 @@ public class Group extends BaseResource implements IResource { * A count of the number of resource instances that are part of the group *

*/ - public void setQuantity( Integer theInteger) { + public Group setQuantity( Integer theInteger) { myQuantity = new IntegerDt(theInteger); + return this; } @@ -589,6 +502,21 @@ public class Group extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for characteristic (Trait of group members), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifies the traits shared by members of the group + *

+ */ + public Characteristic getCharacteristicFirstRep() { + if (getCharacteristic().isEmpty()) { + return addCharacteristic(); + } + return getCharacteristic().get(0); + } /** * Gets the value(s) for member (Who is in group). @@ -616,7 +544,19 @@ public class Group extends BaseResource implements IResource { myMember = theValue; } - + /** + * Adds and returns a new value for member (Who is in group) + * + *

+ * Definition: + * Identifies the resource instances that are members of the group. + *

+ */ + public ResourceReferenceDt addMember() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getMember().add(newType); + return newType; + } /** * Block class for child element: Group.characteristic (Trait of group members) @@ -700,7 +640,6 @@ public class Group extends BaseResource implements IResource { myCode = theValue; } - /** * Gets the value(s) for value[x] (Value held by characteristic). @@ -728,7 +667,6 @@ public class Group extends BaseResource implements IResource { myValue = theValue; } - /** * Gets the value(s) for exclude (Group includes or excludes). @@ -759,7 +697,6 @@ public class Group extends BaseResource implements IResource { myExclude = theValue; } - /** * Sets the value for exclude (Group includes or excludes) * @@ -768,8 +705,9 @@ public class Group extends BaseResource implements IResource { * If true, indicates the characteristic is one that is NOT held by members of the group *

*/ - public void setExclude( Boolean theBoolean) { + public Characteristic setExclude( Boolean theBoolean) { myExclude = new BooleanDt(theBoolean); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java index 6aa07ceba9c..6db264d284b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java @@ -17,109 +17,28 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; +import ca.uhn.fhir.model.api.IResourceBlock; +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.dstu.composite.CodingDt; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; +import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; +import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -416,7 +335,6 @@ public class ImagingStudy extends BaseResource implements IResource { myDateTime = theValue; } - /** * Sets the value for dateTime (When the study was performed) * @@ -425,8 +343,9 @@ public class ImagingStudy extends BaseResource implements IResource { * Date and Time the study took place *

*/ - public void setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { + public ImagingStudy setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { myDateTime = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -437,8 +356,9 @@ public class ImagingStudy extends BaseResource implements IResource { * Date and Time the study took place *

*/ - public void setDateTimeWithSecondsPrecision( Date theDate) { + public ImagingStudy setDateTimeWithSecondsPrecision( Date theDate) { myDateTime = new DateTimeDt(theDate); + return this; } @@ -471,7 +391,6 @@ public class ImagingStudy extends BaseResource implements IResource { mySubject = theValue; } - /** * Gets the value(s) for uid (Formal identifier for the study (0020,000D)). @@ -502,7 +421,6 @@ public class ImagingStudy extends BaseResource implements IResource { myUid = theValue; } - /** * Gets the value(s) for accessionNo (Accession Number (0008,0050)). @@ -533,7 +451,6 @@ public class ImagingStudy extends BaseResource implements IResource { myAccessionNo = theValue; } - /** * Gets the value(s) for identifier (Other identifiers for the study (0020,0010)). @@ -578,6 +495,21 @@ public class ImagingStudy extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (Other identifiers for the study (0020,0010)), + * creating it if it does not already exist. + * + *

+ * Definition: + * Other identifiers for the study + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for order (Order(s) that caused this study to be performed). @@ -608,7 +540,19 @@ public class ImagingStudy extends BaseResource implements IResource { myOrder = theValue; } - + /** + * Adds and returns a new value for order (Order(s) that caused this study to be performed) + * + *

+ * Definition: + * A list of the diagnostic orders that resulted in this imaging study being performed + *

+ */ + public ResourceReferenceDt addOrder() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getOrder().add(newType); + return newType; + } /** * Gets the value(s) for modality (All series.modality if actual acquisition modalities). @@ -639,7 +583,6 @@ public class ImagingStudy extends BaseResource implements IResource { myModality = theValue; } - /** * Add a value for modality (All series.modality if actual acquisition modalities) * @@ -695,7 +638,6 @@ public class ImagingStudy extends BaseResource implements IResource { myReferrer = theValue; } - /** * Gets the value(s) for availability (ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)). @@ -726,7 +668,6 @@ public class ImagingStudy extends BaseResource implements IResource { myAvailability = theValue; } - /** * Sets the value(s) for availability (ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)) * @@ -769,7 +710,6 @@ public class ImagingStudy extends BaseResource implements IResource { myUrl = theValue; } - /** * Sets the value for url (Retrieve URI (0008,1190)) * @@ -778,8 +718,9 @@ public class ImagingStudy extends BaseResource implements IResource { * WADO-RS URI where Study is available *

*/ - public void setUrl( String theUri) { + public ImagingStudy setUrl( String theUri) { myUrl = new UriDt(theUri); + return this; } @@ -812,7 +753,6 @@ public class ImagingStudy extends BaseResource implements IResource { myNumberOfSeries = theValue; } - /** * Sets the value for numberOfSeries (Number of Study Related Series (0020,1206)) * @@ -821,8 +761,9 @@ public class ImagingStudy extends BaseResource implements IResource { * Number of Series in Study *

*/ - public void setNumberOfSeries( Integer theInteger) { + public ImagingStudy setNumberOfSeries( Integer theInteger) { myNumberOfSeries = new IntegerDt(theInteger); + return this; } @@ -855,7 +796,6 @@ public class ImagingStudy extends BaseResource implements IResource { myNumberOfInstances = theValue; } - /** * Sets the value for numberOfInstances (Number of Study Related Instances (0020,1208)) * @@ -864,8 +804,9 @@ public class ImagingStudy extends BaseResource implements IResource { * Number of SOP Instances in Study *

*/ - public void setNumberOfInstances( Integer theInteger) { + public ImagingStudy setNumberOfInstances( Integer theInteger) { myNumberOfInstances = new IntegerDt(theInteger); + return this; } @@ -898,7 +839,6 @@ public class ImagingStudy extends BaseResource implements IResource { myClinicalInformation = theValue; } - /** * Sets the value for clinicalInformation (Diagnoses etc with request (0040,1002)) * @@ -907,8 +847,9 @@ public class ImagingStudy extends BaseResource implements IResource { * Diagnoses etc provided with request *

*/ - public void setClinicalInformation( String theString) { + public ImagingStudy setClinicalInformation( String theString) { myClinicalInformation = new StringDt(theString); + return this; } @@ -955,6 +896,21 @@ public class ImagingStudy extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for procedure (Type of procedure performed (0008,1032)), + * creating it if it does not already exist. + * + *

+ * Definition: + * Type of procedure performed + *

+ */ + public CodingDt getProcedureFirstRep() { + if (getProcedure().isEmpty()) { + return addProcedure(); + } + return getProcedure().get(0); + } /** * Gets the value(s) for interpreter (Who interpreted images (0008,1060)). @@ -985,7 +941,6 @@ public class ImagingStudy extends BaseResource implements IResource { myInterpreter = theValue; } - /** * Gets the value(s) for description (Institution-generated description (0008,1030)). @@ -1016,7 +971,6 @@ public class ImagingStudy extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Institution-generated description (0008,1030)) * @@ -1025,8 +979,9 @@ public class ImagingStudy extends BaseResource implements IResource { * Institution-generated description or classification of the Study (component) performed *

*/ - public void setDescription( String theString) { + public ImagingStudy setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -1073,6 +1028,21 @@ public class ImagingStudy extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for series (Each study has one or more series of instances), + * creating it if it does not already exist. + * + *

+ * Definition: + * Each study has one or more series of image instances + *

+ */ + public Series getSeriesFirstRep() { + if (getSeries().isEmpty()) { + return addSeries(); + } + return getSeries().get(0); + } /** * Block class for child element: ImagingStudy.series (Each study has one or more series of instances) @@ -1200,7 +1170,6 @@ public class ImagingStudy extends BaseResource implements IResource { myNumber = theValue; } - /** * Sets the value for number (Number of this series in overall sequence (0020,0011)) * @@ -1209,8 +1178,9 @@ public class ImagingStudy extends BaseResource implements IResource { * The number of this series in the overall sequence *

*/ - public void setNumber( Integer theInteger) { + public Series setNumber( Integer theInteger) { myNumber = new IntegerDt(theInteger); + return this; } @@ -1243,7 +1213,6 @@ public class ImagingStudy extends BaseResource implements IResource { myModality = theValue; } - /** * Sets the value(s) for modality (The modality of the instances in the series (0008,0060)) * @@ -1286,7 +1255,6 @@ public class ImagingStudy extends BaseResource implements IResource { myUid = theValue; } - /** * Gets the value(s) for description (A description of the series (0008,103E)). @@ -1317,7 +1285,6 @@ public class ImagingStudy extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (A description of the series (0008,103E)) * @@ -1326,8 +1293,9 @@ public class ImagingStudy extends BaseResource implements IResource { * A description of the series *

*/ - public void setDescription( String theString) { + public Series setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -1360,7 +1328,6 @@ public class ImagingStudy extends BaseResource implements IResource { myNumberOfInstances = theValue; } - /** * Sets the value for numberOfInstances (Number of Series Related Instances (0020,1209)) * @@ -1369,8 +1336,9 @@ public class ImagingStudy extends BaseResource implements IResource { * Sequence that contains attributes from the *

*/ - public void setNumberOfInstances( Integer theInteger) { + public Series setNumberOfInstances( Integer theInteger) { myNumberOfInstances = new IntegerDt(theInteger); + return this; } @@ -1403,7 +1371,6 @@ public class ImagingStudy extends BaseResource implements IResource { myAvailability = theValue; } - /** * Sets the value(s) for availability (ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)) * @@ -1446,7 +1413,6 @@ public class ImagingStudy extends BaseResource implements IResource { myUrl = theValue; } - /** * Sets the value for url (Retrieve URI (0008,1115 > 0008,1190)) * @@ -1455,8 +1421,9 @@ public class ImagingStudy extends BaseResource implements IResource { * WADO-RS URI where Series is available *

*/ - public void setUrl( String theUri) { + public Series setUrl( String theUri) { myUrl = new UriDt(theUri); + return this; } @@ -1489,7 +1456,6 @@ public class ImagingStudy extends BaseResource implements IResource { myBodySite = theValue; } - /** * Gets the value(s) for dateTime (When the series started). @@ -1520,7 +1486,6 @@ public class ImagingStudy extends BaseResource implements IResource { myDateTime = theValue; } - /** * Sets the value for dateTime (When the series started) * @@ -1529,8 +1494,9 @@ public class ImagingStudy extends BaseResource implements IResource { * *

*/ - public void setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { + public Series setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { myDateTime = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -1541,8 +1507,9 @@ public class ImagingStudy extends BaseResource implements IResource { * *

*/ - public void setDateTimeWithSecondsPrecision( Date theDate) { + public Series setDateTimeWithSecondsPrecision( Date theDate) { myDateTime = new DateTimeDt(theDate); + return this; } @@ -1589,6 +1556,21 @@ public class ImagingStudy extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for instance (A single instance taken from a patient (image or other)), + * creating it if it does not already exist. + * + *

+ * Definition: + * A single image taken from a patient + *

+ */ + public SeriesInstance getInstanceFirstRep() { + if (getInstance().isEmpty()) { + return addInstance(); + } + return getInstance().get(0); + } } @@ -1700,7 +1682,6 @@ public class ImagingStudy extends BaseResource implements IResource { myNumber = theValue; } - /** * Sets the value for number (The number of this instance in the series (0020,0013)) * @@ -1709,8 +1690,9 @@ public class ImagingStudy extends BaseResource implements IResource { * The number of this image in the series *

*/ - public void setNumber( Integer theInteger) { + public SeriesInstance setNumber( Integer theInteger) { myNumber = new IntegerDt(theInteger); + return this; } @@ -1743,7 +1725,6 @@ public class ImagingStudy extends BaseResource implements IResource { myUid = theValue; } - /** * Gets the value(s) for sopclass (DICOM class type (0008,0016)). @@ -1774,7 +1755,6 @@ public class ImagingStudy extends BaseResource implements IResource { mySopclass = theValue; } - /** * Gets the value(s) for type (Type of instance (image etc) (0004,1430)). @@ -1805,7 +1785,6 @@ public class ImagingStudy extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value for type (Type of instance (image etc) (0004,1430)) * @@ -1814,8 +1793,9 @@ public class ImagingStudy extends BaseResource implements IResource { * *

*/ - public void setType( String theString) { + public SeriesInstance setType( String theString) { myType = new StringDt(theString); + return this; } @@ -1848,7 +1828,6 @@ public class ImagingStudy extends BaseResource implements IResource { myTitle = theValue; } - /** * Sets the value for title (Description (0070,0080 | 0040,A043 > 0008,0104 | 0042,0010 | 0008,0008)) * @@ -1857,8 +1836,9 @@ public class ImagingStudy extends BaseResource implements IResource { * *

*/ - public void setTitle( String theString) { + public SeriesInstance setTitle( String theString) { myTitle = new StringDt(theString); + return this; } @@ -1891,7 +1871,6 @@ public class ImagingStudy extends BaseResource implements IResource { myUrl = theValue; } - /** * Sets the value for url (WADO-RS service where instance is available (0008,1199 > 0008,1190)) * @@ -1900,8 +1879,9 @@ public class ImagingStudy extends BaseResource implements IResource { * WADO-RS url where image is available *

*/ - public void setUrl( String theUri) { + public SeriesInstance setUrl( String theUri) { myUrl = new UriDt(theUri); + return this; } @@ -1934,7 +1914,6 @@ public class ImagingStudy extends BaseResource implements IResource { myAttachment = theValue; } - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java index b51a3276ce8..662830b7b37 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java @@ -17,113 +17,30 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +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.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.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -357,7 +274,6 @@ public class Location extends BaseResource implements IResource { myIdentifier = theValue; } - /** * Gets the value(s) for name (Name of the location as used by humans). @@ -388,7 +304,6 @@ public class Location extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Name of the location as used by humans) * @@ -397,8 +312,9 @@ public class Location extends BaseResource implements IResource { * Name of the location as used by humans. Does not need to be unique. *

*/ - public void setName( String theString) { + public Location setName( String theString) { myName = new StringDt(theString); + return this; } @@ -431,7 +347,6 @@ public class Location extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Description of the Location, which helps in finding or referencing the place) * @@ -440,8 +355,9 @@ public class Location extends BaseResource implements IResource { * Description of the Location, which helps in finding or referencing the place *

*/ - public void setDescription( String theString) { + public Location setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -474,7 +390,6 @@ public class Location extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (Indicates the type of function performed at the location) * @@ -531,6 +446,21 @@ public class Location extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (Contact details of the location), + * creating it if it does not already exist. + * + *

+ * Definition: + * The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for address (Physical location). @@ -561,7 +491,6 @@ public class Location extends BaseResource implements IResource { myAddress = theValue; } - /** * Gets the value(s) for physicalType (Physical form of the location). @@ -592,7 +521,6 @@ public class Location extends BaseResource implements IResource { myPhysicalType = theValue; } - /** * Gets the value(s) for position (The absolute geographic location). @@ -623,7 +551,6 @@ public class Location extends BaseResource implements IResource { myPosition = theValue; } - /** * Gets the value(s) for managingOrganization (The organization that is responsible for the provisioning and upkeep of the location). @@ -654,7 +581,6 @@ public class Location extends BaseResource implements IResource { myManagingOrganization = theValue; } - /** * Gets the value(s) for status (active | suspended | inactive). @@ -685,7 +611,6 @@ public class Location extends BaseResource implements IResource { myStatus = theValue; } - /** * Sets the value(s) for status (active | suspended | inactive) * @@ -728,7 +653,6 @@ public class Location extends BaseResource implements IResource { myPartOf = theValue; } - /** * Gets the value(s) for mode (instance | kind). @@ -759,7 +683,6 @@ public class Location extends BaseResource implements IResource { myMode = theValue; } - /** * Sets the value(s) for mode (instance | kind) * @@ -850,7 +773,6 @@ public class Location extends BaseResource implements IResource { myLongitude = theValue; } - /** * Sets the value for longitude (Longitude as expressed in KML) * @@ -859,8 +781,9 @@ public class Location extends BaseResource implements IResource { * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below) *

*/ - public void setLongitude( long theValue) { + public Position setLongitude( long theValue) { myLongitude = new DecimalDt(theValue); + return this; } /** @@ -871,8 +794,9 @@ public class Location extends BaseResource implements IResource { * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below) *

*/ - public void setLongitude( double theValue) { + public Position setLongitude( double theValue) { myLongitude = new DecimalDt(theValue); + return this; } /** @@ -883,8 +807,9 @@ public class Location extends BaseResource implements IResource { * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below) *

*/ - public void setLongitude( java.math.BigDecimal theValue) { + public Position setLongitude( java.math.BigDecimal theValue) { myLongitude = new DecimalDt(theValue); + return this; } @@ -917,7 +842,6 @@ public class Location extends BaseResource implements IResource { myLatitude = theValue; } - /** * Sets the value for latitude (Latitude as expressed in KML) * @@ -926,8 +850,9 @@ public class Location extends BaseResource implements IResource { * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below) *

*/ - public void setLatitude( long theValue) { + public Position setLatitude( long theValue) { myLatitude = new DecimalDt(theValue); + return this; } /** @@ -938,8 +863,9 @@ public class Location extends BaseResource implements IResource { * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below) *

*/ - public void setLatitude( double theValue) { + public Position setLatitude( double theValue) { myLatitude = new DecimalDt(theValue); + return this; } /** @@ -950,8 +876,9 @@ public class Location extends BaseResource implements IResource { * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below) *

*/ - public void setLatitude( java.math.BigDecimal theValue) { + public Position setLatitude( java.math.BigDecimal theValue) { myLatitude = new DecimalDt(theValue); + return this; } @@ -984,7 +911,6 @@ public class Location extends BaseResource implements IResource { myAltitude = theValue; } - /** * Sets the value for altitude (Altitude as expressed in KML) * @@ -993,8 +919,9 @@ public class Location extends BaseResource implements IResource { * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below) *

*/ - public void setAltitude( long theValue) { + public Position setAltitude( long theValue) { myAltitude = new DecimalDt(theValue); + return this; } /** @@ -1005,8 +932,9 @@ public class Location extends BaseResource implements IResource { * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below) *

*/ - public void setAltitude( double theValue) { + public Position setAltitude( double theValue) { myAltitude = new DecimalDt(theValue); + return this; } /** @@ -1017,8 +945,9 @@ public class Location extends BaseResource implements IResource { * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below) *

*/ - public void setAltitude( java.math.BigDecimal theValue) { + public Position setAltitude( java.math.BigDecimal theValue) { myAltitude = new DecimalDt(theValue); + return this; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java index 2a571086e1d..388fae78254 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java @@ -17,113 +17,26 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; +import ca.uhn.fhir.model.api.TemporalPrecisionEnum; +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.dstu.composite.AttachmentDt; +import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -358,7 +271,6 @@ public class Media extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (photo | video | audio) * @@ -401,7 +313,6 @@ public class Media extends BaseResource implements IResource { mySubtype = theValue; } - /** * Gets the value(s) for identifier (Identifier(s) for the image). @@ -446,6 +357,21 @@ public class Media extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (Identifier(s) for the image), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for dateTime (When the media was taken/recorded (end)). @@ -476,7 +402,6 @@ public class Media extends BaseResource implements IResource { myDateTime = theValue; } - /** * Sets the value for dateTime (When the media was taken/recorded (end)) * @@ -485,8 +410,9 @@ public class Media extends BaseResource implements IResource { * When the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the end of the recording *

*/ - public void setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { + public Media setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { myDateTime = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -497,8 +423,9 @@ public class Media extends BaseResource implements IResource { * When the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the end of the recording *

*/ - public void setDateTimeWithSecondsPrecision( Date theDate) { + public Media setDateTimeWithSecondsPrecision( Date theDate) { myDateTime = new DateTimeDt(theDate); + return this; } @@ -528,7 +455,6 @@ public class Media extends BaseResource implements IResource { mySubject = theValue; } - /** * Gets the value(s) for operator (The person who generated the image). @@ -559,7 +485,6 @@ public class Media extends BaseResource implements IResource { myOperator = theValue; } - /** * Gets the value(s) for view (Imaging view e.g Lateral or Antero-posterior). @@ -590,7 +515,6 @@ public class Media extends BaseResource implements IResource { myView = theValue; } - /** * Gets the value(s) for deviceName (Name of the device/manufacturer). @@ -621,7 +545,6 @@ public class Media extends BaseResource implements IResource { myDeviceName = theValue; } - /** * Sets the value for deviceName (Name of the device/manufacturer) * @@ -630,8 +553,9 @@ public class Media extends BaseResource implements IResource { * The name of the device / manufacturer of the device that was used to make the recording *

*/ - public void setDeviceName( String theString) { + public Media setDeviceName( String theString) { myDeviceName = new StringDt(theString); + return this; } @@ -664,7 +588,6 @@ public class Media extends BaseResource implements IResource { myHeight = theValue; } - /** * Sets the value for height (Height of the image in pixels(photo/video)) * @@ -673,8 +596,9 @@ public class Media extends BaseResource implements IResource { * Height of the image in pixels(photo/video) *

*/ - public void setHeight( Integer theInteger) { + public Media setHeight( Integer theInteger) { myHeight = new IntegerDt(theInteger); + return this; } @@ -707,7 +631,6 @@ public class Media extends BaseResource implements IResource { myWidth = theValue; } - /** * Sets the value for width (Width of the image in pixels (photo/video)) * @@ -716,8 +639,9 @@ public class Media extends BaseResource implements IResource { * Width of the image in pixels (photo/video) *

*/ - public void setWidth( Integer theInteger) { + public Media setWidth( Integer theInteger) { myWidth = new IntegerDt(theInteger); + return this; } @@ -750,7 +674,6 @@ public class Media extends BaseResource implements IResource { myFrames = theValue; } - /** * Sets the value for frames (Number of frames if > 1 (photo)) * @@ -759,8 +682,9 @@ public class Media extends BaseResource implements IResource { * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required *

*/ - public void setFrames( Integer theInteger) { + public Media setFrames( Integer theInteger) { myFrames = new IntegerDt(theInteger); + return this; } @@ -793,7 +717,6 @@ public class Media extends BaseResource implements IResource { myLength = theValue; } - /** * Sets the value for length (Length in seconds (audio / video)) * @@ -802,8 +725,9 @@ public class Media extends BaseResource implements IResource { * The length of the recording in seconds - for audio and video *

*/ - public void setLength( Integer theInteger) { + public Media setLength( Integer theInteger) { myLength = new IntegerDt(theInteger); + return this; } @@ -836,7 +760,6 @@ public class Media extends BaseResource implements IResource { myContent = theValue; } - diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java index 7936df955aa..2ceeac8f583 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java @@ -17,113 +17,25 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; +import ca.uhn.fhir.model.api.IResourceBlock; +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.dstu.composite.CodeableConceptDt; +import ca.uhn.fhir.model.dstu.composite.RatioDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -310,7 +222,6 @@ public class Medication extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Common / Commercial name) * @@ -319,8 +230,9 @@ public class Medication extends BaseResource implements IResource { * The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code *

*/ - public void setName( String theString) { + public Medication setName( String theString) { myName = new StringDt(theString); + return this; } @@ -353,7 +265,6 @@ public class Medication extends BaseResource implements IResource { myCode = theValue; } - /** * Gets the value(s) for isBrand (True if a brand). @@ -384,7 +295,6 @@ public class Medication extends BaseResource implements IResource { myIsBrand = theValue; } - /** * Sets the value for isBrand (True if a brand) * @@ -393,8 +303,9 @@ public class Medication extends BaseResource implements IResource { * Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is) *

*/ - public void setIsBrand( Boolean theBoolean) { + public Medication setIsBrand( Boolean theBoolean) { myIsBrand = new BooleanDt(theBoolean); + return this; } @@ -427,7 +338,6 @@ public class Medication extends BaseResource implements IResource { myManufacturer = theValue; } - /** * Gets the value(s) for kind (product | package). @@ -458,7 +368,6 @@ public class Medication extends BaseResource implements IResource { myKind = theValue; } - /** * Sets the value(s) for kind (product | package) * @@ -501,7 +410,6 @@ public class Medication extends BaseResource implements IResource { myProduct = theValue; } - /** * Gets the value(s) for package (Details about packaged medications). @@ -532,7 +440,6 @@ public class Medication extends BaseResource implements IResource { myPackage = theValue; } - /** * Sets the value for package (Details about packaged medications) * @@ -541,8 +448,9 @@ public class Medication extends BaseResource implements IResource { * Information that only applies to packages (not products) *

*/ - public void setPackage( String theCode) { + public Medication setPackage( String theCode) { myPackage = new CodeDt(theCode); + return this; } @@ -616,7 +524,6 @@ public class Medication extends BaseResource implements IResource { myForm = theValue; } - /** * Gets the value(s) for ingredient (Active or inactive ingredient). @@ -661,6 +568,21 @@ public class Medication extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for ingredient (Active or inactive ingredient), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifies a particular constituent of interest in the product + *

+ */ + public ProductIngredient getIngredientFirstRep() { + if (getIngredient().isEmpty()) { + return addIngredient(); + } + return getIngredient().get(0); + } } @@ -735,7 +657,6 @@ public class Medication extends BaseResource implements IResource { myItem = theValue; } - /** * Gets the value(s) for amount (How much ingredient in product). @@ -766,7 +687,6 @@ public class Medication extends BaseResource implements IResource { myAmount = theValue; } - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java index 951c8489bd9..a2d079bfadd 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java @@ -17,113 +17,39 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IDatatype; +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.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.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; +import ca.uhn.fhir.model.dstu.composite.PeriodDt; +import ca.uhn.fhir.model.dstu.composite.QuantityDt; +import ca.uhn.fhir.model.dstu.composite.RangeDt; +import ca.uhn.fhir.model.dstu.composite.RatioDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.composite.SampledDataDt; import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -473,7 +399,6 @@ public class Observation extends BaseResource implements IResource { myName = theValue; } - /** * Gets the value(s) for value[x] (Actual result). @@ -501,7 +426,6 @@ public class Observation extends BaseResource implements IResource { myValue = theValue; } - /** * Gets the value(s) for interpretation (High, low, normal, etc.). @@ -532,7 +456,6 @@ public class Observation extends BaseResource implements IResource { myInterpretation = theValue; } - /** * Sets the value(s) for interpretation (High, low, normal, etc.) * @@ -575,7 +498,6 @@ public class Observation extends BaseResource implements IResource { myComments = theValue; } - /** * Sets the value for comments (Comments about result) * @@ -584,8 +506,9 @@ public class Observation extends BaseResource implements IResource { * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. *

*/ - public void setComments( String theString) { + public Observation setComments( String theString) { myComments = new StringDt(theString); + return this; } @@ -615,7 +538,6 @@ public class Observation extends BaseResource implements IResource { myApplies = theValue; } - /** * Gets the value(s) for issued (Date/Time this was made available). @@ -646,7 +568,6 @@ public class Observation extends BaseResource implements IResource { myIssued = theValue; } - /** * Sets the value for issued (Date/Time this was made available) * @@ -655,8 +576,9 @@ public class Observation extends BaseResource implements IResource { * *

*/ - public void setIssued( Date theDate, TemporalPrecisionEnum thePrecision) { - myIssued = new InstantDt(theDate, thePrecision); + public Observation setIssuedWithMillisPrecision( Date theDate) { + myIssued = new InstantDt(theDate); + return this; } /** @@ -667,8 +589,9 @@ public class Observation extends BaseResource implements IResource { * *

*/ - public void setIssuedWithMillisPrecision( Date theDate) { - myIssued = new InstantDt(theDate); + public Observation setIssued( Date theDate, TemporalPrecisionEnum thePrecision) { + myIssued = new InstantDt(theDate, thePrecision); + return this; } @@ -701,7 +624,6 @@ public class Observation extends BaseResource implements IResource { myStatus = theValue; } - /** * Sets the value(s) for status (registered | preliminary | final | amended +) * @@ -744,7 +666,6 @@ public class Observation extends BaseResource implements IResource { myReliability = theValue; } - /** * Sets the value(s) for reliability (ok | ongoing | early | questionable | calibrating | error +) * @@ -787,7 +708,6 @@ public class Observation extends BaseResource implements IResource { myBodySite = theValue; } - /** * Gets the value(s) for method (How it was done). @@ -818,7 +738,6 @@ public class Observation extends BaseResource implements IResource { myMethod = theValue; } - /** * Gets the value(s) for identifier (Unique Id for this particular observation). @@ -849,7 +768,6 @@ public class Observation extends BaseResource implements IResource { myIdentifier = theValue; } - /** * Gets the value(s) for subject (Who and/or what this is about). @@ -877,7 +795,6 @@ public class Observation extends BaseResource implements IResource { mySubject = theValue; } - /** * Gets the value(s) for specimen (Specimen used for this observation). @@ -908,7 +825,6 @@ public class Observation extends BaseResource implements IResource { mySpecimen = theValue; } - /** * Gets the value(s) for performer (Who did the observation). @@ -936,7 +852,19 @@ public class Observation extends BaseResource implements IResource { myPerformer = theValue; } - + /** + * Adds and returns a new value for performer (Who did the observation) + * + *

+ * Definition: + * Who was responsible for asserting the observed value as \"true\" + *

+ */ + public ResourceReferenceDt addPerformer() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getPerformer().add(newType); + return newType; + } /** * Gets the value(s) for referenceRange (Provides guide for interpretation). @@ -981,6 +909,21 @@ public class Observation extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for referenceRange (Provides guide for interpretation), + * creating it if it does not already exist. + * + *

+ * Definition: + * Guidance on how to interpret the value by comparison to a normal or recommended range + *

+ */ + public ReferenceRange getReferenceRangeFirstRep() { + if (getReferenceRange().isEmpty()) { + return addReferenceRange(); + } + return getReferenceRange().get(0); + } /** * Gets the value(s) for related (Observations related to this observation). @@ -1025,6 +968,21 @@ public class Observation extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for related (Observations related to this observation), + * creating it if it does not already exist. + * + *

+ * Definition: + * Related observations - either components, or previous observations, or statements of derivation + *

+ */ + public Related getRelatedFirstRep() { + if (getRelated().isEmpty()) { + return addRelated(); + } + return getRelated().get(0); + } /** * Block class for child element: Observation.referenceRange (Provides guide for interpretation) @@ -1110,7 +1068,6 @@ public class Observation extends BaseResource implements IResource { myLow = theValue; } - /** * Gets the value(s) for high (High Range, if relevant). @@ -1141,7 +1098,6 @@ public class Observation extends BaseResource implements IResource { myHigh = theValue; } - /** * Gets the value(s) for meaning (Indicates the meaning/use of this range of this range). @@ -1172,7 +1128,6 @@ public class Observation extends BaseResource implements IResource { myMeaning = theValue; } - /** * Gets the value(s) for age (Applicable age range, if relevant). @@ -1203,7 +1158,6 @@ public class Observation extends BaseResource implements IResource { myAge = theValue; } - } @@ -1281,7 +1235,6 @@ public class Observation extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by) * @@ -1324,7 +1277,6 @@ public class Observation extends BaseResource implements IResource { myTarget = theValue; } - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java index 46ab8c67c82..dd4f665c554 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java @@ -17,113 +17,28 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +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.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.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; +import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; +import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -340,6 +255,21 @@ public class Organization extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (Identifies this organization across multiple systems), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifier for the organization that is used to identify the organization across multiple disparate systems + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for name (Name used for the organization). @@ -370,7 +300,6 @@ public class Organization extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Name used for the organization) * @@ -379,8 +308,9 @@ public class Organization extends BaseResource implements IResource { * A name associated with the organization *

*/ - public void setName( String theString) { + public Organization setName( String theString) { myName = new StringDt(theString); + return this; } @@ -413,7 +343,6 @@ public class Organization extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (Kind of organization) * @@ -470,6 +399,21 @@ public class Organization extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (A contact detail for the organization), + * creating it if it does not already exist. + * + *

+ * Definition: + * A contact detail for the organization + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for address (An address for the organization). @@ -514,6 +458,21 @@ public class Organization extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for address (An address for the organization), + * creating it if it does not already exist. + * + *

+ * Definition: + * An address for the organization + *

+ */ + public AddressDt getAddressFirstRep() { + if (getAddress().isEmpty()) { + return addAddress(); + } + return getAddress().get(0); + } /** * Gets the value(s) for partOf (The organization of which this organization forms a part). @@ -544,7 +503,6 @@ public class Organization extends BaseResource implements IResource { myPartOf = theValue; } - /** * Gets the value(s) for contact (Contact for the organization for a certain purpose). @@ -589,6 +547,21 @@ public class Organization extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for contact (Contact for the organization for a certain purpose), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public Contact getContactFirstRep() { + if (getContact().isEmpty()) { + return addContact(); + } + return getContact().get(0); + } /** * Gets the value(s) for location (Location(s) the organization uses to provide services). @@ -619,7 +592,19 @@ public class Organization extends BaseResource implements IResource { myLocation = theValue; } - + /** + * Adds and returns a new value for location (Location(s) the organization uses to provide services) + * + *

+ * Definition: + * Location(s) the organization uses to provide services + *

+ */ + public ResourceReferenceDt addLocation() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getLocation().add(newType); + return newType; + } /** * Gets the value(s) for active (Whether the organization's record is still in active use). @@ -650,7 +635,6 @@ public class Organization extends BaseResource implements IResource { myActive = theValue; } - /** * Sets the value for active (Whether the organization's record is still in active use) * @@ -659,8 +643,9 @@ public class Organization extends BaseResource implements IResource { * Whether the organization's record is still in active use *

*/ - public void setActive( Boolean theBoolean) { + public Organization setActive( Boolean theBoolean) { myActive = new BooleanDt(theBoolean); + return this; } @@ -755,7 +740,6 @@ public class Organization extends BaseResource implements IResource { myPurpose = theValue; } - /** * Gets the value(s) for name (A name associated with the contact). @@ -786,7 +770,6 @@ public class Organization extends BaseResource implements IResource { myName = theValue; } - /** * Gets the value(s) for telecom (Contact details (telephone, email, etc) for a contact). @@ -831,6 +814,21 @@ public class Organization extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (Contact details (telephone, email, etc) for a contact), + * creating it if it does not already exist. + * + *

+ * Definition: + * A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for address (Visiting or postal addresses for the contact). @@ -861,7 +859,6 @@ public class Organization extends BaseResource implements IResource { myAddress = theValue; } - /** * Gets the value(s) for gender (Gender for administrative purposes). @@ -892,7 +889,6 @@ public class Organization extends BaseResource implements IResource { myGender = theValue; } - /** * Sets the value(s) for gender (Gender for administrative purposes) * diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java index 9b8c5d02126..0f975d1c1ad 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java @@ -17,113 +17,37 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IDatatype; +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.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.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; +import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; +import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; +import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -483,6 +407,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (An identifier for the person as this patient), + * creating it if it does not already exist. + * + *

+ * Definition: + * An identifier that applies to this person as a patient + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for name (A name associated with the patient). @@ -527,6 +466,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for name (A name associated with the patient), + * creating it if it does not already exist. + * + *

+ * Definition: + * A name associated with the individual. + *

+ */ + public HumanNameDt getNameFirstRep() { + if (getName().isEmpty()) { + return addName(); + } + return getName().get(0); + } /** * Gets the value(s) for telecom (A contact detail for the individual). @@ -571,6 +525,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (A contact detail for the individual), + * creating it if it does not already exist. + * + *

+ * Definition: + * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for gender (Gender for administrative purposes). @@ -601,7 +570,6 @@ public class Patient extends BaseResource implements IResource { myGender = theValue; } - /** * Sets the value(s) for gender (Gender for administrative purposes) * @@ -644,7 +612,6 @@ public class Patient extends BaseResource implements IResource { myBirthDate = theValue; } - /** * Sets the value for birthDate (The date and time of birth for the individual) * @@ -653,8 +620,9 @@ public class Patient extends BaseResource implements IResource { * The date and time of birth for the individual *

*/ - public void setBirthDate( Date theDate, TemporalPrecisionEnum thePrecision) { + public Patient setBirthDate( Date theDate, TemporalPrecisionEnum thePrecision) { myBirthDate = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -665,8 +633,9 @@ public class Patient extends BaseResource implements IResource { * The date and time of birth for the individual *

*/ - public void setBirthDateWithSecondsPrecision( Date theDate) { + public Patient setBirthDateWithSecondsPrecision( Date theDate) { myBirthDate = new DateTimeDt(theDate); + return this; } @@ -696,7 +665,6 @@ public class Patient extends BaseResource implements IResource { myDeceased = theValue; } - /** * Gets the value(s) for address (Addresses for the individual). @@ -741,6 +709,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for address (Addresses for the individual), + * creating it if it does not already exist. + * + *

+ * Definition: + * Addresses for the individual + *

+ */ + public AddressDt getAddressFirstRep() { + if (getAddress().isEmpty()) { + return addAddress(); + } + return getAddress().get(0); + } /** * Gets the value(s) for maritalStatus (Marital (civil) status of a person). @@ -771,7 +754,6 @@ public class Patient extends BaseResource implements IResource { myMaritalStatus = theValue; } - /** * Sets the value(s) for maritalStatus (Marital (civil) status of a person) * @@ -811,7 +793,6 @@ public class Patient extends BaseResource implements IResource { myMultipleBirth = theValue; } - /** * Gets the value(s) for photo (Image of the person). @@ -856,6 +837,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for photo (Image of the person), + * creating it if it does not already exist. + * + *

+ * Definition: + * Image of the person + *

+ */ + public AttachmentDt getPhotoFirstRep() { + if (getPhoto().isEmpty()) { + return addPhoto(); + } + return getPhoto().get(0); + } /** * Gets the value(s) for contact (A contact party (e.g. guardian, partner, friend) for the patient). @@ -900,6 +896,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for contact (A contact party (e.g. guardian, partner, friend) for the patient), + * creating it if it does not already exist. + * + *

+ * Definition: + * A contact party (e.g. guardian, partner, friend) for the patient + *

+ */ + public Contact getContactFirstRep() { + if (getContact().isEmpty()) { + return addContact(); + } + return getContact().get(0); + } /** * Gets the value(s) for animal (If this patient is an animal (non-human)). @@ -930,7 +941,6 @@ public class Patient extends BaseResource implements IResource { myAnimal = theValue; } - /** * Gets the value(s) for communication (Languages which may be used to communicate with the patient about his or her health). @@ -975,6 +985,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for communication (Languages which may be used to communicate with the patient about his or her health), + * creating it if it does not already exist. + * + *

+ * Definition: + * Languages which may be used to communicate with the patient about his or her health + *

+ */ + public CodeableConceptDt getCommunicationFirstRep() { + if (getCommunication().isEmpty()) { + return addCommunication(); + } + return getCommunication().get(0); + } /** * Gets the value(s) for careProvider (Patient's nominated care provider). @@ -1002,7 +1027,19 @@ public class Patient extends BaseResource implements IResource { myCareProvider = theValue; } - + /** + * Adds and returns a new value for careProvider (Patient's nominated care provider) + * + *

+ * Definition: + * Patient's nominated care provider + *

+ */ + public ResourceReferenceDt addCareProvider() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getCareProvider().add(newType); + return newType; + } /** * Gets the value(s) for managingOrganization (Organization that is the custodian of the patient record). @@ -1033,7 +1070,6 @@ public class Patient extends BaseResource implements IResource { myManagingOrganization = theValue; } - /** * Gets the value(s) for link (Link to another patient resource that concerns the same actual person). @@ -1078,6 +1114,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for link (Link to another patient resource that concerns the same actual person), + * creating it if it does not already exist. + * + *

+ * Definition: + * Link to another patient resource that concerns the same actual person + *

+ */ + public Link getLinkFirstRep() { + if (getLink().isEmpty()) { + return addLink(); + } + return getLink().get(0); + } /** * Gets the value(s) for active (Whether this patient's record is in active use). @@ -1108,7 +1159,6 @@ public class Patient extends BaseResource implements IResource { myActive = theValue; } - /** * Sets the value for active (Whether this patient's record is in active use) * @@ -1117,8 +1167,9 @@ public class Patient extends BaseResource implements IResource { * Whether this patient record is in active use *

*/ - public void setActive( Boolean theBoolean) { + public Patient setActive( Boolean theBoolean) { myActive = new BooleanDt(theBoolean); + return this; } @@ -1236,6 +1287,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for relationship (The kind of relationship), + * creating it if it does not already exist. + * + *

+ * Definition: + * The nature of the relationship between the patient and the contact person + *

+ */ + public CodeableConceptDt getRelationshipFirstRep() { + if (getRelationship().isEmpty()) { + return addRelationship(); + } + return getRelationship().get(0); + } /** * Gets the value(s) for name (A name associated with the person). @@ -1266,7 +1332,6 @@ public class Patient extends BaseResource implements IResource { myName = theValue; } - /** * Gets the value(s) for telecom (A contact detail for the person). @@ -1311,6 +1376,21 @@ public class Patient extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (A contact detail for the person), + * creating it if it does not already exist. + * + *

+ * Definition: + * A contact detail for the person, e.g. a telephone number or an email address. + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for address (Address for the contact person). @@ -1341,7 +1421,6 @@ public class Patient extends BaseResource implements IResource { myAddress = theValue; } - /** * Gets the value(s) for gender (Gender for administrative purposes). @@ -1372,7 +1451,6 @@ public class Patient extends BaseResource implements IResource { myGender = theValue; } - /** * Sets the value(s) for gender (Gender for administrative purposes) * @@ -1415,7 +1493,6 @@ public class Patient extends BaseResource implements IResource { myOrganization = theValue; } - } @@ -1498,7 +1575,6 @@ public class Patient extends BaseResource implements IResource { mySpecies = theValue; } - /** * Sets the value(s) for species (E.g. Dog, Cow) * @@ -1541,7 +1617,6 @@ public class Patient extends BaseResource implements IResource { myBreed = theValue; } - /** * Gets the value(s) for genderStatus (E.g. Neutered, Intact). @@ -1572,7 +1647,6 @@ public class Patient extends BaseResource implements IResource { myGenderStatus = theValue; } - } @@ -1650,7 +1724,6 @@ public class Patient extends BaseResource implements IResource { myOther = theValue; } - /** * Gets the value(s) for type (replace | refer | seealso - type of link). @@ -1681,7 +1754,6 @@ public class Patient extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (replace | refer | seealso - type of link) * diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java index ec21a253ce7..72f13ef3840 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java @@ -17,113 +17,32 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +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.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.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -395,6 +314,21 @@ public class Practitioner extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (A identifier for the person as this agent), + * creating it if it does not already exist. + * + *

+ * Definition: + * An identifier that applies to this person in this role + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for name (A name associated with the person). @@ -425,7 +359,6 @@ public class Practitioner extends BaseResource implements IResource { myName = theValue; } - /** * Gets the value(s) for telecom (A contact detail for the practitioner). @@ -470,6 +403,21 @@ public class Practitioner extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (A contact detail for the practitioner), + * creating it if it does not already exist. + * + *

+ * Definition: + * A contact detail for the practitioner, e.g. a telephone number or an email address. + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for address (Where practitioner can be found/visited). @@ -500,7 +448,6 @@ public class Practitioner extends BaseResource implements IResource { myAddress = theValue; } - /** * Gets the value(s) for gender (Gender for administrative purposes). @@ -531,7 +478,6 @@ public class Practitioner extends BaseResource implements IResource { myGender = theValue; } - /** * Sets the value(s) for gender (Gender for administrative purposes) * @@ -574,7 +520,6 @@ public class Practitioner extends BaseResource implements IResource { myBirthDate = theValue; } - /** * Sets the value for birthDate (The date and time of birth for the practitioner) * @@ -583,8 +528,9 @@ public class Practitioner extends BaseResource implements IResource { * The date and time of birth for the practitioner *

*/ - public void setBirthDate( Date theDate, TemporalPrecisionEnum thePrecision) { + public Practitioner setBirthDate( Date theDate, TemporalPrecisionEnum thePrecision) { myBirthDate = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -595,8 +541,9 @@ public class Practitioner extends BaseResource implements IResource { * The date and time of birth for the practitioner *

*/ - public void setBirthDateWithSecondsPrecision( Date theDate) { + public Practitioner setBirthDateWithSecondsPrecision( Date theDate) { myBirthDate = new DateTimeDt(theDate); + return this; } @@ -643,6 +590,21 @@ public class Practitioner extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for photo (Image of the person), + * creating it if it does not already exist. + * + *

+ * Definition: + * Image of the person + *

+ */ + public AttachmentDt getPhotoFirstRep() { + if (getPhoto().isEmpty()) { + return addPhoto(); + } + return getPhoto().get(0); + } /** * Gets the value(s) for organization (The represented organization). @@ -673,7 +635,6 @@ public class Practitioner extends BaseResource implements IResource { myOrganization = theValue; } - /** * Gets the value(s) for role (Roles which this practitioner may perform). @@ -704,7 +665,6 @@ public class Practitioner extends BaseResource implements IResource { myRole = theValue; } - /** * Add a value for role (Roles which this practitioner may perform) * @@ -760,7 +720,6 @@ public class Practitioner extends BaseResource implements IResource { mySpecialty = theValue; } - /** * Add a value for specialty (Specific specialty of the practitioner) * @@ -816,7 +775,6 @@ public class Practitioner extends BaseResource implements IResource { myPeriod = theValue; } - /** * Gets the value(s) for location (The location(s) at which this practitioner provides care). @@ -847,7 +805,19 @@ public class Practitioner extends BaseResource implements IResource { myLocation = theValue; } - + /** + * Adds and returns a new value for location (The location(s) at which this practitioner provides care) + * + *

+ * Definition: + * The location(s) at which this practitioner provides care + *

+ */ + public ResourceReferenceDt addLocation() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getLocation().add(newType); + return newType; + } /** * Gets the value(s) for qualification (Qualifications obtained by training and certification). @@ -892,6 +862,21 @@ public class Practitioner extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for qualification (Qualifications obtained by training and certification), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public Qualification getQualificationFirstRep() { + if (getQualification().isEmpty()) { + return addQualification(); + } + return getQualification().get(0); + } /** * Gets the value(s) for communication (A language the practitioner is able to use in patient communication). @@ -936,6 +921,21 @@ public class Practitioner extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for communication (A language the practitioner is able to use in patient communication), + * creating it if it does not already exist. + * + *

+ * Definition: + * A language the practitioner is able to use in patient communication + *

+ */ + public CodeableConceptDt getCommunicationFirstRep() { + if (getCommunication().isEmpty()) { + return addCommunication(); + } + return getCommunication().get(0); + } /** * Block class for child element: Practitioner.qualification (Qualifications obtained by training and certification) @@ -1016,7 +1016,6 @@ public class Practitioner extends BaseResource implements IResource { myCode = theValue; } - /** * Gets the value(s) for period (Period during which the qualification is valid). @@ -1047,7 +1046,6 @@ public class Practitioner extends BaseResource implements IResource { myPeriod = theValue; } - /** * Gets the value(s) for issuer (Organization that regulates and issues the qualification). @@ -1078,7 +1076,6 @@ public class Practitioner extends BaseResource implements IResource { myIssuer = theValue; } - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java index 4fd6a1b90d5..b54d39149f4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java @@ -17,111 +17,39 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IDatatype; +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.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.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; import ca.uhn.fhir.model.dstu.composite.ContactDt; +import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; +import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; +import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -411,7 +339,6 @@ public class Profile extends BaseResource implements IResource { myIdentifier = theValue; } - /** * Sets the value for identifier (Logical id to reference this profile) * @@ -420,8 +347,9 @@ public class Profile extends BaseResource implements IResource { * The identifier that is used to identify this profile when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI) *

*/ - public void setIdentifier( String theString) { + public Profile setIdentifier( String theString) { myIdentifier = new StringDt(theString); + return this; } @@ -454,7 +382,6 @@ public class Profile extends BaseResource implements IResource { myVersion = theValue; } - /** * Sets the value for version (Logical id for this version of the profile) * @@ -463,8 +390,9 @@ public class Profile extends BaseResource implements IResource { * The identifier that is used to identify this version of the profile 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 void setVersion( String theString) { + public Profile setVersion( String theString) { myVersion = new StringDt(theString); + return this; } @@ -497,7 +425,6 @@ public class Profile extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Informal name for this profile) * @@ -506,8 +433,9 @@ public class Profile extends BaseResource implements IResource { * A free text natural language name identifying the Profile *

*/ - public void setName( String theString) { + public Profile setName( String theString) { myName = new StringDt(theString); + return this; } @@ -540,7 +468,6 @@ public class Profile extends BaseResource implements IResource { myPublisher = theValue; } - /** * Sets the value for publisher (Name of the publisher (Organization or individual)) * @@ -549,8 +476,9 @@ public class Profile extends BaseResource implements IResource { * Details of the individual or organization who accepts responsibility for publishing the profile *

*/ - public void setPublisher( String theString) { + public Profile setPublisher( String theString) { myPublisher = new StringDt(theString); + return this; } @@ -597,6 +525,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (Contact information of the publisher), + * creating it if it does not already exist. + * + *

+ * Definition: + * Contact details to assist a user in finding and communicating with the publisher + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for description (Natural language description of the profile). @@ -627,7 +570,6 @@ public class Profile extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Natural language description of the profile) * @@ -636,8 +578,9 @@ public class Profile extends BaseResource implements IResource { * A free text natural language description of the profile and its use *

*/ - public void setDescription( String theString) { + public Profile setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -684,6 +627,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for code (Assist with indexing and finding), + * 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 status (draft | active | retired). @@ -714,7 +672,6 @@ public class Profile extends BaseResource implements IResource { myStatus = theValue; } - /** * Sets the value(s) for status (draft | active | retired) * @@ -757,7 +714,6 @@ public class Profile extends BaseResource implements IResource { myExperimental = theValue; } - /** * Sets the value for experimental (If for testing purposes, not real usage) * @@ -766,8 +722,9 @@ public class Profile extends BaseResource implements IResource { * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage *

*/ - public void setExperimental( Boolean theBoolean) { + public Profile setExperimental( Boolean theBoolean) { myExperimental = new BooleanDt(theBoolean); + return this; } @@ -800,7 +757,6 @@ public class Profile extends BaseResource implements IResource { myDate = theValue; } - /** * Sets the value for date (Date for this version of the profile) * @@ -809,8 +765,9 @@ public class Profile extends BaseResource implements IResource { * The date that this version of the profile was published *

*/ - public void setDate( Date theDate, TemporalPrecisionEnum thePrecision) { + public Profile setDate( Date theDate, TemporalPrecisionEnum thePrecision) { myDate = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -821,8 +778,9 @@ public class Profile extends BaseResource implements IResource { * The date that this version of the profile was published *

*/ - public void setDateWithSecondsPrecision( Date theDate) { + public Profile setDateWithSecondsPrecision( Date theDate) { myDate = new DateTimeDt(theDate); + return this; } @@ -855,7 +813,6 @@ public class Profile extends BaseResource implements IResource { myRequirements = theValue; } - /** * Sets the value for requirements (Scope and Usage this profile is for) * @@ -864,8 +821,9 @@ public class Profile extends BaseResource implements IResource { * The Scope and Usage that this profile was created to meet *

*/ - public void setRequirements( String theString) { + public Profile setRequirements( String theString) { myRequirements = new StringDt(theString); + return this; } @@ -898,7 +856,6 @@ public class Profile extends BaseResource implements IResource { myFhirVersion = theValue; } - /** * Sets the value for fhirVersion (FHIR Version this profile targets) * @@ -907,8 +864,9 @@ public class Profile extends BaseResource implements IResource { * The version of the FHIR specification on which this profile is based *

*/ - public void setFhirVersion( String theId) { + public Profile setFhirVersion( String theId) { myFhirVersion = new IdDt(theId); + return this; } @@ -955,6 +913,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for mapping (External specification that the content is mapped to), + * 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 structure (A constraint on a resource or a data type). @@ -999,6 +972,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for structure (A constraint on a resource or a data type), + * creating it if it does not already exist. + * + *

+ * Definition: + * A constraint statement about what contents a resource or data type may have + *

+ */ + public Structure getStructureFirstRep() { + if (getStructure().isEmpty()) { + return addStructure(); + } + return getStructure().get(0); + } /** * Gets the value(s) for extensionDefn (Definition of an extension). @@ -1043,6 +1031,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for extensionDefn (Definition of an extension), + * creating it if it does not already exist. + * + *

+ * Definition: + * An extension defined as part of the profile + *

+ */ + public ExtensionDefn getExtensionDefnFirstRep() { + if (getExtensionDefn().isEmpty()) { + return addExtensionDefn(); + } + return getExtensionDefn().get(0); + } /** * Gets the value(s) for query (Definition of a named query). @@ -1087,6 +1090,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for query (Definition of a named query), + * creating it if it does not already exist. + * + *

+ * Definition: + * Definition of a named query and its parameters and their meaning + *

+ */ + public Query getQueryFirstRep() { + if (getQuery().isEmpty()) { + return addQuery(); + } + return getQuery().get(0); + } /** * Block class for child element: Profile.mapping (External specification that the content is mapped to) @@ -1172,7 +1190,6 @@ public class Profile extends BaseResource implements IResource { myIdentity = theValue; } - /** * Sets the value for identity (Internal id when this mapping is used) * @@ -1181,8 +1198,9 @@ public class Profile extends BaseResource implements IResource { * An Internal id that is used to identify this mapping set when specific mappings are made *

*/ - public void setIdentity( String theId) { + public Mapping setIdentity( String theId) { myIdentity = new IdDt(theId); + return this; } @@ -1215,7 +1233,6 @@ public class Profile extends BaseResource implements IResource { myUri = theValue; } - /** * Sets the value for uri (Identifies what this mapping refers to) * @@ -1224,8 +1241,9 @@ public class Profile extends BaseResource implements IResource { * A URI that identifies the specification that this mapping is expressed to *

*/ - public void setUri( String theUri) { + public Mapping setUri( String theUri) { myUri = new UriDt(theUri); + return this; } @@ -1258,7 +1276,6 @@ public class Profile extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Names what this mapping refers to) * @@ -1267,8 +1284,9 @@ public class Profile extends BaseResource implements IResource { * A name for the specification that is being mapped to *

*/ - public void setName( String theString) { + public Mapping setName( String theString) { myName = new StringDt(theString); + return this; } @@ -1301,7 +1319,6 @@ public class Profile extends BaseResource implements IResource { myComments = theValue; } - /** * Sets the value for comments (Versions, Issues, Scope limitations etc) * @@ -1310,8 +1327,9 @@ public class Profile extends BaseResource implements IResource { * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage *

*/ - public void setComments( String theString) { + public Mapping setComments( String theString) { myComments = new StringDt(theString); + return this; } @@ -1417,7 +1435,6 @@ public class Profile extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (The Resource or Data Type being described) * @@ -1460,7 +1477,6 @@ public class Profile extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Name for this particular structure (reference target)) * @@ -1469,8 +1485,9 @@ public class Profile extends BaseResource implements IResource { * The name of this resource constraint statement (to refer to it from other resource constraints - from Profile.structure.element.definition.type.profile) *

*/ - public void setName( String theString) { + public Structure setName( String theString) { myName = new StringDt(theString); + return this; } @@ -1503,7 +1520,6 @@ public class Profile extends BaseResource implements IResource { myPublish = theValue; } - /** * Sets the value for publish (This definition is published (i.e. for validation)) * @@ -1512,8 +1528,9 @@ public class Profile extends BaseResource implements IResource { * This definition of a profile on a structure is published as a formal statement. Some structural definitions might be defined purely for internal use within the profile, and not intended to be used outside that context *

*/ - public void setPublish( Boolean theBoolean) { + public Structure setPublish( Boolean theBoolean) { myPublish = new BooleanDt(theBoolean); + return this; } @@ -1546,7 +1563,6 @@ public class Profile extends BaseResource implements IResource { myPurpose = theValue; } - /** * Sets the value for purpose (Human summary: why describe this resource?) * @@ -1555,8 +1571,9 @@ public class Profile extends BaseResource implements IResource { * Human summary: why describe this resource? *

*/ - public void setPurpose( String theString) { + public Structure setPurpose( String theString) { myPurpose = new StringDt(theString); + return this; } @@ -1603,6 +1620,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for element (Definition of elements in the resource (if no profile)), + * creating it if it does not already exist. + * + *

+ * Definition: + * Captures constraints on each element within the resource + *

+ */ + public StructureElement getElementFirstRep() { + if (getElement().isEmpty()) { + return addElement(); + } + return getElement().get(0); + } /** * Gets the value(s) for searchParam (Search params defined). @@ -1647,6 +1679,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for searchParam (Search params defined), + * creating it if it does not already exist. + * + *

+ * Definition: + * Additional search parameters for implementations to support and/or make use of + *

+ */ + public StructureSearchParam getSearchParamFirstRep() { + if (getSearchParam().isEmpty()) { + return addSearchParam(); + } + return getSearchParam().get(0); + } } @@ -1742,7 +1789,6 @@ public class Profile extends BaseResource implements IResource { myPath = theValue; } - /** * Sets the value for path (The path of the element (see the formal definitions)) * @@ -1751,8 +1797,9 @@ public class Profile extends BaseResource implements IResource { * The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource *

*/ - public void setPath( String theString) { + public StructureElement setPath( String theString) { myPath = new StringDt(theString); + return this; } @@ -1785,7 +1832,6 @@ public class Profile extends BaseResource implements IResource { myRepresentation = theValue; } - /** * Add a value for representation (How this element is represented in instances) * @@ -1841,7 +1887,6 @@ public class Profile extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Name for this particular element definition (reference target)) * @@ -1850,8 +1895,9 @@ public class Profile extends BaseResource implements IResource { * The name of this element definition (to refer to it from other element definitions using Profile.structure.element.definition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element *

*/ - public void setName( String theString) { + public StructureElement setName( String theString) { myName = new StringDt(theString); + return this; } @@ -1884,7 +1930,6 @@ public class Profile extends BaseResource implements IResource { mySlicing = theValue; } - /** * Gets the value(s) for definition (More specific definition of the element). @@ -1915,7 +1960,6 @@ public class Profile extends BaseResource implements IResource { myDefinition = theValue; } - } @@ -1997,7 +2041,6 @@ public class Profile extends BaseResource implements IResource { myDiscriminator = theValue; } - /** * Sets the value for discriminator (Element that used to distinguish the slices) * @@ -2006,8 +2049,9 @@ public class Profile extends BaseResource implements IResource { * Designates which child element is used to discriminate between the slices when processing an instance. The value of the child element in the instance SHALL completely distinguish which slice the element in the resource matches based on the allowed values for that element in each of the slices *

*/ - public void setDiscriminator( String theId) { + public StructureElementSlicing setDiscriminator( String theId) { myDiscriminator = new IdDt(theId); + return this; } @@ -2040,7 +2084,6 @@ public class Profile extends BaseResource implements IResource { myOrdered = theValue; } - /** * Sets the value for ordered (If elements must be in same order as slices) * @@ -2049,8 +2092,9 @@ public class Profile extends BaseResource implements IResource { * If the matching elements have to occur in the same order as defined in the profile *

*/ - public void setOrdered( Boolean theBoolean) { + public StructureElementSlicing setOrdered( Boolean theBoolean) { myOrdered = new BooleanDt(theBoolean); + return this; } @@ -2083,7 +2127,6 @@ public class Profile extends BaseResource implements IResource { myRules = theValue; } - /** * Sets the value(s) for rules (closed | open | openAtEnd) * @@ -2283,7 +2326,6 @@ public class Profile extends BaseResource implements IResource { myShort = theValue; } - /** * Sets the value for short (Concise definition for xml presentation) * @@ -2292,8 +2334,9 @@ public class Profile extends BaseResource implements IResource { * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification) *

*/ - public void setShort( String theString) { + public StructureElementDefinition setShort( String theString) { myShort = new StringDt(theString); + return this; } @@ -2326,7 +2369,6 @@ public class Profile extends BaseResource implements IResource { myFormal = theValue; } - /** * Sets the value for formal (Full formal definition in human language) * @@ -2335,8 +2377,9 @@ public class Profile extends BaseResource implements IResource { * The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource *

*/ - public void setFormal( String theString) { + public StructureElementDefinition setFormal( String theString) { myFormal = new StringDt(theString); + return this; } @@ -2369,7 +2412,6 @@ public class Profile extends BaseResource implements IResource { myComments = theValue; } - /** * Sets the value for comments (Comments about the use of this element) * @@ -2378,8 +2420,9 @@ public class Profile extends BaseResource implements IResource { * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. *

*/ - public void setComments( String theString) { + public StructureElementDefinition setComments( String theString) { myComments = new StringDt(theString); + return this; } @@ -2412,7 +2455,6 @@ public class Profile extends BaseResource implements IResource { myRequirements = theValue; } - /** * Sets the value for requirements (Why is this needed?) * @@ -2421,8 +2463,9 @@ public class Profile extends BaseResource implements IResource { * Explains why this element is needed and why it's been constrained as it has *

*/ - public void setRequirements( String theString) { + public StructureElementDefinition setRequirements( String theString) { myRequirements = new StringDt(theString); + return this; } @@ -2469,6 +2512,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for synonym (Other names), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifies additional names by which this element might also be known + *

+ */ + public StringDt getSynonymFirstRep() { + if (getSynonym().isEmpty()) { + return addSynonym(); + } + return getSynonym().get(0); + } /** * Adds a new value for synonym (Other names) * @@ -2476,12 +2534,15 @@ public class Profile extends BaseResource implements IResource { * Definition: * Identifies additional names by which this element might also be known *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addSynonym( String theString) { + public StructureElementDefinition addSynonym( String theString) { if (mySynonym == null) { mySynonym = new java.util.ArrayList(); } - mySynonym.add(new StringDt(theString)); + mySynonym.add(new StringDt(theString)); + return this; } @@ -2514,7 +2575,6 @@ public class Profile extends BaseResource implements IResource { myMin = theValue; } - /** * Sets the value for min (Minimum Cardinality) * @@ -2523,8 +2583,9 @@ public class Profile extends BaseResource implements IResource { * The minimum number of times this element SHALL appear in the instance *

*/ - public void setMin( Integer theInteger) { + public StructureElementDefinition setMin( Integer theInteger) { myMin = new IntegerDt(theInteger); + return this; } @@ -2557,7 +2618,6 @@ public class Profile extends BaseResource implements IResource { myMax = theValue; } - /** * Sets the value for max (Maximum Cardinality (a number or *)) * @@ -2566,8 +2626,9 @@ public class Profile extends BaseResource implements IResource { * The maximum number of times this element is permitted to appear in the instance *

*/ - public void setMax( String theString) { + public StructureElementDefinition setMax( String theString) { myMax = new StringDt(theString); + return this; } @@ -2614,6 +2675,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for type (Data type and Profile for this element), + * creating it if it does not already exist. + * + *

+ * Definition: + * The data type or resource that the value of this element is permitted to be + *

+ */ + public StructureElementDefinitionType getTypeFirstRep() { + if (getType().isEmpty()) { + return addType(); + } + return getType().get(0); + } /** * Gets the value(s) for nameReference (To another element constraint (by element.name)). @@ -2644,7 +2720,6 @@ public class Profile extends BaseResource implements IResource { myNameReference = theValue; } - /** * Sets the value for nameReference (To another element constraint (by element.name)) * @@ -2653,8 +2728,9 @@ public class Profile extends BaseResource implements IResource { * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element *

*/ - public void setNameReference( String theString) { + public StructureElementDefinition setNameReference( String theString) { myNameReference = new StringDt(theString); + return this; } @@ -2684,7 +2760,6 @@ public class Profile extends BaseResource implements IResource { myValue = theValue; } - /** * Gets the value(s) for example[x] (Example value: [as defined for type]). @@ -2712,7 +2787,6 @@ public class Profile extends BaseResource implements IResource { myExample = theValue; } - /** * Gets the value(s) for maxLength (Length for strings). @@ -2743,7 +2817,6 @@ public class Profile extends BaseResource implements IResource { myMaxLength = theValue; } - /** * Sets the value for maxLength (Length for strings) * @@ -2752,8 +2825,9 @@ public class Profile extends BaseResource implements IResource { * Indicates the shortest length that SHALL be supported by conformant instances without truncation *

*/ - public void setMaxLength( Integer theInteger) { + public StructureElementDefinition setMaxLength( Integer theInteger) { myMaxLength = new IntegerDt(theInteger); + return this; } @@ -2800,6 +2874,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for condition (Reference to invariant about presence), + * creating it if it does not already exist. + * + *

+ * Definition: + * A reference to an invariant that may make additional statements about the cardinality or value in the instance + *

+ */ + public IdDt getConditionFirstRep() { + if (getCondition().isEmpty()) { + return addCondition(); + } + return getCondition().get(0); + } /** * Adds a new value for condition (Reference to invariant about presence) * @@ -2807,12 +2896,15 @@ public class Profile extends BaseResource implements IResource { * Definition: * A reference to an invariant that may make additional statements about the cardinality or value in the instance *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addCondition( String theId) { + public StructureElementDefinition addCondition( String theId) { if (myCondition == null) { myCondition = new java.util.ArrayList(); } - myCondition.add(new IdDt(theId)); + myCondition.add(new IdDt(theId)); + return this; } @@ -2859,6 +2951,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for constraint (Condition that must evaluate to true), + * creating it if it does not already exist. + * + *

+ * Definition: + * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance + *

+ */ + public StructureElementDefinitionConstraint getConstraintFirstRep() { + if (getConstraint().isEmpty()) { + return addConstraint(); + } + return getConstraint().get(0); + } /** * Gets the value(s) for mustSupport (If the element must supported). @@ -2889,7 +2996,6 @@ public class Profile extends BaseResource implements IResource { myMustSupport = theValue; } - /** * Sets the value for mustSupport (If the element must supported) * @@ -2898,8 +3004,9 @@ public class Profile extends BaseResource implements IResource { * If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported *

*/ - public void setMustSupport( Boolean theBoolean) { + public StructureElementDefinition setMustSupport( Boolean theBoolean) { myMustSupport = new BooleanDt(theBoolean); + return this; } @@ -2932,7 +3039,6 @@ public class Profile extends BaseResource implements IResource { myIsModifier = theValue; } - /** * Sets the value for isModifier (If this modifies the meaning of other elements) * @@ -2941,8 +3047,9 @@ public class Profile extends BaseResource implements IResource { * If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. *

*/ - public void setIsModifier( Boolean theBoolean) { + public StructureElementDefinition setIsModifier( Boolean theBoolean) { myIsModifier = new BooleanDt(theBoolean); + return this; } @@ -2975,7 +3082,6 @@ public class Profile extends BaseResource implements IResource { myBinding = theValue; } - /** * Gets the value(s) for mapping (Map element to another set of definitions). @@ -3020,6 +3126,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for mapping (Map element to another set of definitions), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifies a concept from an external specification that roughly corresponds to this element + *

+ */ + public StructureElementDefinitionMapping getMappingFirstRep() { + if (getMapping().isEmpty()) { + return addMapping(); + } + return getMapping().get(0); + } } @@ -3101,7 +3222,6 @@ public class Profile extends BaseResource implements IResource { myCode = theValue; } - /** * Sets the value(s) for code (Name of Data type or Resource) * @@ -3144,7 +3264,6 @@ public class Profile extends BaseResource implements IResource { myProfile = theValue; } - /** * Sets the value for profile (Profile.structure to apply) * @@ -3153,8 +3272,9 @@ public class Profile extends BaseResource implements IResource { * Identifies a profile that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile *

*/ - public void setProfile( String theUri) { + public StructureElementDefinitionType setProfile( String theUri) { myProfile = new UriDt(theUri); + return this; } @@ -3187,7 +3307,6 @@ public class Profile extends BaseResource implements IResource { myAggregation = theValue; } - /** * Add a value for aggregation (contained | referenced | bundled - how aggregated) * @@ -3309,7 +3428,6 @@ public class Profile extends BaseResource implements IResource { myKey = theValue; } - /** * Sets the value for key (Target of 'condition' reference above) * @@ -3318,8 +3436,9 @@ public class Profile extends BaseResource implements IResource { * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality *

*/ - public void setKey( String theId) { + public StructureElementDefinitionConstraint setKey( String theId) { myKey = new IdDt(theId); + return this; } @@ -3352,7 +3471,6 @@ public class Profile extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Short human label) * @@ -3361,8 +3479,9 @@ public class Profile extends BaseResource implements IResource { * Used to label the constraint in OCL or in short displays incapable of displaying the full human description *

*/ - public void setName( String theString) { + public StructureElementDefinitionConstraint setName( String theString) { myName = new StringDt(theString); + return this; } @@ -3395,7 +3514,6 @@ public class Profile extends BaseResource implements IResource { mySeverity = theValue; } - /** * Sets the value(s) for severity (error | warning) * @@ -3438,7 +3556,6 @@ public class Profile extends BaseResource implements IResource { myHuman = theValue; } - /** * Sets the value for human (Human description of constraint) * @@ -3447,8 +3564,9 @@ public class Profile extends BaseResource implements IResource { * Text that can be used to describe the constraint in messages identifying that the constraint has been violated *

*/ - public void setHuman( String theString) { + public StructureElementDefinitionConstraint setHuman( String theString) { myHuman = new StringDt(theString); + return this; } @@ -3481,7 +3599,6 @@ public class Profile extends BaseResource implements IResource { myXpath = theValue; } - /** * Sets the value for xpath (XPath expression of constraint) * @@ -3490,8 +3607,9 @@ public class Profile extends BaseResource implements IResource { * XPath expression of constraint *

*/ - public void setXpath( String theString) { + public StructureElementDefinitionConstraint setXpath( String theString) { myXpath = new StringDt(theString); + return this; } @@ -3593,7 +3711,6 @@ public class Profile extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Descriptive Name) * @@ -3602,8 +3719,9 @@ public class Profile extends BaseResource implements IResource { * A descriptive name for this - can be useful for generating implementation artifacts *

*/ - public void setName( String theString) { + public StructureElementDefinitionBinding setName( String theString) { myName = new StringDt(theString); + return this; } @@ -3636,7 +3754,6 @@ public class Profile extends BaseResource implements IResource { myIsExtensible = theValue; } - /** * Sets the value for isExtensible (Can additional codes be used?) * @@ -3645,8 +3762,9 @@ public class Profile extends BaseResource implements IResource { * If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone *

*/ - public void setIsExtensible( Boolean theBoolean) { + public StructureElementDefinitionBinding setIsExtensible( Boolean theBoolean) { myIsExtensible = new BooleanDt(theBoolean); + return this; } @@ -3679,7 +3797,6 @@ public class Profile extends BaseResource implements IResource { myConformance = theValue; } - /** * Sets the value(s) for conformance (required | preferred | example) * @@ -3722,7 +3839,6 @@ public class Profile extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Human explanation of the value set) * @@ -3731,8 +3847,9 @@ public class Profile extends BaseResource implements IResource { * Describes the intended use of this particular set of codes *

*/ - public void setDescription( String theString) { + public StructureElementDefinitionBinding setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -3762,7 +3879,6 @@ public class Profile extends BaseResource implements IResource { myReference = theValue; } - } @@ -3838,7 +3954,6 @@ public class Profile extends BaseResource implements IResource { myIdentity = theValue; } - /** * Sets the value for identity (Reference to mapping declaration) * @@ -3847,8 +3962,9 @@ public class Profile extends BaseResource implements IResource { * An internal reference to the definition of a mapping *

*/ - public void setIdentity( String theId) { + public StructureElementDefinitionMapping setIdentity( String theId) { myIdentity = new IdDt(theId); + return this; } @@ -3881,7 +3997,6 @@ public class Profile extends BaseResource implements IResource { myMap = theValue; } - /** * Sets the value for map (Details of the mapping) * @@ -3890,8 +4005,9 @@ public class Profile extends BaseResource implements IResource { * Expresses what part of the target specification corresponds to this element *

*/ - public void setMap( String theString) { + public StructureElementDefinitionMapping setMap( String theString) { myMap = new StringDt(theString); + return this; } @@ -3992,7 +4108,6 @@ public class Profile extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Name of search parameter) * @@ -4001,8 +4116,9 @@ public class Profile extends BaseResource implements IResource { * The name of the standard or custom search parameter *

*/ - public void setName( String theString) { + public StructureSearchParam setName( String theString) { myName = new StringDt(theString); + return this; } @@ -4035,7 +4151,6 @@ public class Profile extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (number | date | string | token | reference | composite | quantity) * @@ -4078,7 +4193,6 @@ public class Profile extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (Contents and meaning of search parameter) * @@ -4087,8 +4201,9 @@ public class Profile extends BaseResource implements IResource { * A specification for search parameters. For standard parameters, provides additional information on how the parameter is used in this solution. For custom parameters, provides a description of what the parameter does *

*/ - public void setDocumentation( String theString) { + public StructureSearchParam setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } @@ -4121,7 +4236,6 @@ public class Profile extends BaseResource implements IResource { myXpath = theValue; } - /** * Sets the value for xpath (XPath that extracts the parameter set) * @@ -4130,8 +4244,9 @@ public class Profile extends BaseResource implements IResource { * An XPath expression that returns a set of elements for the search parameter *

*/ - public void setXpath( String theString) { + public StructureSearchParam setXpath( String theString) { myXpath = new StringDt(theString); + return this; } @@ -4164,7 +4279,6 @@ public class Profile extends BaseResource implements IResource { myTarget = theValue; } - /** * Add a value for target (Types of resource (if a resource reference)) * @@ -4287,7 +4401,6 @@ public class Profile extends BaseResource implements IResource { myCode = theValue; } - /** * Sets the value for code (Identifies the extension in this profile) * @@ -4296,8 +4409,9 @@ public class Profile extends BaseResource implements IResource { * A unique code (within the profile) used to identify the extension *

*/ - public void setCode( String theCode) { + public ExtensionDefn setCode( String theCode) { myCode = new CodeDt(theCode); + return this; } @@ -4330,7 +4444,6 @@ public class Profile extends BaseResource implements IResource { myDisplay = theValue; } - /** * Sets the value for display (Use this name when displaying the value) * @@ -4339,8 +4452,9 @@ public class Profile extends BaseResource implements IResource { * Defined so that applications can use this name when displaying the value of the extension to the user *

*/ - public void setDisplay( String theString) { + public ExtensionDefn setDisplay( String theString) { myDisplay = new StringDt(theString); + return this; } @@ -4373,7 +4487,6 @@ public class Profile extends BaseResource implements IResource { myContextType = theValue; } - /** * Sets the value(s) for contextType (resource | datatype | mapping | extension) * @@ -4430,6 +4543,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for context (Where the extension can be used in instances), + * 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 (Where the extension can be used in instances) * @@ -4437,12 +4565,15 @@ public class Profile extends BaseResource implements IResource { * 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 void addContext( String theString) { + public ExtensionDefn addContext( String theString) { if (myContext == null) { myContext = new java.util.ArrayList(); } - myContext.add(new StringDt(theString)); + myContext.add(new StringDt(theString)); + return this; } @@ -4475,7 +4606,6 @@ public class Profile extends BaseResource implements IResource { myDefinition = theValue; } - } @@ -4508,7 +4638,7 @@ public class Profile extends BaseResource implements IResource { @Child(name="parameter", type=StructureSearchParam.class, order=2, min=0, max=Child.MAX_UNLIMITED) @Description( - shortDefinition="SearchParameter for the named query", + shortDefinition="Parameter for the named query", formalDefinition="A parameter of a named query" ) private java.util.List myParameter; @@ -4558,7 +4688,6 @@ public class Profile extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Special named queries (_query=)) * @@ -4567,8 +4696,9 @@ public class Profile extends BaseResource implements IResource { * The name of a query, which is used in the URI from Conformance statements declaring use of the query. Typically this will also be the name for the _query parameter when the query is called, though in some cases it may be aliased by a server to avoid collisions *

*/ - public void setName( String theString) { + public Query setName( String theString) { myName = new StringDt(theString); + return this; } @@ -4601,7 +4731,6 @@ public class Profile extends BaseResource implements IResource { myDocumentation = theValue; } - /** * Sets the value for documentation (Describes the named query) * @@ -4610,13 +4739,14 @@ public class Profile extends BaseResource implements IResource { * Description of the query - the functionality it offers, and considerations about how it functions and to use it *

*/ - public void setDocumentation( String theString) { + public Query setDocumentation( String theString) { myDocumentation = new StringDt(theString); + return this; } /** - * Gets the value(s) for parameter (SearchParameter for the named query). + * Gets the value(s) for parameter (Parameter for the named query). * creating it if it does * not exist. Will not return null. * @@ -4633,7 +4763,7 @@ public class Profile extends BaseResource implements IResource { } /** - * Sets the value(s) for parameter (SearchParameter for the named query) + * Sets the value(s) for parameter (Parameter for the named query) * *

* Definition: @@ -4645,7 +4775,7 @@ public class Profile extends BaseResource implements IResource { } /** - * Adds and returns a new value for parameter (SearchParameter for the named query) + * Adds and returns a new value for parameter (Parameter for the named query) * *

* Definition: @@ -4658,6 +4788,21 @@ public class Profile extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for parameter (Parameter for the named query), + * creating it if it does not already exist. + * + *

+ * Definition: + * A parameter of a named query + *

+ */ + public StructureSearchParam getParameterFirstRep() { + if (getParameter().isEmpty()) { + return addParameter(); + } + return getParameter().get(0); + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java index f86169a0699..4a340125b79 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java @@ -17,113 +17,24 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.List; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.IResource; +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.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; +import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; +import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -331,6 +242,21 @@ public class RelatedPerson extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (A Human identifier for this person), + * creating it if it does not already exist. + * + *

+ * Definition: + * Identifier for a person within a particular scope. + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for patient (The patient this person is related to). @@ -361,7 +287,6 @@ public class RelatedPerson extends BaseResource implements IResource { myPatient = theValue; } - /** * Gets the value(s) for relationship (The nature of the relationship). @@ -392,7 +317,6 @@ public class RelatedPerson extends BaseResource implements IResource { myRelationship = theValue; } - /** * Sets the value(s) for relationship (The nature of the relationship) * @@ -435,7 +359,6 @@ public class RelatedPerson extends BaseResource implements IResource { myName = theValue; } - /** * Gets the value(s) for telecom (A contact detail for the person). @@ -480,6 +403,21 @@ public class RelatedPerson extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (A contact detail for the person), + * creating it if it does not already exist. + * + *

+ * Definition: + * A contact detail for the person, e.g. a telephone number or an email address. + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for gender (Gender for administrative purposes). @@ -510,7 +448,6 @@ public class RelatedPerson extends BaseResource implements IResource { myGender = theValue; } - /** * Sets the value(s) for gender (Gender for administrative purposes) * @@ -553,7 +490,6 @@ public class RelatedPerson extends BaseResource implements IResource { myAddress = theValue; } - /** * Gets the value(s) for photo (Image of the person). @@ -598,6 +534,21 @@ public class RelatedPerson extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for photo (Image of the person), + * creating it if it does not already exist. + * + *

+ * Definition: + * Image of the person + *

+ */ + public AttachmentDt getPhotoFirstRep() { + if (getPhoto().isEmpty()) { + return addPhoto(); + } + return getPhoto().get(0); + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java index 9ec29c545d0..3498814337a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java @@ -17,113 +17,33 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IDatatype; +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.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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; +import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -281,6 +201,21 @@ public class Specimen extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (External Identifier), + * creating it if it does not already exist. + * + *

+ * Definition: + * Id for specimen + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for type (Kind of material that forms the specimen). @@ -311,7 +246,6 @@ public class Specimen extends BaseResource implements IResource { myType = theValue; } - /** * Gets the value(s) for source (Parent of specimen). @@ -356,6 +290,21 @@ public class Specimen extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for source (Parent of specimen), + * creating it if it does not already exist. + * + *

+ * Definition: + * Parent specimen from which the focal specimen was a component + *

+ */ + public Source getSourceFirstRep() { + if (getSource().isEmpty()) { + return addSource(); + } + return getSource().get(0); + } /** * Gets the value(s) for subject (Where the specimen came from. This may be the patient(s) or from the environment or a device). @@ -383,7 +332,6 @@ public class Specimen extends BaseResource implements IResource { mySubject = theValue; } - /** * Gets the value(s) for accessionIdentifier (Identifier assigned by the lab). @@ -414,7 +362,6 @@ public class Specimen extends BaseResource implements IResource { myAccessionIdentifier = theValue; } - /** * Gets the value(s) for receivedTime (The time when specimen was received for processing). @@ -445,7 +392,6 @@ public class Specimen extends BaseResource implements IResource { myReceivedTime = theValue; } - /** * Sets the value for receivedTime (The time when specimen was received for processing) * @@ -454,8 +400,9 @@ public class Specimen extends BaseResource implements IResource { * Time when specimen was received for processing or testing *

*/ - public void setReceivedTime( Date theDate, TemporalPrecisionEnum thePrecision) { + public Specimen setReceivedTime( Date theDate, TemporalPrecisionEnum thePrecision) { myReceivedTime = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -466,8 +413,9 @@ public class Specimen extends BaseResource implements IResource { * Time when specimen was received for processing or testing *

*/ - public void setReceivedTimeWithSecondsPrecision( Date theDate) { + public Specimen setReceivedTimeWithSecondsPrecision( Date theDate) { myReceivedTime = new DateTimeDt(theDate); + return this; } @@ -500,7 +448,6 @@ public class Specimen extends BaseResource implements IResource { myCollection = theValue; } - /** * Gets the value(s) for treatment (Treatment and processing step details). @@ -545,6 +492,21 @@ public class Specimen extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for treatment (Treatment and processing step details), + * creating it if it does not already exist. + * + *

+ * Definition: + * Details concerning treatment and processing steps for the specimen + *

+ */ + public Treatment getTreatmentFirstRep() { + if (getTreatment().isEmpty()) { + return addTreatment(); + } + return getTreatment().get(0); + } /** * Gets the value(s) for container (Direct container of specimen (tube/slide, etc)). @@ -589,6 +551,21 @@ public class Specimen extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for container (Direct container of specimen (tube/slide, etc)), + * creating it if it does not already exist. + * + *

+ * Definition: + * The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. + *

+ */ + public Container getContainerFirstRep() { + if (getContainer().isEmpty()) { + return addContainer(); + } + return getContainer().get(0); + } /** * Block class for child element: Specimen.source (Parent of specimen) @@ -662,7 +639,6 @@ public class Specimen extends BaseResource implements IResource { myRelationship = theValue; } - /** * Sets the value(s) for relationship (parent | child) * @@ -705,7 +681,19 @@ public class Specimen extends BaseResource implements IResource { myTarget = theValue; } - + /** + * Adds and returns a new value for target (The subject of the relationship) + * + *

+ * Definition: + * The specimen resource that is the target of this relationship + *

+ */ + public ResourceReferenceDt addTarget() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getTarget().add(newType); + return newType; + } } @@ -814,7 +802,6 @@ public class Specimen extends BaseResource implements IResource { myCollector = theValue; } - /** * Gets the value(s) for comment (Collector comments). @@ -859,6 +846,21 @@ public class Specimen extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for comment (Collector comments), + * creating it if it does not already exist. + * + *

+ * Definition: + * To communicate any details or issues encountered during the specimen collection procedure. + *

+ */ + public StringDt getCommentFirstRep() { + if (getComment().isEmpty()) { + return addComment(); + } + return getComment().get(0); + } /** * Adds a new value for comment (Collector comments) * @@ -866,12 +868,15 @@ public class Specimen extends BaseResource implements IResource { * Definition: * To communicate any details or issues encountered during the specimen collection procedure. *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addComment( String theString) { + public Collection addComment( String theString) { if (myComment == null) { myComment = new java.util.ArrayList(); } - myComment.add(new StringDt(theString)); + myComment.add(new StringDt(theString)); + return this; } @@ -901,7 +906,6 @@ public class Specimen extends BaseResource implements IResource { myCollected = theValue; } - /** * Gets the value(s) for quantity (The quantity of specimen collected). @@ -932,7 +936,6 @@ public class Specimen extends BaseResource implements IResource { myQuantity = theValue; } - /** * Gets the value(s) for method (Technique used to perform collection). @@ -963,7 +966,6 @@ public class Specimen extends BaseResource implements IResource { myMethod = theValue; } - /** * Sets the value(s) for method (Technique used to perform collection) * @@ -1006,7 +1008,6 @@ public class Specimen extends BaseResource implements IResource { mySourceSite = theValue; } - } @@ -1091,7 +1092,6 @@ public class Specimen extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Textual description of procedure) * @@ -1100,8 +1100,9 @@ public class Specimen extends BaseResource implements IResource { * *

*/ - public void setDescription( String theString) { + public Treatment setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -1134,7 +1135,6 @@ public class Specimen extends BaseResource implements IResource { myProcedure = theValue; } - /** * Sets the value(s) for procedure (Indicates the treatment or processing step applied to the specimen) * @@ -1177,7 +1177,19 @@ public class Specimen extends BaseResource implements IResource { myAdditive = theValue; } - + /** + * Adds and returns a new value for additive (Material used in the processing step) + * + *

+ * Definition: + * + *

+ */ + public ResourceReferenceDt addAdditive() { + ResourceReferenceDt newType = new ResourceReferenceDt(); + getAdditive().add(newType); + return newType; + } } @@ -1297,6 +1309,21 @@ public class Specimen extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for identifier (Id for the container), + * creating it if it does not already exist. + * + *

+ * Definition: + * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances + *

+ */ + public IdentifierDt getIdentifierFirstRep() { + if (getIdentifier().isEmpty()) { + return addIdentifier(); + } + return getIdentifier().get(0); + } /** * Gets the value(s) for description (Textual description of the container). @@ -1327,7 +1354,6 @@ public class Specimen extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Textual description of the container) * @@ -1336,8 +1362,9 @@ public class Specimen extends BaseResource implements IResource { * *

*/ - public void setDescription( String theString) { + public Container setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -1370,7 +1397,6 @@ public class Specimen extends BaseResource implements IResource { myType = theValue; } - /** * Gets the value(s) for capacity (Container volume or size). @@ -1401,7 +1427,6 @@ public class Specimen extends BaseResource implements IResource { myCapacity = theValue; } - /** * Gets the value(s) for specimenQuantity (Quantity of specimen within container). @@ -1432,7 +1457,6 @@ public class Specimen extends BaseResource implements IResource { mySpecimenQuantity = theValue; } - /** * Gets the value(s) for additive (Additive associated with container). @@ -1463,7 +1487,6 @@ public class Specimen extends BaseResource implements IResource { myAdditive = theValue; } - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java index d67964bf758..97d20a0c2e8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java @@ -17,113 +17,28 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; +import ca.uhn.fhir.model.api.IResourceBlock; +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.dstu.composite.CodeableConceptDt; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.composite.QuantityDt; +import ca.uhn.fhir.model.dstu.composite.RatioDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; /** @@ -267,7 +182,6 @@ public class Substance extends BaseResource implements IResource { myType = theValue; } - /** * Sets the value(s) for type (What kind of substance this is) * @@ -310,7 +224,6 @@ public class Substance extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Textual description of the substance, comments) * @@ -319,8 +232,9 @@ public class Substance extends BaseResource implements IResource { * A description of the substance - its appearance, handling requirements, and other usage notes *

*/ - public void setDescription( String theString) { + public Substance setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -353,7 +267,6 @@ public class Substance extends BaseResource implements IResource { myInstance = theValue; } - /** * Gets the value(s) for ingredient (Composition information about the substance). @@ -398,6 +311,21 @@ public class Substance extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for ingredient (Composition information about the substance), + * creating it if it does not already exist. + * + *

+ * Definition: + * A substance can be composed of other substances + *

+ */ + public Ingredient getIngredientFirstRep() { + if (getIngredient().isEmpty()) { + return addIngredient(); + } + return getIngredient().get(0); + } /** * Block class for child element: Substance.instance (If this describes a specific package/container of the substance) @@ -476,7 +404,6 @@ public class Substance extends BaseResource implements IResource { myIdentifier = theValue; } - /** * Gets the value(s) for expiry (When no longer valid to use). @@ -507,7 +434,6 @@ public class Substance extends BaseResource implements IResource { myExpiry = theValue; } - /** * Sets the value for expiry (When no longer valid to use) * @@ -516,8 +442,9 @@ public class Substance extends BaseResource implements IResource { * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. *

*/ - public void setExpiry( Date theDate, TemporalPrecisionEnum thePrecision) { + public Instance setExpiry( Date theDate, TemporalPrecisionEnum thePrecision) { myExpiry = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -528,8 +455,9 @@ public class Substance extends BaseResource implements IResource { * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. *

*/ - public void setExpiryWithSecondsPrecision( Date theDate) { + public Instance setExpiryWithSecondsPrecision( Date theDate) { myExpiry = new DateTimeDt(theDate); + return this; } @@ -562,7 +490,6 @@ public class Substance extends BaseResource implements IResource { myQuantity = theValue; } - } @@ -640,7 +567,6 @@ public class Substance extends BaseResource implements IResource { myQuantity = theValue; } - /** * Gets the value(s) for substance (A component of the substance). @@ -671,7 +597,6 @@ public class Substance extends BaseResource implements IResource { mySubstance = theValue; } - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java index bc125ee6435..628b1688c3c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java @@ -17,111 +17,28 @@ package ca.uhn.fhir.model.dstu.resource; -import java.util.*; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.api.annotation.*; +import java.util.Date; +import java.util.List; -import ca.uhn.fhir.model.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.AggregationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.valueset.BindingConformanceEnum; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.ConformanceEventModeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConformanceStatementStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.ConstraintSeverityEnum; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Device; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; -import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; -import ca.uhn.fhir.model.dstu.resource.Group; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.dstu.resource.Media; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Medication; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageEventEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.MessageTransportEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.resource.Practitioner; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.resource.RelatedPerson; -import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.RestfulSecurityServiceEnum; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; -import ca.uhn.fhir.model.dstu.resource.Specimen; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.dstu.resource.Substance; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.dstu.resource.ValueSet; -import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; +import ca.uhn.fhir.model.api.IResourceBlock; +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.dstu.composite.ContactDt; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -397,7 +314,6 @@ public class ValueSet extends BaseResource implements IResource { myIdentifier = theValue; } - /** * Sets the value for identifier (Logical id to reference this value set) * @@ -406,8 +322,9 @@ public class ValueSet extends BaseResource implements IResource { * The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI) *

*/ - public void setIdentifier( String theString) { + public ValueSet setIdentifier( String theString) { myIdentifier = new StringDt(theString); + return this; } @@ -440,7 +357,6 @@ public class ValueSet extends BaseResource implements IResource { myVersion = theValue; } - /** * Sets the value for version (Logical id for this version of the value set) * @@ -449,8 +365,9 @@ public class ValueSet extends BaseResource implements IResource { * The identifier that is 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 void setVersion( String theString) { + public ValueSet setVersion( String theString) { myVersion = new StringDt(theString); + return this; } @@ -483,7 +400,6 @@ public class ValueSet extends BaseResource implements IResource { myName = theValue; } - /** * Sets the value for name (Informal name for this value set) * @@ -492,8 +408,9 @@ public class ValueSet extends BaseResource implements IResource { * A free text natural language name describing the value set *

*/ - public void setName( String theString) { + public ValueSet setName( String theString) { myName = new StringDt(theString); + return this; } @@ -526,7 +443,6 @@ public class ValueSet extends BaseResource implements IResource { myPublisher = theValue; } - /** * Sets the value for publisher (Name of the publisher (Organization or individual)) * @@ -535,8 +451,9 @@ public class ValueSet extends BaseResource implements IResource { * The name of the individual or organization that published the value set *

*/ - public void setPublisher( String theString) { + public ValueSet setPublisher( String theString) { myPublisher = new StringDt(theString); + return this; } @@ -583,6 +500,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for telecom (Contact information of the publisher), + * creating it if it does not already exist. + * + *

+ * Definition: + * Contacts of the publisher to assist a user in finding and communicating with the publisher + *

+ */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } /** * Gets the value(s) for description (Human language description of the value set). @@ -613,7 +545,6 @@ public class ValueSet extends BaseResource implements IResource { myDescription = theValue; } - /** * Sets the value for description (Human language description of the value set) * @@ -622,8 +553,9 @@ public class ValueSet extends BaseResource implements IResource { * A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. *

*/ - public void setDescription( String theString) { + public ValueSet setDescription( String theString) { myDescription = new StringDt(theString); + return this; } @@ -656,7 +588,6 @@ public class ValueSet extends BaseResource implements IResource { myCopyright = theValue; } - /** * Sets the value for copyright (About the value set or its content) * @@ -665,8 +596,9 @@ public class ValueSet extends BaseResource implements IResource { * A copyright statement relating to the value set and/or its contents *

*/ - public void setCopyright( String theString) { + public ValueSet setCopyright( String theString) { myCopyright = new StringDt(theString); + return this; } @@ -699,7 +631,6 @@ public class ValueSet extends BaseResource implements IResource { myStatus = theValue; } - /** * Sets the value(s) for status (draft | active | retired) * @@ -742,7 +673,6 @@ public class ValueSet extends BaseResource implements IResource { myExperimental = theValue; } - /** * Sets the value for experimental (If for testing purposes, not real usage) * @@ -751,8 +681,9 @@ public class ValueSet extends BaseResource implements IResource { * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage *

*/ - public void setExperimental( Boolean theBoolean) { + public ValueSet setExperimental( Boolean theBoolean) { myExperimental = new BooleanDt(theBoolean); + return this; } @@ -785,7 +716,6 @@ public class ValueSet extends BaseResource implements IResource { myExtensible = theValue; } - /** * Sets the value for extensible (Whether this is intended to be used with an extensible binding) * @@ -794,8 +724,9 @@ public class ValueSet extends BaseResource implements IResource { * Whether this is intended to be used with an extensible binding or not *

*/ - public void setExtensible( Boolean theBoolean) { + public ValueSet setExtensible( Boolean theBoolean) { myExtensible = new BooleanDt(theBoolean); + return this; } @@ -828,7 +759,6 @@ public class ValueSet extends BaseResource implements IResource { myDate = theValue; } - /** * Sets the value for date (Date for given status) * @@ -837,8 +767,9 @@ public class ValueSet extends BaseResource implements IResource { * The date that the value set status was last changed *

*/ - public void setDate( Date theDate, TemporalPrecisionEnum thePrecision) { + public ValueSet setDate( Date theDate, TemporalPrecisionEnum thePrecision) { myDate = new DateTimeDt(theDate, thePrecision); + return this; } /** @@ -849,8 +780,9 @@ public class ValueSet extends BaseResource implements IResource { * The date that the value set status was last changed *

*/ - public void setDateWithSecondsPrecision( Date theDate) { + public ValueSet setDateWithSecondsPrecision( Date theDate) { myDate = new DateTimeDt(theDate); + return this; } @@ -883,7 +815,6 @@ public class ValueSet extends BaseResource implements IResource { myDefine = theValue; } - /** * Gets the value(s) for compose (When value set includes codes from elsewhere). @@ -914,7 +845,6 @@ public class ValueSet extends BaseResource implements IResource { myCompose = theValue; } - /** * Gets the value(s) for expansion (When value set is an expansion). @@ -945,7 +875,6 @@ public class ValueSet extends BaseResource implements IResource { myExpansion = theValue; } - /** * Block class for child element: ValueSet.define (When value set defines its own codes) @@ -1031,7 +960,6 @@ public class ValueSet extends BaseResource implements IResource { mySystem = theValue; } - /** * Sets the value for system (URI to identify the code system) * @@ -1040,8 +968,9 @@ public class ValueSet extends BaseResource implements IResource { * *

*/ - public void setSystem( String theUri) { + public Define setSystem( String theUri) { mySystem = new UriDt(theUri); + return this; } @@ -1074,7 +1003,6 @@ public class ValueSet extends BaseResource implements IResource { myVersion = theValue; } - /** * Sets the value for version (Version of this system) * @@ -1083,8 +1011,9 @@ public class ValueSet extends BaseResource implements IResource { * 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 void setVersion( String theString) { + public Define setVersion( String theString) { myVersion = new StringDt(theString); + return this; } @@ -1117,7 +1046,6 @@ public class ValueSet extends BaseResource implements IResource { myCaseSensitive = theValue; } - /** * Sets the value for caseSensitive (If code comparison is case sensitive) * @@ -1126,8 +1054,9 @@ public class ValueSet extends BaseResource implements IResource { * If code comparison is case sensitive when codes within this system are compared to each other *

*/ - public void setCaseSensitive( Boolean theBoolean) { + public Define setCaseSensitive( Boolean theBoolean) { myCaseSensitive = new BooleanDt(theBoolean); + return this; } @@ -1174,6 +1103,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for concept (Concepts in the code system), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public DefineConcept getConceptFirstRep() { + if (getConcept().isEmpty()) { + return addConcept(); + } + return getConcept().get(0); + } } @@ -1269,7 +1213,6 @@ public class ValueSet extends BaseResource implements IResource { myCode = theValue; } - /** * Sets the value for code (Code that identifies concept) * @@ -1278,8 +1221,9 @@ public class ValueSet extends BaseResource implements IResource { * *

*/ - public void setCode( String theCode) { + public DefineConcept setCode( String theCode) { myCode = new CodeDt(theCode); + return this; } @@ -1312,7 +1256,6 @@ public class ValueSet extends BaseResource implements IResource { myAbstract = theValue; } - /** * Sets the value for abstract (If this code is not for use as a real concept) * @@ -1321,8 +1264,9 @@ public class ValueSet extends BaseResource implements IResource { * If this code is not for use as a real concept *

*/ - public void setAbstract( Boolean theBoolean) { + public DefineConcept setAbstract( Boolean theBoolean) { myAbstract = new BooleanDt(theBoolean); + return this; } @@ -1355,7 +1299,6 @@ public class ValueSet extends BaseResource implements IResource { myDisplay = theValue; } - /** * Sets the value for display (Text to Display to the user) * @@ -1364,8 +1307,9 @@ public class ValueSet extends BaseResource implements IResource { * *

*/ - public void setDisplay( String theString) { + public DefineConcept setDisplay( String theString) { myDisplay = new StringDt(theString); + return this; } @@ -1398,7 +1342,6 @@ public class ValueSet extends BaseResource implements IResource { myDefinition = theValue; } - /** * Sets the value for definition (Formal Definition) * @@ -1407,8 +1350,9 @@ public class ValueSet extends BaseResource implements IResource { * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept *

*/ - public void setDefinition( String theString) { + public DefineConcept setDefinition( String theString) { myDefinition = new StringDt(theString); + return this; } @@ -1455,6 +1399,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for concept (Child Concepts (is-a / contains)), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public DefineConcept getConceptFirstRep() { + if (getConcept().isEmpty()) { + return addConcept(); + } + return getConcept().get(0); + } } @@ -1552,6 +1511,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for import (Import the contents of another value set), + * creating it if it does not already exist. + * + *

+ * Definition: + * Includes the contents of the referenced value set as a part of the contents of this value set + *

+ */ + public UriDt getImportFirstRep() { + if (getImport().isEmpty()) { + return addImport(); + } + return getImport().get(0); + } /** * Adds a new value for import (Import the contents of another value set) * @@ -1559,12 +1533,15 @@ public class ValueSet extends BaseResource implements IResource { * Definition: * Includes the contents of the referenced value set as a part of the contents of this value set *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addImport( String theUri) { + public Compose addImport( String theUri) { if (myImport == null) { myImport = new java.util.ArrayList(); } - myImport.add(new UriDt(theUri)); + myImport.add(new UriDt(theUri)); + return this; } @@ -1611,6 +1588,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for include (Include one or more codes from a code system), + * creating it if it does not already exist. + * + *

+ * Definition: + * Include one or more codes from a code system + *

+ */ + public ComposeInclude getIncludeFirstRep() { + if (getInclude().isEmpty()) { + return addInclude(); + } + return getInclude().get(0); + } /** * Gets the value(s) for exclude (Explicitly exclude codes). @@ -1655,6 +1647,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for exclude (Explicitly exclude codes), + * creating it if it does not already exist. + * + *

+ * Definition: + * Exclude one or more codes from the value set + *

+ */ + public ComposeInclude getExcludeFirstRep() { + if (getExclude().isEmpty()) { + return addExclude(); + } + return getExclude().get(0); + } } @@ -1743,7 +1750,6 @@ public class ValueSet extends BaseResource implements IResource { mySystem = theValue; } - /** * Sets the value for system (The system the codes come from) * @@ -1752,8 +1758,9 @@ public class ValueSet extends BaseResource implements IResource { * The code system from which the selected codes come from *

*/ - public void setSystem( String theUri) { + public ComposeInclude setSystem( String theUri) { mySystem = new UriDt(theUri); + return this; } @@ -1786,7 +1793,6 @@ public class ValueSet extends BaseResource implements IResource { myVersion = theValue; } - /** * Sets the value for version (Specific version of the code system referred to) * @@ -1795,8 +1801,9 @@ public class ValueSet extends BaseResource implements IResource { * The version of the code system that the codes are selected from *

*/ - public void setVersion( String theString) { + public ComposeInclude setVersion( String theString) { myVersion = new StringDt(theString); + return this; } @@ -1843,6 +1850,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for code (Code or concept from system), + * creating it if it does not already exist. + * + *

+ * Definition: + * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance + *

+ */ + public CodeDt getCodeFirstRep() { + if (getCode().isEmpty()) { + return addCode(); + } + return getCode().get(0); + } /** * Adds a new value for code (Code or concept from system) * @@ -1850,12 +1872,15 @@ public class ValueSet extends BaseResource implements IResource { * Definition: * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance *

+ * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void addCode( String theCode) { + public ComposeInclude addCode( String theCode) { if (myCode == null) { myCode = new java.util.ArrayList(); } - myCode.add(new CodeDt(theCode)); + myCode.add(new CodeDt(theCode)); + return this; } @@ -1902,6 +1927,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for filter (Select codes/concepts by their properties (including relationships)), + * creating it if it does not already exist. + * + *

+ * Definition: + * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + *

+ */ + public ComposeIncludeFilter getFilterFirstRep() { + if (getFilter().isEmpty()) { + return addFilter(); + } + return getFilter().get(0); + } } @@ -1983,7 +2023,6 @@ public class ValueSet extends BaseResource implements IResource { myProperty = theValue; } - /** * Sets the value for property () * @@ -1992,8 +2031,9 @@ public class ValueSet extends BaseResource implements IResource { * A code that identifies a property defined in the code system *

*/ - public void setProperty( String theCode) { + public ComposeIncludeFilter setProperty( String theCode) { myProperty = new CodeDt(theCode); + return this; } @@ -2026,7 +2066,6 @@ public class ValueSet extends BaseResource implements IResource { myOp = theValue; } - /** * Sets the value(s) for op (= | is-a | is-not-a | regex | in | not in) * @@ -2069,7 +2108,6 @@ public class ValueSet extends BaseResource implements IResource { myValue = theValue; } - /** * Sets the value for value (Code from the system, or regex criteria) * @@ -2078,8 +2116,9 @@ public class ValueSet extends BaseResource implements IResource { * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value *

*/ - public void setValue( String theCode) { + public ComposeIncludeFilter setValue( String theCode) { myValue = new CodeDt(theCode); + return this; } @@ -2166,7 +2205,6 @@ public class ValueSet extends BaseResource implements IResource { myIdentifier = theValue; } - /** * Gets the value(s) for timestamp (Time valueset expansion happened). @@ -2197,7 +2235,6 @@ public class ValueSet extends BaseResource implements IResource { myTimestamp = theValue; } - /** * Sets the value for timestamp (Time valueset expansion happened) * @@ -2206,8 +2243,9 @@ public class ValueSet extends BaseResource implements IResource { * *

*/ - public void setTimestamp( Date theDate, TemporalPrecisionEnum thePrecision) { - myTimestamp = new InstantDt(theDate, thePrecision); + public Expansion setTimestampWithMillisPrecision( Date theDate) { + myTimestamp = new InstantDt(theDate); + return this; } /** @@ -2218,8 +2256,9 @@ public class ValueSet extends BaseResource implements IResource { * *

*/ - public void setTimestampWithMillisPrecision( Date theDate) { - myTimestamp = new InstantDt(theDate); + public Expansion setTimestamp( Date theDate, TemporalPrecisionEnum thePrecision) { + myTimestamp = new InstantDt(theDate, thePrecision); + return this; } @@ -2266,6 +2305,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for contains (Codes in the value set), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public ExpansionContains getContainsFirstRep() { + if (getContains().isEmpty()) { + return addContains(); + } + return getContains().get(0); + } } @@ -2354,7 +2408,6 @@ public class ValueSet extends BaseResource implements IResource { mySystem = theValue; } - /** * Sets the value for system (System value for the code) * @@ -2363,8 +2416,9 @@ public class ValueSet extends BaseResource implements IResource { * *

*/ - public void setSystem( String theUri) { + public ExpansionContains setSystem( String theUri) { mySystem = new UriDt(theUri); + return this; } @@ -2397,7 +2451,6 @@ public class ValueSet extends BaseResource implements IResource { myCode = theValue; } - /** * Sets the value for code (Code - if blank, this is not a choosable code) * @@ -2406,8 +2459,9 @@ public class ValueSet extends BaseResource implements IResource { * *

*/ - public void setCode( String theCode) { + public ExpansionContains setCode( String theCode) { myCode = new CodeDt(theCode); + return this; } @@ -2440,7 +2494,6 @@ public class ValueSet extends BaseResource implements IResource { myDisplay = theValue; } - /** * Sets the value for display (User display for the concept) * @@ -2449,8 +2502,9 @@ public class ValueSet extends BaseResource implements IResource { * *

*/ - public void setDisplay( String theString) { + public ExpansionContains setDisplay( String theString) { myDisplay = new StringDt(theString); + return this; } @@ -2497,6 +2551,21 @@ public class ValueSet extends BaseResource implements IResource { return newType; } + /** + * Gets the first repetition for contains (Codes contained in this concept), + * creating it if it does not already exist. + * + *

+ * Definition: + * + *

+ */ + public ExpansionContains getContainsFirstRep() { + if (getContains().isEmpty()) { + return addContains(); + } + return getContains().get(0); + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AddressUseEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AddressUseEnum.java index 8e7af0aba04..0834efea35f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AddressUseEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AddressUseEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum AddressUseEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AdministrativeGenderCodesEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AdministrativeGenderCodesEnum.java index 9080c017d06..fc3bef06312 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AdministrativeGenderCodesEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AdministrativeGenderCodesEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum AdministrativeGenderCodesEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AdmitSourceEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AdmitSourceEnum.java index 859ad8aa42b..86f29801d5f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AdmitSourceEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AdmitSourceEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum AdmitSourceEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AggregationModeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AggregationModeEnum.java index 60d0a0d6bb4..64b208d74db 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AggregationModeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AggregationModeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum AggregationModeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AnimalSpeciesEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AnimalSpeciesEnum.java index 75dc85669f5..0740810ba43 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AnimalSpeciesEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AnimalSpeciesEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum AnimalSpeciesEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/BindingConformanceEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/BindingConformanceEnum.java index f8f7dd220ab..9128cb487b3 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/BindingConformanceEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/BindingConformanceEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum BindingConformanceEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConformanceEventModeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConformanceEventModeEnum.java index 40cfac3382e..6ead45fbbf4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConformanceEventModeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConformanceEventModeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ConformanceEventModeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConformanceStatementStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConformanceStatementStatusEnum.java index bba1cda2887..5fdddf75797 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConformanceStatementStatusEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConformanceStatementStatusEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ConformanceStatementStatusEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConstraintSeverityEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConstraintSeverityEnum.java index 4dae5072625..077dd54c2df 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConstraintSeverityEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConstraintSeverityEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ConstraintSeverityEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactSystemEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactSystemEnum.java index eb09b1d6f61..0bedabfba0a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactSystemEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactSystemEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ContactSystemEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactUseEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactUseEnum.java index 8ccb4c42632..f59a28e331f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactUseEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactUseEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ContactUseEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DataTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DataTypeEnum.java index b53c53d1e79..4ef67d9de00 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DataTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DataTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum DataTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticOrderPriorityEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticOrderPriorityEnum.java index 9da01597c09..d53c7028f5a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticOrderPriorityEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticOrderPriorityEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum DiagnosticOrderPriorityEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticOrderStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticOrderStatusEnum.java index 43f53331bf8..a3dbc077753 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticOrderStatusEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticOrderStatusEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum DiagnosticOrderStatusEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticReportStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticReportStatusEnum.java index ad53c670914..4bb7463eec2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticReportStatusEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DiagnosticReportStatusEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum DiagnosticReportStatusEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DocumentModeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DocumentModeEnum.java index e88daa8965a..fb5fd1b334d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DocumentModeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DocumentModeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum DocumentModeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterClassEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterClassEnum.java index 9c88e7daa42..4e52815649b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterClassEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterClassEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum EncounterClassEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterReasonCodesEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterReasonCodesEnum.java index d68deff262a..8ab5bc911cc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterReasonCodesEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterReasonCodesEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum EncounterReasonCodesEnum { ; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterStateEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterStateEnum.java index 8ac2ca18a63..fe6f0a1a450 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterStateEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterStateEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum EncounterStateEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterTypeEnum.java index 557df59e194..eb70fb3d125 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EncounterTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum EncounterTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EventTimingEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EventTimingEnum.java index 422ea762ea6..95fbd017cf4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EventTimingEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/EventTimingEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum EventTimingEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ExtensionContextEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ExtensionContextEnum.java index d305d45efa9..7dfd5430776 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ExtensionContextEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ExtensionContextEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ExtensionContextEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FHIRDefinedTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FHIRDefinedTypeEnum.java index 78e5a82b1e1..af1537a7835 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FHIRDefinedTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FHIRDefinedTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum FHIRDefinedTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FilterOperatorEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FilterOperatorEnum.java index 2b4cf2f4967..415fdf9fca3 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FilterOperatorEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FilterOperatorEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum FilterOperatorEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/GroupTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/GroupTypeEnum.java index bef28a9632b..4865bb27967 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/GroupTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/GroupTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum GroupTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/HierarchicalRelationshipTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/HierarchicalRelationshipTypeEnum.java index 8168a3f69e7..7a54c31f335 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/HierarchicalRelationshipTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/HierarchicalRelationshipTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum HierarchicalRelationshipTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/IdentifierUseEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/IdentifierUseEnum.java index 86fb510814f..cb730f54b38 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/IdentifierUseEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/IdentifierUseEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum IdentifierUseEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ImagingModalityEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ImagingModalityEnum.java index 01d51f84112..fb2368b86a2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ImagingModalityEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ImagingModalityEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ImagingModalityEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/InstanceAvailabilityEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/InstanceAvailabilityEnum.java index 024f9135273..5b8579c9ded 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/InstanceAvailabilityEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/InstanceAvailabilityEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum InstanceAvailabilityEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LinkTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LinkTypeEnum.java index 1df57d15599..58b5f80b3b3 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LinkTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LinkTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum LinkTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationModeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationModeEnum.java index 3e1535b47b0..fe6e00442bd 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationModeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationModeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum LocationModeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationStatusEnum.java index 9b245f0d755..36392e12c30 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationStatusEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationStatusEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum LocationStatusEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationTypeEnum.java index 43da18f818f..32e1a356b38 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum LocationTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MaritalStatusCodesEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MaritalStatusCodesEnum.java index 2729305d903..7a503e89fb2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MaritalStatusCodesEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MaritalStatusCodesEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum MaritalStatusCodesEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MediaTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MediaTypeEnum.java index 79e0b761a25..bb045f98431 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MediaTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MediaTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum MediaTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MedicationKindEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MedicationKindEnum.java index 883793555dc..a3595d62ab3 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MedicationKindEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MedicationKindEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum MedicationKindEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageEventEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageEventEnum.java index 4bd88417417..8f77d5c7373 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageEventEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageEventEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum MessageEventEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageSignificanceCategoryEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageSignificanceCategoryEnum.java index 5c91d621019..e257e23d8ab 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageSignificanceCategoryEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageSignificanceCategoryEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum MessageSignificanceCategoryEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageTransportEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageTransportEnum.java index 919a5cdec09..1fcee4235ee 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageTransportEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MessageTransportEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum MessageTransportEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ModalityEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ModalityEnum.java index 89d6408f84a..5b0d4adff18 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ModalityEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ModalityEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ModalityEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NameUseEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NameUseEnum.java index a840d79ac8a..1cbd699f1db 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NameUseEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NameUseEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum NameUseEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationInterpretationCodesEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationInterpretationCodesEnum.java index 43091629456..756f6ff8111 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationInterpretationCodesEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationInterpretationCodesEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ObservationInterpretationCodesEnum { ; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationRelationshipTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationRelationshipTypeEnum.java index 12935223067..43e8fc0f10f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationRelationshipTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationRelationshipTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ObservationRelationshipTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationReliabilityEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationReliabilityEnum.java index c29efbf2119..914a7057416 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationReliabilityEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationReliabilityEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ObservationReliabilityEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationStatusEnum.java index 981f2269cad..1ef8c76a570 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationStatusEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationStatusEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ObservationStatusEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/OrganizationTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/OrganizationTypeEnum.java index e8554e05dfe..0b9bb93d0d4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/OrganizationTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/OrganizationTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum OrganizationTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ParticipantTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ParticipantTypeEnum.java index c81375118a5..6847e614d9f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ParticipantTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ParticipantTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ParticipantTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PatientRelationshipTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PatientRelationshipTypeEnum.java index ab090d5cd47..7eb44b5e137 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PatientRelationshipTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PatientRelationshipTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum PatientRelationshipTypeEnum { ; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerRoleEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerRoleEnum.java index 8ec4108092d..55cd0aad5e7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerRoleEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerRoleEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum PractitionerRoleEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerSpecialtyEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerSpecialtyEnum.java index 99ae1802ea8..91baf569041 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerSpecialtyEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerSpecialtyEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum PractitionerSpecialtyEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PropertyRepresentationEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PropertyRepresentationEnum.java index 9b211757d28..45ee8117ea3 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PropertyRepresentationEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PropertyRepresentationEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum PropertyRepresentationEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/QuantityCompararatorEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/QuantityCompararatorEnum.java index 343c2fa347f..cfa2ee82347 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/QuantityCompararatorEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/QuantityCompararatorEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum QuantityCompararatorEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceProfileStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceProfileStatusEnum.java index 82473d28661..b4f91cd6f79 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceProfileStatusEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceProfileStatusEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ResourceProfileStatusEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceTypeEnum.java index e97a97fa098..4f0d6f841e6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ResourceTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulConformanceModeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulConformanceModeEnum.java index 3c052f5d238..cb523a892a3 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulConformanceModeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulConformanceModeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum RestfulConformanceModeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulOperationSystemEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulOperationSystemEnum.java index 4194c55fe53..cca87aff1c7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulOperationSystemEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulOperationSystemEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum RestfulOperationSystemEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulOperationTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulOperationTypeEnum.java index e5b0acd85c0..965a78ae9f7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulOperationTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulOperationTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum RestfulOperationTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulSecurityServiceEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulSecurityServiceEnum.java index 582964e9484..97eb12f8ad7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulSecurityServiceEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/RestfulSecurityServiceEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum RestfulSecurityServiceEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SearchParamTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SearchParamTypeEnum.java index 954f60aab09..84b3b44ca98 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SearchParamTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SearchParamTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum SearchParamTypeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SlicingRulesEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SlicingRulesEnum.java index 607578e31f2..2c5c28e73c1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SlicingRulesEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SlicingRulesEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum SlicingRulesEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenCollectionMethodEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenCollectionMethodEnum.java index 8bfd477920e..abc18b1e836 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenCollectionMethodEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenCollectionMethodEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum SpecimenCollectionMethodEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenTreatmentProcedureEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenTreatmentProcedureEnum.java index c5c217ecf94..453cf400f8a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenTreatmentProcedureEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenTreatmentProcedureEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum SpecimenTreatmentProcedureEnum { ; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SubstanceTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SubstanceTypeEnum.java index d393c5f887a..5389284dd28 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SubstanceTypeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SubstanceTypeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum SubstanceTypeEnum { ; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/UnitsOfTimeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/UnitsOfTimeEnum.java index 32c60720c24..8bde3e0a832 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/UnitsOfTimeEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/UnitsOfTimeEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum UnitsOfTimeEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ValueSetStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ValueSetStatusEnum.java index 51b011acaac..4a8c5ba1b62 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ValueSetStatusEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ValueSetStatusEnum.java @@ -1,10 +1,11 @@ package ca.uhn.fhir.model.dstu.valueset; -import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + public enum ValueSetStatusEnum { /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/DateTimeDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/DateTimeDt.java index e9890d2bfe4..ee64a5139f5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/DateTimeDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/DateTimeDt.java @@ -23,7 +23,18 @@ public class DateTimeDt extends BaseDateTimeDt { } /** - * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: + * Create a new DateTimeDt + */ + @SimpleSetter(suffix = "WithSecondsPrecision") + public DateTimeDt(@SimpleSetter.Parameter(name = "theDate") Date theDate) { + setValue(theDate); + setPrecision(DEFAULT_PRECISION); + setTimeZone(TimeZone.getDefault()); + } + + /** + * Constructor which accepts a date value and a precision value. Valid + * precisions values for this type are: *
    *
  • {@link TemporalPrecisionEnum#YEAR} *
  • {@link TemporalPrecisionEnum#MONTH} @@ -40,13 +51,10 @@ public class DateTimeDt extends BaseDateTimeDt { } /** - * Create a new DateTimeDt + * Create a new instance using a string date/time */ - @SimpleSetter(suffix="WithSecondsPrecision") - public DateTimeDt(@SimpleSetter.Parameter(name="theDate") Date theDate) { - setValue(theDate); - setPrecision(DEFAULT_PRECISION); - setTimeZone(TimeZone.getDefault()); + public DateTimeDt(String theValue) { + setValueAsString(theValue); } @Override diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/INarrativeGenerator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/INarrativeGenerator.java new file mode 100644 index 00000000000..0dcde9c19be --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/INarrativeGenerator.java @@ -0,0 +1,10 @@ +package ca.uhn.fhir.narrative; + +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dstu.composite.NarrativeDt; + +public interface INarrativeGenerator { + + public NarrativeDt generateNarrative(String theProfile, IResource theResource); + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/ThymeleafNarrativeGenerator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/ThymeleafNarrativeGenerator.java new file mode 100644 index 00000000000..472bce4dfaf --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/ThymeleafNarrativeGenerator.java @@ -0,0 +1,112 @@ +package ca.uhn.fhir.narrative; + +import static org.apache.commons.lang3.StringUtils.*; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.util.HashMap; +import java.util.Properties; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.input.ReaderInputStream; +import org.thymeleaf.TemplateEngine; +import org.thymeleaf.TemplateProcessingParameters; +import org.thymeleaf.context.Context; +import org.thymeleaf.resourceresolver.IResourceResolver; +import org.thymeleaf.standard.StandardDialect; +import org.thymeleaf.templateresolver.TemplateResolver; + +import ca.uhn.fhir.context.ConfigurationException; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dstu.composite.NarrativeDt; +import ca.uhn.fhir.model.dstu.resource.Patient; +import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum; +import ca.uhn.fhir.model.primitive.XhtmlDt; + +public class ThymeleafNarrativeGenerator implements INarrativeGenerator { + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ThymeleafNarrativeGenerator.class); + private TemplateEngine myTemplateEngine; + private HashMap myProfileToNarrativeTemplate; + + public ThymeleafNarrativeGenerator() throws IOException { + myProfileToNarrativeTemplate = new HashMap(); + + Properties file = new Properties(); + InputStream resource = loadResource("classpath:ca/uhn/fhir/narrative/narratives.properties"); + file.load(resource); + for (Object nextKeyObj : file.keySet()) { + String nextKey = (String) nextKeyObj; + if (nextKey.endsWith(".profile")) { + String name = nextKey.substring(0, nextKey.indexOf(".profile")); + if (isBlank(name)) { + continue; + } + + String narrativeName = file.getProperty(name + ".narrative"); + if (isBlank(narrativeName)) { + continue; + } + + String narrative = IOUtils.toString(loadResource(narrativeName)); + myProfileToNarrativeTemplate.put(file.getProperty(nextKey), narrative); + } + } + myTemplateEngine = new TemplateEngine(); + + TemplateResolver resolver = new TemplateResolver(); + resolver.setResourceResolver(new IResourceResolver() { + + @Override + public InputStream getResourceAsStream(TemplateProcessingParameters theTemplateProcessingParameters, String theResourceName) { + String template = myProfileToNarrativeTemplate.get(theResourceName); + return new ReaderInputStream(new StringReader(template)); + } + + @Override + public String getName() { + return getClass().getCanonicalName(); + } + }); + myTemplateEngine.setTemplateResolver(resolver); + myTemplateEngine.setDialect(new StandardDialect()); + + myTemplateEngine.initialize(); + } + + private InputStream loadResource(String name) { + if (name.startsWith("classpath:")) { + String cpName = name.substring("classpath:".length()); + InputStream resource = ThymeleafNarrativeGenerator.class.getResourceAsStream(cpName); + if (resource == null) { + resource = ThymeleafNarrativeGenerator.class.getResourceAsStream("/"+cpName); + if (resource == null) { + throw new ConfigurationException("Can not find '" + cpName + "' on classpath"); + } + } + return resource; + } else { + throw new IllegalArgumentException("Invalid resource name: '" + name + "'"); + } + } + + public String generateString(Patient theValue) { + + Context context = new Context(); + context.setVariable("resource", theValue); + String result = myTemplateEngine.process("ca/uhn/fhir/narrative/Patient.html", context); + + ourLog.info("Result: {}", result); + + return result; + } + + @Override + public NarrativeDt generateNarrative(String theProfile, IResource theResource) { + Context context = new Context(); + context.setVariable("resource", theResource); + String result = myTemplateEngine.process(theProfile, context); + return new NarrativeDt(new XhtmlDt(result), NarrativeStatusEnum.GENERATED); + } + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/ThymeleafResolver.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/ThymeleafResolver.java new file mode 100644 index 00000000000..28e5847d470 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/ThymeleafResolver.java @@ -0,0 +1,35 @@ +package ca.uhn.fhir.narrative; + +import org.thymeleaf.TemplateProcessingParameters; +import org.thymeleaf.templateresolver.ITemplateResolver; +import org.thymeleaf.templateresolver.TemplateResolution; + +public class ThymeleafResolver implements ITemplateResolver { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ThymeleafResolver.class); + + @Override + public String getName() { + return ""; + } + + @Override + public Integer getOrder() { + return 0; + } + + @Override + public void initialize() { + // nothing + } + + @Override + public TemplateResolution resolveTemplate(TemplateProcessingParameters theTemplateProcessingParameters) { + + String templateName = theTemplateProcessingParameters.getTemplateName(); + ourLog.info("Resolving template: {}", templateName); + + return null; + } + +} 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 1f17d9b35ed..7238884f6aa 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 @@ -7,20 +7,31 @@ import java.util.List; import java.util.Set; import java.util.UUID; +import ca.uhn.fhir.context.BaseRuntimeChildDefinition; +import ca.uhn.fhir.context.BaseRuntimeDeclaredChildDefinition; import ca.uhn.fhir.context.ConfigurationException; +import ca.uhn.fhir.context.RuntimeChildChoiceDefinition; +import ca.uhn.fhir.model.api.Bundle; +import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.primitive.IdDt; public abstract class BaseParser implements IParser { + @SuppressWarnings("cast") @Override - @SuppressWarnings("unchecked") public T parseResource(Class theResourceType, String theMessageString) { StringReader reader = new StringReader(theMessageString); return (T) parseResource(theResourceType, reader); } + @Override + public Bundle parseBundle(String theXml) throws ConfigurationException, DataFormatException { + StringReader reader = new StringReader(theXml); + return parseBundle(reader); + } + @Override public IResource parseResource(String theMessageString) throws ConfigurationException, DataFormatException { return parseResource(null, theMessageString); @@ -54,4 +65,20 @@ public abstract class BaseParser implements IParser { } + protected void throwExceptionForUnknownChildType(BaseRuntimeChildDefinition nextChild, Class type) { + if (nextChild instanceof BaseRuntimeDeclaredChildDefinition) { + StringBuilder b = new StringBuilder(); + b.append(((BaseRuntimeDeclaredChildDefinition) nextChild).getElementName()); + b.append(" has type "); + b.append(type); + b.append(" but this is not a valid type for this element"); + if (nextChild instanceof RuntimeChildChoiceDefinition) { + RuntimeChildChoiceDefinition choice = (RuntimeChildChoiceDefinition)nextChild; + b.append(" - Expected one of: " + choice.getValidChildTypes()); + } + throw new DataFormatException(b.toString()); + } + throw new DataFormatException(nextChild + " has no child of type " + type); + } + } 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 cbd667df85a..de5e10448f6 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 @@ -8,11 +8,14 @@ import java.io.StringReader; import java.io.StringWriter; import java.io.Writer; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import javax.json.Json; import javax.json.JsonArray; @@ -29,7 +32,6 @@ import org.apache.commons.lang3.StringUtils; import ca.uhn.fhir.context.BaseRuntimeChildDefinition; import ca.uhn.fhir.context.BaseRuntimeElementCompositeDefinition; import ca.uhn.fhir.context.BaseRuntimeElementDefinition; -import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.RuntimeChildDeclaredExtensionDefinition; import ca.uhn.fhir.context.RuntimeChildUndeclaredExtensionDefinition; @@ -38,6 +40,7 @@ import ca.uhn.fhir.model.api.BaseBundle; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.BundleEntry; import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.IIdentifiableElement; import ca.uhn.fhir.model.api.IPrimitiveDatatype; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.ISupportsUndeclaredExtensions; @@ -63,6 +66,9 @@ public class JsonParser extends BaseParser implements IParser { @Override public String encodeBundleToString(Bundle theBundle) throws DataFormatException, IOException { + if (theBundle == null) { + throw new NullPointerException("Bundle can not be null"); + } StringWriter stringWriter = new StringWriter(); encodeBundleToWriter(theBundle, stringWriter); @@ -132,25 +138,32 @@ public class JsonParser extends BaseParser implements IParser { public void encodeResourceToWriter(IResource theResource, Writer theWriter) throws IOException { JsonGenerator eventWriter = createJsonGenerator(theWriter); - // try { encodeResourceToJsonStreamWriter(theResource, eventWriter, null); eventWriter.flush(); - // } catch (XMLStreamException e) { - // throw new - // ConfigurationException("Failed to initialize STaX event factory", e); - // } } @Override public Bundle parseBundle(Reader theReader) { - // TODO Auto-generated method stub - return null; - } + JsonReader reader = Json.createReader(theReader); + JsonObject object = reader.readObject(); - @Override - public Bundle parseBundle(String theMessageString) throws ConfigurationException, DataFormatException { - // TODO Auto-generated method stub - return null; + JsonValue resourceTypeObj = object.get("resourceType"); + assertObjectOfType(resourceTypeObj, JsonValue.ValueType.STRING, "resourceType"); + String resourceType = ((JsonString) resourceTypeObj).getString(); + if (!"Bundle".equals(resourceType)) { + throw new DataFormatException("Trying to parse bundle but found resourceType other than 'Bundle'. Found: '" + resourceType + "'"); + } + + ParserState state = ParserState.getPreAtomInstance(myContext, true); + state.enteringNewElement(null, "feed"); + + parseBundleChildren(object, state); + + state.endingElement(); + + Bundle retVal = state.getObject(); + + return retVal; } @Override @@ -179,7 +192,7 @@ public class JsonParser extends BaseParser implements IParser { parseChildren(object, state); - state.endingElement(null); + state.endingElement(); @SuppressWarnings("unchecked") T retVal = (T) state.getObject(); @@ -187,7 +200,7 @@ public class JsonParser extends BaseParser implements IParser { return retVal; } - private void parseChildren(JsonObject theObject, ParserState theState) { + private void parseChildren(JsonObject theObject, ParserState theState) { String elementId = null; for (String nextName : theObject.keySet()) { if ("resourceType".equals(nextName)) { @@ -215,13 +228,62 @@ public class JsonParser extends BaseParser implements IParser { } if (elementId != null) { - // System.out.checkError(); // TODO: remove - IResource object = theState.getObject(); - object.setId(new IdDt(elementId)); + IElement object = theState.getObject(); + if (object instanceof IIdentifiableElement) { + ((IIdentifiableElement) object).setId(new IdDt(elementId)); + } } } - private void parseChildren(ParserState theState, String theName, JsonValue theJsonVal, JsonValue theAlternateVal) { + private static final Set BUNDLE_TEXTNODE_CHILDREN; + + static { + HashSet hashSet = new HashSet(); + hashSet.add("title"); + hashSet.add("id"); + hashSet.add("updated"); + hashSet.add("published"); + BUNDLE_TEXTNODE_CHILDREN=Collections.unmodifiableSet(hashSet); + } + + private void parseBundleChildren(JsonObject theObject, ParserState theState) { + for (String nextName : theObject.keySet()) { + if ("resourceType".equals(nextName)) { + continue; + } else if ("link".equals(nextName)) { + JsonArray entries = theObject.getJsonArray(nextName); + for (JsonValue jsonValue : entries) { + theState.enteringNewElement(null, "link"); + JsonObject linkObj = (JsonObject) jsonValue; + String rel = linkObj.getString("rel", null); + String href = linkObj.getString("href", null); + theState.attributeValue("rel", rel); + theState.attributeValue("href", href); + theState.endingElement(); + } + continue; + } else if ("entry".equals(nextName)) { + JsonArray entries = theObject.getJsonArray(nextName); + for (JsonValue jsonValue : entries) { + theState.enteringNewElement(null, "entry"); + parseBundleChildren((JsonObject) jsonValue, theState); + theState.endingElement(); + } + continue; + } else if (BUNDLE_TEXTNODE_CHILDREN.contains(nextName)) { + theState.enteringNewElement(null, nextName); + theState.string(theObject.getString(nextName, null)); + theState.endingElement(); + continue; + } + + JsonValue nextVal = theObject.get(nextName); + parseChildren(theState, nextName, nextVal, null); + + } + } + + private void parseChildren(ParserState theState, String theName, JsonValue theJsonVal, JsonValue theAlternateVal) { switch (theJsonVal.getValueType()) { case ARRAY: { JsonArray nextArray = (JsonArray) theJsonVal; @@ -250,9 +312,9 @@ public class JsonParser extends BaseParser implements IParser { } parseChildren(nextObject, theState); if (preResource) { - theState.endingElement(null); + theState.endingElement(); } - theState.endingElement(null); + theState.endingElement(); break; } case STRING: { @@ -260,7 +322,7 @@ public class JsonParser extends BaseParser implements IParser { theState.enteringNewElement(null, theName); theState.attributeValue("value", nextValStr.getString()); parseAlternates(theAlternateVal, theState); - theState.endingElement(null); + theState.endingElement(); break; } case NUMBER: @@ -269,14 +331,14 @@ public class JsonParser extends BaseParser implements IParser { theState.enteringNewElement(null, theName); theState.attributeValue("value", theJsonVal.toString()); parseAlternates(theAlternateVal, theState); - theState.endingElement(null); + theState.endingElement(); break; case NULL: break; } } - private void parseAlternates(JsonValue theAlternateVal, ParserState theState) { + private void parseAlternates(JsonValue theAlternateVal, ParserState theState) { if (theAlternateVal == null || theAlternateVal.getValueType() == ValueType.NULL) { return; } @@ -306,12 +368,12 @@ public class JsonParser extends BaseParser implements IParser { } } - private void parseExtension(ParserState theState, JsonArray array, boolean theIsModifier) { + private void parseExtension(ParserState theState, JsonArray array, boolean theIsModifier) { // TODO: use theIsModifier for (int i = 0; i < array.size(); i++) { JsonObject nextExtObj = array.getJsonObject(i); String url = nextExtObj.getString("url"); - theState.enteringNewElementExtension(null, url, false); + theState.enteringNewElementExtension(null, url, theIsModifier); for (Iterator iter = nextExtObj.keySet().iterator(); iter.hasNext();) { String next = iter.next(); if ("url".equals(next)) { @@ -327,7 +389,7 @@ public class JsonParser extends BaseParser implements IParser { parseChildren(theState, next, jsonVal, null); } } - theState.endingElement(null); + theState.endingElement(); } } @@ -478,7 +540,7 @@ public class JsonParser extends BaseParser implements IParser { String childName = nextChild.getChildNameByDatatype(type); BaseRuntimeElementDefinition childDef = nextChild.getChildElementDefinitionByDatatype(type); if (childDef == null) { - throw new IllegalStateException(nextChild + " has no child of type " + type); + super.throwExceptionForUnknownChildType(nextChild, type); } if (nextChild instanceof RuntimeChildDeclaredExtensionDefinition) { 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 411abbdd485..08d34b5a79e 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 @@ -7,7 +7,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.xml.stream.events.EndElement; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; @@ -59,8 +58,8 @@ class ParserState { myState.attributeValue(theName, theValue); } - public void endingElement(EndElement theElem) throws DataFormatException { - myState.endingElement(theElem); + public void endingElement() throws DataFormatException { + myState.endingElement(); } public void enteringNewElement(String theNamespaceURI, String theName) throws DataFormatException { @@ -85,6 +84,9 @@ class ParserState { } public boolean verifyNamespace(String theExpect, String theActual) { + if (myJsonMode) { + return true; + } return StringUtils.equals(theExpect, theActual); } @@ -133,7 +135,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { pop(); } @@ -171,7 +173,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { pop(); } @@ -193,7 +195,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { pop(); } @@ -253,7 +255,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { if (myInstance != null) { if ("self".equals(myRel)) { myInstance.getLinkSelf().setValueAsString(myHref); @@ -293,7 +295,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { myPrimitive.setValueAsString(myData); pop(); } @@ -331,7 +333,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { pop(); } @@ -383,7 +385,7 @@ class ParserState { } @SuppressWarnings("unused") - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { // ignore by default } @@ -448,7 +450,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { pop(); } @@ -481,7 +483,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { pop(); } @@ -510,10 +512,9 @@ class ParserState { return; } case RESOURCE_REF: { - RuntimeResourceReferenceDefinition resourceRefTarget = (RuntimeResourceReferenceDefinition) target; ResourceReferenceDt newChildInstance = new ResourceReferenceDt(); myDefinition.getMutator().addValue(myParentInstance, newChildInstance); - ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), resourceRefTarget, newChildInstance); + ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), newChildInstance); push(newState); return; } @@ -569,7 +570,7 @@ class ParserState { @SuppressWarnings("unchecked") @Override - public void endingElement(EndElement theElem) { + public void endingElement() { pop(); if (myState == null) { myObject = (T) myInstance; @@ -607,7 +608,7 @@ class ParserState { ResourceReferenceDt newChildInstance = new ResourceReferenceDt(); getPreResourceState().getResourceReferences().add(newChildInstance); child.getMutator().addValue(myInstance, newChildInstance); - ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), resourceRefTarget, newChildInstance); + ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), newChildInstance); push(newState); return; } @@ -679,7 +680,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { if (myExtension.getValue() != null && myExtension.getUndeclaredExtensions().size() > 0) { throw new DataFormatException("Extension must not have both a value and other contained extensions"); } @@ -711,10 +712,9 @@ class ParserState { return; } case RESOURCE_REF: { - RuntimeResourceReferenceDefinition resourceRefTarget = (RuntimeResourceReferenceDefinition) target; ResourceReferenceDt newChildInstance = new ResourceReferenceDt(); myExtension.setValue(newChildInstance); - ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), resourceRefTarget, newChildInstance); + ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), newChildInstance); push(newState); return; } @@ -742,7 +742,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { // ignore } @@ -765,8 +765,7 @@ class ParserState { @Override protected IElement getCurrentElement() { - // TODO Auto-generated method stub - return null; + return myInstance; } } @@ -804,7 +803,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { pop(); } @@ -888,7 +887,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) { + public void endingElement() { pop(); } @@ -920,13 +919,11 @@ class ParserState { private class ResourceReferenceState extends BaseState { - private RuntimeResourceReferenceDefinition myDefinition; private ResourceReferenceDt myInstance; private ResourceReferenceSubState mySubState; - public ResourceReferenceState(PreResourceState thePreResourceState, RuntimeResourceReferenceDefinition theDefinition, ResourceReferenceDt theInstance) { + public ResourceReferenceState(PreResourceState thePreResourceState, ResourceReferenceDt theInstance) { super(thePreResourceState); - myDefinition = theDefinition; myInstance = theInstance; mySubState = ResourceReferenceSubState.INITIAL; } @@ -950,7 +947,7 @@ class ParserState { } @Override - public void endingElement(EndElement theElement) { + public void endingElement() { switch (mySubState) { case INITIAL: pop(); @@ -1016,12 +1013,12 @@ class ParserState { } @Override - public void endingElement(EndElement theElem) throws DataFormatException { + public void endingElement() throws DataFormatException { if (myJsonMode) { pop(); return; } - super.endingElement(theElem); + super.endingElement(); } @Override 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 59f56970ac8..9619b1c45ab 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 @@ -3,7 +3,6 @@ package ca.uhn.fhir.parser; import static org.apache.commons.lang3.StringUtils.*; import java.io.Reader; -import java.io.StringReader; import java.io.StringWriter; import java.io.Writer; import java.util.Iterator; @@ -20,7 +19,6 @@ import javax.xml.stream.XMLStreamWriter; import javax.xml.stream.events.Attribute; import javax.xml.stream.events.Characters; import javax.xml.stream.events.Comment; -import javax.xml.stream.events.EndElement; import javax.xml.stream.events.EntityReference; import javax.xml.stream.events.Namespace; import javax.xml.stream.events.StartElement; @@ -34,6 +32,7 @@ import ca.uhn.fhir.context.BaseRuntimeElementDefinition; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.RuntimeChildDeclaredExtensionDefinition; +import ca.uhn.fhir.context.RuntimeChildNarrativeDefinition; import ca.uhn.fhir.context.RuntimeChildUndeclaredExtensionDefinition; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.model.api.Bundle; @@ -44,10 +43,12 @@ import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.ISupportsUndeclaredExtensions; import ca.uhn.fhir.model.api.UndeclaredExtension; import ca.uhn.fhir.model.dstu.composite.ContainedDt; +import ca.uhn.fhir.model.dstu.composite.NarrativeDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.XhtmlDt; +import ca.uhn.fhir.narrative.INarrativeGenerator; import ca.uhn.fhir.util.PrettyPrintWriterWrapper; public class XmlParser extends BaseParser implements IParser { @@ -182,16 +183,6 @@ public class XmlParser extends BaseParser implements IParser { return parseBundle(streamReader); } - /* - * (non-Javadoc) - * - * @see ca.uhn.fhir.parser.IParser#parseBundle(java.lang.String) - */ - @Override - public Bundle parseBundle(String theXml) throws ConfigurationException, DataFormatException { - StringReader reader = new StringReader(theXml); - return parseBundle(reader); - } @Override public T parseResource(Class theResourceType, Reader theReader) { @@ -266,16 +257,7 @@ public class XmlParser extends BaseParser implements IParser { String name = (elem.getName().getLocalPart()); parserState.attributeValue(name, elem.getValue()); } else if (nextEvent.isEndElement()) { - EndElement elem = nextEvent.asEndElement(); - - String name = elem.getName().getLocalPart(); - String namespaceURI = elem.getName().getNamespaceURI(); - // if (!FHIR_NS.equals(namespaceURI) && - // !XHTML_NS.equals(namespaceURI)) { - // continue; - // } - - parserState.endingElement(elem); + parserState.endingElement(); if (parserState.isComplete()) { return parserState.getObject(); } @@ -295,8 +277,7 @@ public class XmlParser extends BaseParser implements IParser { } } - private void encodeChildElementToStreamWriter(XMLStreamWriter theEventWriter, IElement nextValue, String childName, BaseRuntimeElementDefinition childDef, String theExtensionUrl) - throws XMLStreamException, DataFormatException { + private void encodeChildElementToStreamWriter(RuntimeResourceDefinition theResDef, IResource theResource, XMLStreamWriter theEventWriter, IElement nextValue, String childName, BaseRuntimeElementDefinition childDef, String theExtensionUrl) throws XMLStreamException, DataFormatException { if (nextValue.isEmpty()) { return; } @@ -308,7 +289,7 @@ public class XmlParser extends BaseParser implements IParser { if (value != null) { theEventWriter.writeStartElement(childName); theEventWriter.writeAttribute("value", value); - encodeExtensionsIfPresent(theEventWriter, nextValue); + encodeExtensionsIfPresent(theResDef, theResource, theEventWriter, nextValue); theEventWriter.writeEndElement(); } break; @@ -320,8 +301,8 @@ public class XmlParser extends BaseParser implements IParser { theEventWriter.writeAttribute("url", theExtensionUrl); } BaseRuntimeElementCompositeDefinition childCompositeDef = (BaseRuntimeElementCompositeDefinition) childDef; - encodeCompositeElementToStreamWriter(nextValue, theEventWriter, childCompositeDef); - encodeExtensionsIfPresent(theEventWriter, nextValue); + encodeCompositeElementToStreamWriter(theResDef, theResource, nextValue, theEventWriter, childCompositeDef); + encodeExtensionsIfPresent(theResDef, theResource, theEventWriter, nextValue); theEventWriter.writeEndElement(); break; } @@ -361,9 +342,22 @@ public class XmlParser extends BaseParser implements IParser { } - private void encodeCompositeElementChildrenToStreamWriter(IElement theElement, XMLStreamWriter theEventWriter, List children) throws XMLStreamException, - DataFormatException { + private void encodeCompositeElementChildrenToStreamWriter(RuntimeResourceDefinition theResDef, IResource theResource, IElement theElement, XMLStreamWriter theEventWriter, List children) throws XMLStreamException, DataFormatException { for (BaseRuntimeChildDefinition nextChild : children) { + if (nextChild instanceof RuntimeChildNarrativeDefinition) { + INarrativeGenerator gen = myContext.getNarrativeGenerator(); + if (gen != null) { + NarrativeDt narr = gen.generateNarrative(theResDef.getResourceProfile(), theResource); + if (narr!=null) { + RuntimeChildNarrativeDefinition child = (RuntimeChildNarrativeDefinition) nextChild; + String childName = nextChild.getChildNameByDatatype(child.getDatatype()); + BaseRuntimeElementDefinition type = child.getChildByName(childName); + encodeChildElementToStreamWriter(theResDef, theResource, theEventWriter, narr, childName, type, null); + continue; + } + } + } + List values = nextChild.getAccessor().getValues(theElement); if (values == null || values.isEmpty()) { continue; @@ -378,7 +372,7 @@ public class XmlParser extends BaseParser implements IParser { String extensionUrl = nextChild.getExtensionUrl(); BaseRuntimeElementDefinition childDef = nextChild.getChildElementDefinitionByDatatype(type); if (childDef == null) { - throw new IllegalStateException(nextChild + " has no child of type " + type); + super.throwExceptionForUnknownChildType(nextChild, type); } if (extensionUrl != null && childName.equals("extension") == false) { @@ -390,27 +384,27 @@ public class XmlParser extends BaseParser implements IParser { } theEventWriter.writeAttribute("url", extensionUrl); - encodeChildElementToStreamWriter(theEventWriter, nextValue, childName, childDef, null); + encodeChildElementToStreamWriter(theResDef, theResource, theEventWriter, nextValue, childName, childDef, null); theEventWriter.writeEndElement(); } else { - encodeChildElementToStreamWriter(theEventWriter, nextValue, childName, childDef, extensionUrl); + encodeChildElementToStreamWriter(theResDef, theResource, theEventWriter, nextValue, childName, childDef, extensionUrl); } } } } - private void encodeCompositeElementToStreamWriter(IElement theElement, XMLStreamWriter theEventWriter, BaseRuntimeElementCompositeDefinition resDef) throws XMLStreamException, - DataFormatException { - encodeExtensionsIfPresent(theEventWriter, theElement); - encodeCompositeElementChildrenToStreamWriter(theElement, theEventWriter, resDef.getExtensions()); - encodeCompositeElementChildrenToStreamWriter(theElement, theEventWriter, resDef.getChildren()); + + private void encodeCompositeElementToStreamWriter(RuntimeResourceDefinition theResDef, IResource theResource, IElement theElement, XMLStreamWriter theEventWriter, BaseRuntimeElementCompositeDefinition resDef) throws XMLStreamException, DataFormatException { + encodeExtensionsIfPresent(theResDef, theResource, theEventWriter, theElement); + encodeCompositeElementChildrenToStreamWriter(theResDef, theResource, theElement, theEventWriter, resDef.getExtensions()); + encodeCompositeElementChildrenToStreamWriter(theResDef, theResource, theElement, theEventWriter, resDef.getChildren()); } - private void encodeExtensionsIfPresent(XMLStreamWriter theWriter, IElement theResource) throws XMLStreamException, DataFormatException { - if (theResource instanceof ISupportsUndeclaredExtensions) { - ISupportsUndeclaredExtensions res = (ISupportsUndeclaredExtensions) theResource; - encodeUndeclaredExtensions(theWriter, res.getUndeclaredExtensions(), "extension"); - encodeUndeclaredExtensions(theWriter, res.getUndeclaredModifierExtensions(), "modifierExtension"); + private void encodeExtensionsIfPresent(RuntimeResourceDefinition theResDef, IResource theResource, XMLStreamWriter theWriter, IElement theElement) throws XMLStreamException, DataFormatException { + if (theElement instanceof ISupportsUndeclaredExtensions) { + ISupportsUndeclaredExtensions res = (ISupportsUndeclaredExtensions) theElement; + encodeUndeclaredExtensions(theResDef, theResource, theWriter, res.getUndeclaredExtensions(), "extension"); + encodeUndeclaredExtensions(theResDef, theResource, theWriter, res.getUndeclaredModifierExtensions(), "modifierExtension"); } } @@ -442,12 +436,12 @@ public class XmlParser extends BaseParser implements IParser { theEventWriter.writeAttribute("id", theResource.getId().getValue()); } - encodeCompositeElementToStreamWriter(theResource, theEventWriter, resDef); + encodeCompositeElementToStreamWriter(resDef, theResource, theResource, theEventWriter, resDef); theEventWriter.writeEndElement(); } - private void encodeUndeclaredExtensions(XMLStreamWriter theWriter, List extensions, String tagName) throws XMLStreamException { + private void encodeUndeclaredExtensions(RuntimeResourceDefinition theResDef, IResource theResource, XMLStreamWriter theWriter, List extensions, String tagName) throws XMLStreamException { for (UndeclaredExtension next : extensions) { theWriter.writeStartElement(tagName); theWriter.writeAttribute("url", next.getUrl()); @@ -460,11 +454,11 @@ public class XmlParser extends BaseParser implements IParser { throw new ConfigurationException("Unable to encode extension, unregognized child element type: " + nextValue.getClass().getCanonicalName()); } BaseRuntimeElementDefinition childDef = extDef.getChildElementDefinitionByDatatype(nextValue.getClass()); - encodeChildElementToStreamWriter(theWriter, nextValue, childName, childDef, null); + encodeChildElementToStreamWriter(theResDef, theResource, theWriter, nextValue, childName, childDef, null); } // child extensions - encodeExtensionsIfPresent(theWriter, next); + encodeExtensionsIfPresent(theResDef, theResource, theWriter, next); theWriter.writeEndElement(); } @@ -552,12 +546,12 @@ public class XmlParser extends BaseParser implements IParser { } private Bundle parseBundle(XMLEventReader theStreamReader) { - ParserState parserState = ParserState.getPreAtomInstance(myContext,false); + ParserState parserState = ParserState.getPreAtomInstance(myContext, false); return doXmlLoop(theStreamReader, parserState); } private T parseResource(Class theResourceType, XMLEventReader theStreamReader) { - ParserState parserState = ParserState.getPreResourceInstance(theResourceType, myContext,false); + ParserState parserState = ParserState.getPreResourceInstance(theResourceType, myContext, false); return doXmlLoop(theStreamReader, parserState); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IRestfulClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IRestfulClient.java index 1447f2e9420..2d3090e5174 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IRestfulClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IRestfulClient.java @@ -11,6 +11,9 @@ public interface IRestfulClient { HttpClient getHttpClient(); + /** + * Base URL for the server, with no trailing "/" + */ String getServerBase(); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseMethodBinding.java index 365224f549d..016ced6e0e4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseMethodBinding.java @@ -1,6 +1,5 @@ package ca.uhn.fhir.rest.method; -import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java index 25e89d2a309..c096b4c86c7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java @@ -16,7 +16,6 @@ import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.client.GetClientInvocation; import ca.uhn.fhir.rest.param.IParameter; -import ca.uhn.fhir.rest.param.SearchParameter; import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.Util; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java index d4ca2d95c9b..ef574ad4803 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java @@ -6,7 +6,6 @@ import java.util.Date; import java.util.List; import ca.uhn.fhir.model.api.IQueryParameterAnd; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; public class DateRangeParam implements IQueryParameterAnd { 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 5cbf9b8add5..3c8c1df43b6 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 @@ -205,7 +205,9 @@ public abstract class RestfulServer extends HttpServlet { StringBuffer requestUrl = request.getRequestURL(); String servletContextPath = ""; if (request.getServletContext() != null) { - servletContextPath = StringUtils.defaultString(request.getServletContext().getContextPath()); + servletContextPath = StringUtils.defaultIfBlank(request.getServletContext().getContextPath(), servletPath); + } else { + servletContextPath = servletPath; } ourLog.info("Request FullPath: {}", requestFullPath); @@ -232,6 +234,10 @@ public abstract class RestfulServer extends HttpServlet { } String fhirServerBase = requestUrl.substring(0, contextIndex + servletPath.length()); + if (fhirServerBase.endsWith("/")) { + fhirServerBase = fhirServerBase.substring(0, fhirServerBase.length() - 1); + } + String completeUrl = StringUtils.isNotBlank(request.getQueryString()) ? requestUrl + "?" + request.getQueryString() : requestUrl.toString(); Map params = new HashMap(request.getParameterMap()); @@ -376,7 +382,7 @@ public abstract class RestfulServer extends HttpServlet { private void streamResponseAsBundle(HttpServletResponse theHttpResponse, List theResult, EncodingUtil theResponseEncoding, String theServerBase, String theCompleteUrl, boolean thePrettyPrint, boolean theRequestIsBrowser) throws IOException { - assert theServerBase.endsWith("/"); + assert !theServerBase.endsWith("/"); theHttpResponse.setStatus(200); @@ -409,6 +415,7 @@ public abstract class RestfulServer extends HttpServlet { StringBuilder b = new StringBuilder(); b.append(theServerBase); + b.append('/'); b.append(def.getName()); b.append('/'); b.append(next.getId().getValue()); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DatatypeUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DatatypeUtil.java index 1274fe014b1..ab3ffccc8a0 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DatatypeUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DatatypeUtil.java @@ -23,4 +23,21 @@ public class DatatypeUtil { return retVal; } + /** + * Joins a list of strings with a single space (' ') between each string + */ + public static String joinStringsSpaceSeparated(List theStrings) { + StringBuilder b = new StringBuilder(); + for (StringDt next : theStrings) { + if (next.isEmpty()) { + continue; + } + if (b.length() > 0) { + b.append(' '); + } + b.append(next.getValue()); + } + return b.toString(); + } + } diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/DiagnosticReport.html b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/DiagnosticReport.html new file mode 100644 index 00000000000..3d149db3258 --- /dev/null +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/DiagnosticReport.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/Patient.html b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/Patient.html new file mode 100644 index 00000000000..fcf69ccd808 --- /dev/null +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/Patient.html @@ -0,0 +1,31 @@ +
    + + Dr + John + SMITH + Esq + + + + + + + + + + + + + + +
    Identifier8708660
    Address + + 123 Fake Street
    +
    + Toronto + ON + Canada +
    Date of birth + 22 March 2012 +
    +
    \ No newline at end of file diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/narratives.properties b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/narratives.properties new file mode 100644 index 00000000000..a827f45188d --- /dev/null +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/narratives.properties @@ -0,0 +1,6 @@ + +diagnosticreport.profile=http://hl7.org/fhir/profiles/DiagnosticReport +diagnosticreport.narrative=classpath:ca/uhn/fhir/narrative/DiagnosticReport.html + +patient.profile=http://hl7.org/fhir/profiles/Patient +patient.narrative=classpath:ca/uhn/fhir/narrative/Patient.html \ No newline at end of file diff --git a/hapi-fhir-base/src/site/example/java/example/CompleteExampleClient.java b/hapi-fhir-base/src/site/example/java/example/CompleteExampleClient.java new file mode 100644 index 00000000000..6aaffeb627e --- /dev/null +++ b/hapi-fhir-base/src/site/example/java/example/CompleteExampleClient.java @@ -0,0 +1,68 @@ +package example; + +//START SNIPPET: client +import java.io.IOException; +import java.util.List; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.resource.Organization; +import ca.uhn.fhir.model.dstu.resource.Patient; +import ca.uhn.fhir.rest.annotation.Required; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.client.api.IRestfulClient; + +public class CompleteExampleClient { + + /** + * This is a simple client interface. It can have many methods + * for various searches but in this case it has only 1. + */ + public static interface ClientInterface extends IRestfulClient + { + + /** + * This translated into a URL similar to the following: + * http://fhir.healthintersections.com.au/open/Patient?identifier=urn:oid:1.2.36.146.595.217.0.1%7C12345 + */ + @Search + List findPatientsForMrn(@Required(name=Patient.SP_IDENTIFIER) IdentifierDt theIdentifier); + + } + + /** + * The main method here will directly call an open FHIR server + * and retrieve a list of resources matching a given criteria, + * then load a linked resource. + */ + public static void main(String[] args) throws IOException { + + // Create a client factory + FhirContext ctx = new FhirContext(); + + //Create the client + String serverBase = "http://fhir.healthintersections.com.au/open"; + ClientInterface client = ctx.newRestfulClient(ClientInterface.class, serverBase); + + // Invoke the client to search for patient + List patients = client.findPatientsForMrn(new IdentifierDt("urn:oid:1.2.36.146.595.217.0.1", "12345")); + + System.out.println("Found "+ patients.size() + " patients"); + + // Print a value from the loaded resource + Patient patient = patients.get(0); + System.out.println("Patient Last Name: " + patient.getName().get(0).getFamily().get(0).getValue()); + + // Load a referenced resource + ResourceReferenceDt managingRef = patient.getManagingOrganization(); + Organization org = (Organization) managingRef.loadResource(client); + + // Print organization name + System.out.println(org.getName().getValue()); + + } + +} +//END SNIPPET: client + diff --git a/hapi-fhir-base/src/site/example/java/example/ExampleRestfulClient.java b/hapi-fhir-base/src/site/example/java/example/ExampleRestfulClient.java index dc1d220c57f..d9f6129e29e 100644 --- a/hapi-fhir-base/src/site/example/java/example/ExampleRestfulClient.java +++ b/hapi-fhir-base/src/site/example/java/example/ExampleRestfulClient.java @@ -13,9 +13,8 @@ public class ExampleRestfulClient { //START SNIPPET: client public static void main(String[] args) { FhirContext ctx = new FhirContext(Patient.class); - IRestfulClientFactory clientFactory = ctx.newRestfulClientFactory(); String serverBase = "http://foo.com/fhirServerBase"; - RestfulClientImpl client = clientFactory.newClient(RestfulClientImpl.class, serverBase); + RestfulClientImpl client = ctx.newRestfulClient(RestfulClientImpl.class, serverBase); // The client is now ready for use! List patients = client.getPatient(new StringDt("SMITH")); diff --git a/hapi-fhir-base/src/site/example/java/example/FhirContextIntro.java b/hapi-fhir-base/src/site/example/java/example/FhirContextIntro.java index 661bc7f9c85..359fbb03eef 100644 --- a/hapi-fhir-base/src/site/example/java/example/FhirContextIntro.java +++ b/hapi-fhir-base/src/site/example/java/example/FhirContextIntro.java @@ -23,10 +23,9 @@ FhirContext ctx = new FhirContext(); } - public static void main(String[] args) { - -Patient patient = new Patient(); + public static void main(String[] args) throws DataFormatException, IOException { +new FhirContextIntro().encodeMsg(); } @@ -61,7 +60,14 @@ name.addGiven("Q"); String encoded = ctx.newXmlParser().encodeResourceToString(patient); System.out.println(encoded); //END SNIPPET: encodeMsg - + +//START SNIPPET: encodeMsgJson +IParser jsonParser = ctx.newJsonParser(); +jsonParser.setPrettyPrint(true); +encoded = jsonParser.encodeResourceToString(patient); +System.out.println(encoded); +//END SNIPPET: encodeMsgJson + } diff --git a/hapi-fhir-base/src/site/example/java/example/FhirDataModel.java b/hapi-fhir-base/src/site/example/java/example/FhirDataModel.java index 6e5850d5f29..586a1177322 100644 --- a/hapi-fhir-base/src/site/example/java/example/FhirDataModel.java +++ b/hapi-fhir-base/src/site/example/java/example/FhirDataModel.java @@ -4,6 +4,7 @@ import java.util.Date; import ca.uhn.fhir.model.api.TemporalPrecisionEnum; import ca.uhn.fhir.model.dstu.composite.CodingDt; +import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.PeriodDt; import ca.uhn.fhir.model.dstu.resource.Observation; @@ -11,6 +12,7 @@ import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.model.primitive.StringDt; public class FhirDataModel { @@ -83,4 +85,25 @@ patient.setGender(AdministrativeGenderCodesEnum.M); } + +public void namesHard() { +// START SNIPPET: namesHard +Patient patient = new Patient(); +HumanNameDt name = patient.addName(); +StringDt family = name.addFamily(); +family.setValue("Smith"); +StringDt firstName = name.addGiven(); +firstName.setValue("Rob"); +StringDt secondName = name.addGiven(); +secondName.setValue("Bruce"); +//END SNIPPET: namesHard +} + +public void namesEasy() { +// START SNIPPET: namesEasy +Patient patient = new Patient(); +patient.addName().addFamily("Smith").addGiven("Rob").addGiven("Bruce"); +//END SNIPPET: namesEasy +} + } diff --git a/hapi-fhir-base/src/site/example/java/example/MyPatient.java b/hapi-fhir-base/src/site/example/java/example/MyPatient.java new file mode 100644 index 00000000000..709f6d6dd62 --- /dev/null +++ b/hapi-fhir-base/src/site/example/java/example/MyPatient.java @@ -0,0 +1,79 @@ +package example; + +//START SNIPPET: patientDef +import java.util.ArrayList; +import java.util.List; + +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.dstu.resource.Patient; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.util.ElementUtil; + +/** + * Definition class for adding extensions to the built-in + * Patient resource type. + */ +@ResourceDef(name="Patient") +public class MyPatient extends Patient { + + /** + * 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 + * and mutator methods. + */ + @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; + + /** + * The second example extension uses a List type to provide + * repeatable values. Note that a [max=] value has been placed in + * the @Child annotation. + * + * Note also that this extension is a modifier extension + */ + @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; + + /** + * It is important to override the isEmpty() method, adding a check for any + * newly added fields. + */ + @Override + public boolean isEmpty() { + return super.isEmpty() && ElementUtil.isEmpty(myPetName, myImportantDates); + } + + /******** + * Accessors and mutators follow + ********/ + + public List getImportantDates() { + if (myImportantDates==null) { + myImportantDates = new ArrayList(); + } + return myImportantDates; + } + + public StringDt getPetName() { + return myPetName; + } + + public void setImportantDates(List theImportantDates) { + myImportantDates = theImportantDates; + } + + public void setPetName(StringDt thePetName) { + myPetName = thePetName; + } + +} +//END SNIPPET: patientDef diff --git a/hapi-fhir-base/src/site/example/java/example/MyPatientUse.java b/hapi-fhir-base/src/site/example/java/example/MyPatientUse.java new file mode 100644 index 00000000000..eed0fd197be --- /dev/null +++ b/hapi-fhir-base/src/site/example/java/example/MyPatientUse.java @@ -0,0 +1,43 @@ +package example; + +import java.io.IOException; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.parser.DataFormatException; +import ca.uhn.fhir.parser.IParser; +import ca.uhn.fhir.parser.MyPatient; + +public class MyPatientUse { + +@SuppressWarnings("unused") +public static void main(String[] args) throws DataFormatException, IOException { +//START SNIPPET: patientUse +MyPatient patient = new MyPatient(); +patient.setPetName(new StringDt("Fido")); +patient.getImportantDates().add(new DateTimeDt("2010-01-02")); +patient.getImportantDates().add(new DateTimeDt("2014-01-26T11:11:11")); + +patient.addName().addFamily("Smith").addGiven("John").addGiven("Quincy").addSuffix("Jr"); + +IParser p = new FhirContext().newXmlParser().setPrettyPrint(true); +String messageString = p.encodeResourceToString(patient); + +System.out.println(messageString); +//END SNIPPET: patientUse + +//START SNIPPET: patientParse +IParser parser = new FhirContext().newXmlParser(); +MyPatient newPatient = parser.parseResource(MyPatient.class, messageString); +//END SNIPPET: patientParse + +{ + FhirContext ctx2 = new FhirContext(); + RuntimeResourceDefinition def = ctx2.getResourceDefinition(patient); + System.out.println(ctx2.newXmlParser().setPrettyPrint(true).encodeResourceToString(def.toProfile())); +} +} + +} diff --git a/hapi-fhir-base/src/site/site.xml b/hapi-fhir-base/src/site/site.xml index 25f8151e1f2..6c7ed0893fa 100644 --- a/hapi-fhir-base/src/site/site.xml +++ b/hapi-fhir-base/src/site/site.xml @@ -32,8 +32,13 @@ + - + + + + + @@ -41,7 +46,7 @@ - + diff --git a/hapi-fhir-base/src/site/xdoc/doc_extensions.xml b/hapi-fhir-base/src/site/xdoc/doc_extensions.xml new file mode 100644 index 00000000000..c606833efaa --- /dev/null +++ b/hapi-fhir-base/src/site/xdoc/doc_extensions.xml @@ -0,0 +1,164 @@ + + + + + Extensions - HAPI FHIR + James Agnew + + + + +
    + + + + +

    + Extensions are a key part of the FHIR specification, providing a standardized + way of placing additional data in a resource. +

    + +
    + +
    + +

    + The most elegant way of adding extensions to a resource is through the + use of custom fields. The following example shows a custom type which + extends the FHIR Patient resource definition through two extensions. +

    + + + + + + +

    + Using this custom type is as simple as instantiating the type + and working with the new fields. +

    + + + + + + +

    + This example produces the following output: +

    + + + + + + + + + + + + + + + + + +]]> + +

    + Parsing messages using your new custom type is equally simple. + These types can also be used as method return types in clients + and servers. +

    + + + + + + + + +

    + Note in the example above the use of the @Description + annotation on the extension fields. This documentation is important, + as the FHIR Server will automatically add it to the generated Profile + resources which are exported by the server. +

    + +

    + These bits of documentation will then be re-added to any automatically + generated clients built using Tinder + against your server. +

    + +

    + The following is a snippet from the generated Profile resource + which is automatically created by a HAPI RESTful server using + your new type. (Don't worry if this part doens't make sense to you + yet, this is an advanced feature) +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + +
    + +
    + + + +
    diff --git a/hapi-fhir-base/src/site/xdoc/doc_fhirobjects.xml b/hapi-fhir-base/src/site/xdoc/doc_fhirobjects.xml index db74d75f46c..237e94cb3ec 100644 --- a/hapi-fhir-base/src/site/xdoc/doc_fhirobjects.xml +++ b/hapi-fhir-base/src/site/xdoc/doc_fhirobjects.xml @@ -70,6 +70,38 @@ + + +

    + The FHIR data model is rich enough to meet common use cases, but sometimes + that richness adds complexity. For example, a Patient may have multiple names + (a preferred name, a nickname, etc.) and each of those names may have multiple + last names, multiple prefixes, etc. +

    + +

    + The example below shows populating a name entry for a Patient. Note the + use of the StringDt type, which encapsulates a regular String, but allows for + extensions to be added. +

    + + + + + + +

    + HAPI also provides for simple setters that use Java primitive types + and can be chained, leading to much simpler code. +

    + + + + + + +
    + diff --git a/hapi-fhir-base/src/site/xdoc/doc_intro.xml b/hapi-fhir-base/src/site/xdoc/doc_intro.xml index 530a2c1318d..393efea6c9d 100644 --- a/hapi-fhir-base/src/site/xdoc/doc_intro.xml +++ b/hapi-fhir-base/src/site/xdoc/doc_intro.xml @@ -56,6 +56,14 @@ 1.0-SNAPSHOT ]]> +

    + If you are not using Maven, you can download the latest version + of the snapshot JAR (and optionally the Javadoc and Sources JAR) from the Maven + repo here: download. + Once a formal release has been created, it will be uploaded through the Sourceforge + file release system (as the HAPI v2 libraries are). +

    +

    @@ -104,7 +112,7 @@ - +

    The parser can also be used to encode a resource (which you can populate @@ -135,6 +143,45 @@ + + +

    + JSON parsing/encoding is also supported. +

    + + + + + + +

    + This code gives the following output: +

    + + + +
    + diff --git a/hapi-fhir-base/src/site/xdoc/doc_rest_client.xml b/hapi-fhir-base/src/site/xdoc/doc_rest_client.xml index 845aae506fd..a5a8906a4be 100644 --- a/hapi-fhir-base/src/site/xdoc/doc_rest_client.xml +++ b/hapi-fhir-base/src/site/xdoc/doc_rest_client.xml @@ -87,6 +87,20 @@ +
    + +

    + The following is a complete example showing a RESTful client + using HAPI FHIR. +

    + + + + + + +
    + diff --git a/hapi-fhir-base/src/site/xdoc/index.xml b/hapi-fhir-base/src/site/xdoc/index.xml index 85d2bad1f24..9342b5b36ed 100644 --- a/hapi-fhir-base/src/site/xdoc/index.xml +++ b/hapi-fhir-base/src/site/xdoc/index.xml @@ -11,7 +11,7 @@

    - SOCIALPLUGINSHEREAPI + SOCIALPLUGINSHEREFHIR

    This is the homepage for the HAPI-FHIR library. We are developing @@ -19,21 +19,6 @@ This library is still in experimental stage, so please tread with caution.

    - - -

    - The easiest way to get started with HAPI-FHIR is to either download the - source code from our - Git Repository, - or to use Maven: -

    - - ca.uhn.hapi.fhir - hapi-fhir-base - 1.0-SNAPSHOT -]]> - -
    diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/ThymeleafNarrativeGeneratorTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/ThymeleafNarrativeGeneratorTest.java new file mode 100644 index 00000000000..1debd596835 --- /dev/null +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/ThymeleafNarrativeGeneratorTest.java @@ -0,0 +1,35 @@ +package ca.uhn.fhir.narrative; + +import java.io.IOException; +import java.util.Date; + +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.TemporalPrecisionEnum; +import ca.uhn.fhir.model.dstu.resource.Patient; +import ca.uhn.fhir.narrative.ThymeleafNarrativeGenerator; + +public class ThymeleafNarrativeGeneratorTest { + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ThymeleafNarrativeGeneratorTest.class); + + @Test + public void testGeneratePatient() throws IOException { + FhirContext ctx = new FhirContext(); + + Patient value = new Patient(); + + value.addIdentifier().setSystem("urn:names").setValue("123456"); + value.addName().addFamily("blow").addGiven("joe").addGiven("john"); + value.getAddressFirstRep().addLine("123 Fake Street").addLine("Unit 1"); + value.getAddressFirstRep().setCity("Toronto").setState("ON").setCountry("Canada"); + + value.setBirthDate(new Date(), TemporalPrecisionEnum.DAY); + + ThymeleafNarrativeGenerator gen = new ThymeleafNarrativeGenerator(); + String output = gen.generateNarrative("http://hl7.org/fhir/profiles/Patient", value).getDiv().getValueAsString(); + + ourLog.info(output); + } + +} diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java index 07fdba51e20..88ad792953c 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java @@ -17,6 +17,7 @@ import org.junit.Test; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.Bundle; +import ca.uhn.fhir.model.api.BundleEntry; import ca.uhn.fhir.model.api.UndeclaredExtension; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.resource.DiagnosticReport; @@ -90,12 +91,41 @@ public class JsonParserTest { // ourLog.info("Reading in message: {}", msg); Patient res = p.parseResource(Patient.class, msg); + assertEquals(2, res.getUndeclaredExtensions().size()); + assertEquals(1, res.getUndeclaredModifierExtensions().size()); + String encoded = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(res); ourLog.info(encoded); } + @Test + public void testParseBundle() throws DataFormatException, IOException { + + String msg = IOUtils.toString(XmlParser.class.getResourceAsStream("/atom-document-large.json")); + FhirContext ctx = new FhirContext(Patient.class); + IParser p = ctx.newJsonParser(); + Bundle bundle = p.parseBundle(msg); + + String encoded = ctx.newXmlParser().setPrettyPrint(true).encodeBundleToString(bundle); + ourLog.info(encoded); + + assertEquals("http://fhir.healthintersections.com.au/open/DiagnosticReport/_search?_format=application/json+fhir&search-id=46d5f0e7-9240-4d4f-9f51-f8ac975c65&search-sort=_id",bundle.getLinkSelf().getValue()); + assertEquals("urn:uuid:0b754ff9-03cf-4322-a119-15019af8a3",bundle.getBundleId().getValue()); + + BundleEntry entry = bundle.getEntries().get(0); + assertEquals("http://fhir.healthintersections.com.au/open/DiagnosticReport/101",entry.getEntryId().getValue()); + assertEquals("http://fhir.healthintersections.com.au/open/DiagnosticReport/101/_history/1", entry.getLinkSelf().getValue()); + assertEquals("2014-03-10T11:55:59Z", entry.getUpdated().getValueAsString()); + + DiagnosticReport res = (DiagnosticReport)entry.getResource(); + assertEquals("Complete Blood Count", res.getName().getText().getValue()); + + } + + + @Test public void testParseWithContained() throws DataFormatException, IOException { @@ -144,10 +174,13 @@ public class JsonParserTest { Observation obs = new Observation(); obs.setValue(new DecimalDt(112.22)); - IParser p = new FhirContext(Observation.class).newXmlParser(); - - // Should have good error message - p.encodeResourceToString(obs); + IParser p = new FhirContext(Observation.class).newJsonParser(); + + try { + p.encodeResourceToString(obs); + } catch (DataFormatException e) { + assertThat(e.getMessage(), StringContains.containsString("PeriodDt")); + } } } diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/MyPatient.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/MyPatient.java new file mode 100644 index 00000000000..f276c3425c2 --- /dev/null +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/MyPatient.java @@ -0,0 +1,52 @@ +package ca.uhn.fhir.parser; + +import java.util.ArrayList; +import java.util.List; + +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.dstu.resource.Patient; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.model.primitive.StringDt; + +@ResourceDef(name="Patient") +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; + + @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 the patient") + private List myImportantDates; + + @Override + public boolean isEmpty() { + return super.isEmpty() && myPetName.isEmpty(); + } + + + public List getImportantDates() { + if (myImportantDates==null) { + myImportantDates = new ArrayList(); + } + return myImportantDates; + } + + public StringDt getPetName() { + return myPetName; + } + + public void setImportantDates(List theImportantDates) { + myImportantDates = theImportantDates; + } + + public void setPetName(StringDt thePetName) { + myPetName = thePetName; + } + +} diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java index 982bdf4b152..788ebe82667 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.parser; import static org.junit.Assert.*; +import static org.mockito.Mockito.*; import java.io.IOException; import java.io.StringReader; @@ -30,15 +31,68 @@ import ca.uhn.fhir.model.dstu.resource.ValueSet; import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum; import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum; +import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.DecimalDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.XhtmlDt; +import ca.uhn.fhir.narrative.INarrativeGenerator; public class XmlParserTest { + @Test + public void testExtensions() throws DataFormatException, IOException { + + MyPatient patient = new MyPatient(); + patient.setPetName(new StringDt("Fido")); + patient.getImportantDates().add(new DateTimeDt("2010-01-02")); + patient.getImportantDates().add(new DateTimeDt("2014-01-26T11:11:11")); + + patient.addName().addFamily("Smith"); + + IParser p = new FhirContext().newXmlParser(); + String str = p.encodeResourceToString(patient); + + ourLog.info(str); + + assertThat(str, StringContains.containsString("")); + assertThat(str, StringContains.containsString("")); + assertThat(str, StringContains.containsString("")); + assertThat(str, StringContains.containsString("")); + assertThat(str, StringContains.containsString("")); + } + + + @Test + public void testNarrativeGeneration() throws DataFormatException, IOException { + + Patient patient = new Patient(); + + patient.addName().addFamily("Smith"); + + INarrativeGenerator gen = mock(INarrativeGenerator.class); + XhtmlDt xhtmlDt = new XhtmlDt("
    help
    "); + NarrativeDt nar = new NarrativeDt(xhtmlDt, NarrativeStatusEnum.GENERATED); + when(gen.generateNarrative(eq("http://hl7.org/fhir/profiles/Patient"), eq(patient))).thenReturn(nar); + + FhirContext context = new FhirContext(); + context.setNarrativeGenerator(gen); + IParser p = context.newXmlParser(); + String str = p.encodeResourceToString(patient); + + ourLog.info(str); + + assertThat(str, StringContains.containsString("")); + assertThat(str, StringContains.containsString("")); + } + + + @Test public void testParseBundleLarge() throws IOException { String msg = IOUtils.toString(XmlParser.class.getResourceAsStream("/atom-document-large.xml")); - IParser p = new FhirContext(Patient.class).newXmlParser(); + FhirContext ctx = new FhirContext(Patient.class); + IParser p = ctx.newXmlParser(); Bundle bundle = p.parseBundle(msg); assertEquals("http://spark.furore.com/fhir/_snapshot?id=327d6bb9-83b0-4929-aa91-6dd9c41e587b&start=0&_count=20", bundle.getLinkSelf().getValue()); @@ -93,12 +147,16 @@ public class XmlParserTest { Observation obs = new Observation(); obs.setValue(new DecimalDt(112.22)); - IParser p = new FhirContext(Observation.class).newXmlParser(); - - // Should have good error message - p.encodeResourceToString(obs); + IParser p = new FhirContext(Observation.class).newJsonParser(); + + try { + p.encodeResourceToString(obs); + } catch (DataFormatException e) { + assertThat(e.getMessage(), StringContains.containsString("PeriodDt")); + } } + @Test public void testEncodeContainedResources() throws IOException { diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java index 794e3744616..e488b82169e 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java @@ -41,17 +41,15 @@ public class ClientTest { private HttpClient httpClient; private HttpResponse httpResponse; private FhirContext ctx; - private IRestfulClientFactory clientFactory; // atom-document-large.xml @Before public void before() { ctx = new FhirContext(Patient.class, Conformance.class); - clientFactory = ctx.newRestfulClientFactory(); httpClient = mock(HttpClient.class, new ReturnsDeepStubs()); - clientFactory.setHttpClient(httpClient); + ctx.getRestfulClientFactory().setHttpClient(httpClient); httpResponse = mock(HttpResponse.class, new ReturnsDeepStubs()); } @@ -77,7 +75,7 @@ public class ClientTest { when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); // Patient response = client.findPatientByMrn(new IdentifierDt("urn:foo", "123")); Patient response = client.getPatientById(new IdDt("111")); @@ -107,7 +105,7 @@ public class ClientTest { when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); // Patient response = client.findPatientByMrn(new IdentifierDt("urn:foo", "123")); Patient response = client.getPatientByVersionId(new IdDt("111"), new IdDt("999")); @@ -127,7 +125,7 @@ public class ClientTest { when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); Patient response = client.findPatientByMrn(new IdentifierDt("urn:foo", "123")); assertEquals("http://foo/Patient?identifier=urn%3Afoo%7C123", capt.getValue().getURI().toString()); @@ -147,7 +145,7 @@ public class ClientTest { when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); DateRangeParam param = new DateRangeParam(); param.setLowerBound(new QualifiedDateParam(QuantityCompararatorEnum.GREATERTHAN_OR_EQUALS, "2011-01-01")); param.setUpperBound(new QualifiedDateParam(QuantityCompararatorEnum.LESSTHAN_OR_EQUALS, "2021-01-01")); @@ -172,7 +170,7 @@ public class ClientTest { when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); List response = client.getPatientByDob(new QualifiedDateParam(QuantityCompararatorEnum.GREATERTHAN_OR_EQUALS, "2011-01-02")); assertEquals("http://foo/Patient?birthdate=%3E%3D2011-01-02", capt.getValue().getURI().toString()); @@ -191,7 +189,7 @@ public class ClientTest { when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); client.getPatientWithIncludes(new StringDt("aaa"), Arrays.asList(new PathSpecification[] {new PathSpecification("inc1"), new PathSpecification("inc2")})); assertEquals("http://foo/Patient?withIncludes=aaa&_include=inc1&_include=inc2", capt.getValue().getURI().toString()); @@ -209,7 +207,7 @@ public class ClientTest { when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); CodingListParam identifiers = new CodingListParam(); identifiers.add(new CodingDt("foo", "bar")); identifiers.add(new CodingDt("baz", "boz")); @@ -230,7 +228,7 @@ public class ClientTest { when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); Conformance response = client.getServerConformanceStatement(); assertEquals("http://foo/metadata", capt.getValue().getURI().toString()); @@ -249,7 +247,7 @@ public class ClientTest { when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); Bundle response = client.findPatientByName(new StringDt("AAA"), null); assertEquals("http://foo/Patient?family=AAA", capt.getValue().getURI().toString()); @@ -261,7 +259,7 @@ public class ClientTest { */ when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); - client = clientFactory.newClient(ITestClient.class, "http://foo"); + client = ctx.newRestfulClient(ITestClient.class, "http://foo"); response = client.findPatientByName(new StringDt("AAA"), new StringDt("BBB")); assertEquals("http://foo/Patient?family=AAA&given=BBB", capt.getValue().getURI().toString()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/Tester.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/Tester.java index c9801badea7..0c77965462d 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/Tester.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/Tester.java @@ -14,8 +14,7 @@ public class Tester { try { FhirContext ctx = new FhirContext(Patient.class); - IRestfulClientFactory factory = ctx.newRestfulClientFactory(); - ITestClient client = factory.newClient(ITestClient.class, "http://spark.furore.com/fhir/"); + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://spark.furore.com/fhir/"); Patient patient = client.getPatientById(new IdDt("1")); System.out.println(ctx.newXmlParser().encodeResourceToString(patient)); diff --git a/hapi-fhir-structures-dstu/pom.xml b/hapi-fhir-structures-dstu/pom.xml index 1aaf910904e..0933eebc18f 100644 --- a/hapi-fhir-structures-dstu/pom.xml +++ b/hapi-fhir-structures-dstu/pom.xml @@ -62,6 +62,13 @@ true + + org.apache.maven.plugins + maven-deploy-plugin + + true + + diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureParser.java index cc352b2e63c..36a151dee8c 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureParser.java @@ -81,8 +81,7 @@ public abstract class BaseStructureParser { } } - private ca.uhn.fhir.model.api.annotation.SimpleSetter.Parameter findAnnotation(Class theBase, Annotation[] theAnnotations, - Class theClass) { + private ca.uhn.fhir.model.api.annotation.SimpleSetter.Parameter findAnnotation(Class theBase, Annotation[] theAnnotations, Class theClass) { for (Annotation next : theAnnotations) { if (theClass.equals(next.annotationType())) { return (ca.uhn.fhir.model.api.annotation.SimpleSetter.Parameter) next; @@ -105,7 +104,7 @@ public abstract class BaseStructureParser { private void scanForImportsNames(BaseElement theNext) throws MojoFailureException { for (BaseElement next : theNext.getChildren()) { - ourLog.info("Element Name: {}", next.getName()); + ourLog.debug("Element Name: {}", next.getName()); if (next instanceof SimpleChild) { for (String nextType : next.getType()) { if (((SimpleChild) next).isBoundCode()) { @@ -130,7 +129,7 @@ public abstract class BaseStructureParser { myImports.add(UndeclaredExtension.class.getCanonicalName()); return; } - + if (myLocallyDefinedClassNames.containsKey(nextType)) { myImports.add(nextType); } else { @@ -239,10 +238,12 @@ public abstract class BaseStructureParser { VelocityContext ctx = new VelocityContext(); ctx.put("includeDescriptionAnnotations", true); ctx.put("packageBase", thePackageBase); + ctx.put("hash", "#"); ctx.put("imports", imports); ctx.put("profile", theResource.getProfile()); ctx.put("id", StringUtils.defaultString(theResource.getId())); - ctx.put("className", theResource.getName()); + ctx.put("className", theResource.getName()); // HumanName + ctx.put("classNameComplete", theResource.getName() + getFilenameSuffix()); // HumanNameDt ctx.put("shortName", defaultString(theResource.getShortName())); ctx.put("definition", defaultString(theResource.getDefinition())); ctx.put("requirements", defaultString(theResource.getRequirement())); @@ -274,7 +275,7 @@ public abstract class BaseStructureParser { } } } - + public void writeAll(File theOutputDirectory, String thePackageBase) throws MojoFailureException { if (!theOutputDirectory.exists()) { theOutputDirectory.mkdirs(); @@ -289,6 +290,7 @@ public abstract class BaseStructureParser { for (BaseRootType next : myResources) { scanForTypeNameConflicts(next); + fixResourceReferenceClassNames(next, thePackageBase); File f = new File(theOutputDirectory, next.getName() + getFilenameSuffix() + ".java"); try { @@ -299,6 +301,41 @@ public abstract class BaseStructureParser { } } + /** + * Example: Encounter has an internal block class named "Location", but it + * also has a reference to the Location resource type, so we need to use the + * fully qualified name for that resource reference + */ + private void fixResourceReferenceClassNames(BaseElement theNext, String thePackageBase) { + for (BaseElement next : theNext.getChildren()) { + fixResourceReferenceClassNames(next, thePackageBase); + } + + if (theNext.isResourceRef()) { + for (int i = 0; i < theNext.getType().size(); i++) { + String nextTypeName= theNext.getType().get(i); + if ("Any".equals(nextTypeName)) { + continue; + } +// if ("Location".equals(nextTypeName)) { +// ourLog.info("***** Checking for Location"); +// ourLog.info("***** Imports are: {}", new TreeSet(myImports)); +// } + boolean found = false; + for (String nextImport : myImports) { + if (nextImport.endsWith(".resource."+nextTypeName)) { +// ourLog.info("***** Found match " + nextImport); + theNext.getType().set(i, nextImport); + found=true; + } + } + if (!found) { + theNext.getType().set(i, thePackageBase+".resource." + nextTypeName); + } + } + } + } + static String cellValue(Node theRowXml, int theCellIndex) { NodeList cells = ((Element) theRowXml).getElementsByTagName("Cell"); @@ -330,12 +367,16 @@ public abstract class BaseStructureParser { String base = "/home/t3903uhn/workspace/uhn-fhir-service/"; TinderStructuresMojo m = new TinderStructuresMojo(); m.setPackageName("ca.uhn.sailfhirmodel"); -// m.setResourceProfileFiles(new ArrayList()); -// m.getResourceProfileFiles().add(base + "src/main/resources/profile/patient.xml"); -// m.getResourceProfileFiles().add(base + "src/main/resources/profile/organization.xml"); -// m.setResourceValueSetFiles(new ArrayList()); -// m.getResourceValueSetFiles().add(base + "src/main/resources/valueset/valueset-cgta-patientidpool.xml"); -// m.getResourceValueSetFiles().add(base + "src/main/resources/valueset/valueset-cgta-provideridpool.xml"); + // m.setResourceProfileFiles(new ArrayList()); + // m.getResourceProfileFiles().add(base + + // "src/main/resources/profile/patient.xml"); + // m.getResourceProfileFiles().add(base + + // "src/main/resources/profile/organization.xml"); + // m.setResourceValueSetFiles(new ArrayList()); + // m.getResourceValueSetFiles().add(base + + // "src/main/resources/valueset/valueset-cgta-patientidpool.xml"); + // m.getResourceValueSetFiles().add(base + + // "src/main/resources/valueset/valueset-cgta-provideridpool.xml"); m.setTargetDirectory(base + "target/generated-sources/tinder"); m.setBuildDatatypes(true); m.execute(); diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceGeneratorUsingSpreadsheet.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceGeneratorUsingSpreadsheet.java index 19ec06fbba4..282105e2195 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceGeneratorUsingSpreadsheet.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceGeneratorUsingSpreadsheet.java @@ -39,7 +39,8 @@ public class ResourceGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetP ResourceGeneratorUsingSpreadsheet p = new ResourceGeneratorUsingSpreadsheet(); p.setBaseResourceNames(Collections.singletonList("encounter")); p.parse(); - p.writeAll(new File("tmp"), "ca.test"); + p.markResourcesForImports(); + p.writeAll(new File("target/gen/ca/test/resource"), "ca.test"); // // // TODO: this needs to be properly populated // p.getAllDatatypes().add("String"); diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderClientMojo.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderClientMojo.java index 90727a791c2..d3710bdd467 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderClientMojo.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderClientMojo.java @@ -25,7 +25,6 @@ import ca.uhn.fhir.model.dstu.resource.Conformance.Rest; import ca.uhn.fhir.model.dstu.resource.Conformance.RestResource; import ca.uhn.fhir.model.dstu.resource.Profile; import ca.uhn.fhir.model.dstu.valueset.RestfulConformanceModeEnum; -import ca.uhn.fhir.rest.client.IRestfulClientFactory; import ca.uhn.fhir.rest.client.api.IBasicClient; import ca.uhn.fhir.tinder.model.BaseRootType; import ca.uhn.fhir.tinder.model.RestResourceTm; @@ -73,8 +72,7 @@ public class TinderClientMojo extends AbstractMojo { // } FhirContext ctx = new FhirContext(Conformance.class); - IRestfulClientFactory cFact = ctx.newRestfulClientFactory(); - IBasicClient client = cFact.newClient(IBasicClient.class, serverBaseHref); + IBasicClient client = ctx.newRestfulClient(IBasicClient.class, serverBaseHref); Conformance conformance = client.getServerConformanceStatement(); diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java index d7d9e8e48bc..9ff2adb0bc1 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java @@ -3,6 +3,7 @@ package ca.uhn.fhir.tinder.model; import static org.apache.commons.lang.StringUtils.*; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -11,6 +12,7 @@ import org.apache.commons.lang3.StringUtils; public abstract class BaseElement { + private String myDeclaringClassNameComplete; private String myBinding; private String myBindingClass; private String myCardMax; @@ -29,11 +31,23 @@ public abstract class BaseElement { private String myV2Mapping; private String myExtensionUrl; + public String getDeclaringClassNameComplete() { + return myDeclaringClassNameComplete; + } + + public void setDeclaringClassNameComplete(String theDeclaringClassNameComplete) { + myDeclaringClassNameComplete = theDeclaringClassNameComplete; + } + public void addChild(Child theElem) { if (myChildren == null) { myChildren = new ArrayList(); } myChildren.add(theElem); + + if (theElem.getDeclaringClassNameComplete()==null) { + theElem.setDeclaringClassNameComplete(getDeclaringClassNameComplete()); + } } public String getBinding() { @@ -60,7 +74,7 @@ public abstract class BaseElement { if (myChildren == null) { myChildren = new ArrayList(); } - return myChildren; + return Collections.unmodifiableList(myChildren); } public String getComments() { @@ -174,11 +188,11 @@ public abstract class BaseElement { public void setElementNameAndDeriveParentElementName(String theName) { int lastDot = theName.lastIndexOf('.'); if (lastDot == -1) { - myElementName = (theName); + setElementName(theName); } else { String elementName = theName.substring(lastDot + 1); String elementParentName = theName.substring(0, lastDot); - myElementName = (elementName); + setElementName(elementName); myElementParentName = (elementParentName); } } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java index 9dd7e8dc5da..902dea435f6 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java @@ -17,6 +17,14 @@ public abstract class Child extends BaseElement { return getSingleType(); } + public String getBoundDatatype() { + String singleType = getSingleType(); + if ("CodeDt".equals(singleType) || "CodeableConceptDt".equals(singleType)) { + return "Bound" + singleType; + } + throw new IllegalStateException(); + } + public String getCardMaxForChildAnnotation() { if (getCardMax().equals("*")) { return "Child.MAX_UNLIMITED"; @@ -24,10 +32,7 @@ public abstract class Child extends BaseElement { return getCardMax(); } } - - public boolean isSingleChildInstantiable() { - return true; - } + /** * Strips off "[x]" @@ -49,24 +54,6 @@ public abstract class Child extends BaseElement { return elementName; } - public String getBoundDatatype() { - String singleType = getSingleType(); - if ("CodeDt".equals(singleType) || "CodeableConceptDt".equals(singleType)) { - return "Bound" + singleType; - } - throw new IllegalStateException(); - } - - public boolean isBoundCode() { - String singleType = getSingleType(); - if ("CodeDt".equals(singleType) || "CodeableConceptDt".equals(singleType)) { - if (StringUtils.isNotBlank(getBindingClass())) { - return true; - } - } - return false; - } - public String getReferenceType() { String retVal; if (this.isResourceRef()) { @@ -95,7 +82,7 @@ public abstract class Child extends BaseElement { public String getReferenceTypeForConstructor() { return getReferenceType().replaceAll("^java.util.List<", "java.util.ArrayList<"); } - + public List getReferenceTypesForMultiple() { ArrayList retVal = new ArrayList(); for (String next : getType()) { @@ -107,7 +94,7 @@ public abstract class Child extends BaseElement { } return retVal; } - + public List getSimpleSetters() { if (isBoundCode()) { return Collections.emptyList(); @@ -115,19 +102,6 @@ public abstract class Child extends BaseElement { return mySimpleStters; } - public String getVariableName() { - String elementName = getMethodName(); - return "my" + elementName; - } - - public boolean isBlock() { - return false; - } - - public boolean isRepeatable() { - return "1".equals(getCardMax()) == false; - } - public String getSingleType() { String retVal; String elemName = this.getType().get(0); @@ -147,4 +121,32 @@ public abstract class Child extends BaseElement { return "Dt"; } + public String getVariableName() { + String elementName = getMethodName(); + return "my" + elementName; + } + + public boolean isBlock() { + return false; + } + + public boolean isBoundCode() { + String singleType = getSingleType(); + if ("CodeDt".equals(singleType) || "CodeableConceptDt".equals(singleType)) { + if (StringUtils.isNotBlank(getBindingClass())) { + return true; + } + } + return false; + } + + public boolean isRepeatable() { + return "1".equals(getCardMax()) == false; + } + + public boolean isSingleChildInstantiable() { + return true; + } + + } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Composite.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Composite.java index caf433da53d..416888fe839 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Composite.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Composite.java @@ -2,4 +2,9 @@ package ca.uhn.fhir.tinder.model; public class Composite extends BaseRootType { + @Override + public void setElementName(String theName) { + super.setElementName(theName); + setDeclaringClassNameComplete(theName+"Dt"); + } } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Resource.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Resource.java index 3d04ae71390..faf6c541188 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Resource.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Resource.java @@ -2,4 +2,10 @@ package ca.uhn.fhir.tinder.model; public class Resource extends BaseRootType { + @Override + public void setElementName(String theName) { + super.setElementName(theName); + setDeclaringClassNameComplete(theName); + } + } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/ResourceBlock.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/ResourceBlock.java index 8535a2743c7..9e9af733efc 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/ResourceBlock.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/ResourceBlock.java @@ -36,6 +36,11 @@ public class ResourceBlock extends Child { } + @Override + public String getDeclaringClassNameComplete() { + return getClassName(); + } + @Override public String getSingleType() { return getClassName(); diff --git a/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm b/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm index ec58bfc0105..850fceeb91e 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm @@ -74,45 +74,6 @@ public class ${className}Dt ######################### ### Type-specific methods ######################### -#if ( ${className} == "Identifier" ) - /** - * Returns true if this identifier has the same {@link IdentifierDt#[[#]]#getValue() value} - * and {@link IdentifierDt#[[#]]#getSystem() system} (as compared by simple equals comparison). - * Does not compare other values (e.g. {@link IdentifierDt#[[#]]#getUse() use}) or any extensions. - */ - public boolean matchesSystemAndValue(IdentifierDt theIdentifier) { - if (theIdentifier == null) { - return false; - } - return getValue().equals(theIdentifier.getValue()) && getSystem().equals(theIdentifier.getSystem()); - } - - /** - * {@inheritDoc} - */ - @Override - public String getValueAsQueryToken() { - if (org.apache.commons.lang3.StringUtils.isNotBlank(getSystem().getValueAsString())) { - return getSystem().getValueAsString() + '|' + getValue().getValueAsString(); - } else { - return getValue().getValueAsString(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void setValueAsQueryToken(String theParameter) { - int barIndex = theParameter.indexOf('|'); - if (barIndex != -1) { - setSystem(new UriDt(theParameter.substring(0, barIndex))); - setValue(theParameter.substring(barIndex + 1)); - } else { - setValue(theParameter); - } - } -#end #if ( ${className} == "Coding" ) /** * Returns true if this Coding has the same {@link CodingDt#[[#]]#getCode() Code} @@ -152,6 +113,82 @@ public class ${className}Dt } } #end +#if ( ${className} == "HumanName" ) + /** + * Returns all repetitions of {@link ${hash}getFamily() family name} as a space separated string + * + * @see DatatypeUtil${hash}joinStringsSpaceSeparated(List) + */ + public String getFamilyAsSingleString() { + return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getFamily()); + } + + /** + * Returns all repetitions of {@link ${hash}getGiven() given name} as a space separated string + * + * @see DatatypeUtil${hash}joinStringsSpaceSeparated(List) + */ + public String getGivenAsSingleString() { + return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getGiven()); + } + + /** + * Returns all repetitions of {@link ${hash}getPrefix() prefix name} as a space separated string + * + * @see DatatypeUtil${hash}joinStringsSpaceSeparated(List) + */ + public String getPrefixAsSingleString() { + return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getPrefix()); + } + + /** + * Returns all repetitions of {@link ${hash}Suffix() suffix} as a space separated string + * + * @see DatatypeUtil${hash}joinStringsSpaceSeparated(List) + */ + public String getSuffixAsSingleString() { + return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getSuffix()); + } +#end +#if ( ${className} == "Identifier" ) + /** + * Returns true if this identifier has the same {@link IdentifierDt#[[#]]#getValue() value} + * and {@link IdentifierDt#[[#]]#getSystem() system} (as compared by simple equals comparison). + * Does not compare other values (e.g. {@link IdentifierDt#[[#]]#getUse() use}) or any extensions. + */ + public boolean matchesSystemAndValue(IdentifierDt theIdentifier) { + if (theIdentifier == null) { + return false; + } + return getValue().equals(theIdentifier.getValue()) && getSystem().equals(theIdentifier.getSystem()); + } + + /** + * {@inheritDoc} + */ + @Override + public String getValueAsQueryToken() { + if (org.apache.commons.lang3.StringUtils.isNotBlank(getSystem().getValueAsString())) { + return getSystem().getValueAsString() + '|' + getValue().getValueAsString(); + } else { + return getValue().getValueAsString(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void setValueAsQueryToken(String theParameter) { + int barIndex = theParameter.indexOf('|'); + if (barIndex != -1) { + setSystem(new UriDt(theParameter.substring(0, barIndex))); + setValue(theParameter.substring(barIndex + 1)); + } else { + setValue(theParameter); + } + } +#end #childExtensionTypes( $childExtensionTypes ) diff --git a/hapi-tinder-plugin/src/main/resources/vm/templates.vm b/hapi-tinder-plugin/src/main/resources/vm/templates.vm index 059e182da7c..9f8b53f99c5 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/templates.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/templates.vm @@ -105,6 +105,22 @@ get${child.methodName}().add(newType); return newType; } + + /** + * Gets the first repetition for ${child.elementName} (${child.shortName}), + * creating it if it does not already exist. + * + *

    + * Definition: + * ${child.definition} + *

    + */ + public ${child.singleType} get${child.methodName}FirstRep() { + if (get${child.methodName}().isEmpty()) { + return add${child.methodName}(); + } + return get${child.methodName}().get(0); + } #end #if( ${child.repeatable} && ${child.singleChildInstantiable} && ${child.resourceRef} ) /** @@ -170,12 +186,15 @@ * Definition: * ${child.definition} *

    + * + * @return Returns a reference to this object, to allow for simple chaining. */ - public void add${child.methodName}(#{foreach}($param in $ss.parameters) ${param.datatype} ${param.parameter}#{if}( $foreach.hasNext ), #{end}#{end}) { + public ${child.declaringClassNameComplete} add${child.methodName}(#{foreach}($param in $ss.parameters) ${param.datatype} ${param.parameter}#{if}( $foreach.hasNext ), #{end}#{end}) { if (${child.variableName} == null) { ${child.variableName} = new ${child.referenceTypeForConstructor}(); } - ${child.variableName}.add(new ${ss.datatype}(#{foreach}($param in $ss.parameters)${param.parameter}#{if}( $foreach.hasNext ), #{end}#{end})); + ${child.variableName}.add(new ${ss.datatype}(#{foreach}($param in $ss.parameters)${param.parameter}#{if}( $foreach.hasNext ), #{end}#{end})); + return this; } #else /** @@ -186,8 +205,9 @@ * ${child.definition} *

    */ - public void set${child.methodName}${ss.suffix}(#{foreach}($param in $ss.parameters) ${param.datatype} ${param.parameter}#{if}( $foreach.hasNext ), #{end}#{end}) { + public ${child.declaringClassNameComplete} set${child.methodName}${ss.suffix}(#{foreach}($param in $ss.parameters) ${param.datatype} ${param.parameter}#{if}( $foreach.hasNext ), #{end}#{end}) { ${child.variableName} = new ${ss.datatype}(#{foreach}($param in $ss.parameters)${param.parameter}#{if}( $foreach.hasNext ), #{end}#{end}); + return this; } #end diff --git a/hapi-tinder-plugin/tmp/ValueSet.java b/hapi-tinder-plugin/tmp/ValueSet.java new file mode 100644 index 00000000000..74fd17b7014 --- /dev/null +++ b/hapi-tinder-plugin/tmp/ValueSet.java @@ -0,0 +1,2539 @@ + + + + + + + + + + + + + + + + +package ca.test.resource; + + +import java.util.*; +import ca.uhn.fhir.model.api.*; +import ca.uhn.fhir.model.api.annotation.*; + +import ca.uhn.fhir.model.dstu.composite.ContactDt; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.primitive.BooleanDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.UriDt; + + +/** + * HAPI/FHIR ValueSet Resource + * (A set of codes drawn from one or more code systems) + * + *

    + * Definition: + * A value set specifies a set of codes drawn from one or more code systems + *

    + * + *

    + * Requirements: + * + *

    + */ +@ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/profiles/ValueSet", id="valueset") +public class ValueSet extends BaseResource implements IResource { + + /** + * Search parameter constant for identifier + *

    + * Description: The identifier of the value set
    + * Type: token
    + * Path: ValueSet.identifier
    + *

    + */ + public static final String SP_IDENTIFIER = "identifier"; + + /** + * Search parameter constant for version + *

    + * Description: The version identifier of the value set
    + * Type: token
    + * Path: ValueSet.version
    + *

    + */ + public static final String SP_VERSION = "version"; + + /** + * Search parameter constant for name + *

    + * Description: The name of the value set
    + * Type: string
    + * Path: ValueSet.name
    + *

    + */ + public static final String SP_NAME = "name"; + + /** + * Search parameter constant for publisher + *

    + * Description: Name of the publisher of the value set
    + * Type: string
    + * Path: ValueSet.publisher
    + *

    + */ + public static final String SP_PUBLISHER = "publisher"; + + /** + * Search parameter constant for description + *

    + * Description: Text search in the description of the value set
    + * Type: string
    + * Path: ValueSet.description
    + *

    + */ + public static final String SP_DESCRIPTION = "description"; + + /** + * Search parameter constant for status + *

    + * Description: The status of the value set
    + * Type: token
    + * Path: ValueSet.status
    + *

    + */ + public static final String SP_STATUS = "status"; + + /** + * Search parameter constant for date + *

    + * Description: The value set publication date
    + * Type: date
    + * Path: ValueSet.date
    + *

    + */ + public static final String SP_DATE = "date"; + + /** + * Search parameter constant for system + *

    + * Description: The system for any codes defined by this value set
    + * Type: token
    + * Path: ValueSet.define.system
    + *

    + */ + public static final String SP_SYSTEM = "system"; + + /** + * Search parameter constant for code + *

    + * Description: A code defined in the value set
    + * Type: token
    + * Path: ValueSet.define.concept.code
    + *

    + */ + public static final String SP_CODE = "code"; + + /** + * Search parameter constant for reference + *

    + * Description: A code system included or excluded in the value set or an imported value set
    + * Type: token
    + * Path: ValueSet.compose.include.system
    + *

    + */ + public static final String SP_REFERENCE = "reference"; + + /** + * Search parameter constant for !restricts + *

    + * Description: A value set listed in the restricts list
    + * Type: token
    + * Path: ValueSet.compose.restricts
    + *

    + */ + public static final String SP_RESTRICTS = "!restricts"; + + + @Child(name="identifier", type=StringDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Logical id to reference this value set", + formalDefinition="The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)" + ) + private StringDt myIdentifier; + + @Child(name="version", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Logical id for this version of the value set", + formalDefinition="The identifier that is 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=2, min=1, max=1) + @Description( + shortDefinition="Informal name for this value set", + formalDefinition="A free text natural language name describing the value set" + ) + private StringDt myName; + + @Child(name="publisher", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Name of the publisher (Organization or individual)", + formalDefinition="The name of the individual or organization that published the value set" + ) + private StringDt myPublisher; + + @Child(name="telecom", type=ContactDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Contact information of the publisher", + formalDefinition="Contacts of the publisher to assist a user in finding and communicating with the publisher" + ) + private java.util.List myTelecom; + + @Child(name="description", type=StringDt.class, order=5, min=1, max=1) + @Description( + shortDefinition="Human language description of the value set", + formalDefinition="A free text natural language description of the use of the value set - reason for definition, conditions of use, etc." + ) + private StringDt myDescription; + + @Child(name="copyright", type=StringDt.class, order=6, min=0, max=1) + @Description( + shortDefinition="About the value set or its content", + formalDefinition="A copyright statement relating to the value set and/or its contents" + ) + private StringDt myCopyright; + + @Child(name="status", type=CodeDt.class, order=7, min=1, max=1) + @Description( + shortDefinition="draft | active | retired", + formalDefinition="The status of the value set" + ) + private CodeDt myStatus; + + @Child(name="experimental", type=BooleanDt.class, order=8, min=0, max=1) + @Description( + shortDefinition="If for testing purposes, not real usage", + 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="extensible", type=BooleanDt.class, order=9, min=0, max=1) + @Description( + shortDefinition="Whether this is intended to be used with an extensible binding", + formalDefinition="Whether this is intended to be used with an extensible binding or not" + ) + private BooleanDt myExtensible; + + @Child(name="date", type=DateTimeDt.class, order=10, min=0, max=1) + @Description( + shortDefinition="Date for given status", + formalDefinition="The date that the value set status was last changed" + ) + private DateTimeDt myDate; + + @Child(name="define", order=11, min=0, max=1) + @Description( + shortDefinition="When value set defines its own codes", + formalDefinition="" + ) + private Define myDefine; + + @Child(name="compose", order=12, min=0, max=1) + @Description( + shortDefinition="When value set includes codes from elsewhere", + formalDefinition="" + ) + private Compose myCompose; + + @Child(name="expansion", order=13, min=0, max=1) + @Description( + shortDefinition="When value set is an expansion", + formalDefinition="" + ) + private Expansion myExpansion; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myCopyright, myStatus, myExperimental, myExtensible, myDate, myDefine, myCompose, myExpansion); + } + + @Override + public java.util.List getAllPopulatedChildElements() { + return getAllPopulatedChildElementsOfType(null); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myCopyright, myStatus, myExperimental, myExtensible, myDate, myDefine, myCompose, myExpansion); + } + + /** + * Gets the value(s) for identifier (Logical id to reference this value set). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI) + *

    + */ + public StringDt getIdentifier() { + if (myIdentifier == null) { + myIdentifier = new StringDt(); + } + return myIdentifier; + } + + /** + * Sets the value(s) for identifier (Logical id to reference this value set) + * + *

    + * Definition: + * The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI) + *

    + */ + public void setIdentifier(StringDt theValue) { + myIdentifier = theValue; + } + + /** + * Sets the value for identifier (Logical id to reference this value set) + * + *

    + * Definition: + * The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI) + *

    + */ + public void setIdentifier( String theString) { + myIdentifier = new StringDt(theString); + } + + + /** + * Gets the value(s) for version (Logical id for this version of the value set). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * The identifier that is 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 getVersion() { + if (myVersion == null) { + myVersion = new StringDt(); + } + return myVersion; + } + + /** + * Sets the value(s) for version (Logical id for this version of the value set) + * + *

    + * Definition: + * The identifier that is 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 void setVersion(StringDt theValue) { + myVersion = theValue; + } + + /** + * Sets the value for version (Logical id for this version of the value set) + * + *

    + * Definition: + * The identifier that is 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 void setVersion( String theString) { + myVersion = new StringDt(theString); + } + + + /** + * Gets the value(s) for name (Informal name for this value set). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * A free text natural language name describing the value set + *

    + */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Informal name for this value set) + * + *

    + * Definition: + * A free text natural language name describing the value set + *

    + */ + public void setName(StringDt theValue) { + myName = theValue; + } + + /** + * Sets the value for name (Informal name for this value set) + * + *

    + * Definition: + * A free text natural language name describing the value set + *

    + */ + public void setName( String theString) { + myName = new StringDt(theString); + } + + + /** + * Gets the value(s) for publisher (Name of the publisher (Organization or individual)). + * 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 getPublisher() { + if (myPublisher == null) { + myPublisher = new StringDt(); + } + return myPublisher; + } + + /** + * Sets the value(s) for publisher (Name of the publisher (Organization or individual)) + * + *

    + * Definition: + * The name of the individual or organization that published the value set + *

    + */ + public void setPublisher(StringDt theValue) { + myPublisher = theValue; + } + + /** + * Sets the value for publisher (Name of the publisher (Organization or individual)) + * + *

    + * Definition: + * The name of the individual or organization that published the value set + *

    + */ + public void setPublisher( String theString) { + myPublisher = new StringDt(theString); + } + + + /** + * Gets the value(s) for telecom (Contact information of the publisher). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * Contacts of the publisher to assist a user in finding and communicating with the publisher + *

    + */ + public java.util.List getTelecom() { + if (myTelecom == null) { + myTelecom = new java.util.ArrayList(); + } + return myTelecom; + } + + /** + * Sets the value(s) for telecom (Contact information of the publisher) + * + *

    + * Definition: + * Contacts of the publisher to assist a user in finding and communicating with the publisher + *

    + */ + public void setTelecom(java.util.List theValue) { + myTelecom = theValue; + } + + /** + * Adds and returns a new value for telecom (Contact information of the publisher) + * + *

    + * Definition: + * Contacts of the publisher to assist a user in finding and communicating with the publisher + *

    + */ + public ContactDt addTelecom() { + ContactDt newType = new ContactDt(); + getTelecom().add(newType); + return newType; + } + + /** + * Gets the first repetition for telecom (Contact information of the publisher), + * creating it if it does not already exist. + * + *

    + * Definition: + * Contacts of the publisher to assist a user in finding and communicating with the publisher + *

    + */ + public ContactDt getTelecomFirstRep() { + if (getTelecom().isEmpty()) { + return addTelecom(); + } + return getTelecom().get(0); + } + + /** + * Gets the value(s) for description (Human language description of the value set). + * 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, conditions of use, etc. + *

    + */ + public StringDt getDescription() { + if (myDescription == null) { + myDescription = new StringDt(); + } + return myDescription; + } + + /** + * Sets the value(s) for description (Human language description of the value set) + * + *

    + * Definition: + * A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. + *

    + */ + public void setDescription(StringDt theValue) { + myDescription = theValue; + } + + /** + * Sets the value for description (Human language description of the value set) + * + *

    + * Definition: + * A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. + *

    + */ + public void setDescription( String theString) { + myDescription = new StringDt(theString); + } + + + /** + * Gets the value(s) for copyright (About the value set or its content). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * A copyright statement relating to the value set and/or its contents + *

    + */ + public StringDt getCopyright() { + if (myCopyright == null) { + myCopyright = new StringDt(); + } + return myCopyright; + } + + /** + * Sets the value(s) for copyright (About the value set or its content) + * + *

    + * Definition: + * A copyright statement relating to the value set and/or its contents + *

    + */ + public void setCopyright(StringDt theValue) { + myCopyright = theValue; + } + + /** + * Sets the value for copyright (About the value set or its content) + * + *

    + * Definition: + * A copyright statement relating to the value set and/or its contents + *

    + */ + public void setCopyright( String theString) { + myCopyright = new StringDt(theString); + } + + + /** + * Gets the value(s) for status (draft | active | retired). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * The status of the value set + *

    + */ + public CodeDt getStatus() { + if (myStatus == null) { + myStatus = new CodeDt(); + } + return myStatus; + } + + /** + * Sets the value(s) for status (draft | active | retired) + * + *

    + * Definition: + * The status of the value set + *

    + */ + public void setStatus(CodeDt theValue) { + myStatus = theValue; + } + + /** + * Sets the value for status (draft | active | retired) + * + *

    + * Definition: + * The status of the value set + *

    + */ + public void setStatus( String theCode) { + myStatus = new CodeDt(theCode); + } + + + /** + * Gets the value(s) for experimental (If for testing purposes, not real usage). + * 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 getExperimental() { + if (myExperimental == null) { + myExperimental = new BooleanDt(); + } + return myExperimental; + } + + /** + * Sets the value(s) for experimental (If for testing purposes, not real usage) + * + *

    + * Definition: + * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage + *

    + */ + public void setExperimental(BooleanDt theValue) { + myExperimental = theValue; + } + + /** + * Sets the value for experimental (If for testing purposes, not real usage) + * + *

    + * Definition: + * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage + *

    + */ + public void setExperimental( Boolean theBoolean) { + myExperimental = new BooleanDt(theBoolean); + } + + + /** + * Gets the value(s) for extensible (Whether this is intended to be used with an extensible binding). + * 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 getExtensible() { + if (myExtensible == null) { + myExtensible = new BooleanDt(); + } + return myExtensible; + } + + /** + * Sets the value(s) for extensible (Whether this is intended to be used with an extensible binding) + * + *

    + * Definition: + * Whether this is intended to be used with an extensible binding or not + *

    + */ + public void setExtensible(BooleanDt theValue) { + myExtensible = theValue; + } + + /** + * Sets the value for extensible (Whether this is intended to be used with an extensible binding) + * + *

    + * Definition: + * Whether this is intended to be used with an extensible binding or not + *

    + */ + public void setExtensible( Boolean theBoolean) { + myExtensible = new BooleanDt(theBoolean); + } + + + /** + * Gets the value(s) for date (Date for given status). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * The date that the value set status was last changed + *

    + */ + public DateTimeDt getDate() { + if (myDate == null) { + myDate = new DateTimeDt(); + } + return myDate; + } + + /** + * Sets the value(s) for date (Date for given status) + * + *

    + * Definition: + * The date that the value set status was last changed + *

    + */ + public void setDate(DateTimeDt theValue) { + myDate = theValue; + } + + /** + * Sets the value for date (Date for given status) + * + *

    + * Definition: + * The date that the value set status was last changed + *

    + */ + public void setDateWithSecondsPrecision( Date theDate) { + myDate = new DateTimeDt(theDate); + } + + /** + * Sets the value for date (Date for given status) + * + *

    + * Definition: + * The date that the value set status was last changed + *

    + */ + public void setDate( Date theDate, TemporalPrecisionEnum thePrecision) { + myDate = new DateTimeDt(theDate, thePrecision); + } + + + /** + * Gets the value(s) for define (When value set defines its own codes). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public Define getDefine() { + if (myDefine == null) { + myDefine = new Define(); + } + return myDefine; + } + + /** + * Sets the value(s) for define (When value set defines its own codes) + * + *

    + * Definition: + * + *

    + */ + public void setDefine(Define theValue) { + myDefine = theValue; + } + + + /** + * Gets the value(s) for compose (When value set includes codes from elsewhere). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public Compose getCompose() { + if (myCompose == null) { + myCompose = new Compose(); + } + return myCompose; + } + + /** + * Sets the value(s) for compose (When value set includes codes from elsewhere) + * + *

    + * Definition: + * + *

    + */ + public void setCompose(Compose theValue) { + myCompose = theValue; + } + + + /** + * Gets the value(s) for expansion (When value set is an expansion). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public Expansion getExpansion() { + if (myExpansion == null) { + myExpansion = new Expansion(); + } + return myExpansion; + } + + /** + * Sets the value(s) for expansion (When value set is an expansion) + * + *

    + * Definition: + * + *

    + */ + public void setExpansion(Expansion theValue) { + myExpansion = theValue; + } + + + /** + * Block class for child element: ValueSet.define (When value set defines its own codes) + * + *

    + * Definition: + * + *

    + */ + @Block(name="ValueSet.define") + public static class Define extends BaseElement implements IResourceBlock { + + @Child(name="system", type=UriDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="URI to identify the code system", + formalDefinition="" + ) + private UriDt mySystem; + + @Child(name="version", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Version of this system", + 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="If code comparison is case sensitive", + 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=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Concepts in the code system", + formalDefinition="" + ) + private java.util.List myConcept; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCaseSensitive, myConcept); + } + + @Override + public java.util.List getAllPopulatedChildElements() { + return getAllPopulatedChildElementsOfType(null); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myVersion, myCaseSensitive, myConcept); + } + + /** + * Gets the value(s) for system (URI to identify the code system). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public UriDt getSystem() { + if (mySystem == null) { + mySystem = new UriDt(); + } + return mySystem; + } + + /** + * Sets the value(s) for system (URI to identify the code system) + * + *

    + * Definition: + * + *

    + */ + public void setSystem(UriDt theValue) { + mySystem = theValue; + } + + /** + * Sets the value for system (URI to identify the code system) + * + *

    + * Definition: + * + *

    + */ + public void setSystem( String theUri) { + mySystem = new UriDt(theUri); + } + + + /** + * Gets the value(s) for version (Version of this system). + * 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 getVersion() { + if (myVersion == null) { + myVersion = new StringDt(); + } + return myVersion; + } + + /** + * Sets the value(s) for version (Version of this system) + * + *

    + * 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 void setVersion(StringDt theValue) { + myVersion = theValue; + } + + /** + * Sets the value for version (Version of this system) + * + *

    + * 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 void setVersion( String theString) { + myVersion = new StringDt(theString); + } + + + /** + * Gets the value(s) for caseSensitive (If code comparison is case sensitive). + * 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 getCaseSensitive() { + if (myCaseSensitive == null) { + myCaseSensitive = new BooleanDt(); + } + return myCaseSensitive; + } + + /** + * Sets the value(s) for caseSensitive (If code comparison is case sensitive) + * + *

    + * Definition: + * If code comparison is case sensitive when codes within this system are compared to each other + *

    + */ + public void setCaseSensitive(BooleanDt theValue) { + myCaseSensitive = theValue; + } + + /** + * Sets the value for caseSensitive (If code comparison is case sensitive) + * + *

    + * Definition: + * If code comparison is case sensitive when codes within this system are compared to each other + *

    + */ + public void setCaseSensitive( Boolean theBoolean) { + myCaseSensitive = new BooleanDt(theBoolean); + } + + + /** + * Gets the value(s) for concept (Concepts in the code system). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public java.util.List getConcept() { + if (myConcept == null) { + myConcept = new java.util.ArrayList(); + } + return myConcept; + } + + /** + * Sets the value(s) for concept (Concepts in the code system) + * + *

    + * Definition: + * + *

    + */ + public void setConcept(java.util.List theValue) { + myConcept = theValue; + } + + /** + * Adds and returns a new value for concept (Concepts in the code system) + * + *

    + * Definition: + * + *

    + */ + public DefineConcept addConcept() { + DefineConcept newType = new DefineConcept(); + getConcept().add(newType); + return newType; + } + + /** + * Gets the first repetition for concept (Concepts in the code system), + * creating it if it does not already exist. + * + *

    + * Definition: + * + *

    + */ + public DefineConcept getConceptFirstRep() { + if (getConcept().isEmpty()) { + return addConcept(); + } + return getConcept().get(0); + } + + + } + + /** + * Block class for child element: ValueSet.define.concept (Concepts in the code system) + * + *

    + * Definition: + * + *

    + */ + @Block(name="ValueSet.define.concept") + public static class DefineConcept extends BaseElement implements IResourceBlock { + + @Child(name="code", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Code that identifies concept", + formalDefinition="" + ) + private CodeDt myCode; + + @Child(name="abstract", type=BooleanDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="If this code is not for use as a real concept", + 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="Text to Display to the user", + formalDefinition="" + ) + private StringDt myDisplay; + + @Child(name="definition", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Formal Definition", + formalDefinition="The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept" + ) + private StringDt myDefinition; + + @Child(name="concept", type=DefineConcept.class, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Child Concepts (is-a / contains)", + formalDefinition="" + ) + private java.util.List myConcept; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myAbstract, myDisplay, myDefinition, myConcept); + } + + @Override + public java.util.List getAllPopulatedChildElements() { + return getAllPopulatedChildElementsOfType(null); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myAbstract, myDisplay, myDefinition, myConcept); + } + + /** + * Gets the value(s) for code (Code that identifies concept). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public CodeDt getCode() { + if (myCode == null) { + myCode = new CodeDt(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Code that identifies concept) + * + *

    + * Definition: + * + *

    + */ + public void setCode(CodeDt theValue) { + myCode = theValue; + } + + /** + * Sets the value for code (Code that identifies concept) + * + *

    + * Definition: + * + *

    + */ + public void setCode( String theCode) { + myCode = new CodeDt(theCode); + } + + + /** + * Gets the value(s) for abstract (If this code is not for use as a real concept). + * 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 getAbstract() { + if (myAbstract == null) { + myAbstract = new BooleanDt(); + } + return myAbstract; + } + + /** + * Sets the value(s) for abstract (If this code is not for use as a real concept) + * + *

    + * Definition: + * If this code is not for use as a real concept + *

    + */ + public void setAbstract(BooleanDt theValue) { + myAbstract = theValue; + } + + /** + * Sets the value for abstract (If this code is not for use as a real concept) + * + *

    + * Definition: + * If this code is not for use as a real concept + *

    + */ + public void setAbstract( Boolean theBoolean) { + myAbstract = new BooleanDt(theBoolean); + } + + + /** + * Gets the value(s) for display (Text to Display to the user). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public StringDt getDisplay() { + if (myDisplay == null) { + myDisplay = new StringDt(); + } + return myDisplay; + } + + /** + * Sets the value(s) for display (Text to Display to the user) + * + *

    + * Definition: + * + *

    + */ + public void setDisplay(StringDt theValue) { + myDisplay = theValue; + } + + /** + * Sets the value for display (Text to Display to the user) + * + *

    + * Definition: + * + *

    + */ + public void setDisplay( String theString) { + myDisplay = new StringDt(theString); + } + + + /** + * Gets the value(s) for definition (Formal Definition). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept + *

    + */ + public StringDt getDefinition() { + if (myDefinition == null) { + myDefinition = new StringDt(); + } + return myDefinition; + } + + /** + * Sets the value(s) for definition (Formal Definition) + * + *

    + * Definition: + * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept + *

    + */ + public void setDefinition(StringDt theValue) { + myDefinition = theValue; + } + + /** + * Sets the value for definition (Formal Definition) + * + *

    + * Definition: + * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept + *

    + */ + public void setDefinition( String theString) { + myDefinition = new StringDt(theString); + } + + + /** + * Gets the value(s) for concept (Child Concepts (is-a / contains)). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public java.util.List getConcept() { + if (myConcept == null) { + myConcept = new java.util.ArrayList(); + } + return myConcept; + } + + /** + * Sets the value(s) for concept (Child Concepts (is-a / contains)) + * + *

    + * Definition: + * + *

    + */ + public void setConcept(java.util.List theValue) { + myConcept = theValue; + } + + /** + * Adds and returns a new value for concept (Child Concepts (is-a / contains)) + * + *

    + * Definition: + * + *

    + */ + public DefineConcept addConcept() { + DefineConcept newType = new DefineConcept(); + getConcept().add(newType); + return newType; + } + + /** + * Gets the first repetition for concept (Child Concepts (is-a / contains)), + * creating it if it does not already exist. + * + *

    + * Definition: + * + *

    + */ + public DefineConcept getConceptFirstRep() { + if (getConcept().isEmpty()) { + return addConcept(); + } + return getConcept().get(0); + } + + + } + + + + /** + * Block class for child element: ValueSet.compose (When value set includes codes from elsewhere) + * + *

    + * Definition: + * + *

    + */ + @Block(name="ValueSet.compose") + public static class Compose extends BaseElement implements IResourceBlock { + + @Child(name="import", type=UriDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Import the contents of another value set", + formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set" + ) + private java.util.List myImport; + + @Child(name="include", order=1, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Include one or more codes from a code system", + 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="Explicitly exclude codes", + 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 java.util.List getAllPopulatedChildElements() { + return getAllPopulatedChildElementsOfType(null); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myImport, myInclude, myExclude); + } + + /** + * Gets the value(s) for import (Import the contents of another value set). + * 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 + *

    + */ + public java.util.List getImport() { + if (myImport == null) { + myImport = new java.util.ArrayList(); + } + return myImport; + } + + /** + * Sets the value(s) for import (Import the contents of another value set) + * + *

    + * Definition: + * Includes the contents of the referenced value set as a part of the contents of this value set + *

    + */ + public void setImport(java.util.List theValue) { + myImport = theValue; + } + + /** + * Adds and returns a new value for import (Import the contents of another value set) + * + *

    + * Definition: + * Includes the contents of the referenced value set as a part of the contents of this value set + *

    + */ + public UriDt addImport() { + UriDt newType = new UriDt(); + getImport().add(newType); + return newType; + } + + /** + * Gets the first repetition for import (Import the contents of another value set), + * creating it if it does not already exist. + * + *

    + * Definition: + * Includes the contents of the referenced value set as a part of the contents of this value set + *

    + */ + public UriDt getImportFirstRep() { + if (getImport().isEmpty()) { + return addImport(); + } + return getImport().get(0); + } + /** + * Adds a new value for import (Import the contents of another value set) + * + *

    + * Definition: + * Includes the contents of the referenced value set as a part of the contents of this value set + *

    + * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public Compose addImport( String theUri) { + if (myImport == null) { + myImport = new java.util.ArrayList(); + } + myImport.add(new UriDt(theUri)); + return this; + } + + + /** + * Gets the value(s) for include (Include one or more codes from a code system). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * Include one or more codes from a code system + *

    + */ + public java.util.List getInclude() { + if (myInclude == null) { + myInclude = new java.util.ArrayList(); + } + return myInclude; + } + + /** + * Sets the value(s) for include (Include one or more codes from a code system) + * + *

    + * Definition: + * Include one or more codes from a code system + *

    + */ + public void setInclude(java.util.List theValue) { + myInclude = theValue; + } + + /** + * Adds and returns a new value for include (Include one or more codes from a code system) + * + *

    + * Definition: + * Include one or more codes from a code system + *

    + */ + public ComposeInclude addInclude() { + ComposeInclude newType = new ComposeInclude(); + getInclude().add(newType); + return newType; + } + + /** + * Gets the first repetition for include (Include one or more codes from a code system), + * creating it if it does not already exist. + * + *

    + * Definition: + * Include one or more codes from a code system + *

    + */ + public ComposeInclude getIncludeFirstRep() { + if (getInclude().isEmpty()) { + return addInclude(); + } + return getInclude().get(0); + } + + /** + * Gets the value(s) for exclude (Explicitly exclude codes). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * Exclude one or more codes from the value set + *

    + */ + public java.util.List getExclude() { + if (myExclude == null) { + myExclude = new java.util.ArrayList(); + } + return myExclude; + } + + /** + * Sets the value(s) for exclude (Explicitly exclude codes) + * + *

    + * Definition: + * Exclude one or more codes from the value set + *

    + */ + public void setExclude(java.util.List theValue) { + myExclude = theValue; + } + + /** + * Adds and returns a new value for exclude (Explicitly exclude codes) + * + *

    + * Definition: + * Exclude one or more codes from the value set + *

    + */ + public ComposeInclude addExclude() { + ComposeInclude newType = new ComposeInclude(); + getExclude().add(newType); + return newType; + } + + /** + * Gets the first repetition for exclude (Explicitly exclude codes), + * creating it if it does not already exist. + * + *

    + * Definition: + * Exclude one or more codes from the value set + *

    + */ + public ComposeInclude getExcludeFirstRep() { + if (getExclude().isEmpty()) { + return addExclude(); + } + return getExclude().get(0); + } + + + } + + /** + * Block class for child element: ValueSet.compose.include (Include one or more codes from a code system) + * + *

    + * Definition: + * Include one or more codes from a code system + *

    + */ + @Block(name="ValueSet.compose.include") + public static class ComposeInclude extends BaseElement implements IResourceBlock { + + @Child(name="system", type=UriDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="The system the codes come from", + formalDefinition="The code system from which the selected codes come from" + ) + private UriDt mySystem; + + @Child(name="version", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Specific version of the code system referred to", + formalDefinition="The version of the code system that the codes are selected from" + ) + private StringDt myVersion; + + @Child(name="code", type=CodeDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Code or concept from system", + formalDefinition="Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance" + ) + private java.util.List myCode; + + @Child(name="filter", order=3, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Select codes/concepts by their properties (including relationships)", + formalDefinition="Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true." + ) + private java.util.List myFilter; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myFilter); + } + + @Override + public java.util.List getAllPopulatedChildElements() { + return getAllPopulatedChildElementsOfType(null); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myVersion, myCode, myFilter); + } + + /** + * Gets the value(s) for system (The system the codes come from). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * The code system from which the selected codes come from + *

    + */ + public UriDt getSystem() { + if (mySystem == null) { + mySystem = new UriDt(); + } + return mySystem; + } + + /** + * Sets the value(s) for system (The system the codes come from) + * + *

    + * Definition: + * The code system from which the selected codes come from + *

    + */ + public void setSystem(UriDt theValue) { + mySystem = theValue; + } + + /** + * Sets the value for system (The system the codes come from) + * + *

    + * Definition: + * The code system from which the selected codes come from + *

    + */ + public void setSystem( String theUri) { + mySystem = new UriDt(theUri); + } + + + /** + * Gets the value(s) for version (Specific version of the code system referred to). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * The version of the code system that the codes are selected from + *

    + */ + public StringDt getVersion() { + if (myVersion == null) { + myVersion = new StringDt(); + } + return myVersion; + } + + /** + * Sets the value(s) for version (Specific version of the code system referred to) + * + *

    + * Definition: + * The version of the code system that the codes are selected from + *

    + */ + public void setVersion(StringDt theValue) { + myVersion = theValue; + } + + /** + * Sets the value for version (Specific version of the code system referred to) + * + *

    + * Definition: + * The version of the code system that the codes are selected from + *

    + */ + public void setVersion( String theString) { + myVersion = new StringDt(theString); + } + + + /** + * Gets the value(s) for code (Code or concept from system). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance + *

    + */ + public java.util.List getCode() { + if (myCode == null) { + myCode = new java.util.ArrayList(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Code or concept from system) + * + *

    + * Definition: + * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance + *

    + */ + public void setCode(java.util.List theValue) { + myCode = theValue; + } + + /** + * Adds and returns a new value for code (Code or concept from system) + * + *

    + * Definition: + * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance + *

    + */ + public CodeDt addCode() { + CodeDt newType = new CodeDt(); + getCode().add(newType); + return newType; + } + + /** + * Gets the first repetition for code (Code or concept from system), + * creating it if it does not already exist. + * + *

    + * Definition: + * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance + *

    + */ + public CodeDt getCodeFirstRep() { + if (getCode().isEmpty()) { + return addCode(); + } + return getCode().get(0); + } + /** + * Adds a new value for code (Code or concept from system) + * + *

    + * Definition: + * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance + *

    + * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public ComposeInclude addCode( String theCode) { + if (myCode == null) { + myCode = new java.util.ArrayList(); + } + myCode.add(new CodeDt(theCode)); + return this; + } + + + /** + * Gets the value(s) for filter (Select codes/concepts by their properties (including relationships)). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + *

    + */ + public java.util.List getFilter() { + if (myFilter == null) { + myFilter = new java.util.ArrayList(); + } + return myFilter; + } + + /** + * Sets the value(s) for filter (Select codes/concepts by their properties (including relationships)) + * + *

    + * Definition: + * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + *

    + */ + public void setFilter(java.util.List theValue) { + myFilter = theValue; + } + + /** + * Adds and returns a new value for filter (Select codes/concepts by their properties (including relationships)) + * + *

    + * Definition: + * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + *

    + */ + public ComposeIncludeFilter addFilter() { + ComposeIncludeFilter newType = new ComposeIncludeFilter(); + getFilter().add(newType); + return newType; + } + + /** + * Gets the first repetition for filter (Select codes/concepts by their properties (including relationships)), + * creating it if it does not already exist. + * + *

    + * Definition: + * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + *

    + */ + public ComposeIncludeFilter getFilterFirstRep() { + if (getFilter().isEmpty()) { + return addFilter(); + } + return getFilter().get(0); + } + + + } + + /** + * Block class for child element: ValueSet.compose.include.filter (Select codes/concepts by their properties (including relationships)) + * + *

    + * Definition: + * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + *

    + */ + @Block(name="ValueSet.compose.include.filter") + public static class ComposeIncludeFilter extends BaseElement implements IResourceBlock { + + @Child(name="property", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="", + formalDefinition="A code that identifies a property defined in the code system" + ) + private CodeDt myProperty; + + @Child(name="op", type=CodeDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="= | is-a | is-not-a | regex | in | not in", + formalDefinition="The kind of operation to perform as a part of the filter criteria" + ) + private CodeDt myOp; + + @Child(name="value", type=CodeDt.class, order=2, min=1, max=1) + @Description( + shortDefinition="Code from the system, or regex criteria", + formalDefinition="The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value" + ) + private CodeDt myValue; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myProperty, myOp, myValue); + } + + @Override + public java.util.List getAllPopulatedChildElements() { + return getAllPopulatedChildElementsOfType(null); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myProperty, myOp, myValue); + } + + /** + * Gets the value(s) for property (). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * A code that identifies a property defined in the code system + *

    + */ + public CodeDt getProperty() { + if (myProperty == null) { + myProperty = new CodeDt(); + } + return myProperty; + } + + /** + * Sets the value(s) for property () + * + *

    + * Definition: + * A code that identifies a property defined in the code system + *

    + */ + public void setProperty(CodeDt theValue) { + myProperty = theValue; + } + + /** + * Sets the value for property () + * + *

    + * Definition: + * A code that identifies a property defined in the code system + *

    + */ + public void setProperty( String theCode) { + myProperty = new CodeDt(theCode); + } + + + /** + * Gets the value(s) for op (= | is-a | is-not-a | regex | in | not in). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * The kind of operation to perform as a part of the filter criteria + *

    + */ + public CodeDt getOp() { + if (myOp == null) { + myOp = new CodeDt(); + } + return myOp; + } + + /** + * Sets the value(s) for op (= | is-a | is-not-a | regex | in | not in) + * + *

    + * Definition: + * The kind of operation to perform as a part of the filter criteria + *

    + */ + public void setOp(CodeDt theValue) { + myOp = theValue; + } + + /** + * Sets the value for op (= | is-a | is-not-a | regex | in | not in) + * + *

    + * Definition: + * The kind of operation to perform as a part of the filter criteria + *

    + */ + public void setOp( String theCode) { + myOp = new CodeDt(theCode); + } + + + /** + * Gets the value(s) for value (Code from the system, or regex criteria). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value + *

    + */ + public CodeDt getValue() { + if (myValue == null) { + myValue = new CodeDt(); + } + return myValue; + } + + /** + * Sets the value(s) for value (Code from the system, or regex criteria) + * + *

    + * Definition: + * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value + *

    + */ + public void setValue(CodeDt theValue) { + myValue = theValue; + } + + /** + * Sets the value for value (Code from the system, or regex criteria) + * + *

    + * Definition: + * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value + *

    + */ + public void setValue( String theCode) { + myValue = new CodeDt(theCode); + } + + + + } + + + + + /** + * Block class for child element: ValueSet.expansion (When value set is an expansion) + * + *

    + * Definition: + * + *

    + */ + @Block(name="ValueSet.expansion") + public static class Expansion extends BaseElement implements IResourceBlock { + + @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Uniquely identifies this expansion", + formalDefinition="An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so" + ) + private IdentifierDt myIdentifier; + + @Child(name="timestamp", type=InstantDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="Time valueset expansion happened", + formalDefinition="" + ) + private InstantDt myTimestamp; + + @Child(name="contains", order=2, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Codes in the value set", + formalDefinition="" + ) + private java.util.List myContains; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myTimestamp, myContains); + } + + @Override + public java.util.List getAllPopulatedChildElements() { + return getAllPopulatedChildElementsOfType(null); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myTimestamp, myContains); + } + + /** + * Gets the value(s) for identifier (Uniquely identifies this expansion). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so + *

    + */ + public IdentifierDt getIdentifier() { + if (myIdentifier == null) { + myIdentifier = new IdentifierDt(); + } + return myIdentifier; + } + + /** + * Sets the value(s) for identifier (Uniquely identifies this expansion) + * + *

    + * Definition: + * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so + *

    + */ + public void setIdentifier(IdentifierDt theValue) { + myIdentifier = theValue; + } + + + /** + * Gets the value(s) for timestamp (Time valueset expansion happened). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public InstantDt getTimestamp() { + if (myTimestamp == null) { + myTimestamp = new InstantDt(); + } + return myTimestamp; + } + + /** + * Sets the value(s) for timestamp (Time valueset expansion happened) + * + *

    + * Definition: + * + *

    + */ + public void setTimestamp(InstantDt theValue) { + myTimestamp = theValue; + } + + /** + * Sets the value for timestamp (Time valueset expansion happened) + * + *

    + * Definition: + * + *

    + */ + public void setTimestamp( Date theDate, TemporalPrecisionEnum thePrecision) { + myTimestamp = new InstantDt(theDate, thePrecision); + } + + /** + * Sets the value for timestamp (Time valueset expansion happened) + * + *

    + * Definition: + * + *

    + */ + public void setTimestampWithMillisPrecision( Date theDate) { + myTimestamp = new InstantDt(theDate); + } + + + /** + * Gets the value(s) for contains (Codes in the value set). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public java.util.List getContains() { + if (myContains == null) { + myContains = new java.util.ArrayList(); + } + return myContains; + } + + /** + * Sets the value(s) for contains (Codes in the value set) + * + *

    + * Definition: + * + *

    + */ + public void setContains(java.util.List theValue) { + myContains = theValue; + } + + /** + * Adds and returns a new value for contains (Codes in the value set) + * + *

    + * Definition: + * + *

    + */ + public ExpansionContains addContains() { + ExpansionContains newType = new ExpansionContains(); + getContains().add(newType); + return newType; + } + + /** + * Gets the first repetition for contains (Codes in the value set), + * creating it if it does not already exist. + * + *

    + * Definition: + * + *

    + */ + public ExpansionContains getContainsFirstRep() { + if (getContains().isEmpty()) { + return addContains(); + } + return getContains().get(0); + } + + + } + + /** + * Block class for child element: ValueSet.expansion.contains (Codes in the value set) + * + *

    + * Definition: + * + *

    + */ + @Block(name="ValueSet.expansion.contains") + public static class ExpansionContains extends BaseElement implements IResourceBlock { + + @Child(name="system", type=UriDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="System value for the code", + formalDefinition="" + ) + private UriDt mySystem; + + @Child(name="code", type=CodeDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Code - if blank, this is not a choosable code", + formalDefinition="" + ) + private CodeDt myCode; + + @Child(name="display", type=StringDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="User display for the concept", + formalDefinition="" + ) + private StringDt myDisplay; + + @Child(name="contains", type=ExpansionContains.class, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Codes contained in this concept", + formalDefinition="" + ) + private java.util.List myContains; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myCode, myDisplay, myContains); + } + + @Override + public java.util.List getAllPopulatedChildElements() { + return getAllPopulatedChildElementsOfType(null); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myCode, myDisplay, myContains); + } + + /** + * Gets the value(s) for system (System value for the code). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public UriDt getSystem() { + if (mySystem == null) { + mySystem = new UriDt(); + } + return mySystem; + } + + /** + * Sets the value(s) for system (System value for the code) + * + *

    + * Definition: + * + *

    + */ + public void setSystem(UriDt theValue) { + mySystem = theValue; + } + + /** + * Sets the value for system (System value for the code) + * + *

    + * Definition: + * + *

    + */ + public void setSystem( String theUri) { + mySystem = new UriDt(theUri); + } + + + /** + * Gets the value(s) for code (Code - if blank, this is not a choosable code). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public CodeDt getCode() { + if (myCode == null) { + myCode = new CodeDt(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Code - if blank, this is not a choosable code) + * + *

    + * Definition: + * + *

    + */ + public void setCode(CodeDt theValue) { + myCode = theValue; + } + + /** + * Sets the value for code (Code - if blank, this is not a choosable code) + * + *

    + * Definition: + * + *

    + */ + public void setCode( String theCode) { + myCode = new CodeDt(theCode); + } + + + /** + * Gets the value(s) for display (User display for the concept). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public StringDt getDisplay() { + if (myDisplay == null) { + myDisplay = new StringDt(); + } + return myDisplay; + } + + /** + * Sets the value(s) for display (User display for the concept) + * + *

    + * Definition: + * + *

    + */ + public void setDisplay(StringDt theValue) { + myDisplay = theValue; + } + + /** + * Sets the value for display (User display for the concept) + * + *

    + * Definition: + * + *

    + */ + public void setDisplay( String theString) { + myDisplay = new StringDt(theString); + } + + + /** + * Gets the value(s) for contains (Codes contained in this concept). + * creating it if it does + * not exist. Will not return null. + * + *

    + * Definition: + * + *

    + */ + public java.util.List getContains() { + if (myContains == null) { + myContains = new java.util.ArrayList(); + } + return myContains; + } + + /** + * Sets the value(s) for contains (Codes contained in this concept) + * + *

    + * Definition: + * + *

    + */ + public void setContains(java.util.List theValue) { + myContains = theValue; + } + + /** + * Adds and returns a new value for contains (Codes contained in this concept) + * + *

    + * Definition: + * + *

    + */ + public ExpansionContains addContains() { + ExpansionContains newType = new ExpansionContains(); + getContains().add(newType); + return newType; + } + + /** + * Gets the first repetition for contains (Codes contained in this concept), + * creating it if it does not already exist. + * + *

    + * Definition: + * + *

    + */ + public ExpansionContains getContainsFirstRep() { + if (getContains().isEmpty()) { + return addContains(); + } + return getContains().get(0); + } + + + } + + + + + +} \ No newline at end of file diff --git a/hapi-tinder-test/pom.xml b/hapi-tinder-test/pom.xml index bce8a6b1403..cddbc22d049 100644 --- a/hapi-tinder-test/pom.xml +++ b/hapi-tinder-test/pom.xml @@ -1,5 +1,4 @@ - + 4.0.0 @@ -21,56 +20,24 @@ hapi-fhir-base 1.0-SNAPSHOT - + junit junit 4.11 test - + - - + + ca.uhn.hapi.fhir hapi-tinder-plugin @@ -122,21 +89,18 @@ true - + - + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + diff --git a/pom.xml b/pom.xml index f0f9dd51877..c83e6d22838 100644 --- a/pom.xml +++ b/pom.xml @@ -20,16 +20,24 @@ + + + Apache Software License 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + hapi-fhir-base hapi-tinder-plugin - hapi-tinder-test + hapi-tinder-test UTF-8 2.9.1 + 3.3 1.6.6 1.3 @@ -46,7 +54,37 @@ 1.6 + + org.apache.maven.plugins + maven-site-plugin + ${maven_site_plugin_version} + + + org.apache.maven.wagon + wagon-ssh + 1.0 + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.1 + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven_javadoc_plugin_version} + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + +