diff --git a/hapi-fhir-base/examples/pom.xml b/hapi-fhir-base/examples/pom.xml index 9e1e4f4348c..401048f53e4 100644 --- a/hapi-fhir-base/examples/pom.xml +++ b/hapi-fhir-base/examples/pom.xml @@ -19,6 +19,11 @@ hapi-fhir-base 0.7-SNAPSHOT + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.7-SNAPSHOT + javax.servlet javax.servlet-api diff --git a/hapi-fhir-base/examples/src/main/java/example/GenericClientExample.java b/hapi-fhir-base/examples/src/main/java/example/GenericClientExample.java index e0e7b2a6287..960f1c3d84f 100644 --- a/hapi-fhir-base/examples/src/main/java/example/GenericClientExample.java +++ b/hapi-fhir-base/examples/src/main/java/example/GenericClientExample.java @@ -6,6 +6,8 @@ import java.util.List; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.base.resource.BaseConformance; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.dstu.resource.Conformance; import ca.uhn.fhir.model.dstu.resource.Observation; import ca.uhn.fhir.model.dstu.resource.OperationOutcome; @@ -70,7 +72,7 @@ public class GenericClientExample { // START SNIPPET: conformance // Retrieve the server's conformance statement and print its // description - Conformance conf = client.conformance(); + BaseConformance conf = client.conformance(); System.out.println(conf.getDescription().getValue()); // END SNIPPET: conformance } @@ -78,7 +80,7 @@ public class GenericClientExample { // START SNIPPET: delete // Retrieve the server's conformance statement and print its // description - OperationOutcome outcome = client.delete().resourceById(new IdDt("Patient", "1234")).execute(); + BaseOperationOutcome outcome = client.delete().resourceById(new IdDt("Patient", "1234")).execute(); // outcome may be null if the server didn't return one if (outcome != null) { diff --git a/hapi-fhir-base/examples/src/main/java/example/RestfulPatientResourceProviderMore.java b/hapi-fhir-base/examples/src/main/java/example/RestfulPatientResourceProviderMore.java index ce1b6884786..f454c958fbf 100644 --- a/hapi-fhir-base/examples/src/main/java/example/RestfulPatientResourceProviderMore.java +++ b/hapi-fhir-base/examples/src/main/java/example/RestfulPatientResourceProviderMore.java @@ -19,6 +19,7 @@ import ca.uhn.fhir.model.api.Tag; import ca.uhn.fhir.model.api.TagList; import ca.uhn.fhir.model.api.TemporalPrecisionEnum; import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.base.composite.BaseCodingDt; import ca.uhn.fhir.rest.annotation.TagListParam; import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.dstu.resource.Conformance; @@ -430,7 +431,7 @@ public List searchByObservationNames( // The list here will contain 0..* codings, and any observations which match any of the // given codings should be returned - List wantedCodings = theCodings.getListAsCodings(); + List wantedCodings = theCodings.getListAsCodings(); List retVal = new ArrayList(); // ...populate... diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index 20bc7b9d663..848ca2a6839 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -178,138 +178,10 @@ javax.servlet javax.servlet-api - 3.1.0 + ${servlet_api_version} provided - - - junit - junit - ${junit_version} - test - - - xmlunit - xmlunit - 1.5 - test - - - org.eclipse.jetty - jetty-servlets - 9.1.1.v20140108 - test - - - org.eclipse.jetty - jetty-servlet - 9.1.1.v20140108 - test - - - org.eclipse.jetty - jetty-server - 9.1.1.v20140108 - test - - - org.eclipse.jetty - jetty-servlet - 9.1.1.v20140108 - test - - - org.eclipse.jetty - jetty-util - 9.1.1.v20140108 - test - - - org.eclipse.jetty - jetty-webapp - 9.1.1.v20140108 - test - - - org.eclipse.jetty - jetty-http - 9.1.1.v20140108 - test - - - - - - org.mockito - mockito-all - 1.9.5 - test - - - net.sf.json-lib - json-lib - 2.4 - jdk15 - test - - - commons-logging - commons-logging - - - - - net.sf.json-lib - json-lib - 2.4 - jdk15-sources - test - - - directory-naming - naming-java - 0.8 - test - - - commons-logging - commons-logging - - - - - org.hamcrest - hamcrest-all - ${hamcrest_version} - test - - - com.google.guava - guava - ${guava_version} - test - - 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 037b2713ef8..a3192a190b5 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 @@ -34,6 +34,7 @@ import ca.uhn.fhir.i18n.HapiLocalizer; import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IFhirVersion; import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; import ca.uhn.fhir.model.view.ViewGenerator; import ca.uhn.fhir.narrative.INarrativeGenerator; import ca.uhn.fhir.parser.DataFormatException; @@ -92,6 +93,13 @@ public class FhirContext { public FhirContext(Collection> theResourceTypes) { scanResourceTypes(theResourceTypes); + + if (FhirVersionEnum.DSTU1.isPresentOnClasspath()) { + myVersion = FhirVersionEnum.DSTU1.getVersionImplementation(); + } else { + throw new IllegalStateException("Could not find any HAPI-FHIR structure JARs on the classpath. Note that as of HAPI version 0.7, a separate FHIR strcture JAR must be added to your classpath or project pom.xml"); + } + } /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirVersionEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirVersionEnum.java new file mode 100644 index 00000000000..eeb9b1204f4 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirVersionEnum.java @@ -0,0 +1,50 @@ +package ca.uhn.fhir.context; + +import ca.uhn.fhir.model.api.IFhirVersion; +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.validation.FhirValidator; + +public enum FhirVersionEnum { + + DSTU1("ca.uhn.fhir.model.dstu.FhirDstu1"); + + private final String myVersionClass; + private volatile Boolean myPresentOnClasspath; + private volatile IFhirVersion myVersionImplementation; + + FhirVersionEnum(String theVersionClass) { + myVersionClass = theVersionClass; + } + + /** + * Returns true if the given version is present on the classpath + */ + public boolean isPresentOnClasspath() { + Boolean retVal = myPresentOnClasspath; + if (retVal==null) { + try { + Class.forName(myVersionClass); + retVal= true; + } catch (Exception e) { + retVal= false; + } + myPresentOnClasspath = retVal; + } + return retVal; + } + + public IFhirVersion getVersionImplementation() { + if (!isPresentOnClasspath()) { + throw new IllegalStateException("Version " + name() + " is not present on classpath"); + } + if (myVersionImplementation == null) { + try { + myVersionImplementation = (IFhirVersion) Class.forName(myVersionClass).newInstance(); + } catch (Exception e) { + throw new InternalErrorException("Failed to instantiate FHIR version " + name(), e); + } + } + return myVersionImplementation; + } + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseConformance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseConformance.java index 132f6b92e60..991d3203617 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseConformance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseConformance.java @@ -1,7 +1,15 @@ package ca.uhn.fhir.model.base.resource; +import ca.uhn.fhir.model.api.BaseResource; import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.primitive.StringDt; -public abstract class BaseConformance implements IResource { +//@ResourceDef(name="Conformance") +public abstract class BaseConformance extends BaseResource implements IResource { + + public abstract StringDt getDescription(); + + public abstract StringDt getPublisher(); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseOperationOutcome.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseOperationOutcome.java index 5e337341565..37e57c2b888 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseOperationOutcome.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseOperationOutcome.java @@ -28,6 +28,10 @@ public abstract class BaseOperationOutcome extends BaseResource implements IReso public abstract BaseCodingDt getType(); public abstract BaseIssue addLocation( String theString); + + public abstract BaseIssue setSeverity(IssueSeverityEnum theSeverity); + + public abstract BaseIssue setDetails(String theString); } 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 a8c59cd1a77..648fc2e5730 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 @@ -448,8 +448,9 @@ public abstract class BaseMethodBinding implements IClientResponseHandler if (!IResource.class.isAssignableFrom(theReturnType)) { return false; } - boolean retVal = Modifier.isAbstract(theReturnType.getModifiers()) == false; - return retVal; + return true; +// boolean retVal = Modifier.isAbstract(theReturnType.getModifiers()) == false; +// return retVal; } protected static IBundleProvider toResourceList(Object response) throws InternalErrorException { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseResourceReturningMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseResourceReturningMethodBinding.java index f52d191277f..6666c882483 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseResourceReturningMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseResourceReturningMethodBinding.java @@ -23,6 +23,7 @@ package ca.uhn.fhir.rest.method; import java.io.IOException; import java.io.Reader; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -101,12 +102,17 @@ abstract class BaseResourceReturningMethodBinding extends BaseMethodBinding) theReturnResourceType; ResourceDef resourceDefAnnotation = theReturnResourceType.getAnnotation(ResourceDef.class); if (resourceDefAnnotation == null) { - throw new ConfigurationException(theReturnResourceType.getCanonicalName() + " has no @" + ResourceDef.class.getSimpleName() + " annotation"); + if (Modifier.isAbstract(theReturnResourceType.getModifiers())) { +// If we're returning an abstract type, that's ok + }else { + throw new ConfigurationException(theReturnResourceType.getCanonicalName() + " has no @" + ResourceDef.class.getSimpleName() + " annotation"); + } + } else { + myResourceType = (Class) theReturnResourceType; + myResourceName = resourceDefAnnotation.name(); } - myResourceName = resourceDefAnnotation.name(); } } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ConformanceMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ConformanceMethodBinding.java index 07716810451..9ede1e02798 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ConformanceMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ConformanceMethodBinding.java @@ -40,8 +40,11 @@ public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding public ConformanceMethodBinding(Method theMethod, FhirContext theContext, Object theProvider) { super(theMethod.getReturnType(), theMethod, theContext, theProvider); - if (getMethodReturnType() != MethodReturnTypeEnum.RESOURCE || BaseConformance.class.isAssignableFrom(theMethod.getReturnType()) || Modifier.isAbstract(theMethod.getReturnType().getModifiers())) { - throw new ConfigurationException("Conformance resource provider method '" + theMethod.getName() + "' should return a Conformance resource class"); +// if (Modifier.isAbstract(theMethod.getReturnType().getModifiers())) { +// throw new ConfigurationException("Conformance resource provider method '" + theMethod.getName() + "' must not be abstract"); +// } + if (getMethodReturnType() != MethodReturnTypeEnum.RESOURCE || !BaseConformance.class.isAssignableFrom(theMethod.getReturnType())) { + throw new ConfigurationException("Conformance resource provider method '" + theMethod.getName() + "' should return a Conformance resource class, returns: " + theMethod.getReturnType()); } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/InternalCodingDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/InternalCodingDt.java index 29ba23141af..f8cac8448c2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/InternalCodingDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/InternalCodingDt.java @@ -41,7 +41,6 @@ import java.util.List; 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.base.composite.BaseCodingDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; @@ -58,7 +57,7 @@ public class InternalCodingDt * Constructor */ public InternalCodingDt() { - // nothing + super(); } /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java index 8fd26141c6e..3915309e094 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java @@ -3,6 +3,7 @@ package ca.uhn.fhir.rest.param; import java.util.ArrayList; import java.util.List; +import ca.uhn.fhir.model.base.composite.BaseCodingDt; import ca.uhn.fhir.model.base.composite.BaseIdentifierDt; /* @@ -33,8 +34,8 @@ public class TokenOrListParam extends BaseOrListParam { return new TokenParam(); } - public List getListAsCodings() { - ArrayList retVal = new ArrayList(); + public List getListAsCodings() { + ArrayList retVal = new ArrayList(); for (TokenParam next : getValuesAsQueryTokens()) { InternalCodingDt nextCoding = next.getValueAsCoding(); if (!nextCoding.isEmpty()) { @@ -48,7 +49,7 @@ public class TokenOrListParam extends BaseOrListParam { * Convenience method which adds a token to this OR list * using the system and code from a coding */ - public void add(InternalCodingDt theCodingDt) { + public void add(BaseCodingDt theCodingDt) { add(new TokenParam(theCodingDt)); } diff --git a/hapi-fhir-base/testmindeps/pom.xml b/hapi-fhir-base/testmindeps/pom.xml index 84aa1061ef6..d8a262b122a 100644 --- a/hapi-fhir-base/testmindeps/pom.xml +++ b/hapi-fhir-base/testmindeps/pom.xml @@ -42,7 +42,11 @@ hapi-fhir-base 0.7-SNAPSHOT - + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.7-SNAPSHOT + diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml index e7482edb462..fc41c1b63c6 100644 --- a/hapi-fhir-jpaserver-base/pom.xml +++ b/hapi-fhir-jpaserver-base/pom.xml @@ -52,7 +52,12 @@ - + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.7-SNAPSHOT + + org.slf4j jcl-over-slf4j diff --git a/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component index ff207aac0dd..f66ee9cee1c 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component +++ b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component @@ -12,6 +12,9 @@ uses + + uses + consumes diff --git a/hapi-fhir-oauth2/pom.xml b/hapi-fhir-oauth2/pom.xml index 0b25822e359..34bcfd4a44d 100644 --- a/hapi-fhir-oauth2/pom.xml +++ b/hapi-fhir-oauth2/pom.xml @@ -19,7 +19,13 @@ hapi-fhir-base 0.7-SNAPSHOT - + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.7-SNAPSHOT + test + + org.mitre @@ -78,12 +84,6 @@ ${jetty_version} test - - org.eclipse.jetty - jetty-servlet - ${jetty_version} - test - org.eclipse.jetty jetty-util diff --git a/hapi-fhir-structures-dstu/.classpath b/hapi-fhir-structures-dstu/.classpath index 81f7606d2eb..11236ee4d63 100644 --- a/hapi-fhir-structures-dstu/.classpath +++ b/hapi-fhir-structures-dstu/.classpath @@ -1,13 +1,20 @@ - - + + + + + + + + + @@ -16,12 +23,7 @@ - - - - - - + diff --git a/hapi-fhir-structures-dstu/.project b/hapi-fhir-structures-dstu/.project index 22a9a48b013..15d970207c9 100644 --- a/hapi-fhir-structures-dstu/.project +++ b/hapi-fhir-structures-dstu/.project @@ -5,11 +5,21 @@ + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.jdt.core.javabuilder + + org.eclipse.wst.validation.validationbuilder + + + org.eclipse.m2e.core.maven2Builder @@ -17,7 +27,10 @@ + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.m2e.core.maven2Nature org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature diff --git a/hapi-fhir-structures-dstu/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-structures-dstu/.settings/org.eclipse.core.resources.prefs index 99f26c0203a..cdfe4f1b669 100644 --- a/hapi-fhir-structures-dstu/.settings/org.eclipse.core.resources.prefs +++ b/hapi-fhir-structures-dstu/.settings/org.eclipse.core.resources.prefs @@ -1,2 +1,5 @@ eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 encoding/=UTF-8 diff --git a/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.common.component b/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000000..d17f93ff282 --- /dev/null +++ b/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.common.component @@ -0,0 +1,7 @@ + + + + + + + diff --git a/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.common.project.facet.core.xml b/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000000..c78d9323fe1 --- /dev/null +++ b/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.validation.prefs b/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 00000000000..04cad8cb752 --- /dev/null +++ b/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06target +eclipse.preferences.version=1 diff --git a/hapi-fhir-structures-dstu/pom.xml b/hapi-fhir-structures-dstu/pom.xml index dda39a0f878..8f5b9ea0c72 100644 --- a/hapi-fhir-structures-dstu/pom.xml +++ b/hapi-fhir-structures-dstu/pom.xml @@ -20,6 +20,170 @@ hapi-fhir-base 0.7-SNAPSHOT + + + javax.servlet + javax.servlet-api + ${servlet_api_version} + provided + + + + + junit + junit + ${junit_version} + test + + + xmlunit + xmlunit + 1.5 + test + + + org.eclipse.jetty + jetty-servlets + ${jetty_version} + test + + + org.eclipse.jetty + jetty-servlet + ${jetty_version} + test + + + org.eclipse.jetty + jetty-server + ${jetty_version} + test + + + org.eclipse.jetty + jetty-servlet + ${jetty_version} + test + + + org.eclipse.jetty + jetty-util + ${jetty_version} + test + + + org.eclipse.jetty + jetty-webapp + ${jetty_version} + test + + + org.eclipse.jetty + jetty-http + ${jetty_version} + test + + + ch.qos.logback + logback-classic + ${logback_version} + true + test + + + org.ebaysf.web + cors-filter + ${ebay_cors_filter_version} + test + + + + + com.phloc + phloc-schematron + ${phloc_schematron_version} + test + + + com.phloc + phloc-commons + ${phloc_commons_version} + test + + + + + + org.mockito + mockito-all + 1.9.5 + test + + + net.sf.json-lib + json-lib + 2.4 + jdk15 + test + + + commons-logging + commons-logging + + + + + net.sf.json-lib + json-lib + 2.4 + jdk15-sources + test + + + directory-naming + naming-java + 0.8 + test + + + commons-logging + commons-logging + + + + + org.hamcrest + hamcrest-all + ${hamcrest_version} + test + + + com.google.guava + guava + ${guava_version} + test + + + diff --git a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java index 8d73999e5e8..d9d3c1d2d5d 100644 --- a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java +++ b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java @@ -44,8 +44,10 @@ import ca.uhn.fhir.model.dstu.resource.Profile.StructureElementDefinitionType; import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.RestfulServer; import ca.uhn.fhir.rest.server.provider.ServerConformanceProvider; +import ca.uhn.fhir.rest.server.provider.ServerProfileProvider; public class FhirDstu1 implements IFhirVersion { @@ -303,4 +305,9 @@ public class FhirDstu1 implements IFhirVersion { } } + @Override + public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) { + return new ServerProfileProvider(theRestfulServer.getFhirContext()); + } + } diff --git a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerProfileProvider.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerProfileProvider.java index c44e7d96d87..a9e791a5845 100644 --- a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerProfileProvider.java +++ b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerProfileProvider.java @@ -39,8 +39,8 @@ public class ServerProfileProvider implements IResourceProvider { private FhirContext myContext; - public ServerProfileProvider(FhirContext theContext) { - myContext = theContext; + public ServerProfileProvider(FhirContext theCtx) { + myContext = theCtx; } @Override diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/DummyPatientWithExtensions.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/DummyPatientWithExtensions.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/context/DummyPatientWithExtensions.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/DummyPatientWithExtensions.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ExtensionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/ExtensionTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ExtensionTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/ExtensionTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/FhirContextTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/FhirContextTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/context/FhirContextTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/FhirContextTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ModelExtensionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/ModelExtensionTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ModelExtensionTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/ModelExtensionTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java similarity index 93% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java index 00018828684..4e22f057e1b 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java @@ -14,7 +14,7 @@ public class ModelScannerTest { /** This failed at one point */ @Test public void testCarePlan() throws DataFormatException { - new ModelScanner(CarePlan.class); + new ModelScanner(new FhirContext(), CarePlan.class); } @Test @@ -34,7 +34,7 @@ public class ModelScannerTest { @Test public void testScanExtensionTypes() throws DataFormatException { - ModelScanner scanner = new ModelScanner(ResourceWithExtensionsA.class); + ModelScanner scanner = new ModelScanner(new FhirContext(),ResourceWithExtensionsA.class); RuntimeResourceDefinition def = (RuntimeResourceDefinition) scanner.getClassToElementDefinitions().get(ResourceWithExtensionsA.class); assertEquals(RuntimeChildCompositeDatatypeDefinition.class, def.getChildByNameOrThrowDataFormatException("identifier").getClass()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/NameChanges.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/NameChanges.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/context/NameChanges.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/NameChanges.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ResourceWithExtensionsA.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/ResourceWithExtensionsA.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ResourceWithExtensionsA.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/ResourceWithExtensionsA.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/RuntimeResourceDefinitionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/RuntimeResourceDefinitionTest.java similarity index 96% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/context/RuntimeResourceDefinitionTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/RuntimeResourceDefinitionTest.java index cac7df5fcca..597c750a5b3 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/RuntimeResourceDefinitionTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/context/RuntimeResourceDefinitionTest.java @@ -22,7 +22,7 @@ public class RuntimeResourceDefinitionTest { FhirContext ctx = new FhirContext(Patient.class, Profile.class); RuntimeResourceDefinition def = ctx.getResourceDefinition(Patient.class); - Profile profile = def.toProfile(); + Profile profile = (Profile) def.toProfile(); ourLog.info(ctx.newXmlParser().encodeResourceToString(profile)); @@ -41,7 +41,7 @@ public class RuntimeResourceDefinitionTest { FhirContext ctx = new FhirContext(ValueSet.class, Profile.class); RuntimeResourceDefinition def = ctx.getResourceDefinition(ValueSet.class); - Profile profile = def.toProfile(); + Profile profile = (Profile) def.toProfile(); String encoded = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(profile); ourLog.info(encoded); @@ -56,7 +56,7 @@ public class RuntimeResourceDefinitionTest { FhirContext ctx = new FhirContext(ResourceWithExtensionsA.class, Profile.class); RuntimeResourceDefinition def = ctx.getResourceDefinition(ResourceWithExtensionsA.class); - Profile profile = def.toProfile(); + Profile profile = (Profile) def.toProfile(); ourLog.info(ctx.newXmlParser().encodeResourceToString(profile)); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/api/TagListTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/api/TagListTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/api/TagListTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/api/TagListTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/Base64BinaryDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/Base64BinaryDtTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/Base64BinaryDtTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/Base64BinaryDtTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/BaseDateTimeDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/BaseDateTimeDtTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/BaseDateTimeDtTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/BaseDateTimeDtTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/CodingDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/CodingDtTest.java similarity index 87% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/CodingDtTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/CodingDtTest.java index e7e4c510710..32639296ac4 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/CodingDtTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/CodingDtTest.java @@ -10,7 +10,7 @@ public class CodingDtTest { @Test public void testTokenNoSystem() { - InternalCodingDt dt = new InternalCodingDt(); + CodingDt dt = new CodingDt(); dt.setValueAsQueryToken(null, "c"); assertEquals(null, dt.getSystem().getValueAsString()); @@ -20,7 +20,7 @@ public class CodingDtTest { @Test public void testTokenWithPipeInValue() { - InternalCodingDt dt = new InternalCodingDt(); + CodingDt dt = new CodingDt(); dt.setValueAsQueryToken(null, "a|b|c"); assertEquals("a", dt.getSystem().getValueAsString()); @@ -30,7 +30,7 @@ public class CodingDtTest { @Test public void testTokenWithPipeInValueAndNoSystem() { - InternalCodingDt dt = new InternalCodingDt(); + CodingDt dt = new CodingDt(); dt.setValueAsQueryToken(null, "|b\\|c"); assertEquals("", dt.getSystem().getValueAsString()); @@ -44,7 +44,7 @@ public class CodingDtTest { */ @Test public void testTokenWithPipeInValueAndNoSystemAndBeLenient() { - InternalCodingDt dt = new InternalCodingDt(); + CodingDt dt = new CodingDt(); dt.setValueAsQueryToken(null, "|b|c"); assertEquals("", dt.getSystem().getValueAsString()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/DecimalDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/DecimalDtTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/DecimalDtTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/DecimalDtTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/IdDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/IdDtTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/IdDtTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/IdDtTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/IdentifierDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/IdentifierDtTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/IdentifierDtTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/IdentifierDtTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/StringDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/StringDtTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/StringDtTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/StringDtTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/UriDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/UriDtTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/UriDtTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/UriDtTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/XhtmlDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/XhtmlDtTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/XhtmlDtTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/primitive/XhtmlDtTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/view/ExtPatient.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/view/ExtPatient.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/view/ExtPatient.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/view/ExtPatient.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/view/ViewGeneratorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/view/ViewGeneratorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/model/view/ViewGeneratorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/view/ViewGeneratorTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/BaseThymeleafNarrativeGeneratorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/narrative/BaseThymeleafNarrativeGeneratorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/BaseThymeleafNarrativeGeneratorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/narrative/BaseThymeleafNarrativeGeneratorTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/CustomThymeleafNarrativeGeneratorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/narrative/CustomThymeleafNarrativeGeneratorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/CustomThymeleafNarrativeGeneratorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/narrative/CustomThymeleafNarrativeGeneratorTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java similarity index 98% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java index 5cf70a08cc6..0dc2d2a55a8 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.narrative; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; import java.io.InputStreamReader; import java.util.Date; @@ -169,8 +170,8 @@ public class DefaultThymeleafNarrativeGeneratorTest { { Observation obs = new Observation(); obs.getName().addCoding().setCode("1938HB").setDisplay("Hemoglobin"); - obs.setValue(new InternalQuantityDt(null, 2.223, "mg/L")); - obs.addReferenceRange().setLow(new InternalQuantityDt(2.20)).setHigh(new InternalQuantityDt(2.99)); + obs.setValue(new QuantityDt(null, 2.223, "mg/L")); + obs.addReferenceRange().setLow(new QuantityDt(2.20)).setHigh(new QuantityDt(2.99)); obs.setStatus(ObservationStatusEnum.FINAL); obs.setComments("This is a result comment"); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/ContainedResourceEncodingTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/ContainedResourceEncodingTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/ContainedResourceEncodingTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/ContainedResourceEncodingTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/MyObservationWithExtensions.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/MyObservationWithExtensions.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/MyObservationWithExtensions.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/MyObservationWithExtensions.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/MyOrganization.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/MyOrganization.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/MyOrganization.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/MyOrganization.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/MyPatient.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/MyPatient.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/MyPatient.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/MyPatient.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/BasicAuthInterceptorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/BasicAuthInterceptorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/BasicAuthInterceptorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/BasicAuthInterceptorTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/BearerTokenAuthInterceptorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/BearerTokenAuthInterceptorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/BearerTokenAuthInterceptorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/BearerTokenAuthInterceptorTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/BinaryClientTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/BinaryClientTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/BinaryClientTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/BinaryClientTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientIntegrationTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientIntegrationTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientIntegrationTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientIntegrationTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java similarity index 99% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java index 164ddbd2e26..199ef7e894a 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java @@ -1,8 +1,12 @@ package ca.uhn.fhir.rest.client; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import java.io.InputStream; import java.io.StringReader; @@ -41,6 +45,7 @@ import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.api.Tag; import ca.uhn.fhir.model.api.TagList; import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.base.resource.BaseConformance; import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.dstu.resource.Conformance; import ca.uhn.fhir.model.dstu.resource.Observation; @@ -275,7 +280,7 @@ public class ClientTest { when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); - Conformance response = client.getServerConformanceStatement(); + BaseConformance response = client.getServerConformanceStatement(); assertEquals("http://foo/metadata", capt.getValue().getURI().toString()); assertEquals("Health Intersections", response.getPublisher().getValue()); @@ -822,8 +827,8 @@ public class ClientTest { ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); TokenOrListParam identifiers = new TokenOrListParam(); - identifiers.add(new InternalCodingDt("foo", "bar")); - identifiers.add(new InternalCodingDt("baz", "boz")); + identifiers.add(new CodingDt("foo", "bar")); + identifiers.add(new CodingDt("baz", "boz")); client.getPatientMultipleIdentifiers(identifiers); assertEquals("http://foo/Patient?ids=foo%7Cbar%2Cbaz%7Cboz", capt.getValue().getURI().toString()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ExceptionHandlingTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ExceptionHandlingTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ExceptionHandlingTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ExceptionHandlingTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java similarity index 99% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java index 2f5522bdbb7..e93b656375d 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/GenericClientTest.java @@ -243,14 +243,14 @@ public class GenericClientTest { IGenericClient client = myCtx.newRestfulGenericClient("http://example.com/fhir"); - OperationOutcome outcome = client.delete().resourceById("Patient", "123").execute(); + OperationOutcome outcome = (OperationOutcome) client.delete().resourceById("Patient", "123").execute(); assertEquals("http://example.com/fhir/Patient/123", capt.getValue().getURI().toString()); assertEquals("DELETE", capt.getValue().getMethod()); assertEquals("testDelete01", outcome.getIssueFirstRep().getLocationFirstRep().getValue()); when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader("LKJHLKJGLKJKLL"), Charset.forName("UTF-8"))); - outcome = client.delete().resourceById(new IdDt("Location", "123", "456")).prettyPrint().encodedJson().execute(); + outcome = (OperationOutcome) client.delete().resourceById(new IdDt("Location", "123", "456")).prettyPrint().encodedJson().execute(); assertEquals("http://example.com/fhir/Location/123?_format=json&_pretty=true", capt.getAllValues().get(1).getURI().toString()); assertEquals("DELETE", capt.getValue().getMethod()); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ITestClient.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ITestClient.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ITestClient.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ITestClient.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/IncludedResourceStitchingClientTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/IncludedResourceStitchingClientTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/IncludedResourceStitchingClientTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/IncludedResourceStitchingClientTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/LoggingInterceptorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/LoggingInterceptorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/LoggingInterceptorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/LoggingInterceptorTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ReferenceClientTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ReferenceClientTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ReferenceClientTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ReferenceClientTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/SearchTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/SearchTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/SearchTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/SearchTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/SortClientTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/SortClientTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/SortClientTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/SortClientTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/StringClientTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/StringClientTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/StringClientTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/StringClientTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/TagsClientTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/TagsClientTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/TagsClientTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/TagsClientTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/TransactionClientTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/TransactionClientTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/TransactionClientTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/TransactionClientTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBindingTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBindingTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBindingTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBindingTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/method/QualifiedParamListTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/method/QualifiedParamListTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/method/QualifiedParamListTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/method/QualifiedParamListTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/param/DateRangeParamTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/DateRangeParamTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/param/DateRangeParamTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/DateRangeParamTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/param/QuantityParamTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/QuantityParamTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/param/QuantityParamTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/QuantityParamTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/param/ReferenceParamTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/ReferenceParamTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/param/ReferenceParamTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/ReferenceParamTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/BinaryTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/BinaryTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/BinaryTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/BinaryTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CompositeParameterTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompositeParameterTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CompositeParameterTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompositeParameterTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CreateTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CreateTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CreateTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CreateTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CustomTypeTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CustomTypeTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CustomTypeTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CustomTypeTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/DynamicSearchTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DynamicSearchTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/DynamicSearchTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DynamicSearchTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ExceptionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ExceptionTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ExceptionTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ExceptionTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/HistoryTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/HistoryTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/HistoryTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/HistoryTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncomingRequestAddressStrategyTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/IncomingRequestAddressStrategyTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncomingRequestAddressStrategyTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/IncomingRequestAddressStrategyTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/InterceptorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/InterceptorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/InterceptorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/InterceptorTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/MethodPriorityTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/MethodPriorityTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/MethodPriorityTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/MethodPriorityTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ReadTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReadTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ReadTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReadTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java similarity index 98% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java index 40983beccb0..29831929fb2 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResfulServerMethodTest.java @@ -1,7 +1,10 @@ package ca.uhn.fhir.rest.server; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; import java.util.ArrayList; import java.util.Arrays; @@ -40,7 +43,7 @@ import ca.uhn.fhir.model.api.BundleEntry; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.Include; import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; -import ca.uhn.fhir.model.dstu.composite.CodingDt; +import ca.uhn.fhir.model.base.composite.BaseCodingDt; import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.QuantityDt; @@ -66,10 +69,9 @@ import ca.uhn.fhir.rest.annotation.ResourceParam; import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.annotation.Validate; import ca.uhn.fhir.rest.api.MethodOutcome; -import ca.uhn.fhir.rest.param.CodingListParam; import ca.uhn.fhir.rest.param.DateParam; import ca.uhn.fhir.rest.param.DateRangeParam; -import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.rest.param.TokenOrListParam; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import ca.uhn.fhir.rest.server.provider.ServerProfileProvider; @@ -1096,7 +1098,7 @@ public class ResfulServerMethodTest { } public List findDiagnosticReportsByPatient(@RequiredParam(name = "Patient.identifier") IdentifierDt thePatientId, - @RequiredParam(name = DiagnosticReport.SP_NAME) CodingListParam theNames, @OptionalParam(name = DiagnosticReport.SP_DATE) DateRangeParam theDateRange) throws Exception { + @RequiredParam(name = DiagnosticReport.SP_NAME) TokenOrListParam theNames, @OptionalParam(name = DiagnosticReport.SP_DATE) DateRangeParam theDateRange) throws Exception { return Collections.emptyList(); } @@ -1198,11 +1200,11 @@ public class ResfulServerMethodTest { } @Search() - public List getPatientMultipleIdentifiers(@RequiredParam(name = "ids") CodingListParam theIdentifiers) { + public List getPatientMultipleIdentifiers(@RequiredParam(name = "ids") TokenOrListParam theIdentifiers) { List retVal = new ArrayList(); Patient next = getIdToPatient().get("1"); - for (InternalCodingDt nextId : theIdentifiers.getCodings()) { + for (BaseCodingDt nextId : theIdentifiers.getListAsCodings()) { next.getIdentifier().add(new IdentifierDt(nextId.getSystem().getValueAsString(), nextId.getCode().getValue())); } @@ -1227,7 +1229,7 @@ public class ResfulServerMethodTest { } @Search() - public Patient getPatientQuantityParam(@RequiredParam(name = "quantityParam") InternalQuantityDt theParam) { + public Patient getPatientQuantityParam(@RequiredParam(name = "quantityParam") QuantityDt theParam) { Patient next = getIdToPatient().get("1"); next.addName().addFamily(theParam.getComparator().getValueAsString()).addFamily(theParam.getValue().getValueAsString()).addFamily(theParam.getSystem().getValueAsString()) .addFamily(theParam.getUnits().getValueAsString()); @@ -1334,7 +1336,9 @@ public class ResfulServerMethodTest { return methodOutcome; } if (thePatient.getNameFirstRep().getFamilyFirstRep().getValueNotNull().equals("BAR")) { - throw new UnprocessableEntityException("it failed"); + OperationOutcome oo = new OperationOutcome(); + oo.addIssue().setDetails("it failed"); + throw new UnprocessableEntityException(oo); } return new MethodOutcome(); } diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerSelfReferenceTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResfulServerSelfReferenceTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResfulServerSelfReferenceTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResfulServerSelfReferenceTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResourceMethodTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResourceMethodTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResourceMethodTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResourceMethodTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResourceProviderWithNoMethodsTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResourceProviderWithNoMethodsTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ResourceProviderWithNoMethodsTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResourceProviderWithNoMethodsTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/SearchTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/SearchTest.java similarity index 98% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/SearchTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/SearchTest.java index 930b044dbda..b20cc654e85 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/SearchTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/SearchTest.java @@ -29,6 +29,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; +import ca.uhn.fhir.model.base.composite.BaseCodingDt; import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.dstu.resource.Observation; import ca.uhn.fhir.model.dstu.resource.Patient; @@ -167,6 +168,7 @@ public class SearchTest { HttpResponse status = ourClient.execute(httpGet); String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = ourCtx.newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.getEntries().size()); @@ -250,8 +252,8 @@ public class SearchTest { o.setId("1"); o.getSubject().setReference(theSubject.getResourceType() + "/" + theSubject.getIdPart()); - for (InternalCodingDt next : theName.getListAsCodings()) { - o.getName().getCoding().add(next); + for (BaseCodingDt next : theName.getListAsCodings()) { + o.getName().getCoding().add(new CodingDt(next)); } return o; diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerBaseTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerBaseTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerBaseTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerBaseTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerConformanceProviderTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerConformanceProviderTest.java similarity index 95% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerConformanceProviderTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerConformanceProviderTest.java index a0bc1cc6034..582e1d805a9 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerConformanceProviderTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerConformanceProviderTest.java @@ -1,7 +1,9 @@ package ca.uhn.fhir.rest.server; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; import java.util.Collection; import java.util.List; @@ -27,8 +29,8 @@ import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.method.BaseMethodBinding; import ca.uhn.fhir.rest.method.SearchMethodBinding; import ca.uhn.fhir.rest.method.SearchParameter; -import ca.uhn.fhir.rest.param.CodingListParam; import ca.uhn.fhir.rest.param.DateRangeParam; +import ca.uhn.fhir.rest.param.TokenOrListParam; import ca.uhn.fhir.rest.server.provider.ServerConformanceProvider; public class ServerConformanceProviderTest { @@ -187,7 +189,7 @@ public class ServerConformanceProviderTest { @Search public List findDiagnosticReportsByPatient ( @RequiredParam(name=DiagnosticReport.SP_SUBJECT + '.' + Patient.SP_IDENTIFIER) IdentifierDt thePatientId, - @OptionalParam(name=DiagnosticReport.SP_NAME) CodingListParam theNames, + @OptionalParam(name=DiagnosticReport.SP_NAME) TokenOrListParam theNames, @OptionalParam(name=DiagnosticReport.SP_DATE) DateRangeParam theDateRange, @IncludeParam(allow= {"DiagnosticReport.result"}) Set theIncludes ) throws Exception { diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerExtraParametersTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerExtraParametersTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerExtraParametersTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerExtraParametersTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java similarity index 90% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java index 75cdfb8b5fb..06bc982109d 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java @@ -24,7 +24,7 @@ public class ServerInvalidDefinitionTest { @Test public void testNonInstantiableTypeForResourceProvider() { RestfulServer srv = new RestfulServer(); - srv.setResourceProviders(new NonInstantiableTypeForResourceProvider()); + srv.setPlainProviders(new NonInstantiableTypeForPlainProvider()); try { srv.init(); @@ -107,7 +107,6 @@ public class ServerInvalidDefinitionTest { return Patient.class; } - @SuppressWarnings("unused") @Read public Patient read(@IdParam IdDt theId) { return null; @@ -123,7 +122,6 @@ public class ServerInvalidDefinitionTest { return Patient.class; } - @SuppressWarnings("unused") @Read public Patient read(@IdParam IdDt theId, @RequiredParam(name="aaa") StringParam theParam) { return null; @@ -139,7 +137,6 @@ public class ServerInvalidDefinitionTest { return Patient.class; } - @SuppressWarnings("unused") @Search public List read(@IdParam IdDt theId, @RequiredParam(name="aaa") StringParam theParam) { return null; @@ -147,15 +144,9 @@ public class ServerInvalidDefinitionTest { } - public static class NonInstantiableTypeForResourceProvider implements IResourceProvider + public static class NonInstantiableTypeForPlainProvider { - @Override - public Class getResourceType() { - return BaseResource.class; - } - - @SuppressWarnings("unused") @Read public BaseResource read(@IdParam IdDt theId) { return null; @@ -172,7 +163,6 @@ public class ServerInvalidDefinitionTest { return Patient.class; } - @SuppressWarnings("unused") @Search public List search(@RequiredParam(name="_pretty") StringParam theParam) { return null; @@ -189,7 +179,6 @@ public class ServerInvalidDefinitionTest { return Patient.class; } - @SuppressWarnings("unused") @Read public Patient read(@IdParam IdDt theId) { return null; diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/SortTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/SortTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/SortTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/SortTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/StringParameterTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/StringParameterTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/StringParameterTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/StringParameterTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TagsServerTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/TagsServerTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TagsServerTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/TagsServerTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TransactionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/TransactionTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TransactionTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/TransactionTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TransactionWithBundleParamTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/TransactionWithBundleParamTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/TransactionWithBundleParamTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/TransactionWithBundleParamTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/UpdateTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/UpdateTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/UpdateTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/UpdateTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/exceptions/ExceptionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/exceptions/ExceptionTest.java similarity index 83% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/exceptions/ExceptionTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/exceptions/ExceptionTest.java index 3f5d16f0f5f..8786d945df2 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/exceptions/ExceptionTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/exceptions/ExceptionTest.java @@ -1,10 +1,12 @@ package ca.uhn.fhir.rest.server.exceptions; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import org.junit.Test; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import com.google.common.collect.ImmutableSet; import com.google.common.reflect.ClassPath; @@ -41,7 +43,7 @@ public class ExceptionTest { } try { - next.getConstructor(String.class, OperationOutcome.class); + next.getConstructor(String.class, BaseOperationOutcome.class); } catch (NoSuchMethodException e) { fail(classInfo.getName() + " has no constructor with params: (String, OperationOutcome)"); } diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptorTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/test/FhirTerserTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/test/FhirTerserTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/test/FhirTerserTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/test/FhirTerserTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/testmodel/IdentifierDt.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/testmodel/IdentifierDt.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/testmodel/IdentifierDt.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/testmodel/IdentifierDt.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/testmodel/Patient.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/testmodel/Patient.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/testmodel/Patient.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/testmodel/Patient.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/FhirTerserTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/util/FhirTerserTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/util/FhirTerserTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/util/FhirTerserTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/XmlUtilTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/util/XmlUtilTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/util/XmlUtilTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/util/XmlUtilTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/validation/ValidatorInstantiatorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ValidatorInstantiatorTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/validation/ValidatorInstantiatorTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ValidatorInstantiatorTest.java diff --git a/hapi-fhir-base/src/test/resources/alert.profile.json b/hapi-fhir-structures-dstu/src/test/resources/alert.profile.json similarity index 100% rename from hapi-fhir-base/src/test/resources/alert.profile.json rename to hapi-fhir-structures-dstu/src/test/resources/alert.profile.json diff --git a/hapi-fhir-base/src/test/resources/atom-document-large.json b/hapi-fhir-structures-dstu/src/test/resources/atom-document-large.json similarity index 100% rename from hapi-fhir-base/src/test/resources/atom-document-large.json rename to hapi-fhir-structures-dstu/src/test/resources/atom-document-large.json diff --git a/hapi-fhir-base/src/test/resources/atom-document-large.xml b/hapi-fhir-structures-dstu/src/test/resources/atom-document-large.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/atom-document-large.xml rename to hapi-fhir-structures-dstu/src/test/resources/atom-document-large.xml diff --git a/hapi-fhir-base/src/test/resources/bundle.json b/hapi-fhir-structures-dstu/src/test/resources/bundle.json similarity index 100% rename from hapi-fhir-base/src/test/resources/bundle.json rename to hapi-fhir-structures-dstu/src/test/resources/bundle.json diff --git a/hapi-fhir-base/src/test/resources/careplan-big-example.xml b/hapi-fhir-structures-dstu/src/test/resources/careplan-big-example.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/careplan-big-example.xml rename to hapi-fhir-structures-dstu/src/test/resources/careplan-big-example.xml diff --git a/hapi-fhir-base/src/test/resources/contained-diagnosticreport.json b/hapi-fhir-structures-dstu/src/test/resources/contained-diagnosticreport.json similarity index 100% rename from hapi-fhir-base/src/test/resources/contained-diagnosticreport.json rename to hapi-fhir-structures-dstu/src/test/resources/contained-diagnosticreport.json diff --git a/hapi-fhir-base/src/test/resources/contained-diagnosticreport.xml b/hapi-fhir-structures-dstu/src/test/resources/contained-diagnosticreport.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/contained-diagnosticreport.xml rename to hapi-fhir-structures-dstu/src/test/resources/contained-diagnosticreport.xml diff --git a/hapi-fhir-base/src/test/resources/diagnostic-report.json b/hapi-fhir-structures-dstu/src/test/resources/diagnostic-report.json similarity index 100% rename from hapi-fhir-base/src/test/resources/diagnostic-report.json rename to hapi-fhir-structures-dstu/src/test/resources/diagnostic-report.json diff --git a/hapi-fhir-base/src/test/resources/example-metadata.xml b/hapi-fhir-structures-dstu/src/test/resources/example-metadata.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/example-metadata.xml rename to hapi-fhir-structures-dstu/src/test/resources/example-metadata.xml diff --git a/hapi-fhir-base/src/test/resources/example-patient-general.json b/hapi-fhir-structures-dstu/src/test/resources/example-patient-general.json similarity index 100% rename from hapi-fhir-base/src/test/resources/example-patient-general.json rename to hapi-fhir-structures-dstu/src/test/resources/example-patient-general.json diff --git a/hapi-fhir-base/src/test/resources/example-patient-general.xml b/hapi-fhir-structures-dstu/src/test/resources/example-patient-general.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/example-patient-general.xml rename to hapi-fhir-structures-dstu/src/test/resources/example-patient-general.xml diff --git a/hapi-fhir-base/src/test/resources/example-uhn-conformance.xml b/hapi-fhir-structures-dstu/src/test/resources/example-uhn-conformance.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/example-uhn-conformance.xml rename to hapi-fhir-structures-dstu/src/test/resources/example-uhn-conformance.xml diff --git a/hapi-fhir-base/src/test/resources/example-uhn-profile.xml b/hapi-fhir-structures-dstu/src/test/resources/example-uhn-profile.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/example-uhn-profile.xml rename to hapi-fhir-structures-dstu/src/test/resources/example-uhn-profile.xml diff --git a/hapi-fhir-base/src/test/resources/feed-with-list.xml b/hapi-fhir-structures-dstu/src/test/resources/feed-with-list.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/feed-with-list.xml rename to hapi-fhir-structures-dstu/src/test/resources/feed-with-list.xml diff --git a/hapi-fhir-base/src/test/resources/fhir-single.xsd b/hapi-fhir-structures-dstu/src/test/resources/fhir-single.xsd similarity index 100% rename from hapi-fhir-base/src/test/resources/fhir-single.xsd rename to hapi-fhir-structures-dstu/src/test/resources/fhir-single.xsd diff --git a/hapi-fhir-base/src/test/resources/furore-conformance.json b/hapi-fhir-structures-dstu/src/test/resources/furore-conformance.json similarity index 100% rename from hapi-fhir-base/src/test/resources/furore-conformance.json rename to hapi-fhir-structures-dstu/src/test/resources/furore-conformance.json diff --git a/hapi-fhir-base/src/test/resources/furore-conformance.xml b/hapi-fhir-structures-dstu/src/test/resources/furore-conformance.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/furore-conformance.xml rename to hapi-fhir-structures-dstu/src/test/resources/furore-conformance.xml diff --git a/hapi-fhir-base/src/test/resources/logback-test.xml b/hapi-fhir-structures-dstu/src/test/resources/logback-test.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/logback-test.xml rename to hapi-fhir-structures-dstu/src/test/resources/logback-test.xml diff --git a/hapi-fhir-base/src/test/resources/mixed-return-bundle.xml b/hapi-fhir-structures-dstu/src/test/resources/mixed-return-bundle.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/mixed-return-bundle.xml rename to hapi-fhir-structures-dstu/src/test/resources/mixed-return-bundle.xml diff --git a/hapi-fhir-base/src/test/resources/narrative/Practitioner.html b/hapi-fhir-structures-dstu/src/test/resources/narrative/Practitioner.html similarity index 100% rename from hapi-fhir-base/src/test/resources/narrative/Practitioner.html rename to hapi-fhir-structures-dstu/src/test/resources/narrative/Practitioner.html diff --git a/hapi-fhir-base/src/test/resources/narrative/customnarrative.properties b/hapi-fhir-structures-dstu/src/test/resources/narrative/customnarrative.properties similarity index 100% rename from hapi-fhir-base/src/test/resources/narrative/customnarrative.properties rename to hapi-fhir-structures-dstu/src/test/resources/narrative/customnarrative.properties diff --git a/hapi-fhir-base/src/test/resources/observation-example-eeg.xml b/hapi-fhir-structures-dstu/src/test/resources/observation-example-eeg.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/observation-example-eeg.xml rename to hapi-fhir-structures-dstu/src/test/resources/observation-example-eeg.xml diff --git a/hapi-fhir-base/src/test/resources/observation-example-f001-glucose.json b/hapi-fhir-structures-dstu/src/test/resources/observation-example-f001-glucose.json similarity index 100% rename from hapi-fhir-base/src/test/resources/observation-example-f001-glucose.json rename to hapi-fhir-structures-dstu/src/test/resources/observation-example-f001-glucose.json diff --git a/hapi-fhir-base/src/test/resources/observation-example-f204-creatinine.json b/hapi-fhir-structures-dstu/src/test/resources/observation-example-f204-creatinine.json similarity index 100% rename from hapi-fhir-base/src/test/resources/observation-example-f204-creatinine.json rename to hapi-fhir-structures-dstu/src/test/resources/observation-example-f204-creatinine.json diff --git a/hapi-fhir-base/src/test/resources/patient-example-dicom.xml b/hapi-fhir-structures-dstu/src/test/resources/patient-example-dicom.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/patient-example-dicom.xml rename to hapi-fhir-structures-dstu/src/test/resources/patient-example-dicom.xml diff --git a/hapi-fhir-base/src/test/resources/patient-example-us-extensions.xml b/hapi-fhir-structures-dstu/src/test/resources/patient-example-us-extensions.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/patient-example-us-extensions.xml rename to hapi-fhir-structures-dstu/src/test/resources/patient-example-us-extensions.xml diff --git a/hapi-fhir-base/src/test/resources/patient.profile.json b/hapi-fhir-structures-dstu/src/test/resources/patient.profile.json similarity index 100% rename from hapi-fhir-base/src/test/resources/patient.profile.json rename to hapi-fhir-structures-dstu/src/test/resources/patient.profile.json diff --git a/hapi-fhir-base/src/test/resources/questionnaire-example.xml b/hapi-fhir-structures-dstu/src/test/resources/questionnaire-example.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/questionnaire-example.xml rename to hapi-fhir-structures-dstu/src/test/resources/questionnaire-example.xml diff --git a/hapi-fhir-base/src/test/resources/securitytest_war/WEB-INF/app-ctx.xml b/hapi-fhir-structures-dstu/src/test/resources/securitytest_war/WEB-INF/app-ctx.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/securitytest_war/WEB-INF/app-ctx.xml rename to hapi-fhir-structures-dstu/src/test/resources/securitytest_war/WEB-INF/app-ctx.xml diff --git a/hapi-fhir-base/src/test/resources/securitytest_war/WEB-INF/web.xml b/hapi-fhir-structures-dstu/src/test/resources/securitytest_war/WEB-INF/web.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/securitytest_war/WEB-INF/web.xml rename to hapi-fhir-structures-dstu/src/test/resources/securitytest_war/WEB-INF/web.xml diff --git a/hapi-fhir-base/src/test/resources/server-conformance-statement.xml b/hapi-fhir-structures-dstu/src/test/resources/server-conformance-statement.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/server-conformance-statement.xml rename to hapi-fhir-structures-dstu/src/test/resources/server-conformance-statement.xml diff --git a/hapi-fhir-base/src/test/resources/xhtml1-strict.xsd b/hapi-fhir-structures-dstu/src/test/resources/xhtml1-strict.xsd similarity index 100% rename from hapi-fhir-base/src/test/resources/xhtml1-strict.xsd rename to hapi-fhir-structures-dstu/src/test/resources/xhtml1-strict.xsd diff --git a/hapi-fhir-base/src/test/resources/xml.xsd b/hapi-fhir-structures-dstu/src/test/resources/xml.xsd similarity index 100% rename from hapi-fhir-base/src/test/resources/xml.xsd rename to hapi-fhir-structures-dstu/src/test/resources/xml.xsd diff --git a/hapi-fhir-base/src/test/resources/xmlexample.xml b/hapi-fhir-structures-dstu/src/test/resources/xmlexample.xml similarity index 100% rename from hapi-fhir-base/src/test/resources/xmlexample.xml rename to hapi-fhir-structures-dstu/src/test/resources/xmlexample.xml diff --git a/hapi-tinder-plugin/pom.xml b/hapi-tinder-plugin/pom.xml index 6096b1af1f0..d778298bfe1 100644 --- a/hapi-tinder-plugin/pom.xml +++ b/hapi-tinder-plugin/pom.xml @@ -21,12 +21,14 @@ hapi-fhir-base 0.7-SNAPSHOT + + org.apache.velocity velocity diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java new file mode 100644 index 00000000000..1a6a6046cfe --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java @@ -0,0 +1,521 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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.primitive.BoundCodeDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.StringDt; + +/** + * HAPI/FHIR AddressDt Datatype + * (A postal address) + * + *

+ * Definition: + * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world + *

+ * + *

+ * Requirements: + * Need to be able to record postal addresses, along with notes about their use + *

+ */ +@DatatypeDef(name="AddressDt") +public class AddressDt + extends BaseIdentifiableElement implements ICompositeDatatype +{ + + /** + * Constructor + */ + public AddressDt() { + // nothing + } + + + @Child(name="use", type=CodeDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="home | work | temp | old - purpose of this address", + formalDefinition="The purpose of this address" + ) + private BoundCodeDt myUse; + + @Child(name="text", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Text representation of the address", + formalDefinition="A full text representation of the address" + ) + private StringDt myText; + + @Child(name="line", type=StringDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Street name, number, direction & P.O. Box etc", + formalDefinition="This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information" + ) + private java.util.List myLine; + + @Child(name="city", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Name of city, town etc.", + formalDefinition="The name of the city, town, village or other community or delivery center." + ) + private StringDt myCity; + + @Child(name="state", type=StringDt.class, order=4, min=0, max=1) + @Description( + shortDefinition="Sub-unit of country (abreviations ok)", + formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)." + ) + private StringDt myState; + + @Child(name="zip", type=StringDt.class, order=5, min=0, max=1) + @Description( + shortDefinition="Postal code for area", + formalDefinition="A postal code designating a region defined by the postal service." + ) + private StringDt myZip; + + @Child(name="country", type=StringDt.class, order=6, min=0, max=1) + @Description( + shortDefinition="Country (can be ISO 3166 3 letter code)", + formalDefinition="Country - a nation as commonly understood or generally accepted" + ) + private StringDt myCountry; + + @Child(name="period", type=PeriodDt.class, order=7, min=0, max=1) + @Description( + shortDefinition="Time period when address was/is in use", + formalDefinition="Time period when address was/is in use" + ) + private PeriodDt myPeriod; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myText, myLine, myCity, myState, myZip, myCountry, myPeriod); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myText, myLine, myCity, myState, myZip, myCountry, myPeriod); + } + + /** + * Gets the value(s) for use (home | work | temp | old - purpose of this address). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The purpose of this address + *

+ */ + public BoundCodeDt getUse() { + if (myUse == null) { + myUse = new BoundCodeDt(AddressUseEnum.VALUESET_BINDER); + } + return myUse; + } + + /** + * Sets the value(s) for use (home | work | temp | old - purpose of this address) + * + *

+ * Definition: + * The purpose of this address + *

+ */ + public AddressDt setUse(BoundCodeDt theValue) { + myUse = theValue; + return this; + } + + /** + * Sets the value(s) for use (home | work | temp | old - purpose of this address) + * + *

+ * Definition: + * The purpose of this address + *

+ */ + public AddressDt setUse(AddressUseEnum theValue) { + getUse().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for text (Text representation of the address). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A full text representation of the address + *

+ */ + public StringDt getText() { + if (myText == null) { + myText = new StringDt(); + } + return myText; + } + + /** + * Sets the value(s) for text (Text representation of the address) + * + *

+ * Definition: + * A full text representation of the address + *

+ */ + public AddressDt setText(StringDt theValue) { + myText = theValue; + return this; + } + + /** + * Sets the value for text (Text representation of the address) + * + *

+ * Definition: + * A full text representation of the address + *

+ */ + public AddressDt setText( String theString) { + myText = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for line (Street name, number, direction & P.O. Box etc). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getLine() { + if (myLine == null) { + myLine = new java.util.ArrayList(); + } + return myLine; + } + + /** + * Sets the value(s) for line (Street name, number, direction & P.O. Box etc) + * + *

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

+ */ + public AddressDt setLine(java.util.List theValue) { + myLine = theValue; + return this; + } + + /** + * Adds and returns a new value for line (Street name, number, direction & P.O. Box etc) + * + *

+ * 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 addLine() { + StringDt newType = new StringDt(); + getLine().add(newType); + 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) + * + *

+ * 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 AddressDt addLine( String theString) { + if (myLine == null) { + myLine = new java.util.ArrayList(); + } + myLine.add(new StringDt(theString)); + return this; + } + + + /** + * Gets the value(s) for city (Name of city, town etc.). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The name of the city, town, village or other community or delivery center. + *

+ */ + public StringDt getCity() { + if (myCity == null) { + myCity = new StringDt(); + } + return myCity; + } + + /** + * Sets the value(s) for city (Name of city, town etc.) + * + *

+ * Definition: + * The name of the city, town, village or other community or delivery center. + *

+ */ + public AddressDt setCity(StringDt theValue) { + myCity = theValue; + return this; + } + + /** + * Sets the value for city (Name of city, town etc.) + * + *

+ * Definition: + * The name of the city, town, village or other community or delivery center. + *

+ */ + public AddressDt setCity( String theString) { + myCity = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for state (Sub-unit of country (abreviations ok)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getState() { + if (myState == null) { + myState = new StringDt(); + } + return myState; + } + + /** + * Sets the value(s) for state (Sub-unit of country (abreviations ok)) + * + *

+ * Definition: + * 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 AddressDt setState(StringDt theValue) { + myState = theValue; + return this; + } + + /** + * Sets the value for state (Sub-unit of country (abreviations ok)) + * + *

+ * Definition: + * 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 AddressDt setState( String theString) { + myState = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for zip (Postal code for area). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A postal code designating a region defined by the postal service. + *

+ */ + public StringDt getZip() { + if (myZip == null) { + myZip = new StringDt(); + } + return myZip; + } + + /** + * Sets the value(s) for zip (Postal code for area) + * + *

+ * Definition: + * A postal code designating a region defined by the postal service. + *

+ */ + public AddressDt setZip(StringDt theValue) { + myZip = theValue; + return this; + } + + /** + * Sets the value for zip (Postal code for area) + * + *

+ * Definition: + * A postal code designating a region defined by the postal service. + *

+ */ + public AddressDt setZip( String theString) { + myZip = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for country (Country (can be ISO 3166 3 letter code)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Country - a nation as commonly understood or generally accepted + *

+ */ + public StringDt getCountry() { + if (myCountry == null) { + myCountry = new StringDt(); + } + return myCountry; + } + + /** + * Sets the value(s) for country (Country (can be ISO 3166 3 letter code)) + * + *

+ * Definition: + * Country - a nation as commonly understood or generally accepted + *

+ */ + public AddressDt setCountry(StringDt theValue) { + myCountry = theValue; + return this; + } + + /** + * Sets the value for country (Country (can be ISO 3166 3 letter code)) + * + *

+ * Definition: + * Country - a nation as commonly understood or generally accepted + *

+ */ + public AddressDt setCountry( String theString) { + myCountry = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for period (Time period when address was/is in use). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Time period when address was/is in use + *

+ */ + public PeriodDt getPeriod() { + if (myPeriod == null) { + myPeriod = new PeriodDt(); + } + return myPeriod; + } + + /** + * Sets the value(s) for period (Time period when address was/is in use) + * + *

+ * Definition: + * Time period when address was/is in use + *

+ */ + public AddressDt setPeriod(PeriodDt theValue) { + myPeriod = theValue; + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AgeDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AgeDt.java new file mode 100644 index 00000000000..c1942fa57bf --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AgeDt.java @@ -0,0 +1,30 @@ +package ca.uhn.fhir.model.dstu.composite; + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +@DatatypeDef(name="AgeDt") +public class AgeDt extends QuantityDt { + + // TODO: implement restricions + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java new file mode 100644 index 00000000000..0b5361057f7 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java @@ -0,0 +1,450 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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.CodeDt; +import ca.uhn.fhir.model.primitive.IntegerDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.UriDt; + +/** + * HAPI/FHIR AttachmentDt Datatype + * (Content in a format defined elsewhere) + * + *

+ * Definition: + * For referring to data content defined in other formats. + *

+ * + *

+ * Requirements: + * Many models need to include data defined in other specifications that is complex and opaque to the healthcare model. This includes documents, media recordings, structured data, etc. + *

+ */ +@DatatypeDef(name="AttachmentDt") +public class AttachmentDt + extends BaseIdentifiableElement implements ICompositeDatatype +{ + + /** + * Constructor + */ + public AttachmentDt() { + // nothing + } + + + @Child(name="contentType", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Mime type of the content, with charset etc.", + formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate" + ) + private CodeDt myContentType; + + @Child(name="language", type=CodeDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Human language of the content (BCP-47)", + formalDefinition="The human language of the content. The value can be any valid value according to BCP 47" + ) + private CodeDt myLanguage; + + @Child(name="data", type=Base64BinaryDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Data inline, base64ed", + formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64" + ) + private Base64BinaryDt myData; + + @Child(name="url", type=UriDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Uri where the data can be found", + formalDefinition="An alternative location where the data can be accessed" + ) + private UriDt myUrl; + + @Child(name="size", type=IntegerDt.class, order=4, min=0, max=1) + @Description( + shortDefinition="Number of bytes of content (if url provided)", + formalDefinition="The number of bytes of data that make up this attachment." + ) + private IntegerDt mySize; + + @Child(name="hash", type=Base64BinaryDt.class, order=5, min=0, max=1) + @Description( + shortDefinition="Hash of the data (sha-1, base64ed )", + formalDefinition="The calculated hash of the data using SHA-1. Represented using base64" + ) + private Base64BinaryDt myHash; + + @Child(name="title", type=StringDt.class, order=6, min=0, max=1) + @Description( + shortDefinition="Label to display in place of the data", + formalDefinition="A label or set of text to display in place of the data" + ) + private StringDt myTitle; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myContentType, myLanguage, myData, myUrl, mySize, myHash, myTitle); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myContentType, myLanguage, myData, myUrl, mySize, myHash, myTitle); + } + + /** + * Gets the value(s) for contentType (Mime type of the content, with charset etc.). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 CodeDt getContentType() { + if (myContentType == null) { + myContentType = new CodeDt(); + } + return myContentType; + } + + /** + * Sets the value(s) for contentType (Mime type of the content, with charset etc.) + * + *

+ * Definition: + * 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 AttachmentDt setContentType(CodeDt theValue) { + myContentType = theValue; + return this; + } + + /** + * Sets the value for contentType (Mime type of the content, with charset etc.) + * + *

+ * Definition: + * 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 AttachmentDt setContentType( String theCode) { + myContentType = new CodeDt(theCode); + return this; + } + + + /** + * Gets the value(s) for language (Human language of the content (BCP-47)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The human language of the content. The value can be any valid value according to BCP 47 + *

+ */ + public CodeDt getLanguage() { + if (myLanguage == null) { + myLanguage = new CodeDt(); + } + return myLanguage; + } + + /** + * Sets the value(s) for language (Human language of the content (BCP-47)) + * + *

+ * Definition: + * The human language of the content. The value can be any valid value according to BCP 47 + *

+ */ + public AttachmentDt setLanguage(CodeDt theValue) { + myLanguage = theValue; + return this; + } + + /** + * Sets the value for language (Human language of the content (BCP-47)) + * + *

+ * Definition: + * The human language of the content. The value can be any valid value according to BCP 47 + *

+ */ + public AttachmentDt setLanguage( String theCode) { + myLanguage = new CodeDt(theCode); + return this; + } + + + /** + * Gets the value(s) for data (Data inline, base64ed). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The actual data of the attachment - a sequence of bytes. In XML, represented using base64 + *

+ */ + public Base64BinaryDt getData() { + if (myData == null) { + myData = new Base64BinaryDt(); + } + return myData; + } + + /** + * Sets the value(s) for data (Data inline, base64ed) + * + *

+ * Definition: + * The actual data of the attachment - a sequence of bytes. In XML, represented using base64 + *

+ */ + public AttachmentDt setData(Base64BinaryDt theValue) { + myData = theValue; + return this; + } + + /** + * Sets the value for data (Data inline, base64ed) + * + *

+ * Definition: + * The actual data of the attachment - a sequence of bytes. In XML, represented using base64 + *

+ */ + public AttachmentDt setData( byte[] theBytes) { + myData = new Base64BinaryDt(theBytes); + return this; + } + + + /** + * Gets the value(s) for url (Uri where the data can be found). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An alternative location where the data can be accessed + *

+ */ + public UriDt getUrl() { + if (myUrl == null) { + myUrl = new UriDt(); + } + return myUrl; + } + + /** + * Sets the value(s) for url (Uri where the data can be found) + * + *

+ * Definition: + * An alternative location where the data can be accessed + *

+ */ + public AttachmentDt setUrl(UriDt theValue) { + myUrl = theValue; + return this; + } + + /** + * Sets the value for url (Uri where the data can be found) + * + *

+ * Definition: + * An alternative location where the data can be accessed + *

+ */ + public AttachmentDt setUrl( String theUri) { + myUrl = new UriDt(theUri); + return this; + } + + + /** + * Gets the value(s) for size (Number of bytes of content (if url provided)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The number of bytes of data that make up this attachment. + *

+ */ + public IntegerDt getSize() { + if (mySize == null) { + mySize = new IntegerDt(); + } + return mySize; + } + + /** + * Sets the value(s) for size (Number of bytes of content (if url provided)) + * + *

+ * Definition: + * The number of bytes of data that make up this attachment. + *

+ */ + public AttachmentDt setSize(IntegerDt theValue) { + mySize = theValue; + return this; + } + + /** + * Sets the value for size (Number of bytes of content (if url provided)) + * + *

+ * Definition: + * The number of bytes of data that make up this attachment. + *

+ */ + public AttachmentDt setSize( int theInteger) { + mySize = new IntegerDt(theInteger); + return this; + } + + + /** + * Gets the value(s) for hash (Hash of the data (sha-1, base64ed )). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The calculated hash of the data using SHA-1. Represented using base64 + *

+ */ + public Base64BinaryDt getHash() { + if (myHash == null) { + myHash = new Base64BinaryDt(); + } + return myHash; + } + + /** + * Sets the value(s) for hash (Hash of the data (sha-1, base64ed )) + * + *

+ * Definition: + * The calculated hash of the data using SHA-1. Represented using base64 + *

+ */ + public AttachmentDt setHash(Base64BinaryDt theValue) { + myHash = theValue; + return this; + } + + /** + * Sets the value for hash (Hash of the data (sha-1, base64ed )) + * + *

+ * Definition: + * The calculated hash of the data using SHA-1. Represented using base64 + *

+ */ + public AttachmentDt setHash( byte[] theBytes) { + myHash = new Base64BinaryDt(theBytes); + return this; + } + + + /** + * Gets the value(s) for title (Label to display in place of the data). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A label or set of text to display in place of the data + *

+ */ + public StringDt getTitle() { + if (myTitle == null) { + myTitle = new StringDt(); + } + return myTitle; + } + + /** + * Sets the value(s) for title (Label to display in place of the data) + * + *

+ * Definition: + * A label or set of text to display in place of the data + *

+ */ + public AttachmentDt setTitle(StringDt theValue) { + myTitle = theValue; + return this; + } + + /** + * Sets the value for title (Label to display in place of the data) + * + *

+ * Definition: + * A label or set of text to display in place of the data + *

+ */ + public AttachmentDt setTitle( String theString) { + myTitle = new StringDt(theString); + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/BoundCodeableConceptDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/BoundCodeableConceptDt.java new file mode 100644 index 00000000000..5c411118f2e --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/BoundCodeableConceptDt.java @@ -0,0 +1,122 @@ +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import static org.apache.commons.lang3.StringUtils.*; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import ca.uhn.fhir.model.api.IValueSetEnumBinder; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +@DatatypeDef(name = "CodeableConcept", isSpecialization = true) +public class BoundCodeableConceptDt> extends CodeableConceptDt { + + private IValueSetEnumBinder myBinder; + + /** + * Constructor + */ + public BoundCodeableConceptDt(IValueSetEnumBinder theBinder) { + myBinder = theBinder; + } + + /** + * Constructor + */ + public BoundCodeableConceptDt(IValueSetEnumBinder theBinder, T theValue) { + myBinder = theBinder; + setValueAsEnum(theValue); + } + + /** + * Constructor + */ + public BoundCodeableConceptDt(IValueSetEnumBinder theBinder, Collection theValues) { + myBinder = theBinder; + setValueAsEnum(theValues); + } + + /** + * Sets the {@link #getCoding()} to contain a coding with the code and + * system defined by the given enumerated types, AND clearing any existing + * codings first. If theValue is null, existing codings are cleared and no + * codings are added. + * + * @param theValue + * The value to add, or null + */ + public void setValueAsEnum(Collection theValues) { + getCoding().clear(); + if (theValues != null) { + for (T next : theValues) { + getCoding().add(new CodingDt(myBinder.toSystemString(next), myBinder.toCodeString(next))); + } + } + } + + /** + * Sets the {@link #getCoding()} to contain a coding with the code and + * system defined by the given enumerated type, AND clearing any existing + * codings first. If theValue is null, existing codings are cleared and no + * codings are added. + * + * @param theValue + * The value to add, or null + */ + public void setValueAsEnum(T theValue) { + getCoding().clear(); + if (theValue == null) { + return; + } + getCoding().add(new CodingDt(myBinder.toSystemString(theValue), myBinder.toCodeString(theValue))); + } + + /** + * Loops through the {@link #getCoding() codings} in this codeable concept + * and returns the first bound enumerated type that matches. Use + * caution using this method, see the return description for more + * information. + * + * @return Returns the bound enumerated type, or null if none + * are found. Note that a null return value doesn't neccesarily + * imply that this Codeable Concept has no codes, only that it has + * no codes that match the enum. + */ + public Set getValueAsEnum() { + Set retVal = new HashSet(); + for (CodingDt next : getCoding()) { + if (next == null) { + continue; + } + T nextT = myBinder.fromCodeString(defaultString(next.getCode().getValue()), defaultString(next.getSystem().getValueAsString())); + if (nextT != null) { + retVal.add(nextT); + } else { + // TODO: throw special exception type? + } + } + return retVal; + } + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java new file mode 100644 index 00000000000..9f358b4baca --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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; + +/** + * HAPI/FHIR CodeableConceptDt Datatype + * (Concept - reference to a terminology or just text) + * + *

+ * Definition: + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text + *

+ * + *

+ * Requirements: + * This is a common pattern in healthcare - a concept that may be defined by one or more codes from formal definitions including LOINC and SNOMED CT, and/or defined by the provision of text that captures a human sense of the concept + *

+ */ +@DatatypeDef(name="CodeableConceptDt") +public class CodeableConceptDt + extends BaseIdentifiableElement implements ICompositeDatatype +{ + + /** + * Constructor + */ + public CodeableConceptDt() { + // nothing + } + + /** + * Constructor which creates a CodeableConceptDt with one coding repetition, containing + * the given system and code + */ + public CodeableConceptDt(String theSystem, String theCode) { + addCoding().setSystem(theSystem).setCode(theCode); + } + + @Child(name="coding", type=CodingDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Code defined by a terminology system", + formalDefinition="A reference to a code defined by a terminology system" + ) + private java.util.List myCoding; + + @Child(name="text", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Plain text representation of the concept", + formalDefinition="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" + ) + private StringDt myText; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCoding, myText); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCoding, myText); + } + + /** + * Gets the value(s) for coding (Code defined by a terminology system). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getCoding() { + if (myCoding == null) { + myCoding = new java.util.ArrayList(); + } + return myCoding; + } + + /** + * Sets the value(s) for coding (Code defined by a terminology system) + * + *

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

+ */ + public CodeableConceptDt setCoding(java.util.List theValue) { + myCoding = theValue; + return this; + } + + /** + * Adds and returns a new value for coding (Code defined by a terminology system) + * + *

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

+ */ + public CodingDt addCoding() { + CodingDt newType = new CodingDt(); + getCoding().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getText() { + if (myText == null) { + myText = new StringDt(); + } + return myText; + } + + /** + * Sets the value(s) for text (Plain text representation of the concept) + * + *

+ * Definition: + * 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 CodeableConceptDt setText(StringDt theValue) { + myText = theValue; + return this; + } + + /** + * Sets the value for text (Plain text representation of the concept) + * + *

+ * Definition: + * 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 CodeableConceptDt setText( String theString) { + myText = new StringDt(theString); + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java new file mode 100644 index 00000000000..7f9f4b1e7cf --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java @@ -0,0 +1,393 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +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.base.composite.BaseCodingDt; +import ca.uhn.fhir.model.primitive.BooleanDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.UriDt; + +/** + * HAPI/FHIR CodingDt Datatype + * (A reference to a code defined by a terminology system) + * + *

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

+ * + *

+ * Requirements: + * References to codes are very common in healthcare models + *

+ */ +@DatatypeDef(name="CodingDt") +public class CodingDt + extends BaseCodingDt implements ICompositeDatatype +{ + + /** + * Constructor + */ + public CodingDt() { + // nothing + } + + /** + * Creates a new Coding with the given system and code + */ + public CodingDt(String theSystem, String theCode) { + setSystem(theSystem); + setCode(theCode); + } + + @Child(name="system", type=UriDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Identity of the terminology system", + formalDefinition="The identification of the code system that defines the meaning of the symbol in the code." + ) + private UriDt mySystem; + + @Child(name="version", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Version of the system - if relevant", + formalDefinition="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" + ) + private StringDt myVersion; + + @Child(name="code", type=CodeDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Symbol in syntax defined by the system", + formalDefinition="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)" + ) + private CodeDt myCode; + + @Child(name="display", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Representation defined by the system", + formalDefinition="A representation of the meaning of the code in the system, following the rules of the system." + ) + private StringDt myDisplay; + + @Child(name="primary", type=BooleanDt.class, order=4, min=0, max=1) + @Description( + shortDefinition="If this code was chosen directly by the user", + formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)" + ) + private BooleanDt myPrimary; + + @Child(name="valueSet", order=5, min=0, max=1, type={ + ca.uhn.fhir.model.dstu.resource.ValueSet.class }) + @Description( + shortDefinition="Set this coding was chosen from", + formalDefinition="The set of possible coded values this coding was chosen from or constrained by" + ) + private ResourceReferenceDt myValueSet; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myDisplay, myPrimary, myValueSet); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myVersion, myCode, myDisplay, myPrimary, myValueSet); + } + + /** + * Gets the value(s) for system (Identity of the terminology system). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The identification of the code system that defines the meaning of the symbol in the code. + *

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

+ * Definition: + * The identification of the code system that defines the meaning of the symbol in the code. + *

+ */ + public CodingDt setSystem(UriDt theValue) { + mySystem = theValue; + return this; + } + + /** + * Sets the value for system (Identity of the terminology system) + * + *

+ * Definition: + * The identification of the code system that defines the meaning of the symbol in the code. + *

+ */ + public CodingDt setSystem( String theUri) { + mySystem = new UriDt(theUri); + return this; + } + + + /** + * Gets the value(s) for version (Version of the system - if relevant). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getVersion() { + if (myVersion == null) { + myVersion = new StringDt(); + } + return myVersion; + } + + /** + * Sets the value(s) for version (Version of the system - if relevant) + * + *

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

+ * Definition: + * 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 CodingDt setVersion( String theString) { + myVersion = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for code (Symbol in syntax defined by the system). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 CodeDt getCode() { + if (myCode == null) { + myCode = new CodeDt(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Symbol in syntax defined by the system) + * + *

+ * Definition: + * 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 CodingDt setCode(CodeDt theValue) { + myCode = theValue; + return this; + } + + /** + * Sets the value for code (Symbol in syntax defined by the system) + * + *

+ * Definition: + * 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 CodingDt setCode( String theCode) { + myCode = new CodeDt(theCode); + return this; + } + + + /** + * Gets the value(s) for display (Representation defined by the system). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A representation of the meaning of the code in the system, following the rules of the system. + *

+ */ + public StringDt getDisplay() { + if (myDisplay == null) { + myDisplay = new StringDt(); + } + return myDisplay; + } + + /** + * Sets the value(s) for display (Representation defined by the system) + * + *

+ * Definition: + * A representation of the meaning of the code in the system, following the rules of the system. + *

+ */ + public CodingDt setDisplay(StringDt theValue) { + myDisplay = theValue; + return this; + } + + /** + * Sets the value for display (Representation defined by the system) + * + *

+ * Definition: + * A representation of the meaning of the code in the system, following the rules of the system. + *

+ */ + public CodingDt setDisplay( String theString) { + myDisplay = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for primary (If this code was chosen directly by the user). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays) + *

+ */ + public BooleanDt getPrimary() { + if (myPrimary == null) { + myPrimary = new BooleanDt(); + } + return myPrimary; + } + + /** + * Sets the value(s) for primary (If this code was chosen directly by the user) + * + *

+ * Definition: + * Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays) + *

+ */ + public CodingDt setPrimary(BooleanDt theValue) { + myPrimary = theValue; + return this; + } + + /** + * Sets the value for primary (If this code was chosen directly by the user) + * + *

+ * Definition: + * Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays) + *

+ */ + public CodingDt setPrimary( boolean theBoolean) { + myPrimary = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for valueSet (Set this coding was chosen from). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The set of possible coded values this coding was chosen from or constrained by + *

+ */ + public ResourceReferenceDt getValueSet() { + if (myValueSet == null) { + myValueSet = new ResourceReferenceDt(); + } + return myValueSet; + } + + /** + * Sets the value(s) for valueSet (Set this coding was chosen from) + * + *

+ * Definition: + * The set of possible coded values this coding was chosen from or constrained by + *

+ */ + public CodingDt setValueSet(ResourceReferenceDt theValue) { + myValueSet = theValue; + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java new file mode 100644 index 00000000000..6863159f5bc --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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.api.annotation.SimpleSetter; +import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; +import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; +import ca.uhn.fhir.model.primitive.BoundCodeDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.StringDt; + +/** + * HAPI/FHIR ContactDt Datatype + * (Technology mediated contact details (phone, fax, email, etc)) + * + *

+ * Definition: + * All kinds of technology mediated contact details for a person or organization, including telephone, email, etc. + *

+ * + *

+ * Requirements: + * Need to track phone, fax, mobile, sms numbers, email addresses, twitter tags, etc. + *

+ */ +@DatatypeDef(name="ContactDt") +public class ContactDt + extends BaseIdentifiableElement implements ICompositeDatatype +{ + + /** + * Constructor + */ + public ContactDt() { + // nothing + } + + /** + * Constructor + */ + @SimpleSetter + public ContactDt(@SimpleSetter.Parameter(name="theValue") String theValue) { + setValue(theValue); + } + + /** + * Constructor + */ + @SimpleSetter + public ContactDt(@SimpleSetter.Parameter(name="theContactUse") ContactUseEnum theContactUse, @SimpleSetter.Parameter(name="theValue") String theValue) { + setUse(theContactUse); + setValue(theValue); + } + + @Child(name="system", type=CodeDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="phone | fax | email | url", + formalDefinition="Telecommunications form for contact - what communications system is required to make use of the contact" + ) + private BoundCodeDt mySystem; + + @Child(name="value", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="The actual contact details", + formalDefinition="The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)." + ) + private StringDt myValue; + + @Child(name="use", type=CodeDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="home | work | temp | old | mobile - purpose of this address", + formalDefinition="Identifies the purpose for the address" + ) + private BoundCodeDt myUse; + + @Child(name="period", type=PeriodDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Time period when the contact was/is in use", + formalDefinition="Time period when the contact was/is in use" + ) + private PeriodDt myPeriod; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myValue, myUse, myPeriod); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myValue, myUse, myPeriod); + } + + /** + * Gets the value(s) for system (phone | fax | email | url). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Telecommunications form for contact - what communications system is required to make use of the contact + *

+ */ + public BoundCodeDt getSystem() { + if (mySystem == null) { + mySystem = new BoundCodeDt(ContactSystemEnum.VALUESET_BINDER); + } + return mySystem; + } + + /** + * Sets the value(s) for system (phone | fax | email | url) + * + *

+ * Definition: + * Telecommunications form for contact - what communications system is required to make use of the contact + *

+ */ + public ContactDt setSystem(BoundCodeDt theValue) { + mySystem = theValue; + return this; + } + + /** + * Sets the value(s) for system (phone | fax | email | url) + * + *

+ * Definition: + * Telecommunications form for contact - what communications system is required to make use of the contact + *

+ */ + public ContactDt setSystem(ContactSystemEnum theValue) { + getSystem().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for value (The actual contact details). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + *

+ */ + public StringDt getValue() { + if (myValue == null) { + myValue = new StringDt(); + } + return myValue; + } + + /** + * Sets the value(s) for value (The actual contact details) + * + *

+ * Definition: + * The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + *

+ */ + public ContactDt setValue(StringDt theValue) { + myValue = theValue; + return this; + } + + /** + * Sets the value for value (The actual contact details) + * + *

+ * Definition: + * The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + *

+ */ + public ContactDt setValue( String theString) { + myValue = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for use (home | work | temp | old | mobile - purpose of this address). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the purpose for the address + *

+ */ + public BoundCodeDt getUse() { + if (myUse == null) { + myUse = new BoundCodeDt(ContactUseEnum.VALUESET_BINDER); + } + return myUse; + } + + /** + * Sets the value(s) for use (home | work | temp | old | mobile - purpose of this address) + * + *

+ * Definition: + * Identifies the purpose for the address + *

+ */ + public ContactDt setUse(BoundCodeDt theValue) { + myUse = theValue; + return this; + } + + /** + * Sets the value(s) for use (home | work | temp | old | mobile - purpose of this address) + * + *

+ * Definition: + * Identifies the purpose for the address + *

+ */ + public ContactDt setUse(ContactUseEnum theValue) { + getUse().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for period (Time period when the contact was/is in use). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Time period when the contact was/is in use + *

+ */ + public PeriodDt getPeriod() { + if (myPeriod == null) { + myPeriod = new PeriodDt(); + } + return myPeriod; + } + + /** + * Sets the value(s) for period (Time period when the contact was/is in use) + * + *

+ * Definition: + * Time period when the contact was/is in use + *

+ */ + public ContactDt setPeriod(PeriodDt theValue) { + myPeriod = theValue; + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ContainedDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ContainedDt.java new file mode 100644 index 00000000000..bc20f2b1a12 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ContainedDt.java @@ -0,0 +1,53 @@ +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.ArrayList; +import java.util.List; + +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; + +@DatatypeDef(name = "duration") +public class ContainedDt implements IDatatype { + + @Child(name = "resource", type = IResource.class, order = 0, min = 0, max = Child.MAX_UNLIMITED) + private List myContainedResources; + + public List getContainedResources() { + if (myContainedResources == null) { + myContainedResources = new ArrayList(); + } + return myContainedResources; + } + + public void setContainedResources(List theContainedResources) { + myContainedResources = theContainedResources; + } + + @Override + public boolean isEmpty() { + return myContainedResources == null || myContainedResources.size() == 0; + } + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/DurationDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/DurationDt.java new file mode 100644 index 00000000000..5fa244c674d --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/DurationDt.java @@ -0,0 +1,33 @@ +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +@DatatypeDef(name = "Duration") +public class DurationDt extends QuantityDt { + + // TODO: implement restricions + + // There SHALL be a code if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM. + // (f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java new file mode 100644 index 00000000000..c1785cbd862 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java @@ -0,0 +1,572 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +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.base.composite.BaseHumanNameDt; +import ca.uhn.fhir.model.dstu.valueset.NameUseEnum; +import ca.uhn.fhir.model.primitive.BoundCodeDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.StringDt; + +/** + * HAPI/FHIR HumanNameDt Datatype + * (Name of a human - parts and usage) + * + *

+ * Definition: + * A human's name with the ability to identify parts and usage + *

+ * + *

+ * Requirements: + * Need to be able to record names, along with notes about their use + *

+ */ +@DatatypeDef(name="HumanNameDt") +public class HumanNameDt + extends BaseHumanNameDt implements ICompositeDatatype +{ + + /** + * Constructor + */ + public HumanNameDt() { + // nothing + } + + + @Child(name="use", type=CodeDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="usual | official | temp | nickname | anonymous | old | maiden", + formalDefinition="Identifies the purpose for this name" + ) + private BoundCodeDt myUse; + + @Child(name="text", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Text representation of the full name", + formalDefinition="A full text representation of the name" + ) + private StringDt myText; + + @Child(name="family", type=StringDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Family name (often called 'Surname')", + formalDefinition="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." + ) + private java.util.List myFamily; + + @Child(name="given", type=StringDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Given names (not always 'first'). Includes middle names", + formalDefinition="Given name" + ) + private java.util.List myGiven; + + @Child(name="prefix", type=StringDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Parts that come before the name", + formalDefinition="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" + ) + private java.util.List myPrefix; + + @Child(name="suffix", type=StringDt.class, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Parts that come after the name", + formalDefinition="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" + ) + private java.util.List mySuffix; + + @Child(name="period", type=PeriodDt.class, order=6, min=0, max=1) + @Description( + shortDefinition="Time period when name was/is in use", + formalDefinition="Indicates the period of time when this name was valid for the named person." + ) + private PeriodDt myPeriod; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myText, myFamily, myGiven, myPrefix, mySuffix, myPeriod); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myText, myFamily, myGiven, myPrefix, mySuffix, myPeriod); + } + + /** + * Gets the value(s) for use (usual | official | temp | nickname | anonymous | old | maiden). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the purpose for this name + *

+ */ + public BoundCodeDt getUse() { + if (myUse == null) { + myUse = new BoundCodeDt(NameUseEnum.VALUESET_BINDER); + } + return myUse; + } + + /** + * Sets the value(s) for use (usual | official | temp | nickname | anonymous | old | maiden) + * + *

+ * Definition: + * Identifies the purpose for this name + *

+ */ + public HumanNameDt setUse(BoundCodeDt theValue) { + myUse = theValue; + return this; + } + + /** + * Sets the value(s) for use (usual | official | temp | nickname | anonymous | old | maiden) + * + *

+ * Definition: + * Identifies the purpose for this name + *

+ */ + public HumanNameDt setUse(NameUseEnum theValue) { + getUse().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for text (Text representation of the full name). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A full text representation of the name + *

+ */ + public StringDt getText() { + if (myText == null) { + myText = new StringDt(); + } + return myText; + } + + /** + * Sets the value(s) for text (Text representation of the full name) + * + *

+ * Definition: + * A full text representation of the name + *

+ */ + public HumanNameDt setText(StringDt theValue) { + myText = theValue; + return this; + } + + /** + * Sets the value for text (Text representation of the full name) + * + *

+ * Definition: + * A full text representation of the name + *

+ */ + public HumanNameDt setText( String theString) { + myText = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for family (Family name (often called 'Surname')). + * creating it if it does + * not exist. Will not return null. + * + *

+ * 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 java.util.List getFamily() { + if (myFamily == null) { + myFamily = new java.util.ArrayList(); + } + return myFamily; + } + + /** + * Sets the value(s) for family (Family name (often called 'Surname')) + * + *

+ * 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 HumanNameDt setFamily(java.util.List theValue) { + myFamily = theValue; + return this; + } + + /** + * Adds and returns a new value for family (Family name (often called 'Surname')) + * + *

+ * 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 addFamily() { + StringDt newType = new StringDt(); + getFamily().add(newType); + 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')) + * + *

+ * 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 HumanNameDt addFamily( String theString) { + if (myFamily == null) { + myFamily = new java.util.ArrayList(); + } + myFamily.add(new StringDt(theString)); + return this; + } + + + /** + * Gets the value(s) for given (Given names (not always 'first'). Includes middle names). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Given name + *

+ */ + public java.util.List getGiven() { + if (myGiven == null) { + myGiven = new java.util.ArrayList(); + } + return myGiven; + } + + /** + * Sets the value(s) for given (Given names (not always 'first'). Includes middle names) + * + *

+ * Definition: + * Given name + *

+ */ + public HumanNameDt setGiven(java.util.List theValue) { + myGiven = theValue; + return this; + } + + /** + * Adds and returns a new value for given (Given names (not always 'first'). Includes middle names) + * + *

+ * Definition: + * Given name + *

+ */ + public StringDt addGiven() { + StringDt newType = new StringDt(); + getGiven().add(newType); + 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) + * + *

+ * Definition: + * Given name + *

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public HumanNameDt addGiven( String theString) { + if (myGiven == null) { + myGiven = new java.util.ArrayList(); + } + myGiven.add(new StringDt(theString)); + return this; + } + + + /** + * Gets the value(s) for prefix (Parts that come before the name). + * creating it if it does + * not exist. Will not return null. + * + *

+ * 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 java.util.List getPrefix() { + if (myPrefix == null) { + myPrefix = new java.util.ArrayList(); + } + return myPrefix; + } + + /** + * Sets the value(s) for prefix (Parts that come before the name) + * + *

+ * 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 HumanNameDt setPrefix(java.util.List theValue) { + myPrefix = theValue; + return this; + } + + /** + * Adds and returns a new value for prefix (Parts that come before the name) + * + *

+ * 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 addPrefix() { + StringDt newType = new StringDt(); + getPrefix().add(newType); + 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) + * + *

+ * 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 HumanNameDt addPrefix( String theString) { + if (myPrefix == null) { + myPrefix = new java.util.ArrayList(); + } + myPrefix.add(new StringDt(theString)); + return this; + } + + + /** + * Gets the value(s) for suffix (Parts that come after the name). + * creating it if it does + * not exist. Will not return null. + * + *

+ * 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 java.util.List getSuffix() { + if (mySuffix == null) { + mySuffix = new java.util.ArrayList(); + } + return mySuffix; + } + + /** + * Sets the value(s) for suffix (Parts that come after the name) + * + *

+ * 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 HumanNameDt setSuffix(java.util.List theValue) { + mySuffix = theValue; + return this; + } + + /** + * Adds and returns a new value for suffix (Parts that come after the name) + * + *

+ * 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 addSuffix() { + StringDt newType = new StringDt(); + getSuffix().add(newType); + 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) + * + *

+ * 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 HumanNameDt addSuffix( String theString) { + if (mySuffix == null) { + mySuffix = new java.util.ArrayList(); + } + mySuffix.add(new StringDt(theString)); + return this; + } + + + /** + * Gets the value(s) for period (Time period when name was/is in use). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates the period of time when this name was valid for the named person. + *

+ */ + public PeriodDt getPeriod() { + if (myPeriod == null) { + myPeriod = new PeriodDt(); + } + return myPeriod; + } + + /** + * Sets the value(s) for period (Time period when name was/is in use) + * + *

+ * Definition: + * Indicates the period of time when this name was valid for the named person. + *

+ */ + public HumanNameDt setPeriod(PeriodDt theValue) { + myPeriod = theValue; + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java new file mode 100644 index 00000000000..2cb87fbfa7e --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +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.api.annotation.SimpleSetter; +import ca.uhn.fhir.model.base.composite.BaseIdentifierDt; +import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.primitive.BoundCodeDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.UriDt; + +/** + * HAPI/FHIR IdentifierDt Datatype + * (An identifier intended for computation) + * + *

+ * Definition: + * A technical identifier - identifies some entity uniquely and unambiguously + *

+ * + *

+ * Requirements: + * Need to be able to identify things with confidence and be sure that the identification is not subject to misinterpretation + *

+ */ +@DatatypeDef(name="IdentifierDt") +public class IdentifierDt + extends BaseIdentifierDt implements ICompositeDatatype +{ + + /** + * Constructor + */ + public IdentifierDt() { + // nothing + } + + /** + * Creates a new identifier with the given system and value + */ + @SimpleSetter + public IdentifierDt(@SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theValue") String theValue) { + setSystem(theSystem); + setValue(theValue); + } + + /** + * Creates a new identifier with the given system and value + */ + @SimpleSetter + public IdentifierDt(@SimpleSetter.Parameter(name="theUse") IdentifierUseEnum theUse, @SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theValue") String theValue, @SimpleSetter.Parameter(name="theLabel") String theLabel) { + setUse(theUse); + setSystem(theSystem); + setValue(theValue); + setLabel(theLabel); + } + + @Override + public String toString() { + return "IdentifierDt[" + getValueAsQueryToken() + "]"; + } + + @Child(name="use", type=CodeDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="usual | official | temp | secondary (If known)", + formalDefinition="The purpose of this identifier" + ) + private BoundCodeDt myUse; + + @Child(name="label", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Description of identifier", + formalDefinition="A text string for the identifier that can be displayed to a human so they can recognize the identifier" + ) + private StringDt myLabel; + + @Child(name="system", type=UriDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="The namespace for the identifier", + formalDefinition="Establishes the namespace in which set of possible id values is unique." + ) + private UriDt mySystem; + + @Child(name="value", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="The value that is unique", + formalDefinition="The portion of the identifier typically displayed to the user and which is unique within the context of the system." + ) + private StringDt myValue; + + @Child(name="period", type=PeriodDt.class, order=4, min=0, max=1) + @Description( + shortDefinition="Time period when id is/was valid for use", + formalDefinition="Time period during which identifier is/was valid for use" + ) + private PeriodDt myPeriod; + + @Child(name="assigner", order=5, min=0, max=1, type={ + ca.uhn.fhir.model.dstu.resource.Conformance.class }) + @Description( + shortDefinition="Organization that issued id (may be just text)", + formalDefinition="Organization that issued/manages the identifier" + ) + private ResourceReferenceDt myAssigner; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myLabel, mySystem, myValue, myPeriod, myAssigner); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myLabel, mySystem, myValue, myPeriod, myAssigner); + } + + /** + * Gets the value(s) for use (usual | official | temp | secondary (If known)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The purpose of this identifier + *

+ */ + public BoundCodeDt getUse() { + if (myUse == null) { + myUse = new BoundCodeDt(IdentifierUseEnum.VALUESET_BINDER); + } + return myUse; + } + + /** + * Sets the value(s) for use (usual | official | temp | secondary (If known)) + * + *

+ * Definition: + * The purpose of this identifier + *

+ */ + public IdentifierDt setUse(BoundCodeDt theValue) { + myUse = theValue; + return this; + } + + /** + * Sets the value(s) for use (usual | official | temp | secondary (If known)) + * + *

+ * Definition: + * The purpose of this identifier + *

+ */ + public IdentifierDt setUse(IdentifierUseEnum theValue) { + getUse().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for label (Description of identifier). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A text string for the identifier that can be displayed to a human so they can recognize the identifier + *

+ */ + public StringDt getLabel() { + if (myLabel == null) { + myLabel = new StringDt(); + } + return myLabel; + } + + /** + * Sets the value(s) for label (Description of identifier) + * + *

+ * Definition: + * A text string for the identifier that can be displayed to a human so they can recognize the identifier + *

+ */ + public IdentifierDt setLabel(StringDt theValue) { + myLabel = theValue; + return this; + } + + /** + * Sets the value for label (Description of identifier) + * + *

+ * Definition: + * A text string for the identifier that can be displayed to a human so they can recognize the identifier + *

+ */ + public IdentifierDt setLabel( String theString) { + myLabel = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for system (The namespace for the identifier). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Establishes the namespace in which set of possible id values is unique. + *

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

+ * Definition: + * Establishes the namespace in which set of possible id values is unique. + *

+ */ + public IdentifierDt setSystem(UriDt theValue) { + mySystem = theValue; + return this; + } + + /** + * Sets the value for system (The namespace for the identifier) + * + *

+ * Definition: + * Establishes the namespace in which set of possible id values is unique. + *

+ */ + public IdentifierDt setSystem( String theUri) { + mySystem = new UriDt(theUri); + return this; + } + + + /** + * Gets the value(s) for value (The value that is unique). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The portion of the identifier typically displayed to the user and which is unique within the context of the system. + *

+ */ + public StringDt getValue() { + if (myValue == null) { + myValue = new StringDt(); + } + return myValue; + } + + /** + * Sets the value(s) for value (The value that is unique) + * + *

+ * Definition: + * The portion of the identifier typically displayed to the user and which is unique within the context of the system. + *

+ */ + public IdentifierDt setValue(StringDt theValue) { + myValue = theValue; + return this; + } + + /** + * Sets the value for value (The value that is unique) + * + *

+ * Definition: + * The portion of the identifier typically displayed to the user and which is unique within the context of the system. + *

+ */ + public IdentifierDt setValue( String theString) { + myValue = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for period (Time period when id is/was valid for use). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Time period during which identifier is/was valid for use + *

+ */ + public PeriodDt getPeriod() { + if (myPeriod == null) { + myPeriod = new PeriodDt(); + } + return myPeriod; + } + + /** + * Sets the value(s) for period (Time period when id is/was valid for use) + * + *

+ * Definition: + * Time period during which identifier is/was valid for use + *

+ */ + public IdentifierDt setPeriod(PeriodDt theValue) { + myPeriod = theValue; + return this; + } + + + /** + * Gets the value(s) for assigner (Organization that issued id (may be just text)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Organization that issued/manages the identifier + *

+ */ + public ResourceReferenceDt getAssigner() { + if (myAssigner == null) { + myAssigner = new ResourceReferenceDt(); + } + return myAssigner; + } + + /** + * Sets the value(s) for assigner (Organization that issued id (may be just text)) + * + *

+ * Definition: + * Organization that issued/manages the identifier + *

+ */ + public IdentifierDt setAssigner(ResourceReferenceDt theValue) { + myAssigner = theValue; + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java new file mode 100644 index 00000000000..d442915f951 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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.dstu.valueset.NarrativeStatusEnum; +import ca.uhn.fhir.model.primitive.BoundCodeDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.XhtmlDt; + +/** + * HAPI/FHIR Narrative Datatype + * (A human-readable formatted text, including images) + * + *

+ * Definition: + * A human-readable formatted text, including images + *

+ * + *

+ * Requirements: + * + *

+ */ +@DatatypeDef(name="Narrative") +public class NarrativeDt extends BaseIdentifiableElement implements ICompositeDatatype { + + @Child(name="status", type=CodeDt.class, order=0, min=1, max=1) + private BoundCodeDt myStatus; + + @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 ); + } + + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements( theType, myStatus, myDiv ); + } + + /** + * Gets the value(s) for status (generated | extensions | additional). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data + *

+ */ + public BoundCodeDt getStatus() { + if (myStatus == null) { + myStatus = new BoundCodeDt(NarrativeStatusEnum.VALUESET_BINDER); + } + return myStatus; + } + + /** + * Sets the value(s) for status (generated | extensions | additional) + * + *

+ * Definition: + * The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data + *

+ */ + public void setStatus(BoundCodeDt theValue) { + myStatus = theValue; + } + + /** + * Sets the value(s) for status (generated | extensions | additional) + * + *

+ * Definition: + * The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data + *

+ */ + public void setStatus(NarrativeStatusEnum theValue) { + getStatus().setValueAsEnum(theValue); + } + + + /** + * Gets the value(s) for div (Limited xhtml content). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The actual narrative content, a stripped down version of XHTML + *

+ */ + public XhtmlDt getDiv() { + if (myDiv == null) { + myDiv = new XhtmlDt(); + } + return myDiv; + } + + /** + * Sets the value(s) for div (Limited xhtml content) + * + *

+ * Definition: + * The actual narrative content, a stripped down version of XHTML + *

+ */ + public void setDiv(XhtmlDt theValue) { + myDiv = theValue; + } + + /** + * Sets the value using a textual DIV (or simple text block which will be + * converted to XHTML) + */ + public void setDiv(String theTextDiv) { + myDiv = new XhtmlDt(theTextDiv); + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java new file mode 100644 index 00000000000..e6bcd4ff20a --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.Date; +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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; + +/** + * HAPI/FHIR PeriodDt Datatype + * (Time range defined by start and end date/time) + * + *

+ * Definition: + * A time period defined by a start and end date and optionally time. + *

+ * + *

+ * Requirements: + * + *

+ */ +@DatatypeDef(name="PeriodDt") +public class PeriodDt + extends BaseIdentifiableElement implements ICompositeDatatype +{ + + /** + * Constructor + */ + public PeriodDt() { + // nothing + } + + + @Child(name="start", type=DateTimeDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Starting time with inclusive boundary", + formalDefinition="The start of the period. The boundary is inclusive." + ) + private DateTimeDt myStart; + + @Child(name="end", type=DateTimeDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="End time with inclusive boundary, if not ongoing", + formalDefinition="The end of the period. If the end of the period is missing, it means that the period is ongoing" + ) + private DateTimeDt myEnd; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myStart, myEnd); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStart, myEnd); + } + + /** + * Gets the value(s) for start (Starting time with inclusive boundary). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The start of the period. The boundary is inclusive. + *

+ */ + public DateTimeDt getStart() { + if (myStart == null) { + myStart = new DateTimeDt(); + } + return myStart; + } + + /** + * Sets the value(s) for start (Starting time with inclusive boundary) + * + *

+ * Definition: + * The start of the period. The boundary is inclusive. + *

+ */ + public PeriodDt setStart(DateTimeDt theValue) { + myStart = theValue; + return this; + } + + /** + * Sets the value for start (Starting time with inclusive boundary) + * + *

+ * Definition: + * The start of the period. The boundary is inclusive. + *

+ */ + public PeriodDt setStartWithSecondsPrecision( Date theDate) { + myStart = new DateTimeDt(theDate); + return this; + } + + /** + * Sets the value for start (Starting time with inclusive boundary) + * + *

+ * Definition: + * The start of the period. The boundary is inclusive. + *

+ */ + public PeriodDt setStart( Date theDate, TemporalPrecisionEnum thePrecision) { + myStart = new DateTimeDt(theDate, thePrecision); + return this; + } + + + /** + * Gets the value(s) for end (End time with inclusive boundary, if not ongoing). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The end of the period. If the end of the period is missing, it means that the period is ongoing + *

+ */ + public DateTimeDt getEnd() { + if (myEnd == null) { + myEnd = new DateTimeDt(); + } + return myEnd; + } + + /** + * Sets the value(s) for end (End time with inclusive boundary, if not ongoing) + * + *

+ * Definition: + * The end of the period. If the end of the period is missing, it means that the period is ongoing + *

+ */ + public PeriodDt setEnd(DateTimeDt theValue) { + myEnd = theValue; + return this; + } + + /** + * Sets the value for end (End time with inclusive boundary, if not ongoing) + * + *

+ * Definition: + * The end of the period. If the end of the period is missing, it means that the period is ongoing + *

+ */ + public PeriodDt setEndWithSecondsPrecision( Date theDate) { + myEnd = new DateTimeDt(theDate); + return this; + } + + /** + * Sets the value for end (End time with inclusive boundary, if not ongoing) + * + *

+ * Definition: + * The end of the period. If the end of the period is missing, it means that the period is ongoing + *

+ */ + public PeriodDt setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { + myEnd = new DateTimeDt(theDate, thePrecision); + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java new file mode 100644 index 00000000000..06b7321e2dd --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +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.api.annotation.SimpleSetter; +import ca.uhn.fhir.model.base.composite.BaseQuantityDt; +import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.primitive.BoundCodeDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.DecimalDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.UriDt; + +/** + * HAPI/FHIR QuantityDt Datatype + * (A measured or measurable amount) + * + *

+ * Definition: + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies + *

+ * + *

+ * Requirements: + * Need to able to capture all sorts of measured values, even if the measured value are not precisely quantified. Values include exact measures such as 3.51g, customary units such as 3 tablets, and currencies such as $100.32USD + *

+ */ +@DatatypeDef(name="QuantityDt") +public class QuantityDt + extends BaseQuantityDt implements ICompositeDatatype +{ + + /** + * Constructor + */ + public QuantityDt() { + // nothing + } + + /** + * Constructor + */ + @SimpleSetter + public QuantityDt(@SimpleSetter.Parameter(name="theValue") double theValue) { + setValue(theValue); + } + + /** + * Constructor + */ + @SimpleSetter + public QuantityDt(@SimpleSetter.Parameter(name="theValue") long theValue) { + setValue(theValue); + } + + /** + * Constructor + */ + @SimpleSetter + public QuantityDt(@SimpleSetter.Parameter(name = "theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name = "theValue") double theValue, + @SimpleSetter.Parameter(name = "theUnits") String theUnits) { + setValue(theValue); + setComparator(theComparator); + setUnits(theUnits); + } + + /** + * Constructor + */ + @SimpleSetter + public QuantityDt(@SimpleSetter.Parameter(name = "theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name = "theValue") long theValue, + @SimpleSetter.Parameter(name = "theUnits") String theUnits) { + setValue(theValue); + setComparator(theComparator); + setUnits(theUnits); + } + + /** + * Constructor + */ + @SimpleSetter + public QuantityDt(@SimpleSetter.Parameter(name="theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name="theValue") double theValue, @SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theUnits") String theUnits) { + setValue(theValue); + setComparator(theComparator); + setSystem(theSystem); + setUnits(theUnits); + } + + /** + * Constructor + */ + @SimpleSetter + public QuantityDt(@SimpleSetter.Parameter(name="theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name="theValue") long theValue, @SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theUnits") String theUnits) { + setValue(theValue); + setComparator(theComparator); + setSystem(theSystem); + setUnits(theUnits); + } + + + @Child(name="value", type=DecimalDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Numerical value (with implicit precision)", + formalDefinition="The value of the measured amount. The value includes an implicit precision in the presentation of the value" + ) + private DecimalDt myValue; + + @Child(name="comparator", type=CodeDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="< | <= | >= | > - how to understand the value", + formalDefinition="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value" + ) + private BoundCodeDt myComparator; + + @Child(name="units", type=StringDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Unit representation", + formalDefinition="A human-readable form of the units" + ) + private StringDt myUnits; + + @Child(name="system", type=UriDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="System that defines coded unit form", + formalDefinition="The identification of the system that provides the coded form of the unit" + ) + private UriDt mySystem; + + @Child(name="code", type=CodeDt.class, order=4, min=0, max=1) + @Description( + shortDefinition="Coded form of the unit", + formalDefinition="A computer processable form of the units in some unit representation system" + ) + private CodeDt myCode; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myValue, myComparator, myUnits, mySystem, myCode); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myValue, myComparator, myUnits, mySystem, myCode); + } + + /** + * Gets the value(s) for value (Numerical value (with implicit precision)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The value of the measured amount. The value includes an implicit precision in the presentation of the value + *

+ */ + public DecimalDt getValue() { + if (myValue == null) { + myValue = new DecimalDt(); + } + return myValue; + } + + /** + * Sets the value(s) for value (Numerical value (with implicit precision)) + * + *

+ * Definition: + * The value of the measured amount. The value includes an implicit precision in the presentation of the value + *

+ */ + public QuantityDt setValue(DecimalDt theValue) { + myValue = theValue; + return this; + } + + /** + * Sets the value for value (Numerical value (with implicit precision)) + * + *

+ * Definition: + * The value of the measured amount. The value includes an implicit precision in the presentation of the value + *

+ */ + public QuantityDt setValue( long theValue) { + myValue = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for value (Numerical value (with implicit precision)) + * + *

+ * Definition: + * The value of the measured amount. The value includes an implicit precision in the presentation of the value + *

+ */ + public QuantityDt setValue( double theValue) { + myValue = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for value (Numerical value (with implicit precision)) + * + *

+ * Definition: + * The value of the measured amount. The value includes an implicit precision in the presentation of the value + *

+ */ + public QuantityDt setValue( java.math.BigDecimal theValue) { + myValue = new DecimalDt(theValue); + return this; + } + + + /** + * Gets the value(s) for comparator (< | <= | >= | > - how to understand the value). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value + *

+ */ + public BoundCodeDt getComparator() { + if (myComparator == null) { + myComparator = new BoundCodeDt(QuantityCompararatorEnum.VALUESET_BINDER); + } + return myComparator; + } + + /** + * Sets the value(s) for comparator (< | <= | >= | > - how to understand the value) + * + *

+ * Definition: + * How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value + *

+ */ + public QuantityDt setComparator(BoundCodeDt theValue) { + myComparator = theValue; + return this; + } + + /** + * Sets the value(s) for comparator (< | <= | >= | > - how to understand the value) + * + *

+ * Definition: + * How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value + *

+ */ + public QuantityDt setComparator(QuantityCompararatorEnum theValue) { + getComparator().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for units (Unit representation). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A human-readable form of the units + *

+ */ + public StringDt getUnits() { + if (myUnits == null) { + myUnits = new StringDt(); + } + return myUnits; + } + + /** + * Sets the value(s) for units (Unit representation) + * + *

+ * Definition: + * A human-readable form of the units + *

+ */ + public QuantityDt setUnits(StringDt theValue) { + myUnits = theValue; + return this; + } + + /** + * Sets the value for units (Unit representation) + * + *

+ * Definition: + * A human-readable form of the units + *

+ */ + public QuantityDt setUnits( String theString) { + myUnits = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for system (System that defines coded unit form). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The identification of the system that provides the coded form of the unit + *

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

+ * Definition: + * The identification of the system that provides the coded form of the unit + *

+ */ + public QuantityDt setSystem(UriDt theValue) { + mySystem = theValue; + return this; + } + + /** + * Sets the value for system (System that defines coded unit form) + * + *

+ * Definition: + * The identification of the system that provides the coded form of the unit + *

+ */ + public QuantityDt setSystem( String theUri) { + mySystem = new UriDt(theUri); + return this; + } + + + /** + * Gets the value(s) for code (Coded form of the unit). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A computer processable form of the units in some unit representation system + *

+ */ + public CodeDt getCode() { + if (myCode == null) { + myCode = new CodeDt(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Coded form of the unit) + * + *

+ * Definition: + * A computer processable form of the units in some unit representation system + *

+ */ + public QuantityDt setCode(CodeDt theValue) { + myCode = theValue; + return this; + } + + /** + * Sets the value for code (Coded form of the unit) + * + *

+ * Definition: + * A computer processable form of the units in some unit representation system + *

+ */ + public QuantityDt setCode( String theCode) { + myCode = new CodeDt(theCode); + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java new file mode 100644 index 00000000000..8a23cb4785a --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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; + +/** + * HAPI/FHIR RangeDt Datatype + * (Set of values bounded by low and high) + * + *

+ * Definition: + * A set of ordered Quantities defined by a low and high limit. + *

+ * + *

+ * Requirements: + * Need to be able to specify ranges of values + *

+ */ +@DatatypeDef(name="RangeDt") +public class RangeDt + extends BaseIdentifiableElement implements ICompositeDatatype +{ + + /** + * Constructor + */ + public RangeDt() { + // nothing + } + + + @Child(name="low", type=QuantityDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Low limit", + formalDefinition="The low limit. The boundary is inclusive." + ) + private QuantityDt myLow; + + @Child(name="high", type=QuantityDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="High limit", + formalDefinition="The high limit. The boundary is inclusive." + ) + private QuantityDt myHigh; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLow, myHigh); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLow, myHigh); + } + + /** + * Gets the value(s) for low (Low limit). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The low limit. The boundary is inclusive. + *

+ */ + public QuantityDt getLow() { + if (myLow == null) { + myLow = new QuantityDt(); + } + return myLow; + } + + /** + * Sets the value(s) for low (Low limit) + * + *

+ * Definition: + * The low limit. The boundary is inclusive. + *

+ */ + public RangeDt setLow(QuantityDt theValue) { + myLow = theValue; + return this; + } + + /** + * Sets the value for low (Low limit) + * + *

+ * Definition: + * The low limit. The boundary is inclusive. + *

+ */ + public RangeDt setLow( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { + myLow = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for low (Low limit) + * + *

+ * Definition: + * The low limit. The boundary is inclusive. + *

+ */ + public RangeDt setLow( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { + myLow = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for low (Low limit) + * + *

+ * Definition: + * The low limit. The boundary is inclusive. + *

+ */ + public RangeDt setLow( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { + myLow = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for low (Low limit) + * + *

+ * Definition: + * The low limit. The boundary is inclusive. + *

+ */ + public RangeDt setLow( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { + myLow = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for low (Low limit) + * + *

+ * Definition: + * The low limit. The boundary is inclusive. + *

+ */ + public RangeDt setLow( double theValue) { + myLow = new QuantityDt(theValue); + return this; + } + + /** + * Sets the value for low (Low limit) + * + *

+ * Definition: + * The low limit. The boundary is inclusive. + *

+ */ + public RangeDt setLow( long theValue) { + myLow = new QuantityDt(theValue); + return this; + } + + + /** + * Gets the value(s) for high (High limit). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The high limit. The boundary is inclusive. + *

+ */ + public QuantityDt getHigh() { + if (myHigh == null) { + myHigh = new QuantityDt(); + } + return myHigh; + } + + /** + * Sets the value(s) for high (High limit) + * + *

+ * Definition: + * The high limit. The boundary is inclusive. + *

+ */ + public RangeDt setHigh(QuantityDt theValue) { + myHigh = theValue; + return this; + } + + /** + * Sets the value for high (High limit) + * + *

+ * Definition: + * The high limit. The boundary is inclusive. + *

+ */ + public RangeDt setHigh( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { + myHigh = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for high (High limit) + * + *

+ * Definition: + * The high limit. The boundary is inclusive. + *

+ */ + public RangeDt setHigh( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { + myHigh = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for high (High limit) + * + *

+ * Definition: + * The high limit. The boundary is inclusive. + *

+ */ + public RangeDt setHigh( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { + myHigh = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for high (High limit) + * + *

+ * Definition: + * The high limit. The boundary is inclusive. + *

+ */ + public RangeDt setHigh( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { + myHigh = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for high (High limit) + * + *

+ * Definition: + * The high limit. The boundary is inclusive. + *

+ */ + public RangeDt setHigh( double theValue) { + myHigh = new QuantityDt(theValue); + return this; + } + + /** + * Sets the value for high (High limit) + * + *

+ * Definition: + * The high limit. The boundary is inclusive. + *

+ */ + public RangeDt setHigh( long theValue) { + myHigh = new QuantityDt(theValue); + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java new file mode 100644 index 00000000000..39850e81c07 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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; + +/** + * HAPI/FHIR RatioDt Datatype + * (A ratio of two Quantity values - a numerator and a denominator) + * + *

+ * Definition: + * A relationship of two Quantity values - expressed as a numerator and a denominator. + *

+ * + *

+ * Requirements: + * Need to able to capture ratios for some measurements (titers) and some rates (costs) + *

+ */ +@DatatypeDef(name="RatioDt") +public class RatioDt + extends BaseIdentifiableElement implements ICompositeDatatype +{ + + /** + * Constructor + */ + public RatioDt() { + // nothing + } + + + @Child(name="numerator", type=QuantityDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Numerator value", + formalDefinition="The value of the numerator" + ) + private QuantityDt myNumerator; + + @Child(name="denominator", type=QuantityDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Denominator value", + formalDefinition="The value of the denominator" + ) + private QuantityDt myDenominator; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myNumerator, myDenominator); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myNumerator, myDenominator); + } + + /** + * Gets the value(s) for numerator (Numerator value). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The value of the numerator + *

+ */ + public QuantityDt getNumerator() { + if (myNumerator == null) { + myNumerator = new QuantityDt(); + } + return myNumerator; + } + + /** + * Sets the value(s) for numerator (Numerator value) + * + *

+ * Definition: + * The value of the numerator + *

+ */ + public RatioDt setNumerator(QuantityDt theValue) { + myNumerator = theValue; + return this; + } + + /** + * Sets the value for numerator (Numerator value) + * + *

+ * Definition: + * The value of the numerator + *

+ */ + public RatioDt setNumerator( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { + myNumerator = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for numerator (Numerator value) + * + *

+ * Definition: + * The value of the numerator + *

+ */ + public RatioDt setNumerator( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { + myNumerator = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for numerator (Numerator value) + * + *

+ * Definition: + * The value of the numerator + *

+ */ + public RatioDt setNumerator( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { + myNumerator = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for numerator (Numerator value) + * + *

+ * Definition: + * The value of the numerator + *

+ */ + public RatioDt setNumerator( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { + myNumerator = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for numerator (Numerator value) + * + *

+ * Definition: + * The value of the numerator + *

+ */ + public RatioDt setNumerator( double theValue) { + myNumerator = new QuantityDt(theValue); + return this; + } + + /** + * Sets the value for numerator (Numerator value) + * + *

+ * Definition: + * The value of the numerator + *

+ */ + public RatioDt setNumerator( long theValue) { + myNumerator = new QuantityDt(theValue); + return this; + } + + + /** + * Gets the value(s) for denominator (Denominator value). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The value of the denominator + *

+ */ + public QuantityDt getDenominator() { + if (myDenominator == null) { + myDenominator = new QuantityDt(); + } + return myDenominator; + } + + /** + * Sets the value(s) for denominator (Denominator value) + * + *

+ * Definition: + * The value of the denominator + *

+ */ + public RatioDt setDenominator(QuantityDt theValue) { + myDenominator = theValue; + return this; + } + + /** + * Sets the value for denominator (Denominator value) + * + *

+ * Definition: + * The value of the denominator + *

+ */ + public RatioDt setDenominator( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { + myDenominator = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for denominator (Denominator value) + * + *

+ * Definition: + * The value of the denominator + *

+ */ + public RatioDt setDenominator( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { + myDenominator = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for denominator (Denominator value) + * + *

+ * Definition: + * The value of the denominator + *

+ */ + public RatioDt setDenominator( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { + myDenominator = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for denominator (Denominator value) + * + *

+ * Definition: + * The value of the denominator + *

+ */ + public RatioDt setDenominator( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { + myDenominator = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for denominator (Denominator value) + * + *

+ * Definition: + * The value of the denominator + *

+ */ + public RatioDt setDenominator( double theValue) { + myDenominator = new QuantityDt(theValue); + return this; + } + + /** + * Sets the value for denominator (Denominator value) + * + *

+ * Definition: + * The value of the denominator + *

+ */ + public RatioDt setDenominator( long theValue) { + myDenominator = new QuantityDt(theValue); + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java new file mode 100644 index 00000000000..4f0a2b479d4 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +import ca.uhn.fhir.model.api.ICompositeDatatype; +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.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.StringDt; + +/** + * HAPI/FHIR ResourceReferenceDt Datatype + * (A reference from one resource to another) + * + *

+ * Definition: + * A reference from one resource to another + *

+ * + *

+ * Requirements: + * + *

+ */ +@DatatypeDef(name="ResourceReferenceDt") +public class ResourceReferenceDt + extends BaseResourceReferenceDt implements ICompositeDatatype +{ + + /** + * Constructor + */ + public ResourceReferenceDt() { + // nothing + } + + /** + * Constructor which creates a resource reference containing the actual resource in question. + *

+ * When using this in a server: Generally if this is serialized, it will be serialized as a contained + * resource, so this should not be used if the intent is not to actually supply the referenced resource. This is not + * a hard-and-fast rule however, as the server can be configured to not serialized this resource, or to load an ID + * and contain even if this constructor is not used. + *

+ * + * @param theResource + * The resource instance + */ + public ResourceReferenceDt(IResource theResource) { + super(theResource); + } + + /** + * Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute + * URL) + * + * @param theId + * The reference itself + */ + public ResourceReferenceDt(String theId) { + setReference(new IdDt(theId)); + } + + /** + * Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute + * URL) + * + * @param theId + * The reference itself + */ + public ResourceReferenceDt(IdDt theResourceId) { + setReference(theResourceId); + } + + @Child(name="reference", type=IdDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Relative, internal or absolute URL reference", + formalDefinition="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" + ) + private IdDt myReference; + + @Child(name="display", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Text alternative for the resource", + formalDefinition="Plain text narrative that identifies the resource in addition to the resource reference" + ) + private StringDt myDisplay; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myReference, myDisplay); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myReference, myDisplay); + } + + /** + * Gets the value(s) for reference (Relative, internal or absolute URL reference). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 IdDt getReference() { + if (myReference == null) { + myReference = new IdDt(); + } + return myReference; + } + + /** + * Sets the value(s) for reference (Relative, internal or absolute URL reference) + * + *

+ * Definition: + * 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 ResourceReferenceDt setReference(IdDt theValue) { + myReference = theValue; + return this; + } + + /** + * Sets the value for reference (Relative, internal or absolute URL reference) + * + *

+ * Definition: + * 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 ResourceReferenceDt setReference( String theId) { + myReference = new IdDt(theId); + return this; + } + + + /** + * Gets the value(s) for display (Text alternative for the resource). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Plain text narrative that identifies the resource in addition to the resource reference + *

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

+ * Definition: + * Plain text narrative that identifies the resource in addition to the resource reference + *

+ */ + public ResourceReferenceDt setDisplay(StringDt theValue) { + myDisplay = theValue; + return this; + } + + /** + * Sets the value for display (Text alternative for the resource) + * + *

+ * Definition: + * Plain text narrative that identifies the resource in addition to the resource reference + *

+ */ + public ResourceReferenceDt setDisplay( String theString) { + myDisplay = new StringDt(theString); + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java new file mode 100644 index 00000000000..d9b2483396a --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java @@ -0,0 +1,618 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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.primitive.DecimalDt; +import ca.uhn.fhir.model.primitive.IntegerDt; +import ca.uhn.fhir.model.primitive.StringDt; + +/** + * HAPI/FHIR SampledDataDt Datatype + * (A series of measurements taken by a device) + * + *

+ * Definition: + * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data + *

+ * + *

+ * Requirements: + * There is a need for a concise way to handle the data produced by devices that sample a physical state at a high frequency + *

+ */ +@DatatypeDef(name="SampledDataDt") +public class SampledDataDt + extends BaseIdentifiableElement implements ICompositeDatatype +{ + + /** + * Constructor + */ + public SampledDataDt() { + // nothing + } + + + @Child(name="origin", type=QuantityDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Zero value and units", + formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series" + ) + private QuantityDt myOrigin; + + @Child(name="period", type=DecimalDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="Number of milliseconds between samples", + formalDefinition="The length of time between sampling times, measured in milliseconds" + ) + private DecimalDt myPeriod; + + @Child(name="factor", type=DecimalDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Multiply data by this before adding to origin", + formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin" + ) + private DecimalDt myFactor; + + @Child(name="lowerLimit", type=DecimalDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Lower limit of detection", + formalDefinition="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)" + ) + private DecimalDt myLowerLimit; + + @Child(name="upperLimit", type=DecimalDt.class, order=4, min=0, max=1) + @Description( + shortDefinition="Upper limit of detection", + formalDefinition="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)" + ) + private DecimalDt myUpperLimit; + + @Child(name="dimensions", type=IntegerDt.class, order=5, min=1, max=1) + @Description( + shortDefinition="Number of sample points at each time point", + formalDefinition="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" + ) + private IntegerDt myDimensions; + + @Child(name="data", type=StringDt.class, order=6, min=1, max=1) + @Description( + shortDefinition="Decimal values with spaces, or \"E\" | \"U\" | \"L\"", + formalDefinition="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" + ) + private StringDt myData; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myOrigin, myPeriod, myFactor, myLowerLimit, myUpperLimit, myDimensions, myData); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myOrigin, myPeriod, myFactor, myLowerLimit, myUpperLimit, myDimensions, myData); + } + + /** + * Gets the value(s) for origin (Zero value and units). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series + *

+ */ + public QuantityDt getOrigin() { + if (myOrigin == null) { + myOrigin = new QuantityDt(); + } + return myOrigin; + } + + /** + * Sets the value(s) for origin (Zero value and units) + * + *

+ * Definition: + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series + *

+ */ + public SampledDataDt setOrigin(QuantityDt theValue) { + myOrigin = theValue; + return this; + } + + /** + * Sets the value for origin (Zero value and units) + * + *

+ * Definition: + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series + *

+ */ + public SampledDataDt setOrigin( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { + myOrigin = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for origin (Zero value and units) + * + *

+ * Definition: + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series + *

+ */ + public SampledDataDt setOrigin( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { + myOrigin = new QuantityDt(theComparator, theValue, theUnits); + return this; + } + + /** + * Sets the value for origin (Zero value and units) + * + *

+ * Definition: + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series + *

+ */ + public SampledDataDt setOrigin( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { + myOrigin = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for origin (Zero value and units) + * + *

+ * Definition: + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series + *

+ */ + public SampledDataDt setOrigin( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { + myOrigin = new QuantityDt(theComparator, theValue, theSystem, theUnits); + return this; + } + + /** + * Sets the value for origin (Zero value and units) + * + *

+ * Definition: + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series + *

+ */ + public SampledDataDt setOrigin( double theValue) { + myOrigin = new QuantityDt(theValue); + return this; + } + + /** + * Sets the value for origin (Zero value and units) + * + *

+ * Definition: + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series + *

+ */ + public SampledDataDt setOrigin( long theValue) { + myOrigin = new QuantityDt(theValue); + return this; + } + + + /** + * Gets the value(s) for period (Number of milliseconds between samples). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The length of time between sampling times, measured in milliseconds + *

+ */ + public DecimalDt getPeriod() { + if (myPeriod == null) { + myPeriod = new DecimalDt(); + } + return myPeriod; + } + + /** + * Sets the value(s) for period (Number of milliseconds between samples) + * + *

+ * Definition: + * The length of time between sampling times, measured in milliseconds + *

+ */ + public SampledDataDt setPeriod(DecimalDt theValue) { + myPeriod = theValue; + return this; + } + + /** + * Sets the value for period (Number of milliseconds between samples) + * + *

+ * Definition: + * The length of time between sampling times, measured in milliseconds + *

+ */ + public SampledDataDt setPeriod( long theValue) { + myPeriod = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for period (Number of milliseconds between samples) + * + *

+ * Definition: + * The length of time between sampling times, measured in milliseconds + *

+ */ + public SampledDataDt setPeriod( double theValue) { + myPeriod = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for period (Number of milliseconds between samples) + * + *

+ * Definition: + * The length of time between sampling times, measured in milliseconds + *

+ */ + public SampledDataDt setPeriod( java.math.BigDecimal theValue) { + myPeriod = new DecimalDt(theValue); + return this; + } + + + /** + * Gets the value(s) for factor (Multiply data by this before adding to origin). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A correction factor that is applied to the sampled data points before they are added to the origin + *

+ */ + public DecimalDt getFactor() { + if (myFactor == null) { + myFactor = new DecimalDt(); + } + return myFactor; + } + + /** + * Sets the value(s) for factor (Multiply data by this before adding to origin) + * + *

+ * Definition: + * A correction factor that is applied to the sampled data points before they are added to the origin + *

+ */ + public SampledDataDt setFactor(DecimalDt theValue) { + myFactor = theValue; + return this; + } + + /** + * Sets the value for factor (Multiply data by this before adding to origin) + * + *

+ * Definition: + * A correction factor that is applied to the sampled data points before they are added to the origin + *

+ */ + public SampledDataDt setFactor( long theValue) { + myFactor = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for factor (Multiply data by this before adding to origin) + * + *

+ * Definition: + * A correction factor that is applied to the sampled data points before they are added to the origin + *

+ */ + public SampledDataDt setFactor( double theValue) { + myFactor = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for factor (Multiply data by this before adding to origin) + * + *

+ * Definition: + * A correction factor that is applied to the sampled data points before they are added to the origin + *

+ */ + public SampledDataDt setFactor( java.math.BigDecimal theValue) { + myFactor = new DecimalDt(theValue); + return this; + } + + + /** + * Gets the value(s) for lowerLimit (Lower limit of detection). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 DecimalDt getLowerLimit() { + if (myLowerLimit == null) { + myLowerLimit = new DecimalDt(); + } + return myLowerLimit; + } + + /** + * Sets the value(s) for lowerLimit (Lower limit of detection) + * + *

+ * Definition: + * 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 SampledDataDt setLowerLimit(DecimalDt theValue) { + myLowerLimit = theValue; + return this; + } + + /** + * Sets the value for lowerLimit (Lower limit of detection) + * + *

+ * Definition: + * 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 SampledDataDt setLowerLimit( long theValue) { + myLowerLimit = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for lowerLimit (Lower limit of detection) + * + *

+ * Definition: + * 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 SampledDataDt setLowerLimit( double theValue) { + myLowerLimit = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for lowerLimit (Lower limit of detection) + * + *

+ * Definition: + * 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 SampledDataDt setLowerLimit( java.math.BigDecimal theValue) { + myLowerLimit = new DecimalDt(theValue); + return this; + } + + + /** + * Gets the value(s) for upperLimit (Upper limit of detection). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 DecimalDt getUpperLimit() { + if (myUpperLimit == null) { + myUpperLimit = new DecimalDt(); + } + return myUpperLimit; + } + + /** + * Sets the value(s) for upperLimit (Upper limit of detection) + * + *

+ * Definition: + * 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 SampledDataDt setUpperLimit(DecimalDt theValue) { + myUpperLimit = theValue; + return this; + } + + /** + * Sets the value for upperLimit (Upper limit of detection) + * + *

+ * Definition: + * 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 SampledDataDt setUpperLimit( long theValue) { + myUpperLimit = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for upperLimit (Upper limit of detection) + * + *

+ * Definition: + * 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 SampledDataDt setUpperLimit( double theValue) { + myUpperLimit = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for upperLimit (Upper limit of detection) + * + *

+ * Definition: + * 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 SampledDataDt setUpperLimit( java.math.BigDecimal theValue) { + myUpperLimit = new DecimalDt(theValue); + return this; + } + + + /** + * Gets the value(s) for dimensions (Number of sample points at each time point). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 IntegerDt getDimensions() { + if (myDimensions == null) { + myDimensions = new IntegerDt(); + } + return myDimensions; + } + + /** + * Sets the value(s) for dimensions (Number of sample points at each time point) + * + *

+ * Definition: + * 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 SampledDataDt setDimensions(IntegerDt theValue) { + myDimensions = theValue; + return this; + } + + /** + * Sets the value for dimensions (Number of sample points at each time point) + * + *

+ * Definition: + * 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 SampledDataDt setDimensions( int theInteger) { + myDimensions = new IntegerDt(theInteger); + return this; + } + + + /** + * Gets the value(s) for data (Decimal values with spaces, or \"E\" | \"U\" | \"L\"). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getData() { + if (myData == null) { + myData = new StringDt(); + } + return myData; + } + + /** + * Sets the value(s) for data (Decimal values with spaces, or \"E\" | \"U\" | \"L\") + * + *

+ * Definition: + * 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 SampledDataDt setData(StringDt theValue) { + myData = theValue; + return this; + } + + /** + * Sets the value for data (Decimal values with spaces, or \"E\" | \"U\" | \"L\") + * + *

+ * Definition: + * 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 SampledDataDt setData( String theString) { + myData = new StringDt(theString); + return this; + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ScheduleDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ScheduleDt.java new file mode 100644 index 00000000000..e13545c60ca --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ScheduleDt.java @@ -0,0 +1,575 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.Date; +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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.UnitsOfTimeEnum; +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; + +/** + * HAPI/FHIR ScheduleDt Datatype + * (A schedule that specifies an event that may occur multiple times) + * + *

+ * Definition: + * Specifies an event that may occur multiple times. Schedules are used for to reord when things are expected or requested to occur. + *

+ * + *

+ * Requirements: + * Need to able to track schedules. There are several different ways to do scheduling: one or more specified times, a simple rules like three times a day, or before/after meals + *

+ */ +@DatatypeDef(name="ScheduleDt") +public class ScheduleDt + extends BaseIdentifiableElement implements ICompositeDatatype +{ + + /** + * Constructor + */ + public ScheduleDt() { + // nothing + } + + + @Child(name="event", type=PeriodDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="When the event occurs", + formalDefinition="Identifies specific time periods when the event should occur" + ) + private java.util.List myEvent; + + @Child(name="repeat", order=1, min=0, max=1) + @Description( + shortDefinition="Only if there is none or one event", + formalDefinition="Identifies a repeating pattern to the intended time periods." + ) + private Repeat myRepeat; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myEvent, myRepeat); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myEvent, myRepeat); + } + + /** + * Gets the value(s) for event (When the event occurs). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getEvent() { + if (myEvent == null) { + myEvent = new java.util.ArrayList(); + } + return myEvent; + } + + /** + * Sets the value(s) for event (When the event occurs) + * + *

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

+ */ + public ScheduleDt setEvent(java.util.List theValue) { + myEvent = theValue; + return this; + } + + /** + * Adds and returns a new value for event (When the event occurs) + * + *

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

+ */ + public PeriodDt addEvent() { + PeriodDt newType = new PeriodDt(); + getEvent().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies a repeating pattern to the intended time periods. + *

+ */ + public Repeat getRepeat() { + if (myRepeat == null) { + myRepeat = new Repeat(); + } + return myRepeat; + } + + /** + * Sets the value(s) for repeat (Only if there is none or one event) + * + *

+ * Definition: + * Identifies a repeating pattern to the intended time periods. + *

+ */ + public ScheduleDt setRepeat(Repeat theValue) { + myRepeat = theValue; + return this; + } + + + /** + * Block class for child element: Schedule.repeat (Only if there is none or one event) + * + *

+ * Definition: + * Identifies a repeating pattern to the intended time periods. + *

+ */ + @Block() + public static class Repeat extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="frequency", type=IntegerDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Event occurs frequency times per duration", + formalDefinition="Indicates how often the event should occur." + ) + private IntegerDt myFrequency; + + @Child(name="when", type=CodeDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events", + formalDefinition="Identifies the occurrence of daily life that determines timing" + ) + private BoundCodeDt myWhen; + + @Child(name="duration", type=DecimalDt.class, order=2, min=1, max=1) + @Description( + shortDefinition="Repeating or event-related duration", + formalDefinition="How long each repetition should last" + ) + private DecimalDt myDuration; + + @Child(name="units", type=CodeDt.class, order=3, min=1, max=1) + @Description( + shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", + formalDefinition="The units of time for the duration" + ) + private BoundCodeDt myUnits; + + @Child(name="count", type=IntegerDt.class, order=4, min=0, max=1) + @Description( + shortDefinition="Number of times to repeat", + formalDefinition="A total count of the desired number of repetitions" + ) + private IntegerDt myCount; + + @Child(name="end", type=DateTimeDt.class, order=5, min=0, max=1) + @Description( + shortDefinition="When to stop repeats", + formalDefinition="When to stop repeating the schedule" + ) + private DateTimeDt myEnd; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myFrequency, myWhen, myDuration, myUnits, myCount, myEnd); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myFrequency, myWhen, myDuration, myUnits, myCount, myEnd); + } + + /** + * Gets the value(s) for frequency (Event occurs frequency times per duration). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates how often the event should occur. + *

+ */ + public IntegerDt getFrequency() { + if (myFrequency == null) { + myFrequency = new IntegerDt(); + } + return myFrequency; + } + + /** + * Sets the value(s) for frequency (Event occurs frequency times per duration) + * + *

+ * Definition: + * Indicates how often the event should occur. + *

+ */ + public Repeat setFrequency(IntegerDt theValue) { + myFrequency = theValue; + return this; + } + + /** + * Sets the value for frequency (Event occurs frequency times per duration) + * + *

+ * Definition: + * Indicates how often the event should occur. + *

+ */ + public Repeat setFrequency( int theInteger) { + myFrequency = new IntegerDt(theInteger); + return this; + } + + + /** + * Gets the value(s) for when (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the occurrence of daily life that determines timing + *

+ */ + public BoundCodeDt getWhen() { + if (myWhen == null) { + myWhen = new BoundCodeDt(EventTimingEnum.VALUESET_BINDER); + } + return myWhen; + } + + /** + * Sets the value(s) for when (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events) + * + *

+ * Definition: + * Identifies the occurrence of daily life that determines timing + *

+ */ + public Repeat setWhen(BoundCodeDt theValue) { + myWhen = theValue; + return this; + } + + /** + * Sets the value(s) for when (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events) + * + *

+ * Definition: + * Identifies the occurrence of daily life that determines timing + *

+ */ + public Repeat setWhen(EventTimingEnum theValue) { + getWhen().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for duration (Repeating or event-related duration). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * How long each repetition should last + *

+ */ + public DecimalDt getDuration() { + if (myDuration == null) { + myDuration = new DecimalDt(); + } + return myDuration; + } + + /** + * Sets the value(s) for duration (Repeating or event-related duration) + * + *

+ * Definition: + * How long each repetition should last + *

+ */ + public Repeat setDuration(DecimalDt theValue) { + myDuration = theValue; + return this; + } + + /** + * Sets the value for duration (Repeating or event-related duration) + * + *

+ * Definition: + * How long each repetition should last + *

+ */ + public Repeat setDuration( long theValue) { + myDuration = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for duration (Repeating or event-related duration) + * + *

+ * Definition: + * How long each repetition should last + *

+ */ + public Repeat setDuration( double theValue) { + myDuration = new DecimalDt(theValue); + return this; + } + + /** + * Sets the value for duration (Repeating or event-related duration) + * + *

+ * Definition: + * How long each repetition should last + *

+ */ + public Repeat setDuration( java.math.BigDecimal theValue) { + myDuration = new DecimalDt(theValue); + return this; + } + + + /** + * Gets the value(s) for units (s | min | h | d | wk | mo | a - unit of time (UCUM)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The units of time for the duration + *

+ */ + public BoundCodeDt getUnits() { + if (myUnits == null) { + myUnits = new BoundCodeDt(UnitsOfTimeEnum.VALUESET_BINDER); + } + return myUnits; + } + + /** + * Sets the value(s) for units (s | min | h | d | wk | mo | a - unit of time (UCUM)) + * + *

+ * Definition: + * The units of time for the duration + *

+ */ + public Repeat setUnits(BoundCodeDt theValue) { + myUnits = theValue; + return this; + } + + /** + * Sets the value(s) for units (s | min | h | d | wk | mo | a - unit of time (UCUM)) + * + *

+ * Definition: + * The units of time for the duration + *

+ */ + public Repeat setUnits(UnitsOfTimeEnum theValue) { + getUnits().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for count (Number of times to repeat). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A total count of the desired number of repetitions + *

+ */ + public IntegerDt getCount() { + if (myCount == null) { + myCount = new IntegerDt(); + } + return myCount; + } + + /** + * Sets the value(s) for count (Number of times to repeat) + * + *

+ * Definition: + * A total count of the desired number of repetitions + *

+ */ + public Repeat setCount(IntegerDt theValue) { + myCount = theValue; + return this; + } + + /** + * Sets the value for count (Number of times to repeat) + * + *

+ * Definition: + * A total count of the desired number of repetitions + *

+ */ + public Repeat setCount( int theInteger) { + myCount = new IntegerDt(theInteger); + return this; + } + + + /** + * Gets the value(s) for end (When to stop repeats). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * When to stop repeating the schedule + *

+ */ + public DateTimeDt getEnd() { + if (myEnd == null) { + myEnd = new DateTimeDt(); + } + return myEnd; + } + + /** + * Sets the value(s) for end (When to stop repeats) + * + *

+ * Definition: + * When to stop repeating the schedule + *

+ */ + public Repeat setEnd(DateTimeDt theValue) { + myEnd = theValue; + return this; + } + + /** + * Sets the value for end (When to stop repeats) + * + *

+ * Definition: + * When to stop repeating the schedule + *

+ */ + public Repeat setEndWithSecondsPrecision( Date theDate) { + myEnd = new DateTimeDt(theDate); + return this; + } + + /** + * Sets the value for end (When to stop repeats) + * + *

+ * Definition: + * When to stop repeating the schedule + *

+ */ + public Repeat setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { + myEnd = new DateTimeDt(theDate, thePrecision); + return this; + } + + + + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java new file mode 100644 index 00000000000..fb7805f4b45 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java @@ -0,0 +1,4885 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.resource; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.util.Date; +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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.Include; +import ca.uhn.fhir.model.api.TemporalPrecisionEnum; +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +import ca.uhn.fhir.model.base.resource.BaseConformance; +import ca.uhn.fhir.model.dstu.composite.BoundCodeableConceptDt; +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.ContactUseEnum; +import ca.uhn.fhir.model.dstu.valueset.DocumentModeEnum; +import ca.uhn.fhir.model.dstu.valueset.MessageSignificanceCategoryEnum; +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.valueset.SearchParamTypeEnum; +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.IdDt; +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.rest.gclient.DateClientParam; +import ca.uhn.fhir.rest.gclient.ReferenceClientParam; +import ca.uhn.fhir.rest.gclient.StringClientParam; +import ca.uhn.fhir.rest.gclient.TokenClientParam; + + +/** + * HAPI/FHIR Conformance Resource + * (A conformance statement) + * + *

+ * Definition: + * A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation + *

+ * + *

+ * Requirements: + * + *

+ * + *

+ * Profile Definition: + * http://hl7.org/fhir/profiles/Conformance + *

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

+ * Description: The identifier of the conformance statement
+ * Type: token
+ * Path: Conformance.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Conformance.identifier", description="The identifier of the conformance statement", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identifier of the conformance statement
+ * Type: token
+ * Path: Conformance.identifier
+ *

+ */ + public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter constant for version + *

+ * Description: The version identifier of the conformance statement
+ * Type: token
+ * Path: Conformance.version
+ *

+ */ + @SearchParamDefinition(name="version", path="Conformance.version", description="The version identifier of the conformance statement", type="token" ) + public static final String SP_VERSION = "version"; + + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the conformance statement
+ * Type: token
+ * Path: Conformance.version
+ *

+ */ + public static final TokenClientParam VERSION = new TokenClientParam(SP_VERSION); + + /** + * Search parameter constant for name + *

+ * Description: Name of the conformance statement
+ * Type: string
+ * Path: Conformance.name
+ *

+ */ + @SearchParamDefinition(name="name", path="Conformance.name", description="Name of the conformance statement", type="string" ) + public static final String SP_NAME = "name"; + + /** + * Fluent Client search parameter constant for name + *

+ * Description: Name of the conformance statement
+ * Type: string
+ * Path: Conformance.name
+ *

+ */ + public static final StringClientParam NAME = new StringClientParam(SP_NAME); + + /** + * Search parameter constant for publisher + *

+ * Description: Name of the publisher of the conformance statement
+ * Type: string
+ * Path: Conformance.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="Conformance.publisher", description="Name of the publisher of the conformance statement", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the conformance statement
+ * Type: string
+ * Path: Conformance.publisher
+ *

+ */ + public static final StringClientParam PUBLISHER = new StringClientParam(SP_PUBLISHER); + + /** + * Search parameter constant for description + *

+ * Description: Text search in the description of the conformance statement
+ * Type: string
+ * Path: Conformance.description
+ *

+ */ + @SearchParamDefinition(name="description", path="Conformance.description", description="Text search in the description of the conformance statement", type="string" ) + public static final String SP_DESCRIPTION = "description"; + + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the conformance statement
+ * Type: string
+ * Path: Conformance.description
+ *

+ */ + public static final StringClientParam DESCRIPTION = new StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter constant for status + *

+ * Description: The current status of the conformance statement
+ * Type: token
+ * Path: Conformance.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Conformance.status", description="The current status of the conformance statement", type="token" ) + public static final String SP_STATUS = "status"; + + /** + * Fluent Client search parameter constant for status + *

+ * Description: The current status of the conformance statement
+ * Type: token
+ * Path: Conformance.status
+ *

+ */ + public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS); + + /** + * Search parameter constant for date + *

+ * Description: The conformance statement publication date
+ * Type: date
+ * Path: Conformance.date
+ *

+ */ + @SearchParamDefinition(name="date", path="Conformance.date", description="The conformance statement publication date", type="date" ) + public static final String SP_DATE = "date"; + + /** + * Fluent Client search parameter constant for date + *

+ * Description: The conformance statement publication date
+ * Type: date
+ * Path: Conformance.date
+ *

+ */ + public static final DateClientParam DATE = new DateClientParam(SP_DATE); + + /** + * Search parameter constant for software + *

+ * Description: Part of a the name of a software application
+ * Type: string
+ * Path: Conformance.software.name
+ *

+ */ + @SearchParamDefinition(name="software", path="Conformance.software.name", description="Part of a the name of a software application", type="string" ) + public static final String SP_SOFTWARE = "software"; + + /** + * Fluent Client search parameter constant for software + *

+ * Description: Part of a the name of a software application
+ * Type: string
+ * Path: Conformance.software.name
+ *

+ */ + public static final StringClientParam SOFTWARE = new StringClientParam(SP_SOFTWARE); + + /** + * Search parameter constant for fhirversion + *

+ * Description: The version of FHIR
+ * Type: token
+ * Path: Conformance.version
+ *

+ */ + @SearchParamDefinition(name="fhirversion", path="Conformance.version", description="The version of FHIR", type="token" ) + public static final String SP_FHIRVERSION = "fhirversion"; + + /** + * Fluent Client search parameter constant for fhirversion + *

+ * Description: The version of FHIR
+ * Type: token
+ * Path: Conformance.version
+ *

+ */ + public static final TokenClientParam FHIRVERSION = new TokenClientParam(SP_FHIRVERSION); + + /** + * Search parameter constant for resource + *

+ * Description: Name of a resource mentioned in a conformance statement
+ * Type: token
+ * Path: Conformance.rest.resource.type
+ *

+ */ + @SearchParamDefinition(name="resource", path="Conformance.rest.resource.type", description="Name of a resource mentioned in a conformance statement", type="token" ) + public static final String SP_RESOURCE = "resource"; + + /** + * Fluent Client search parameter constant for resource + *

+ * Description: Name of a resource mentioned in a conformance statement
+ * Type: token
+ * Path: Conformance.rest.resource.type
+ *

+ */ + public static final TokenClientParam RESOURCE = new TokenClientParam(SP_RESOURCE); + + /** + * Search parameter constant for event + *

+ * Description: Event code in a conformance statement
+ * Type: token
+ * Path: Conformance.messaging.event.code
+ *

+ */ + @SearchParamDefinition(name="event", path="Conformance.messaging.event.code", description="Event code in a conformance statement", type="token" ) + public static final String SP_EVENT = "event"; + + /** + * Fluent Client search parameter constant for event + *

+ * Description: Event code in a conformance statement
+ * Type: token
+ * Path: Conformance.messaging.event.code
+ *

+ */ + public static final TokenClientParam EVENT = new TokenClientParam(SP_EVENT); + + /** + * Search parameter constant for mode + *

+ * Description: Mode - restful (server/client) or messaging (sender/receiver)
+ * Type: token
+ * Path: Conformance.rest.mode
+ *

+ */ + @SearchParamDefinition(name="mode", path="Conformance.rest.mode", description="Mode - restful (server/client) or messaging (sender/receiver)", type="token" ) + public static final String SP_MODE = "mode"; + + /** + * Fluent Client search parameter constant for mode + *

+ * Description: Mode - restful (server/client) or messaging (sender/receiver)
+ * Type: token
+ * Path: Conformance.rest.mode
+ *

+ */ + public static final TokenClientParam MODE = new TokenClientParam(SP_MODE); + + /** + * Search parameter constant for profile + *

+ * Description: A profile id invoked in a conformance statement
+ * Type: reference
+ * Path: Conformance.rest.resource.profile
+ *

+ */ + @SearchParamDefinition(name="profile", path="Conformance.rest.resource.profile", description="A profile id invoked in a conformance statement", type="reference" ) + public static final String SP_PROFILE = "profile"; + + /** + * Fluent Client search parameter constant for profile + *

+ * Description: A profile id invoked in a conformance statement
+ * Type: reference
+ * Path: Conformance.rest.resource.profile
+ *

+ */ + public static final ReferenceClientParam PROFILE = new ReferenceClientParam(SP_PROFILE); + + /** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Conformance.rest.resource.profile". + */ + public static final Include INCLUDE_REST_RESOURCE_PROFILE = new Include("Conformance.rest.resource.profile"); + + /** + * Search parameter constant for format + *

+ * Description:
+ * Type: token
+ * Path: Conformance.format
+ *

+ */ + @SearchParamDefinition(name="format", path="Conformance.format", description="", type="token" ) + public static final String SP_FORMAT = "format"; + + /** + * Fluent Client search parameter constant for format + *

+ * Description:
+ * Type: token
+ * Path: Conformance.format
+ *

+ */ + public static final TokenClientParam FORMAT = new TokenClientParam(SP_FORMAT); + + /** + * Search parameter constant for security + *

+ * Description:
+ * Type: token
+ * Path: Conformance.rest.security
+ *

+ */ + @SearchParamDefinition(name="security", path="Conformance.rest.security", description="", type="token" ) + public static final String SP_SECURITY = "security"; + + /** + * Fluent Client search parameter constant for security + *

+ * Description:
+ * Type: token
+ * Path: Conformance.rest.security
+ *

+ */ + public static final TokenClientParam SECURITY = new TokenClientParam(SP_SECURITY); + + /** + * Search parameter constant for supported-profile + *

+ * Description:
+ * Type: reference
+ * Path: Conformance.profile
+ *

+ */ + @SearchParamDefinition(name="supported-profile", path="Conformance.profile", description="", type="reference" ) + public static final String SP_SUPPORTED_PROFILE = "supported-profile"; + + /** + * Fluent Client search parameter constant for supported-profile + *

+ * Description:
+ * Type: reference
+ * Path: Conformance.profile
+ *

+ */ + public static final ReferenceClientParam SUPPORTED_PROFILE = new ReferenceClientParam(SP_SUPPORTED_PROFILE); + + /** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Conformance.profile". + */ + public static final Include INCLUDE_PROFILE = new Include("Conformance.profile"); + + + @Child(name="identifier", type=StringDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Logical id to reference this statement", + formalDefinition="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)" + ) + private StringDt myIdentifier; + + @Child(name="version", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Logical id for this version of the statement", + formalDefinition="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" + ) + private StringDt myVersion; + + @Child(name="name", type=StringDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Informal name for this conformance statement", + formalDefinition="A free text natural language name identifying the conformance statement" + ) + private StringDt myName; + + @Child(name="publisher", type=StringDt.class, order=3, min=1, max=1) + @Description( + shortDefinition="Publishing Organization", + formalDefinition="Name of Organization publishing this conformance statement" + ) + private StringDt myPublisher; + + @Child(name="telecom", type=ContactDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Contacts for Organization", + formalDefinition="Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc." + ) + private java.util.List myTelecom; + + @Child(name="description", type=StringDt.class, order=5, min=0, max=1) + @Description( + shortDefinition="Human description of the conformance statement", + formalDefinition="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" + ) + private StringDt myDescription; + + @Child(name="status", type=CodeDt.class, order=6, min=0, max=1) + @Description( + shortDefinition="draft | active | retired", + formalDefinition="The status of this conformance statement" + ) + private BoundCodeDt myStatus; + + @Child(name="experimental", type=BooleanDt.class, order=7, min=0, max=1) + @Description( + shortDefinition="If for testing purposes, not real usage", + formalDefinition="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" + ) + private BooleanDt myExperimental; + + @Child(name="date", type=DateTimeDt.class, order=8, min=1, max=1) + @Description( + shortDefinition="Publication Date", + formalDefinition="The date when the conformance statement was published" + ) + private DateTimeDt myDate; + + @Child(name="software", order=9, min=0, max=1) + @Description( + shortDefinition="Software that is covered by this conformance statement", + formalDefinition="Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation." + ) + private Software mySoftware; + + @Child(name="implementation", order=10, min=0, max=1) + @Description( + shortDefinition="If this describes a specific instance", + formalDefinition="Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program" + ) + private Implementation myImplementation; + + @Child(name="fhirVersion", type=IdDt.class, order=11, min=1, max=1) + @Description( + shortDefinition="FHIR Version", + formalDefinition="The version of the FHIR specification on which this conformance statement is based" + ) + private IdDt myFhirVersion; + + @Child(name="acceptUnknown", type=BooleanDt.class, order=12, min=1, max=1) + @Description( + shortDefinition="True if application accepts unknown elements", + formalDefinition="A flag that indicates whether the application accepts unknown elements as part of a resource." + ) + private BooleanDt myAcceptUnknown; + + @Child(name="format", type=CodeDt.class, order=13, min=1, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="formats supported (xml | json | mime type)", + formalDefinition="A list of the formats supported by this implementation" + ) + private java.util.List myFormat; + + @Child(name="profile", order=14, min=0, max=Child.MAX_UNLIMITED, type={ + ca.uhn.fhir.model.dstu.resource.Profile.class }) + @Description( + shortDefinition="Profiles supported by the system", + formalDefinition="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." + ) + private java.util.List myProfile; + + @Child(name="rest", order=15, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="If the endpoint is a RESTful one", + formalDefinition="A definition of the restful capabilities of the solution, if any" + ) + private java.util.List myRest; + + @Child(name="messaging", order=16, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="If messaging is supported", + formalDefinition="A description of the messaging capabilities of the solution" + ) + private java.util.List myMessaging; + + @Child(name="document", order=17, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Document definition", + formalDefinition="A document definition" + ) + private java.util.List myDocument; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myStatus, myExperimental, myDate, mySoftware, myImplementation, myFhirVersion, myAcceptUnknown, myFormat, myProfile, myRest, myMessaging, myDocument); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myStatus, myExperimental, myDate, mySoftware, myImplementation, myFhirVersion, myAcceptUnknown, myFormat, myProfile, myRest, myMessaging, myDocument); + } + + /** + * Gets the value(s) for identifier (Logical id to reference this statement). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getIdentifier() { + if (myIdentifier == null) { + myIdentifier = new StringDt(); + } + return myIdentifier; + } + + /** + * Sets the value(s) for identifier (Logical id to reference this statement) + * + *

+ * Definition: + * 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 Conformance setIdentifier(StringDt theValue) { + myIdentifier = theValue; + return this; + } + + /** + * Sets the value for identifier (Logical id to reference this statement) + * + *

+ * Definition: + * 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 Conformance setIdentifier( String theString) { + myIdentifier = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for version (Logical id for this version of the statement). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ * Definition: + * 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 Conformance setVersion(StringDt theValue) { + myVersion = theValue; + return this; + } + + /** + * Sets the value for version (Logical id for this version of the statement) + * + *

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

+ * Definition: + * A free text natural language name identifying the conformance statement + *

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

+ * Definition: + * A free text natural language name identifying the conformance statement + *

+ */ + public Conformance setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Informal name for this conformance statement) + * + *

+ * Definition: + * A free text natural language name identifying the conformance statement + *

+ */ + public Conformance setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for publisher (Publishing Organization). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Name of Organization publishing this conformance statement + *

+ */ + public StringDt getPublisher() { + if (myPublisher == null) { + myPublisher = new StringDt(); + } + return myPublisher; + } + + /** + * Sets the value(s) for publisher (Publishing Organization) + * + *

+ * Definition: + * Name of Organization publishing this conformance statement + *

+ */ + public Conformance setPublisher(StringDt theValue) { + myPublisher = theValue; + return this; + } + + /** + * Sets the value for publisher (Publishing Organization) + * + *

+ * Definition: + * Name of Organization publishing this conformance statement + *

+ */ + public Conformance setPublisher( String theString) { + myPublisher = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for telecom (Contacts for Organization). + * creating it if it does + * not exist. Will not return null. + * + *

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

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

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

+ */ + public Conformance setTelecom(java.util.List theValue) { + myTelecom = theValue; + return this; + } + + /** + * Adds and returns a new value for telecom (Contacts for Organization) + * + *

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

+ */ + public ContactDt addTelecom() { + ContactDt newType = new ContactDt(); + getTelecom().add(newType); + 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); + } + /** + * Adds a new value for telecom (Contacts for Organization) + * + *

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

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public Conformance addTelecom( ContactUseEnum theContactUse, String theValue) { + if (myTelecom == null) { + myTelecom = new java.util.ArrayList(); + } + myTelecom.add(new ContactDt(theContactUse, theValue)); + return this; + } + + /** + * Adds a new value for telecom (Contacts for Organization) + * + *

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

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public Conformance addTelecom( String theValue) { + if (myTelecom == null) { + myTelecom = new java.util.ArrayList(); + } + myTelecom.add(new ContactDt(theValue)); + return this; + } + + + /** + * Gets the value(s) for description (Human description of the conformance statement). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getDescription() { + if (myDescription == null) { + myDescription = new StringDt(); + } + return myDescription; + } + + /** + * Sets the value(s) for description (Human description of the conformance statement) + * + *

+ * Definition: + * 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 Conformance setDescription(StringDt theValue) { + myDescription = theValue; + return this; + } + + /** + * Sets the value for description (Human description of the conformance statement) + * + *

+ * Definition: + * 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 Conformance setDescription( String theString) { + myDescription = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for status (draft | active | retired). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The status of this conformance statement + *

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

+ * Definition: + * The status of this conformance statement + *

+ */ + public Conformance setStatus(BoundCodeDt theValue) { + myStatus = theValue; + return this; + } + + /** + * Sets the value(s) for status (draft | active | retired) + * + *

+ * Definition: + * The status of this conformance statement + *

+ */ + public Conformance setStatus(ConformanceStatementStatusEnum theValue) { + getStatus().setValueAsEnum(theValue); + return this; + } + + + /** + * 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: + * 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 BooleanDt getExperimental() { + if (myExperimental == null) { + myExperimental = new BooleanDt(); + } + return myExperimental; + } + + /** + * Sets the value(s) for experimental (If for testing purposes, not real usage) + * + *

+ * Definition: + * 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 Conformance setExperimental(BooleanDt theValue) { + myExperimental = theValue; + return this; + } + + /** + * Sets the value for experimental (If for testing purposes, not real usage) + * + *

+ * Definition: + * 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 Conformance setExperimental( boolean theBoolean) { + myExperimental = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for date (Publication Date). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The date when the conformance statement was published + *

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

+ * Definition: + * The date when the conformance statement was published + *

+ */ + public Conformance setDate(DateTimeDt theValue) { + myDate = theValue; + return this; + } + + /** + * Sets the value for date (Publication Date) + * + *

+ * Definition: + * The date when the conformance statement was published + *

+ */ + public Conformance setDateWithSecondsPrecision( Date theDate) { + myDate = new DateTimeDt(theDate); + return this; + } + + /** + * Sets the value for date (Publication Date) + * + *

+ * Definition: + * The date when the conformance statement was published + *

+ */ + public Conformance setDate( Date theDate, TemporalPrecisionEnum thePrecision) { + myDate = new DateTimeDt(theDate, thePrecision); + return this; + } + + + /** + * Gets the value(s) for software (Software that is covered by this conformance statement). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation. + *

+ */ + public Software getSoftware() { + if (mySoftware == null) { + mySoftware = new Software(); + } + return mySoftware; + } + + /** + * Sets the value(s) for software (Software that is covered by this conformance statement) + * + *

+ * Definition: + * Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation. + *

+ */ + public Conformance setSoftware(Software theValue) { + mySoftware = theValue; + return this; + } + + + /** + * Gets the value(s) for implementation (If this describes a specific instance). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program + *

+ */ + public Implementation getImplementation() { + if (myImplementation == null) { + myImplementation = new Implementation(); + } + return myImplementation; + } + + /** + * Sets the value(s) for implementation (If this describes a specific instance) + * + *

+ * Definition: + * Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program + *

+ */ + public Conformance setImplementation(Implementation theValue) { + myImplementation = theValue; + return this; + } + + + /** + * Gets the value(s) for fhirVersion (FHIR Version). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The version of the FHIR specification on which this conformance statement is based + *

+ */ + public IdDt getFhirVersion() { + if (myFhirVersion == null) { + myFhirVersion = new IdDt(); + } + return myFhirVersion; + } + + /** + * Sets the value(s) for fhirVersion (FHIR Version) + * + *

+ * Definition: + * The version of the FHIR specification on which this conformance statement is based + *

+ */ + public Conformance setFhirVersion(IdDt theValue) { + myFhirVersion = theValue; + return this; + } + + /** + * Sets the value for fhirVersion (FHIR Version) + * + *

+ * Definition: + * The version of the FHIR specification on which this conformance statement is based + *

+ */ + public Conformance setFhirVersion( String theId) { + myFhirVersion = new IdDt(theId); + return this; + } + + + /** + * Gets the value(s) for acceptUnknown (True if application accepts unknown elements). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A flag that indicates whether the application accepts unknown elements as part of a resource. + *

+ */ + public BooleanDt getAcceptUnknown() { + if (myAcceptUnknown == null) { + myAcceptUnknown = new BooleanDt(); + } + return myAcceptUnknown; + } + + /** + * Sets the value(s) for acceptUnknown (True if application accepts unknown elements) + * + *

+ * Definition: + * A flag that indicates whether the application accepts unknown elements as part of a resource. + *

+ */ + public Conformance setAcceptUnknown(BooleanDt theValue) { + myAcceptUnknown = theValue; + return this; + } + + /** + * Sets the value for acceptUnknown (True if application accepts unknown elements) + * + *

+ * Definition: + * A flag that indicates whether the application accepts unknown elements as part of a resource. + *

+ */ + public Conformance setAcceptUnknown( boolean theBoolean) { + myAcceptUnknown = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for format (formats supported (xml | json | mime type)). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getFormat() { + if (myFormat == null) { + myFormat = new java.util.ArrayList(); + } + return myFormat; + } + + /** + * Sets the value(s) for format (formats supported (xml | json | mime type)) + * + *

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

+ */ + public Conformance setFormat(java.util.List theValue) { + myFormat = theValue; + return this; + } + + /** + * Adds and returns a new value for format (formats supported (xml | json | mime type)) + * + *

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

+ */ + public CodeDt addFormat() { + CodeDt newType = new CodeDt(); + getFormat().add(newType); + 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)) + * + *

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

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public Conformance addFormat( String theCode) { + if (myFormat == null) { + myFormat = new java.util.ArrayList(); + } + myFormat.add(new CodeDt(theCode)); + return this; + } + + + /** + * Gets the value(s) for profile (Profiles supported by the system). + * creating it if it does + * not exist. Will not return null. + * + *

+ * 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 java.util.List getProfile() { + if (myProfile == null) { + myProfile = new java.util.ArrayList(); + } + return myProfile; + } + + /** + * Sets the value(s) 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 Conformance setProfile(java.util.List theValue) { + myProfile = theValue; + return this; + } + + /** + * 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). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getRest() { + if (myRest == null) { + myRest = new java.util.ArrayList(); + } + return myRest; + } + + /** + * Sets the value(s) for rest (If the endpoint is a RESTful one) + * + *

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

+ */ + public Conformance setRest(java.util.List theValue) { + myRest = theValue; + return this; + } + + /** + * Adds and returns a new value for rest (If the endpoint is a RESTful one) + * + *

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

+ */ + public Rest addRest() { + Rest newType = new Rest(); + getRest().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getMessaging() { + if (myMessaging == null) { + myMessaging = new java.util.ArrayList(); + } + return myMessaging; + } + + /** + * Sets the value(s) for messaging (If messaging is supported) + * + *

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

+ */ + public Conformance setMessaging(java.util.List theValue) { + myMessaging = theValue; + return this; + } + + /** + * Adds and returns a new value for messaging (If messaging is supported) + * + *

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

+ */ + public Messaging addMessaging() { + Messaging newType = new Messaging(); + getMessaging().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A document definition + *

+ */ + public java.util.List getDocument() { + if (myDocument == null) { + myDocument = new java.util.ArrayList(); + } + return myDocument; + } + + /** + * Sets the value(s) for document (Document definition) + * + *

+ * Definition: + * A document definition + *

+ */ + public Conformance setDocument(java.util.List theValue) { + myDocument = theValue; + return this; + } + + /** + * Adds and returns a new value for document (Document definition) + * + *

+ * Definition: + * A document definition + *

+ */ + public Document addDocument() { + Document newType = new Document(); + getDocument().add(newType); + 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) + * + *

+ * Definition: + * Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation. + *

+ */ + @Block() + public static class Software extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="name", type=StringDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="A name the software is known by", + formalDefinition="Name software is known by" + ) + private StringDt myName; + + @Child(name="version", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Version covered by this statement", + formalDefinition="The version identifier for the software covered by this statement" + ) + private StringDt myVersion; + + @Child(name="releaseDate", type=DateTimeDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Date this version released", + formalDefinition="Date this version of the software released" + ) + private DateTimeDt myReleaseDate; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myVersion, myReleaseDate); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myVersion, myReleaseDate); + } + + /** + * Gets the value(s) for name (A name the software is known by). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Name software is known by + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (A name the software is known by) + * + *

+ * Definition: + * Name software is known by + *

+ */ + public Software setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (A name the software is known by) + * + *

+ * Definition: + * Name software is known by + *

+ */ + public Software setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for version (Version covered by this statement). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The version identifier for the software covered by this statement + *

+ */ + public StringDt getVersion() { + if (myVersion == null) { + myVersion = new StringDt(); + } + return myVersion; + } + + /** + * Sets the value(s) for version (Version covered by this statement) + * + *

+ * Definition: + * The version identifier for the software covered by this statement + *

+ */ + public Software setVersion(StringDt theValue) { + myVersion = theValue; + return this; + } + + /** + * Sets the value for version (Version covered by this statement) + * + *

+ * Definition: + * The version identifier for the software covered by this statement + *

+ */ + public Software setVersion( String theString) { + myVersion = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for releaseDate (Date this version released). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Date this version of the software released + *

+ */ + public DateTimeDt getReleaseDate() { + if (myReleaseDate == null) { + myReleaseDate = new DateTimeDt(); + } + return myReleaseDate; + } + + /** + * Sets the value(s) for releaseDate (Date this version released) + * + *

+ * Definition: + * Date this version of the software released + *

+ */ + public Software setReleaseDate(DateTimeDt theValue) { + myReleaseDate = theValue; + return this; + } + + /** + * Sets the value for releaseDate (Date this version released) + * + *

+ * Definition: + * Date this version of the software released + *

+ */ + public Software setReleaseDateWithSecondsPrecision( Date theDate) { + myReleaseDate = new DateTimeDt(theDate); + return this; + } + + /** + * Sets the value for releaseDate (Date this version released) + * + *

+ * Definition: + * Date this version of the software released + *

+ */ + public Software setReleaseDate( Date theDate, TemporalPrecisionEnum thePrecision) { + myReleaseDate = new DateTimeDt(theDate, thePrecision); + return this; + } + + + + } + + + /** + * Block class for child element: Conformance.implementation (If this describes a specific instance) + * + *

+ * Definition: + * Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program + *

+ */ + @Block() + public static class Implementation extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="description", type=StringDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Describes this specific instance", + formalDefinition="Information about the specific installation that this conformance statement relates to" + ) + private StringDt myDescription; + + @Child(name="url", type=UriDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Base URL for the installation", + formalDefinition="A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces." + ) + private UriDt myUrl; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDescription, myUrl); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDescription, myUrl); + } + + /** + * Gets the value(s) for description (Describes this specific instance). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Information about the specific installation that this conformance statement relates to + *

+ */ + public StringDt getDescription() { + if (myDescription == null) { + myDescription = new StringDt(); + } + return myDescription; + } + + /** + * Sets the value(s) for description (Describes this specific instance) + * + *

+ * Definition: + * Information about the specific installation that this conformance statement relates to + *

+ */ + public Implementation setDescription(StringDt theValue) { + myDescription = theValue; + return this; + } + + /** + * Sets the value for description (Describes this specific instance) + * + *

+ * Definition: + * Information about the specific installation that this conformance statement relates to + *

+ */ + public Implementation setDescription( String theString) { + myDescription = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for url (Base URL for the installation). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + *

+ */ + public UriDt getUrl() { + if (myUrl == null) { + myUrl = new UriDt(); + } + return myUrl; + } + + /** + * Sets the value(s) for url (Base URL for the installation) + * + *

+ * Definition: + * A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + *

+ */ + public Implementation setUrl(UriDt theValue) { + myUrl = theValue; + return this; + } + + /** + * Sets the value for url (Base URL for the installation) + * + *

+ * Definition: + * A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + *

+ */ + public Implementation setUrl( String theUri) { + myUrl = new UriDt(theUri); + return this; + } + + + + } + + + /** + * Block class for child element: Conformance.rest (If the endpoint is a RESTful one) + * + *

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

+ */ + @Block() + public static class Rest extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="mode", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="client | server", + formalDefinition="Identifies whether this portion of the statement is describing ability to initiate or receive restful operations" + ) + private BoundCodeDt myMode; + + @Child(name="documentation", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="General description of implementation", + formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security" + ) + private StringDt myDocumentation; + + @Child(name="security", order=2, min=0, max=1) + @Description( + shortDefinition="Information about security of implementation", + formalDefinition="Information about security of implementation" + ) + private RestSecurity mySecurity; + + @Child(name="resource", order=3, min=1, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Resource served on the REST interface", + formalDefinition="A specification of the restful capabilities of the solution for a specific resource type" + ) + private java.util.List myResource; + + @Child(name="operation", order=4, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="What operations are supported?", + formalDefinition="A specification of restful operations supported by the system" + ) + private java.util.List myOperation; + + @Child(name="query", order=5, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Definition of a named query", + formalDefinition="Definition of a named query and its parameters and their meaning" + ) + private java.util.List myQuery; + + @Child(name="documentMailbox", type=UriDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="How documents are accepted in /Mailbox", + formalDefinition="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" + ) + private java.util.List myDocumentMailbox; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myMode, myDocumentation, mySecurity, myResource, myOperation, myQuery, myDocumentMailbox); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMode, myDocumentation, mySecurity, myResource, myOperation, myQuery, myDocumentMailbox); + } + + /** + * Gets the value(s) for mode (client | server). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations + *

+ */ + public BoundCodeDt getMode() { + if (myMode == null) { + myMode = new BoundCodeDt(RestfulConformanceModeEnum.VALUESET_BINDER); + } + return myMode; + } + + /** + * Sets the value(s) for mode (client | server) + * + *

+ * Definition: + * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations + *

+ */ + public Rest setMode(BoundCodeDt theValue) { + myMode = theValue; + return this; + } + + /** + * Sets the value(s) for mode (client | server) + * + *

+ * Definition: + * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations + *

+ */ + public Rest setMode(RestfulConformanceModeEnum theValue) { + getMode().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for documentation (General description of implementation). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Information about the system's restful capabilities that apply across all applications, such as security + *

+ */ + public StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (General description of implementation) + * + *

+ * Definition: + * Information about the system's restful capabilities that apply across all applications, such as security + *

+ */ + public Rest setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (General description of implementation) + * + *

+ * Definition: + * Information about the system's restful capabilities that apply across all applications, such as security + *

+ */ + public Rest setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for security (Information about security of implementation). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Information about security of implementation + *

+ */ + public RestSecurity getSecurity() { + if (mySecurity == null) { + mySecurity = new RestSecurity(); + } + return mySecurity; + } + + /** + * Sets the value(s) for security (Information about security of implementation) + * + *

+ * Definition: + * Information about security of implementation + *

+ */ + public Rest setSecurity(RestSecurity theValue) { + mySecurity = theValue; + return this; + } + + + /** + * Gets the value(s) for resource (Resource served on the REST interface). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getResource() { + if (myResource == null) { + myResource = new java.util.ArrayList(); + } + return myResource; + } + + /** + * Sets the value(s) for resource (Resource served on the REST interface) + * + *

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

+ */ + public Rest setResource(java.util.List theValue) { + myResource = theValue; + return this; + } + + /** + * Adds and returns a new value for resource (Resource served on the REST interface) + * + *

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

+ */ + public RestResource addResource() { + RestResource newType = new RestResource(); + getResource().add(newType); + 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?). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getOperation() { + if (myOperation == null) { + myOperation = new java.util.ArrayList(); + } + return myOperation; + } + + /** + * Sets the value(s) for operation (What operations are supported?) + * + *

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

+ */ + public Rest setOperation(java.util.List theValue) { + myOperation = theValue; + return this; + } + + /** + * Adds and returns a new value for operation (What operations are supported?) + * + *

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

+ */ + public RestOperation addOperation() { + RestOperation newType = new RestOperation(); + getOperation().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getQuery() { + if (myQuery == null) { + myQuery = new java.util.ArrayList(); + } + return myQuery; + } + + /** + * Sets the value(s) for query (Definition of a named query) + * + *

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

+ */ + public Rest setQuery(java.util.List theValue) { + myQuery = theValue; + return this; + } + + /** + * Adds and returns a new value for query (Definition of a named query) + * + *

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

+ */ + public RestQuery addQuery() { + RestQuery newType = new RestQuery(); + getQuery().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

+ * 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 java.util.List getDocumentMailbox() { + if (myDocumentMailbox == null) { + myDocumentMailbox = new java.util.ArrayList(); + } + return myDocumentMailbox; + } + + /** + * Sets the value(s) for documentMailbox (How documents are accepted in /Mailbox) + * + *

+ * 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 Rest setDocumentMailbox(java.util.List theValue) { + myDocumentMailbox = theValue; + return this; + } + + /** + * Adds and returns a new value for documentMailbox (How documents are accepted in /Mailbox) + * + *

+ * 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 addDocumentMailbox() { + UriDt newType = new UriDt(); + getDocumentMailbox().add(newType); + 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) + * + *

+ * 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 Rest addDocumentMailbox( String theUri) { + if (myDocumentMailbox == null) { + myDocumentMailbox = new java.util.ArrayList(); + } + myDocumentMailbox.add(new UriDt(theUri)); + return this; + } + + + + } + + /** + * Block class for child element: Conformance.rest.security (Information about security of implementation) + * + *

+ * Definition: + * Information about security of implementation + *

+ */ + @Block() + public static class RestSecurity extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="cors", type=BooleanDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Adds CORS Headers (http://enable-cors.org/)", + formalDefinition="Server adds CORS headers when responding to requests - this enables javascript applications to yuse the server" + ) + private BooleanDt myCors; + + @Child(name="service", type=CodeableConceptDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="OAuth | OAuth2 | NTLM | Basic | Kerberos", + formalDefinition="Types of security services are supported/required by the system" + ) + private java.util.List> myService; + + @Child(name="description", type=StringDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="General description of how security works", + formalDefinition="General description of how security works" + ) + private StringDt myDescription; + + @Child(name="certificate", order=3, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Certificates associated with security profiles", + formalDefinition="Certificates associated with security profiles" + ) + private java.util.List myCertificate; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCors, myService, myDescription, myCertificate); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCors, myService, myDescription, myCertificate); + } + + /** + * Gets the value(s) for cors (Adds CORS Headers (http://enable-cors.org/)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Server adds CORS headers when responding to requests - this enables javascript applications to yuse the server + *

+ */ + public BooleanDt getCors() { + if (myCors == null) { + myCors = new BooleanDt(); + } + return myCors; + } + + /** + * Sets the value(s) for cors (Adds CORS Headers (http://enable-cors.org/)) + * + *

+ * Definition: + * Server adds CORS headers when responding to requests - this enables javascript applications to yuse the server + *

+ */ + public RestSecurity setCors(BooleanDt theValue) { + myCors = theValue; + return this; + } + + /** + * Sets the value for cors (Adds CORS Headers (http://enable-cors.org/)) + * + *

+ * Definition: + * Server adds CORS headers when responding to requests - this enables javascript applications to yuse the server + *

+ */ + public RestSecurity setCors( boolean theBoolean) { + myCors = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for service (OAuth | OAuth2 | NTLM | Basic | Kerberos). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Types of security services are supported/required by the system + *

+ */ + public java.util.List> getService() { + if (myService == null) { + myService = new java.util.ArrayList>(); + } + return myService; + } + + /** + * Sets the value(s) for service (OAuth | OAuth2 | NTLM | Basic | Kerberos) + * + *

+ * Definition: + * Types of security services are supported/required by the system + *

+ */ + public RestSecurity setService(java.util.List> theValue) { + myService = theValue; + return this; + } + + /** + * Add a value for service (OAuth | OAuth2 | NTLM | Basic | Kerberos) using an enumerated type. This + * is intended as a convenience method for situations where the FHIR defined ValueSets are mandatory + * or contain the desirable codes. If you wish to use codes other than those which are built-in, + * you may also use the {@link #addType()} method. + * + *

+ * Definition: + * Types of security services are supported/required by the system + *

+ */ + public BoundCodeableConceptDt addService(RestfulSecurityServiceEnum theValue) { + BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(RestfulSecurityServiceEnum.VALUESET_BINDER, theValue); + getService().add(retVal); + return retVal; + } + + /** + * Gets the first repetition for service (OAuth | OAuth2 | NTLM | Basic | Kerberos), + * creating it if it does not already exist. + * + *

+ * Definition: + * Types of security services are supported/required by the system + *

+ */ + public BoundCodeableConceptDt getServiceFirstRep() { + if (getService().size() == 0) { + addService(); + } + return getService().get(0); + } + + /** + * Add a value for service (OAuth | OAuth2 | NTLM | Basic | Kerberos) + * + *

+ * Definition: + * Types of security services are supported/required by the system + *

+ */ + public BoundCodeableConceptDt addService() { + BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(RestfulSecurityServiceEnum.VALUESET_BINDER); + getService().add(retVal); + return retVal; + } + + /** + * Sets the value(s), and clears any existing value(s) for service (OAuth | OAuth2 | NTLM | Basic | Kerberos) + * + *

+ * Definition: + * Types of security services are supported/required by the system + *

+ */ + public RestSecurity setService(RestfulSecurityServiceEnum theValue) { + getService().clear(); + addService(theValue); + return this; + } + + + /** + * Gets the value(s) for description (General description of how security works). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * General description of how security works + *

+ */ + public StringDt getDescription() { + if (myDescription == null) { + myDescription = new StringDt(); + } + return myDescription; + } + + /** + * Sets the value(s) for description (General description of how security works) + * + *

+ * Definition: + * General description of how security works + *

+ */ + public RestSecurity setDescription(StringDt theValue) { + myDescription = theValue; + return this; + } + + /** + * Sets the value for description (General description of how security works) + * + *

+ * Definition: + * General description of how security works + *

+ */ + public RestSecurity setDescription( String theString) { + myDescription = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for certificate (Certificates associated with security profiles). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getCertificate() { + if (myCertificate == null) { + myCertificate = new java.util.ArrayList(); + } + return myCertificate; + } + + /** + * Sets the value(s) for certificate (Certificates associated with security profiles) + * + *

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

+ */ + public RestSecurity setCertificate(java.util.List theValue) { + myCertificate = theValue; + return this; + } + + /** + * Adds and returns a new value for certificate (Certificates associated with security profiles) + * + *

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

+ */ + public RestSecurityCertificate addCertificate() { + RestSecurityCertificate newType = new RestSecurityCertificate(); + getCertificate().add(newType); + 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); + } + + + } + + /** + * Block class for child element: Conformance.rest.security.certificate (Certificates associated with security profiles) + * + *

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

+ */ + @Block() + public static class RestSecurityCertificate extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="type", type=CodeDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Mime type for certificate", + formalDefinition="Mime type for certificate" + ) + private CodeDt myType; + + @Child(name="blob", type=Base64BinaryDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Actual certificate", + formalDefinition="Actual certificate" + ) + private Base64BinaryDt myBlob; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myBlob); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myBlob); + } + + /** + * Gets the value(s) for type (Mime type for certificate). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Mime type for certificate + *

+ */ + public CodeDt getType() { + if (myType == null) { + myType = new CodeDt(); + } + return myType; + } + + /** + * Sets the value(s) for type (Mime type for certificate) + * + *

+ * Definition: + * Mime type for certificate + *

+ */ + public RestSecurityCertificate setType(CodeDt theValue) { + myType = theValue; + return this; + } + + /** + * Sets the value for type (Mime type for certificate) + * + *

+ * Definition: + * Mime type for certificate + *

+ */ + public RestSecurityCertificate setType( String theCode) { + myType = new CodeDt(theCode); + return this; + } + + + /** + * Gets the value(s) for blob (Actual certificate). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Actual certificate + *

+ */ + public Base64BinaryDt getBlob() { + if (myBlob == null) { + myBlob = new Base64BinaryDt(); + } + return myBlob; + } + + /** + * Sets the value(s) for blob (Actual certificate) + * + *

+ * Definition: + * Actual certificate + *

+ */ + public RestSecurityCertificate setBlob(Base64BinaryDt theValue) { + myBlob = theValue; + return this; + } + + /** + * Sets the value for blob (Actual certificate) + * + *

+ * Definition: + * Actual certificate + *

+ */ + public RestSecurityCertificate setBlob( byte[] theBytes) { + myBlob = new Base64BinaryDt(theBytes); + return this; + } + + + + } + + + + /** + * Block class for child element: Conformance.rest.resource (Resource served on the REST interface) + * + *

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

+ */ + @Block() + public static class RestResource extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="type", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="A resource type that is supported", + formalDefinition="A type of resource exposed via the restful interface" + ) + private BoundCodeDt myType; + + @Child(name="profile", order=1, min=0, max=1, type={ + ca.uhn.fhir.model.dstu.resource.Profile.class }) + @Description( + shortDefinition="What structural features are supported", + formalDefinition="A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations" + ) + private ResourceReferenceDt myProfile; + + @Child(name="operation", order=2, min=1, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="What operations are supported?", + formalDefinition="Identifies a restful operation supported by the solution" + ) + private java.util.List myOperation; + + @Child(name="readHistory", type=BooleanDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Whether vRead can return past versions", + formalDefinition="A flag for whether the server is able to return past versions as part of the vRead operation" + ) + private BooleanDt myReadHistory; + + @Child(name="updateCreate", type=BooleanDt.class, order=4, min=0, max=1) + @Description( + shortDefinition="If allows/uses update to a new location", + formalDefinition="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" + ) + private BooleanDt myUpdateCreate; + + @Child(name="searchInclude", type=StringDt.class, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="_include values supported by the server", + formalDefinition="A list of _include values supported by the server" + ) + private java.util.List mySearchInclude; + + @Child(name="searchParam", order=6, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Additional search params defined", + formalDefinition="Additional search parameters for implementations to support and/or make use of" + ) + private java.util.List mySearchParam; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myProfile, myOperation, myReadHistory, myUpdateCreate, mySearchInclude, mySearchParam); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myProfile, myOperation, myReadHistory, myUpdateCreate, mySearchInclude, mySearchParam); + } + + /** + * Gets the value(s) for type (A resource type that is supported). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A type of resource exposed via the restful interface + *

+ */ + public BoundCodeDt getType() { + if (myType == null) { + myType = new BoundCodeDt(ResourceTypeEnum.VALUESET_BINDER); + } + return myType; + } + + /** + * Sets the value(s) for type (A resource type that is supported) + * + *

+ * Definition: + * A type of resource exposed via the restful interface + *

+ */ + public RestResource setType(BoundCodeDt theValue) { + myType = theValue; + return this; + } + + /** + * Sets the value(s) for type (A resource type that is supported) + * + *

+ * Definition: + * A type of resource exposed via the restful interface + *

+ */ + public RestResource setType(ResourceTypeEnum theValue) { + getType().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for profile (What structural features are supported). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations + *

+ */ + public ResourceReferenceDt getProfile() { + if (myProfile == null) { + myProfile = new ResourceReferenceDt(); + } + return myProfile; + } + + /** + * Sets the value(s) for profile (What structural features are supported) + * + *

+ * Definition: + * A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations + *

+ */ + public RestResource setProfile(ResourceReferenceDt theValue) { + myProfile = theValue; + return this; + } + + + /** + * Gets the value(s) for operation (What operations are supported?). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getOperation() { + if (myOperation == null) { + myOperation = new java.util.ArrayList(); + } + return myOperation; + } + + /** + * Sets the value(s) for operation (What operations are supported?) + * + *

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

+ */ + public RestResource setOperation(java.util.List theValue) { + myOperation = theValue; + return this; + } + + /** + * Adds and returns a new value for operation (What operations are supported?) + * + *

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

+ */ + public RestResourceOperation addOperation() { + RestResourceOperation newType = new RestResourceOperation(); + getOperation().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A flag for whether the server is able to return past versions as part of the vRead operation + *

+ */ + public BooleanDt getReadHistory() { + if (myReadHistory == null) { + myReadHistory = new BooleanDt(); + } + return myReadHistory; + } + + /** + * Sets the value(s) for readHistory (Whether vRead can return past versions) + * + *

+ * Definition: + * A flag for whether the server is able to return past versions as part of the vRead operation + *

+ */ + public RestResource setReadHistory(BooleanDt theValue) { + myReadHistory = theValue; + return this; + } + + /** + * Sets the value for readHistory (Whether vRead can return past versions) + * + *

+ * Definition: + * A flag for whether the server is able to return past versions as part of the vRead operation + *

+ */ + public RestResource setReadHistory( boolean theBoolean) { + myReadHistory = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for updateCreate (If allows/uses update to a new location). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 BooleanDt getUpdateCreate() { + if (myUpdateCreate == null) { + myUpdateCreate = new BooleanDt(); + } + return myUpdateCreate; + } + + /** + * Sets the value(s) for updateCreate (If allows/uses update to a new location) + * + *

+ * Definition: + * 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 RestResource setUpdateCreate(BooleanDt theValue) { + myUpdateCreate = theValue; + return this; + } + + /** + * Sets the value for updateCreate (If allows/uses update to a new location) + * + *

+ * Definition: + * 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 RestResource setUpdateCreate( boolean theBoolean) { + myUpdateCreate = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for searchInclude (_include values supported by the server). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getSearchInclude() { + if (mySearchInclude == null) { + mySearchInclude = new java.util.ArrayList(); + } + return mySearchInclude; + } + + /** + * Sets the value(s) for searchInclude (_include values supported by the server) + * + *

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

+ */ + public RestResource setSearchInclude(java.util.List theValue) { + mySearchInclude = theValue; + return this; + } + + /** + * Adds and returns a new value for searchInclude (_include values supported by the server) + * + *

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

+ */ + public StringDt addSearchInclude() { + StringDt newType = new StringDt(); + getSearchInclude().add(newType); + 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) + * + *

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

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public RestResource addSearchInclude( String theString) { + if (mySearchInclude == null) { + mySearchInclude = new java.util.ArrayList(); + } + mySearchInclude.add(new StringDt(theString)); + return this; + } + + + /** + * Gets the value(s) for searchParam (Additional search params defined). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getSearchParam() { + if (mySearchParam == null) { + mySearchParam = new java.util.ArrayList(); + } + return mySearchParam; + } + + /** + * Sets the value(s) for searchParam (Additional search params defined) + * + *

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

+ */ + public RestResource setSearchParam(java.util.List theValue) { + mySearchParam = theValue; + return this; + } + + /** + * Adds and returns a new value for searchParam (Additional search params defined) + * + *

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

+ */ + public RestResourceSearchParam addSearchParam() { + RestResourceSearchParam newType = new RestResourceSearchParam(); + getSearchParam().add(newType); + 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); + } + + + } + + /** + * Block class for child element: Conformance.rest.resource.operation (What operations are supported?) + * + *

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

+ */ + @Block() + public static class RestResourceOperation extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="code", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="read | vread | update | delete | history-instance | validate | history-type | create | search-type", + formalDefinition="Coded identifier of the operation, supported by the system resource" + ) + private BoundCodeDt myCode; + + @Child(name="documentation", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Anything special about operation behavior", + formalDefinition="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'" + ) + private StringDt myDocumentation; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myDocumentation); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myDocumentation); + } + + /** + * Gets the value(s) for code (read | vread | update | delete | history-instance | validate | history-type | create | search-type). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Coded identifier of the operation, supported by the system resource + *

+ */ + public BoundCodeDt getCode() { + if (myCode == null) { + myCode = new BoundCodeDt(RestfulOperationTypeEnum.VALUESET_BINDER); + } + return myCode; + } + + /** + * Sets the value(s) for code (read | vread | update | delete | history-instance | validate | history-type | create | search-type) + * + *

+ * Definition: + * Coded identifier of the operation, supported by the system resource + *

+ */ + public RestResourceOperation setCode(BoundCodeDt theValue) { + myCode = theValue; + return this; + } + + /** + * Sets the value(s) for code (read | vread | update | delete | history-instance | validate | history-type | create | search-type) + * + *

+ * Definition: + * Coded identifier of the operation, supported by the system resource + *

+ */ + public RestResourceOperation setCode(RestfulOperationTypeEnum theValue) { + getCode().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for documentation (Anything special about operation behavior). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Anything special about operation behavior) + * + *

+ * Definition: + * 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 RestResourceOperation setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (Anything special about operation behavior) + * + *

+ * Definition: + * 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 RestResourceOperation setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + + } + + + /** + * Block class for child element: Conformance.rest.resource.searchParam (Additional search params defined) + * + *

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

+ */ + @Block() + public static class RestResourceSearchParam extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="name", type=StringDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Name of search parameter", + formalDefinition="The name of the search parameter used in the interface" + ) + private StringDt myName; + + @Child(name="definition", type=UriDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Source of definition for parameter", + formalDefinition="A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter" + ) + private UriDt myDefinition; + + @Child(name="type", type=CodeDt.class, order=2, min=1, max=1) + @Description( + shortDefinition="number | date | string | token | reference | composite | quantity", + formalDefinition="The type of value a search parameter refers to, and how the content is interpreted" + ) + private BoundCodeDt myType; + + @Child(name="documentation", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Server-specific usage", + formalDefinition="This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms." + ) + private StringDt myDocumentation; + + @Child(name="target", type=CodeDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Types of resource (if a resource reference)", + formalDefinition="Types of resource (if a resource is referenced)" + ) + private java.util.List> myTarget; + + @Child(name="chain", type=StringDt.class, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Chained names supported", + formalDefinition="" + ) + private java.util.List myChain; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myDefinition, myType, myDocumentation, myTarget, myChain); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myDefinition, myType, myDocumentation, myTarget, myChain); + } + + /** + * Gets the value(s) for name (Name of search parameter). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The name of the search parameter used in the interface + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Name of search parameter) + * + *

+ * Definition: + * The name of the search parameter used in the interface + *

+ */ + public RestResourceSearchParam setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Name of search parameter) + * + *

+ * Definition: + * The name of the search parameter used in the interface + *

+ */ + public RestResourceSearchParam setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for definition (Source of definition for parameter). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 UriDt getDefinition() { + if (myDefinition == null) { + myDefinition = new UriDt(); + } + return myDefinition; + } + + /** + * Sets the value(s) for definition (Source of definition for parameter) + * + *

+ * Definition: + * 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 RestResourceSearchParam setDefinition(UriDt theValue) { + myDefinition = theValue; + return this; + } + + /** + * Sets the value for definition (Source of definition for parameter) + * + *

+ * Definition: + * 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 RestResourceSearchParam setDefinition( String theUri) { + myDefinition = new UriDt(theUri); + return this; + } + + + /** + * Gets the value(s) for type (number | date | string | token | reference | composite | quantity). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The type of value a search parameter refers to, and how the content is interpreted + *

+ */ + public BoundCodeDt getType() { + if (myType == null) { + myType = new BoundCodeDt(SearchParamTypeEnum.VALUESET_BINDER); + } + return myType; + } + + /** + * Sets the value(s) for type (number | date | string | token | reference | composite | quantity) + * + *

+ * Definition: + * The type of value a search parameter refers to, and how the content is interpreted + *

+ */ + public RestResourceSearchParam setType(BoundCodeDt theValue) { + myType = theValue; + return this; + } + + /** + * Sets the value(s) for type (number | date | string | token | reference | composite | quantity) + * + *

+ * Definition: + * The type of value a search parameter refers to, and how the content is interpreted + *

+ */ + public RestResourceSearchParam setType(SearchParamTypeEnum theValue) { + getType().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for documentation (Server-specific usage). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + *

+ */ + public StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Server-specific usage) + * + *

+ * Definition: + * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + *

+ */ + public RestResourceSearchParam setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (Server-specific usage) + * + *

+ * Definition: + * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + *

+ */ + public RestResourceSearchParam setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for target (Types of resource (if a resource reference)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public java.util.List> getTarget() { + if (myTarget == null) { + myTarget = new java.util.ArrayList>(); + } + return myTarget; + } + + /** + * Sets the value(s) for target (Types of resource (if a resource reference)) + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public RestResourceSearchParam setTarget(java.util.List> theValue) { + myTarget = theValue; + return this; + } + + /** + * Add a value for target (Types of resource (if a resource reference)) using an enumerated type. This + * is intended as a convenience method for situations where the FHIR defined ValueSets are mandatory + * or contain the desirable codes. If you wish to use codes other than those which are built-in, + * you may also use the {@link #addType()} method. + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public BoundCodeDt addTarget(ResourceTypeEnum theValue) { + BoundCodeDt retVal = new BoundCodeDt(ResourceTypeEnum.VALUESET_BINDER, theValue); + getTarget().add(retVal); + return retVal; + } + + /** + * Gets the first repetition for target (Types of resource (if a resource reference)), + * creating it if it does not already exist. + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public BoundCodeDt getTargetFirstRep() { + if (getTarget().size() == 0) { + addTarget(); + } + return getTarget().get(0); + } + + /** + * Add a value for target (Types of resource (if a resource reference)) + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public BoundCodeDt addTarget() { + BoundCodeDt retVal = new BoundCodeDt(ResourceTypeEnum.VALUESET_BINDER); + getTarget().add(retVal); + return retVal; + } + + /** + * Sets the value(s), and clears any existing value(s) for target (Types of resource (if a resource reference)) + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public RestResourceSearchParam setTarget(ResourceTypeEnum theValue) { + getTarget().clear(); + addTarget(theValue); + return this; + } + + + /** + * Gets the value(s) for chain (Chained names supported). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * + *

+ */ + public java.util.List getChain() { + if (myChain == null) { + myChain = new java.util.ArrayList(); + } + return myChain; + } + + /** + * Sets the value(s) for chain (Chained names supported) + * + *

+ * Definition: + * + *

+ */ + public RestResourceSearchParam setChain(java.util.List theValue) { + myChain = theValue; + return this; + } + + /** + * Adds and returns a new value for chain (Chained names supported) + * + *

+ * Definition: + * + *

+ */ + public StringDt addChain() { + StringDt newType = new StringDt(); + getChain().add(newType); + 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) + * + *

+ * Definition: + * + *

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public RestResourceSearchParam addChain( String theString) { + if (myChain == null) { + myChain = new java.util.ArrayList(); + } + myChain.add(new StringDt(theString)); + return this; + } + + + + } + + + + /** + * Block class for child element: Conformance.rest.operation (What operations are supported?) + * + *

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

+ */ + @Block() + public static class RestOperation extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="code", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="transaction | search-system | history-system", + formalDefinition="A coded identifier of the operation, supported by the system" + ) + private BoundCodeDt myCode; + + @Child(name="documentation", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Anything special about operation behavior", + formalDefinition="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" + ) + private StringDt myDocumentation; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myDocumentation); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myDocumentation); + } + + /** + * Gets the value(s) for code (transaction | search-system | history-system). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A coded identifier of the operation, supported by the system + *

+ */ + public BoundCodeDt getCode() { + if (myCode == null) { + myCode = new BoundCodeDt(RestfulOperationSystemEnum.VALUESET_BINDER); + } + return myCode; + } + + /** + * Sets the value(s) for code (transaction | search-system | history-system) + * + *

+ * Definition: + * A coded identifier of the operation, supported by the system + *

+ */ + public RestOperation setCode(BoundCodeDt theValue) { + myCode = theValue; + return this; + } + + /** + * Sets the value(s) for code (transaction | search-system | history-system) + * + *

+ * Definition: + * A coded identifier of the operation, supported by the system + *

+ */ + public RestOperation setCode(RestfulOperationSystemEnum theValue) { + getCode().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for documentation (Anything special about operation behavior). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Anything special about operation behavior) + * + *

+ * Definition: + * 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 RestOperation setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (Anything special about operation behavior) + * + *

+ * Definition: + * 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 RestOperation setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + + } + + + /** + * Block class for child element: Conformance.rest.query (Definition of a named query) + * + *

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

+ */ + @Block() + public static class RestQuery extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="name", type=StringDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Special named queries (_query=)", + formalDefinition="The name of a query, which is used in the _query parameter when the query is called" + ) + private StringDt myName; + + @Child(name="definition", type=UriDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="Where query is defined", + formalDefinition="Identifies the custom query, defined either in FHIR core or another profile" + ) + private UriDt myDefinition; + + @Child(name="documentation", type=StringDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Additional usage guidance", + formalDefinition="Additional information about how the query functions in this particular implementation" + ) + private StringDt myDocumentation; + + @Child(name="parameter", type=RestResourceSearchParam.class, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Parameter for the named query", + formalDefinition="Identifies which of the parameters for the named query are supported" + ) + private java.util.List myParameter; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myDefinition, myDocumentation, myParameter); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myDefinition, myDocumentation, myParameter); + } + + /** + * Gets the value(s) for name (Special named queries (_query=)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The name of a query, which is used in the _query parameter when the query is called + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Special named queries (_query=)) + * + *

+ * Definition: + * The name of a query, which is used in the _query parameter when the query is called + *

+ */ + public RestQuery setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Special named queries (_query=)) + * + *

+ * Definition: + * The name of a query, which is used in the _query parameter when the query is called + *

+ */ + public RestQuery setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for definition (Where query is defined). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the custom query, defined either in FHIR core or another profile + *

+ */ + public UriDt getDefinition() { + if (myDefinition == null) { + myDefinition = new UriDt(); + } + return myDefinition; + } + + /** + * Sets the value(s) for definition (Where query is defined) + * + *

+ * Definition: + * Identifies the custom query, defined either in FHIR core or another profile + *

+ */ + public RestQuery setDefinition(UriDt theValue) { + myDefinition = theValue; + return this; + } + + /** + * Sets the value for definition (Where query is defined) + * + *

+ * Definition: + * Identifies the custom query, defined either in FHIR core or another profile + *

+ */ + public RestQuery setDefinition( String theUri) { + myDefinition = new UriDt(theUri); + return this; + } + + + /** + * Gets the value(s) for documentation (Additional usage guidance). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Additional information about how the query functions in this particular implementation + *

+ */ + public StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Additional usage guidance) + * + *

+ * Definition: + * Additional information about how the query functions in this particular implementation + *

+ */ + public RestQuery setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (Additional usage guidance) + * + *

+ * Definition: + * Additional information about how the query functions in this particular implementation + *

+ */ + public RestQuery setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for parameter (Parameter for the named query). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getParameter() { + if (myParameter == null) { + myParameter = new java.util.ArrayList(); + } + return myParameter; + } + + /** + * Sets the value(s) for parameter (Parameter for the named query) + * + *

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

+ */ + public RestQuery setParameter(java.util.List theValue) { + myParameter = theValue; + return this; + } + + /** + * Adds and returns a new value for parameter (Parameter for the named query) + * + *

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

+ */ + public RestResourceSearchParam addParameter() { + RestResourceSearchParam newType = new RestResourceSearchParam(); + getParameter().add(newType); + 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); + } + + + } + + + + /** + * Block class for child element: Conformance.messaging (If messaging is supported) + * + *

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

+ */ + @Block() + public static class Messaging extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="endpoint", type=UriDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Actual endpoint being described", + formalDefinition="An address to which messages and/or replies are to be sent." + ) + private UriDt myEndpoint; + + @Child(name="reliableCache", type=IntegerDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Reliable Message Cache Length", + formalDefinition="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)" + ) + private IntegerDt myReliableCache; + + @Child(name="documentation", type=StringDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Messaging interface behavior details", + formalDefinition="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." + ) + private StringDt myDocumentation; + + @Child(name="event", order=3, min=1, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Declare support for this event", + formalDefinition="A description of the solution's support for an event at this end point." + ) + private java.util.List myEvent; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myEndpoint, myReliableCache, myDocumentation, myEvent); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myEndpoint, myReliableCache, myDocumentation, myEvent); + } + + /** + * Gets the value(s) for endpoint (Actual endpoint being described). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An address to which messages and/or replies are to be sent. + *

+ */ + public UriDt getEndpoint() { + if (myEndpoint == null) { + myEndpoint = new UriDt(); + } + return myEndpoint; + } + + /** + * Sets the value(s) for endpoint (Actual endpoint being described) + * + *

+ * Definition: + * An address to which messages and/or replies are to be sent. + *

+ */ + public Messaging setEndpoint(UriDt theValue) { + myEndpoint = theValue; + return this; + } + + /** + * Sets the value for endpoint (Actual endpoint being described) + * + *

+ * Definition: + * An address to which messages and/or replies are to be sent. + *

+ */ + public Messaging setEndpoint( String theUri) { + myEndpoint = new UriDt(theUri); + return this; + } + + + /** + * Gets the value(s) for reliableCache (Reliable Message Cache Length). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 IntegerDt getReliableCache() { + if (myReliableCache == null) { + myReliableCache = new IntegerDt(); + } + return myReliableCache; + } + + /** + * Sets the value(s) for reliableCache (Reliable Message Cache Length) + * + *

+ * Definition: + * 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 Messaging setReliableCache(IntegerDt theValue) { + myReliableCache = theValue; + return this; + } + + /** + * Sets the value for reliableCache (Reliable Message Cache Length) + * + *

+ * Definition: + * 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 Messaging setReliableCache( int theInteger) { + myReliableCache = new IntegerDt(theInteger); + return this; + } + + + /** + * Gets the value(s) for documentation (Messaging interface behavior details). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Messaging interface behavior details) + * + *

+ * Definition: + * 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 Messaging setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (Messaging interface behavior details) + * + *

+ * Definition: + * 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 Messaging setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for event (Declare support for this event). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getEvent() { + if (myEvent == null) { + myEvent = new java.util.ArrayList(); + } + return myEvent; + } + + /** + * Sets the value(s) for event (Declare support for this event) + * + *

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

+ */ + public Messaging setEvent(java.util.List theValue) { + myEvent = theValue; + return this; + } + + /** + * Adds and returns a new value for event (Declare support for this event) + * + *

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

+ */ + public MessagingEvent addEvent() { + MessagingEvent newType = new MessagingEvent(); + getEvent().add(newType); + 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); + } + + + } + + /** + * Block class for child element: Conformance.messaging.event (Declare support for this event) + * + *

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

+ */ + @Block() + public static class MessagingEvent extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="code", type=CodingDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Event type", + formalDefinition="A coded identifier of a supported messaging event" + ) + private CodingDt myCode; + + @Child(name="category", type=CodeDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Consequence | Currency | Notification", + formalDefinition="The impact of the content of the message" + ) + private BoundCodeDt myCategory; + + @Child(name="mode", type=CodeDt.class, order=2, min=1, max=1) + @Description( + shortDefinition="sender | receiver", + formalDefinition="The mode of this event declaration - whether application is sender or receiver" + ) + private BoundCodeDt myMode; + + @Child(name="protocol", type=CodingDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="http | ftp | mllp +", + formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint" + ) + private java.util.List myProtocol; + + @Child(name="focus", type=CodeDt.class, order=4, min=1, max=1) + @Description( + shortDefinition="Resource that's focus of message", + formalDefinition="A resource associated with the event. This is the resource that defines the event." + ) + private BoundCodeDt myFocus; + + @Child(name="request", order=5, min=1, max=1, type={ + ca.uhn.fhir.model.dstu.resource.Profile.class }) + @Description( + shortDefinition="Profile that describes the request", + formalDefinition="Information about the request for this event" + ) + private ResourceReferenceDt myRequest; + + @Child(name="response", order=6, min=1, max=1, type={ + ca.uhn.fhir.model.dstu.resource.Profile.class }) + @Description( + shortDefinition="Profile that describes the response", + formalDefinition="Information about the response for this event" + ) + private ResourceReferenceDt myResponse; + + @Child(name="documentation", type=StringDt.class, order=7, min=0, max=1) + @Description( + shortDefinition="Endpoint-specific event documentation", + formalDefinition="Guidance on how this event is handled, such as internal system trigger points, business rules, etc." + ) + private StringDt myDocumentation; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myCategory, myMode, myProtocol, myFocus, myRequest, myResponse, myDocumentation); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myCategory, myMode, myProtocol, myFocus, myRequest, myResponse, myDocumentation); + } + + /** + * Gets the value(s) for code (Event type). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A coded identifier of a supported messaging event + *

+ */ + public CodingDt getCode() { + if (myCode == null) { + myCode = new CodingDt(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Event type) + * + *

+ * Definition: + * A coded identifier of a supported messaging event + *

+ */ + public MessagingEvent setCode(CodingDt theValue) { + myCode = theValue; + return this; + } + + + /** + * Gets the value(s) for category (Consequence | Currency | Notification). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The impact of the content of the message + *

+ */ + public BoundCodeDt getCategory() { + if (myCategory == null) { + myCategory = new BoundCodeDt(MessageSignificanceCategoryEnum.VALUESET_BINDER); + } + return myCategory; + } + + /** + * Sets the value(s) for category (Consequence | Currency | Notification) + * + *

+ * Definition: + * The impact of the content of the message + *

+ */ + public MessagingEvent setCategory(BoundCodeDt theValue) { + myCategory = theValue; + return this; + } + + /** + * Sets the value(s) for category (Consequence | Currency | Notification) + * + *

+ * Definition: + * The impact of the content of the message + *

+ */ + public MessagingEvent setCategory(MessageSignificanceCategoryEnum theValue) { + getCategory().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for mode (sender | receiver). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The mode of this event declaration - whether application is sender or receiver + *

+ */ + public BoundCodeDt getMode() { + if (myMode == null) { + myMode = new BoundCodeDt(ConformanceEventModeEnum.VALUESET_BINDER); + } + return myMode; + } + + /** + * Sets the value(s) for mode (sender | receiver) + * + *

+ * Definition: + * The mode of this event declaration - whether application is sender or receiver + *

+ */ + public MessagingEvent setMode(BoundCodeDt theValue) { + myMode = theValue; + return this; + } + + /** + * Sets the value(s) for mode (sender | receiver) + * + *

+ * Definition: + * The mode of this event declaration - whether application is sender or receiver + *

+ */ + public MessagingEvent setMode(ConformanceEventModeEnum theValue) { + getMode().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for protocol (http | ftp | mllp +). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getProtocol() { + if (myProtocol == null) { + myProtocol = new java.util.ArrayList(); + } + return myProtocol; + } + + /** + * Sets the value(s) for protocol (http | ftp | mllp +) + * + *

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

+ */ + public MessagingEvent setProtocol(java.util.List theValue) { + myProtocol = theValue; + return this; + } + + /** + * Adds and returns a new value for protocol (http | ftp | mllp +) + * + *

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

+ */ + public CodingDt addProtocol() { + CodingDt newType = new CodingDt(); + getProtocol().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A resource associated with the event. This is the resource that defines the event. + *

+ */ + public BoundCodeDt getFocus() { + if (myFocus == null) { + myFocus = new BoundCodeDt(ResourceTypeEnum.VALUESET_BINDER); + } + return myFocus; + } + + /** + * Sets the value(s) for focus (Resource that's focus of message) + * + *

+ * Definition: + * A resource associated with the event. This is the resource that defines the event. + *

+ */ + public MessagingEvent setFocus(BoundCodeDt theValue) { + myFocus = theValue; + return this; + } + + /** + * Sets the value(s) for focus (Resource that's focus of message) + * + *

+ * Definition: + * A resource associated with the event. This is the resource that defines the event. + *

+ */ + public MessagingEvent setFocus(ResourceTypeEnum theValue) { + getFocus().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for request (Profile that describes the request). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Information about the request for this event + *

+ */ + public ResourceReferenceDt getRequest() { + if (myRequest == null) { + myRequest = new ResourceReferenceDt(); + } + return myRequest; + } + + /** + * Sets the value(s) for request (Profile that describes the request) + * + *

+ * Definition: + * Information about the request for this event + *

+ */ + public MessagingEvent setRequest(ResourceReferenceDt theValue) { + myRequest = theValue; + return this; + } + + + /** + * Gets the value(s) for response (Profile that describes the response). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Information about the response for this event + *

+ */ + public ResourceReferenceDt getResponse() { + if (myResponse == null) { + myResponse = new ResourceReferenceDt(); + } + return myResponse; + } + + /** + * Sets the value(s) for response (Profile that describes the response) + * + *

+ * Definition: + * Information about the response for this event + *

+ */ + public MessagingEvent setResponse(ResourceReferenceDt theValue) { + myResponse = theValue; + return this; + } + + + /** + * Gets the value(s) for documentation (Endpoint-specific event documentation). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + *

+ */ + public StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Endpoint-specific event documentation) + * + *

+ * Definition: + * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + *

+ */ + public MessagingEvent setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (Endpoint-specific event documentation) + * + *

+ * Definition: + * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + *

+ */ + public MessagingEvent setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + + } + + + + /** + * Block class for child element: Conformance.document (Document definition) + * + *

+ * Definition: + * A document definition + *

+ */ + @Block() + public static class Document extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="mode", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="producer | consumer", + formalDefinition="Mode of this document declaration - whether application is producer or consumer" + ) + private BoundCodeDt myMode; + + @Child(name="documentation", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Description of document support", + formalDefinition="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." + ) + private StringDt myDocumentation; + + @Child(name="profile", order=2, min=1, max=1, type={ + ca.uhn.fhir.model.dstu.resource.Profile.class }) + @Description( + shortDefinition="Constraint on a resource used in the document", + formalDefinition="A constraint on a resource used in the document" + ) + private ResourceReferenceDt myProfile; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myMode, myDocumentation, myProfile); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMode, myDocumentation, myProfile); + } + + /** + * Gets the value(s) for mode (producer | consumer). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Mode of this document declaration - whether application is producer or consumer + *

+ */ + public BoundCodeDt getMode() { + if (myMode == null) { + myMode = new BoundCodeDt(DocumentModeEnum.VALUESET_BINDER); + } + return myMode; + } + + /** + * Sets the value(s) for mode (producer | consumer) + * + *

+ * Definition: + * Mode of this document declaration - whether application is producer or consumer + *

+ */ + public Document setMode(BoundCodeDt theValue) { + myMode = theValue; + return this; + } + + /** + * Sets the value(s) for mode (producer | consumer) + * + *

+ * Definition: + * Mode of this document declaration - whether application is producer or consumer + *

+ */ + public Document setMode(DocumentModeEnum theValue) { + getMode().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for documentation (Description of document support). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Description of document support) + * + *

+ * Definition: + * 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 Document setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (Description of document support) + * + *

+ * Definition: + * 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 Document setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for profile (Constraint on a resource used in the document). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A constraint on a resource used in the document + *

+ */ + public ResourceReferenceDt getProfile() { + if (myProfile == null) { + myProfile = new ResourceReferenceDt(); + } + return myProfile; + } + + /** + * Sets the value(s) for profile (Constraint on a resource used in the document) + * + *

+ * Definition: + * A constraint on a resource used in the document + *

+ */ + public Document setProfile(ResourceReferenceDt theValue) { + myProfile = theValue; + return this; + } + + + + } + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java new file mode 100644 index 00000000000..170b3de1b01 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java @@ -0,0 +1,5138 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.resource; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.util.Date; +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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.Include; +import ca.uhn.fhir.model.api.TemporalPrecisionEnum; +import ca.uhn.fhir.model.api.annotation.Block; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; +import ca.uhn.fhir.model.dstu.composite.CodingDt; +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.ContactUseEnum; +import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.ExtensionContextEnum; +import ca.uhn.fhir.model.dstu.valueset.FHIRDefinedTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.PropertyRepresentationEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceProfileStatusEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.SlicingRulesEnum; +import ca.uhn.fhir.model.primitive.BooleanDt; +import ca.uhn.fhir.model.primitive.BoundCodeDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.IntegerDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.UriDt; +import ca.uhn.fhir.rest.gclient.DateClientParam; +import ca.uhn.fhir.rest.gclient.ReferenceClientParam; +import ca.uhn.fhir.rest.gclient.StringClientParam; +import ca.uhn.fhir.rest.gclient.TokenClientParam; + + +/** + * HAPI/FHIR Profile Resource + * (Resource Profile) + * + *

+ * Definition: + * A Resource Profile - a statement of use of one or more FHIR Resources. It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions + *

+ * + *

+ * Requirements: + * + *

+ * + *

+ * Profile Definition: + * http://hl7.org/fhir/profiles/Profile + *

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

+ * Description: The identifier of the profile
+ * Type: token
+ * Path: Profile.identifier
+ *

+ */ + @SearchParamDefinition(name="identifier", path="Profile.identifier", description="The identifier of the profile", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + + /** + * Fluent Client search parameter constant for identifier + *

+ * Description: The identifier of the profile
+ * Type: token
+ * Path: Profile.identifier
+ *

+ */ + public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter constant for version + *

+ * Description: The version identifier of the profile
+ * Type: token
+ * Path: Profile.version
+ *

+ */ + @SearchParamDefinition(name="version", path="Profile.version", description="The version identifier of the profile", type="token" ) + public static final String SP_VERSION = "version"; + + /** + * Fluent Client search parameter constant for version + *

+ * Description: The version identifier of the profile
+ * Type: token
+ * Path: Profile.version
+ *

+ */ + public static final TokenClientParam VERSION = new TokenClientParam(SP_VERSION); + + /** + * Search parameter constant for name + *

+ * Description: Name of the profile
+ * Type: string
+ * Path: Profile.name
+ *

+ */ + @SearchParamDefinition(name="name", path="Profile.name", description="Name of the profile", type="string" ) + public static final String SP_NAME = "name"; + + /** + * Fluent Client search parameter constant for name + *

+ * Description: Name of the profile
+ * Type: string
+ * Path: Profile.name
+ *

+ */ + public static final StringClientParam NAME = new StringClientParam(SP_NAME); + + /** + * Search parameter constant for publisher + *

+ * Description: Name of the publisher of the profile
+ * Type: string
+ * Path: Profile.publisher
+ *

+ */ + @SearchParamDefinition(name="publisher", path="Profile.publisher", description="Name of the publisher of the profile", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + + /** + * Fluent Client search parameter constant for publisher + *

+ * Description: Name of the publisher of the profile
+ * Type: string
+ * Path: Profile.publisher
+ *

+ */ + public static final StringClientParam PUBLISHER = new StringClientParam(SP_PUBLISHER); + + /** + * Search parameter constant for description + *

+ * Description: Text search in the description of the profile
+ * Type: string
+ * Path: Profile.description
+ *

+ */ + @SearchParamDefinition(name="description", path="Profile.description", description="Text search in the description of the profile", type="string" ) + public static final String SP_DESCRIPTION = "description"; + + /** + * Fluent Client search parameter constant for description + *

+ * Description: Text search in the description of the profile
+ * Type: string
+ * Path: Profile.description
+ *

+ */ + public static final StringClientParam DESCRIPTION = new StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter constant for status + *

+ * Description: The current status of the profile
+ * Type: token
+ * Path: Profile.status
+ *

+ */ + @SearchParamDefinition(name="status", path="Profile.status", description="The current status of the profile", type="token" ) + public static final String SP_STATUS = "status"; + + /** + * Fluent Client search parameter constant for status + *

+ * Description: The current status of the profile
+ * Type: token
+ * Path: Profile.status
+ *

+ */ + public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS); + + /** + * Search parameter constant for date + *

+ * Description: The profile publication date
+ * Type: date
+ * Path: Profile.date
+ *

+ */ + @SearchParamDefinition(name="date", path="Profile.date", description="The profile publication date", type="date" ) + public static final String SP_DATE = "date"; + + /** + * Fluent Client search parameter constant for date + *

+ * Description: The profile publication date
+ * Type: date
+ * Path: Profile.date
+ *

+ */ + public static final DateClientParam DATE = new DateClientParam(SP_DATE); + + /** + * Search parameter constant for code + *

+ * Description: A code for the profile in the format uri::code (server may choose to do subsumption)
+ * Type: token
+ * Path: Profile.code
+ *

+ */ + @SearchParamDefinition(name="code", path="Profile.code", description="A code for the profile in the format uri::code (server may choose to do subsumption)", type="token" ) + public static final String SP_CODE = "code"; + + /** + * Fluent Client search parameter constant for code + *

+ * Description: A code for the profile in the format uri::code (server may choose to do subsumption)
+ * Type: token
+ * Path: Profile.code
+ *

+ */ + public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); + + /** + * Search parameter constant for extension + *

+ * Description: An extension code (use or definition)
+ * Type: token
+ * Path: Profile.extensionDefn.code
+ *

+ */ + @SearchParamDefinition(name="extension", path="Profile.extensionDefn.code", description="An extension code (use or definition)", type="token" ) + public static final String SP_EXTENSION = "extension"; + + /** + * Fluent Client search parameter constant for extension + *

+ * Description: An extension code (use or definition)
+ * Type: token
+ * Path: Profile.extensionDefn.code
+ *

+ */ + public static final TokenClientParam EXTENSION = new TokenClientParam(SP_EXTENSION); + + /** + * Search parameter constant for valueset + *

+ * Description: A vocabulary binding code
+ * Type: reference
+ * Path: Profile.structure.element.definition.binding.reference[x]
+ *

+ */ + @SearchParamDefinition(name="valueset", path="Profile.structure.element.definition.binding.reference[x]", description="A vocabulary binding code", type="reference" ) + public static final String SP_VALUESET = "valueset"; + + /** + * Fluent Client search parameter constant for valueset + *

+ * Description: A vocabulary binding code
+ * Type: reference
+ * Path: Profile.structure.element.definition.binding.reference[x]
+ *

+ */ + public static final ReferenceClientParam VALUESET = new ReferenceClientParam(SP_VALUESET); + + /** + * Constant for fluent queries to be used to add include statements. Specifies + * the path value of "Profile.structure.element.definition.binding.reference[x]". + */ + public static final Include INCLUDE_STRUCTURE_ELEMENT_DEFINITION_BINDING_REFERENCE = new Include("Profile.structure.element.definition.binding.reference[x]"); + + /** + * Search parameter constant for type + *

+ * Description: Type of resource that is constrained in the profile
+ * Type: token
+ * Path: Profile.structure.type
+ *

+ */ + @SearchParamDefinition(name="type", path="Profile.structure.type", description="Type of resource that is constrained in the profile", type="token" ) + public static final String SP_TYPE = "type"; + + /** + * Fluent Client search parameter constant for type + *

+ * Description: Type of resource that is constrained in the profile
+ * Type: token
+ * Path: Profile.structure.type
+ *

+ */ + public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); + + + @Child(name="identifier", type=StringDt.class, order=0, min=0, max=1) + @Description( + shortDefinition="Logical id to reference this profile", + formalDefinition="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)" + ) + private StringDt myIdentifier; + + @Child(name="version", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Logical id for this version of the profile", + formalDefinition="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" + ) + private StringDt myVersion; + + @Child(name="name", type=StringDt.class, order=2, min=1, max=1) + @Description( + shortDefinition="Informal name for this profile", + formalDefinition="A free text natural language name identifying the Profile" + ) + 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="Details of the individual or organization who accepts responsibility for publishing the profile" + ) + 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="Contact details 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=0, max=1) + @Description( + shortDefinition="Natural language description of the profile", + formalDefinition="A free text natural language description of the profile and its use" + ) + private StringDt myDescription; + + @Child(name="code", type=CodingDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Assist with indexing and finding", + formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates." + ) + private java.util.List myCode; + + @Child(name="status", type=CodeDt.class, order=7, min=1, max=1) + @Description( + shortDefinition="draft | active | retired", + formalDefinition="The status of the profile" + ) + private BoundCodeDt myStatus; + + @Child(name="experimental", type=BooleanDt.class, order=8, min=0, max=1) + @Description( + shortDefinition="If for testing purposes, not real usage", + formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage" + ) + private BooleanDt myExperimental; + + @Child(name="date", type=DateTimeDt.class, order=9, min=0, max=1) + @Description( + shortDefinition="Date for this version of the profile", + formalDefinition="The date that this version of the profile was published" + ) + private DateTimeDt myDate; + + @Child(name="requirements", type=StringDt.class, order=10, min=0, max=1) + @Description( + shortDefinition="Scope and Usage this profile is for", + formalDefinition="The Scope and Usage that this profile was created to meet" + ) + private StringDt myRequirements; + + @Child(name="fhirVersion", type=IdDt.class, order=11, min=0, max=1) + @Description( + shortDefinition="FHIR Version this profile targets", + formalDefinition="The version of the FHIR specification on which this profile is based" + ) + private IdDt myFhirVersion; + + @Child(name="mapping", order=12, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="External specification that the content is mapped to", + formalDefinition="An external specification that the content is mapped to" + ) + private java.util.List myMapping; + + @Child(name="structure", order=13, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="A constraint on a resource or a data type", + formalDefinition="A constraint statement about what contents a resource or data type may have" + ) + private java.util.List myStructure; + + @Child(name="extensionDefn", order=14, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Definition of an extension", + formalDefinition="An extension defined as part of the profile" + ) + private java.util.List myExtensionDefn; + + @Child(name="query", order=15, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Definition of a named query", + formalDefinition="Definition of a named query and its parameters and their meaning" + ) + private java.util.List myQuery; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myCode, myStatus, myExperimental, myDate, myRequirements, myFhirVersion, myMapping, myStructure, myExtensionDefn, myQuery); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myCode, myStatus, myExperimental, myDate, myRequirements, myFhirVersion, myMapping, myStructure, myExtensionDefn, myQuery); + } + + /** + * Gets the value(s) for identifier (Logical id to reference this profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getIdentifier() { + if (myIdentifier == null) { + myIdentifier = new StringDt(); + } + return myIdentifier; + } + + /** + * Sets the value(s) for identifier (Logical id to reference this profile) + * + *

+ * Definition: + * 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 Profile setIdentifier(StringDt theValue) { + myIdentifier = theValue; + return this; + } + + /** + * Sets the value for identifier (Logical id to reference this profile) + * + *

+ * Definition: + * 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 Profile setIdentifier( String theString) { + myIdentifier = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for version (Logical id for this version of the profile). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ * Definition: + * 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 Profile setVersion(StringDt theValue) { + myVersion = theValue; + return this; + } + + /** + * Sets the value for version (Logical id for this version of the profile) + * + *

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

+ * Definition: + * A free text natural language name identifying the Profile + *

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

+ * Definition: + * A free text natural language name identifying the Profile + *

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

+ * Definition: + * A free text natural language name identifying the Profile + *

+ */ + public Profile setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * 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: + * Details of the individual or organization who accepts responsibility for publishing the profile + *

+ */ + 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: + * Details of the individual or organization who accepts responsibility for publishing the profile + *

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

+ * Definition: + * Details of the individual or organization who accepts responsibility for publishing the profile + *

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

+ * Definition: + * Contact details 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: + * Contact details to assist a user in finding and communicating with the publisher + *

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

+ * Definition: + * Contact details 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: + * 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); + } + /** + * Adds a new value for telecom (Contact information of the publisher) + * + *

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

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public Profile addTelecom( ContactUseEnum theContactUse, String theValue) { + if (myTelecom == null) { + myTelecom = new java.util.ArrayList(); + } + myTelecom.add(new ContactDt(theContactUse, theValue)); + return this; + } + + /** + * Adds a new value for telecom (Contact information of the publisher) + * + *

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

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public Profile addTelecom( String theValue) { + if (myTelecom == null) { + myTelecom = new java.util.ArrayList(); + } + myTelecom.add(new ContactDt(theValue)); + return this; + } + + + /** + * Gets the value(s) for description (Natural language description of the profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A free text natural language description of the profile and its use + *

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

+ * Definition: + * A free text natural language description of the profile and its use + *

+ */ + public Profile setDescription(StringDt theValue) { + myDescription = theValue; + return this; + } + + /** + * Sets the value for description (Natural language description of the profile) + * + *

+ * Definition: + * A free text natural language description of the profile and its use + *

+ */ + public Profile setDescription( String theString) { + myDescription = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for code (Assist with indexing and finding). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + *

+ */ + public java.util.List getCode() { + if (myCode == null) { + myCode = new java.util.ArrayList(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Assist with indexing and finding) + * + *

+ * Definition: + * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + *

+ */ + public Profile setCode(java.util.List theValue) { + myCode = theValue; + return this; + } + + /** + * Adds and returns a new value for code (Assist with indexing and finding) + * + *

+ * Definition: + * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + *

+ */ + public CodingDt addCode() { + CodingDt newType = new CodingDt(); + getCode().add(newType); + return newType; + } + + /** + * 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). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The status of the profile + *

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

+ * Definition: + * The status of the profile + *

+ */ + public Profile setStatus(BoundCodeDt theValue) { + myStatus = theValue; + return this; + } + + /** + * Sets the value(s) for status (draft | active | retired) + * + *

+ * Definition: + * The status of the profile + *

+ */ + public Profile setStatus(ResourceProfileStatusEnum theValue) { + getStatus().setValueAsEnum(theValue); + return this; + } + + + /** + * 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 profile 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 profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage + *

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

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

+ */ + public Profile setExperimental( boolean theBoolean) { + myExperimental = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for date (Date for this version of the profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The date that this version of the profile was published + *

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

+ * Definition: + * The date that this version of the profile was published + *

+ */ + public Profile setDate(DateTimeDt theValue) { + myDate = theValue; + return this; + } + + /** + * Sets the value for date (Date for this version of the profile) + * + *

+ * Definition: + * The date that this version of the profile was published + *

+ */ + public Profile setDateWithSecondsPrecision( Date theDate) { + myDate = new DateTimeDt(theDate); + return this; + } + + /** + * Sets the value for date (Date for this version of the profile) + * + *

+ * Definition: + * The date that this version of the profile was published + *

+ */ + public Profile setDate( Date theDate, TemporalPrecisionEnum thePrecision) { + myDate = new DateTimeDt(theDate, thePrecision); + return this; + } + + + /** + * Gets the value(s) for requirements (Scope and Usage this profile is for). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The Scope and Usage that this profile was created to meet + *

+ */ + public StringDt getRequirements() { + if (myRequirements == null) { + myRequirements = new StringDt(); + } + return myRequirements; + } + + /** + * Sets the value(s) for requirements (Scope and Usage this profile is for) + * + *

+ * Definition: + * The Scope and Usage that this profile was created to meet + *

+ */ + public Profile setRequirements(StringDt theValue) { + myRequirements = theValue; + return this; + } + + /** + * Sets the value for requirements (Scope and Usage this profile is for) + * + *

+ * Definition: + * The Scope and Usage that this profile was created to meet + *

+ */ + public Profile setRequirements( String theString) { + myRequirements = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for fhirVersion (FHIR Version this profile targets). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The version of the FHIR specification on which this profile is based + *

+ */ + public IdDt getFhirVersion() { + if (myFhirVersion == null) { + myFhirVersion = new IdDt(); + } + return myFhirVersion; + } + + /** + * Sets the value(s) for fhirVersion (FHIR Version this profile targets) + * + *

+ * Definition: + * The version of the FHIR specification on which this profile is based + *

+ */ + public Profile setFhirVersion(IdDt theValue) { + myFhirVersion = theValue; + return this; + } + + /** + * Sets the value for fhirVersion (FHIR Version this profile targets) + * + *

+ * Definition: + * The version of the FHIR specification on which this profile is based + *

+ */ + public Profile setFhirVersion( String theId) { + myFhirVersion = new IdDt(theId); + return this; + } + + + /** + * Gets the value(s) for mapping (External specification that the content is mapped to). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An external specification that the content is mapped to + *

+ */ + public java.util.List getMapping() { + if (myMapping == null) { + myMapping = new java.util.ArrayList(); + } + return myMapping; + } + + /** + * Sets the value(s) for mapping (External specification that the content is mapped to) + * + *

+ * Definition: + * An external specification that the content is mapped to + *

+ */ + public Profile setMapping(java.util.List theValue) { + myMapping = theValue; + return this; + } + + /** + * Adds and returns a new value for mapping (External specification that the content is mapped to) + * + *

+ * Definition: + * An external specification that the content is mapped to + *

+ */ + public Mapping addMapping() { + Mapping newType = new Mapping(); + getMapping().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getStructure() { + if (myStructure == null) { + myStructure = new java.util.ArrayList(); + } + return myStructure; + } + + /** + * Sets the value(s) for structure (A constraint on a resource or a data type) + * + *

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

+ */ + public Profile setStructure(java.util.List theValue) { + myStructure = theValue; + return this; + } + + /** + * Adds and returns a new value for structure (A constraint on a resource or a data type) + * + *

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

+ */ + public Structure addStructure() { + Structure newType = new Structure(); + getStructure().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getExtensionDefn() { + if (myExtensionDefn == null) { + myExtensionDefn = new java.util.ArrayList(); + } + return myExtensionDefn; + } + + /** + * Sets the value(s) for extensionDefn (Definition of an extension) + * + *

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

+ */ + public Profile setExtensionDefn(java.util.List theValue) { + myExtensionDefn = theValue; + return this; + } + + /** + * Adds and returns a new value for extensionDefn (Definition of an extension) + * + *

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

+ */ + public ExtensionDefn addExtensionDefn() { + ExtensionDefn newType = new ExtensionDefn(); + getExtensionDefn().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getQuery() { + if (myQuery == null) { + myQuery = new java.util.ArrayList(); + } + return myQuery; + } + + /** + * Sets the value(s) for query (Definition of a named query) + * + *

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

+ */ + public Profile setQuery(java.util.List theValue) { + myQuery = theValue; + return this; + } + + /** + * Adds and returns a new value for query (Definition of a named query) + * + *

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

+ */ + public Query addQuery() { + Query newType = new Query(); + getQuery().add(newType); + 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) + * + *

+ * Definition: + * An external specification that the content is mapped to + *

+ */ + @Block() + public static class Mapping extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="identity", type=IdDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Internal id when this mapping is used", + formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made" + ) + private IdDt myIdentity; + + @Child(name="uri", type=UriDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Identifies what this mapping refers to", + formalDefinition="A URI that identifies the specification that this mapping is expressed to" + ) + private UriDt myUri; + + @Child(name="name", type=StringDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Names what this mapping refers to", + formalDefinition="A name for the specification that is being mapped to" + ) + private StringDt myName; + + @Child(name="comments", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Versions, Issues, Scope limitations etc", + formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage" + ) + private StringDt myComments; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentity, myUri, myName, myComments); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentity, myUri, myName, myComments); + } + + /** + * Gets the value(s) for identity (Internal id when this mapping is used). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An Internal id that is used to identify this mapping set when specific mappings are made + *

+ */ + public IdDt getIdentity() { + if (myIdentity == null) { + myIdentity = new IdDt(); + } + return myIdentity; + } + + /** + * Sets the value(s) for identity (Internal id when this mapping is used) + * + *

+ * Definition: + * An Internal id that is used to identify this mapping set when specific mappings are made + *

+ */ + public Mapping setIdentity(IdDt theValue) { + myIdentity = theValue; + return this; + } + + /** + * Sets the value for identity (Internal id when this mapping is used) + * + *

+ * Definition: + * An Internal id that is used to identify this mapping set when specific mappings are made + *

+ */ + public Mapping setIdentity( String theId) { + myIdentity = new IdDt(theId); + return this; + } + + + /** + * Gets the value(s) for uri (Identifies what this mapping refers to). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A URI that identifies the specification that this mapping is expressed to + *

+ */ + public UriDt getUri() { + if (myUri == null) { + myUri = new UriDt(); + } + return myUri; + } + + /** + * Sets the value(s) for uri (Identifies what this mapping refers to) + * + *

+ * Definition: + * A URI that identifies the specification that this mapping is expressed to + *

+ */ + public Mapping setUri(UriDt theValue) { + myUri = theValue; + return this; + } + + /** + * Sets the value for uri (Identifies what this mapping refers to) + * + *

+ * Definition: + * A URI that identifies the specification that this mapping is expressed to + *

+ */ + public Mapping setUri( String theUri) { + myUri = new UriDt(theUri); + return this; + } + + + /** + * Gets the value(s) for name (Names what this mapping refers to). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A name for the specification that is being mapped to + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Names what this mapping refers to) + * + *

+ * Definition: + * A name for the specification that is being mapped to + *

+ */ + public Mapping setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Names what this mapping refers to) + * + *

+ * Definition: + * A name for the specification that is being mapped to + *

+ */ + public Mapping setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for comments (Versions, Issues, Scope limitations etc). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage + *

+ */ + public StringDt getComments() { + if (myComments == null) { + myComments = new StringDt(); + } + return myComments; + } + + /** + * Sets the value(s) for comments (Versions, Issues, Scope limitations etc) + * + *

+ * Definition: + * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage + *

+ */ + public Mapping setComments(StringDt theValue) { + myComments = theValue; + return this; + } + + /** + * Sets the value for comments (Versions, Issues, Scope limitations etc) + * + *

+ * Definition: + * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage + *

+ */ + public Mapping setComments( String theString) { + myComments = new StringDt(theString); + return this; + } + + + + } + + + /** + * Block class for child element: Profile.structure (A constraint on a resource or a data type) + * + *

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

+ */ + @Block() + public static class Structure extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="type", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="The Resource or Data Type being described", + formalDefinition="The Resource or Data type being described" + ) + private BoundCodeDt myType; + + @Child(name="name", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Name for this particular structure (reference target)", + formalDefinition="The name of this resource constraint statement (to refer to it from other resource constraints - from Profile.structure.element.definition.type.profile)" + ) + private StringDt myName; + + @Child(name="publish", type=BooleanDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="This definition is published (i.e. for validation)", + formalDefinition="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" + ) + private BooleanDt myPublish; + + @Child(name="purpose", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Human summary: why describe this resource?", + formalDefinition="Human summary: why describe this resource?" + ) + private StringDt myPurpose; + + @Child(name="element", order=4, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Definition of elements in the resource (if no profile)", + formalDefinition="Captures constraints on each element within the resource" + ) + private java.util.List myElement; + + @Child(name="searchParam", order=5, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Search params defined", + formalDefinition="Additional search parameters for implementations to support and/or make use of" + ) + private java.util.List mySearchParam; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myName, myPublish, myPurpose, myElement, mySearchParam); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myName, myPublish, myPurpose, myElement, mySearchParam); + } + + /** + * Gets the value(s) for type (The Resource or Data Type being described). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The Resource or Data type being described + *

+ */ + public BoundCodeDt getType() { + if (myType == null) { + myType = new BoundCodeDt(FHIRDefinedTypeEnum.VALUESET_BINDER); + } + return myType; + } + + /** + * Sets the value(s) for type (The Resource or Data Type being described) + * + *

+ * Definition: + * The Resource or Data type being described + *

+ */ + public Structure setType(BoundCodeDt theValue) { + myType = theValue; + return this; + } + + /** + * Sets the value(s) for type (The Resource or Data Type being described) + * + *

+ * Definition: + * The Resource or Data type being described + *

+ */ + public Structure setType(FHIRDefinedTypeEnum theValue) { + getType().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for name (Name for this particular structure (reference target)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The name of this resource constraint statement (to refer to it from other resource constraints - from Profile.structure.element.definition.type.profile) + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Name for this particular structure (reference target)) + * + *

+ * Definition: + * The name of this resource constraint statement (to refer to it from other resource constraints - from Profile.structure.element.definition.type.profile) + *

+ */ + public Structure setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Name for this particular structure (reference target)) + * + *

+ * Definition: + * The name of this resource constraint statement (to refer to it from other resource constraints - from Profile.structure.element.definition.type.profile) + *

+ */ + public Structure setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for publish (This definition is published (i.e. for validation)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 BooleanDt getPublish() { + if (myPublish == null) { + myPublish = new BooleanDt(); + } + return myPublish; + } + + /** + * Sets the value(s) for publish (This definition is published (i.e. for validation)) + * + *

+ * Definition: + * 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 Structure setPublish(BooleanDt theValue) { + myPublish = theValue; + return this; + } + + /** + * Sets the value for publish (This definition is published (i.e. for validation)) + * + *

+ * Definition: + * 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 Structure setPublish( boolean theBoolean) { + myPublish = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for purpose (Human summary: why describe this resource?). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Human summary: why describe this resource? + *

+ */ + public StringDt getPurpose() { + if (myPurpose == null) { + myPurpose = new StringDt(); + } + return myPurpose; + } + + /** + * Sets the value(s) for purpose (Human summary: why describe this resource?) + * + *

+ * Definition: + * Human summary: why describe this resource? + *

+ */ + public Structure setPurpose(StringDt theValue) { + myPurpose = theValue; + return this; + } + + /** + * Sets the value for purpose (Human summary: why describe this resource?) + * + *

+ * Definition: + * Human summary: why describe this resource? + *

+ */ + public Structure setPurpose( String theString) { + myPurpose = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for element (Definition of elements in the resource (if no profile)). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getElement() { + if (myElement == null) { + myElement = new java.util.ArrayList(); + } + return myElement; + } + + /** + * Sets the value(s) for element (Definition of elements in the resource (if no profile)) + * + *

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

+ */ + public Structure setElement(java.util.List theValue) { + myElement = theValue; + return this; + } + + /** + * Adds and returns a new value for element (Definition of elements in the resource (if no profile)) + * + *

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

+ */ + public StructureElement addElement() { + StructureElement newType = new StructureElement(); + getElement().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getSearchParam() { + if (mySearchParam == null) { + mySearchParam = new java.util.ArrayList(); + } + return mySearchParam; + } + + /** + * Sets the value(s) for searchParam (Search params defined) + * + *

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

+ */ + public Structure setSearchParam(java.util.List theValue) { + mySearchParam = theValue; + return this; + } + + /** + * Adds and returns a new value for searchParam (Search params defined) + * + *

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

+ */ + public StructureSearchParam addSearchParam() { + StructureSearchParam newType = new StructureSearchParam(); + getSearchParam().add(newType); + 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); + } + + + } + + /** + * Block class for child element: Profile.structure.element (Definition of elements in the resource (if no profile)) + * + *

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

+ */ + @Block() + public static class StructureElement extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="path", type=StringDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="The path of the element (see the formal definitions)", + formalDefinition="The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource" + ) + private StringDt myPath; + + @Child(name="representation", type=CodeDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="How this element is represented in instances", + formalDefinition="Codes that define how this element is represented in instances, when the deviation varies from the normal case" + ) + private java.util.List> myRepresentation; + + @Child(name="name", type=StringDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Name for this particular element definition (reference target)", + formalDefinition="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" + ) + private StringDt myName; + + @Child(name="slicing", order=3, min=0, max=1) + @Description( + shortDefinition="This element is sliced - slices follow", + formalDefinition="Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)" + ) + private StructureElementSlicing mySlicing; + + @Child(name="definition", order=4, min=0, max=1) + @Description( + shortDefinition="More specific definition of the element", + formalDefinition="Definition of the content of the element to provide a more specific definition than that contained for the element in the base resource" + ) + private StructureElementDefinition myDefinition; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myPath, myRepresentation, myName, mySlicing, myDefinition); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myPath, myRepresentation, myName, mySlicing, myDefinition); + } + + /** + * Gets the value(s) for path (The path of the element (see the formal definitions)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource + *

+ */ + public StringDt getPath() { + if (myPath == null) { + myPath = new StringDt(); + } + return myPath; + } + + /** + * Sets the value(s) for path (The path of the element (see the formal definitions)) + * + *

+ * Definition: + * The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource + *

+ */ + public StructureElement setPath(StringDt theValue) { + myPath = theValue; + return this; + } + + /** + * Sets the value for path (The path of the element (see the formal definitions)) + * + *

+ * Definition: + * The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource + *

+ */ + public StructureElement setPath( String theString) { + myPath = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for representation (How this element is represented in instances). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public java.util.List> getRepresentation() { + if (myRepresentation == null) { + myRepresentation = new java.util.ArrayList>(); + } + return myRepresentation; + } + + /** + * Sets the value(s) for representation (How this element is represented in instances) + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public StructureElement setRepresentation(java.util.List> theValue) { + myRepresentation = theValue; + return this; + } + + /** + * Add a value for representation (How this element is represented in instances) using an enumerated type. This + * is intended as a convenience method for situations where the FHIR defined ValueSets are mandatory + * or contain the desirable codes. If you wish to use codes other than those which are built-in, + * you may also use the {@link #addType()} method. + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public BoundCodeDt addRepresentation(PropertyRepresentationEnum theValue) { + BoundCodeDt retVal = new BoundCodeDt(PropertyRepresentationEnum.VALUESET_BINDER, theValue); + getRepresentation().add(retVal); + return retVal; + } + + /** + * Gets the first repetition for representation (How this element is represented in instances), + * creating it if it does not already exist. + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public BoundCodeDt getRepresentationFirstRep() { + if (getRepresentation().size() == 0) { + addRepresentation(); + } + return getRepresentation().get(0); + } + + /** + * Add a value for representation (How this element is represented in instances) + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public BoundCodeDt addRepresentation() { + BoundCodeDt retVal = new BoundCodeDt(PropertyRepresentationEnum.VALUESET_BINDER); + getRepresentation().add(retVal); + return retVal; + } + + /** + * Sets the value(s), and clears any existing value(s) for representation (How this element is represented in instances) + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public StructureElement setRepresentation(PropertyRepresentationEnum theValue) { + getRepresentation().clear(); + addRepresentation(theValue); + return this; + } + + + /** + * Gets the value(s) for name (Name for this particular element definition (reference target)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Name for this particular element definition (reference target)) + * + *

+ * Definition: + * 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 StructureElement setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Name for this particular element definition (reference target)) + * + *

+ * Definition: + * 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 StructureElement setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for slicing (This element is sliced - slices follow). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set) + *

+ */ + public StructureElementSlicing getSlicing() { + if (mySlicing == null) { + mySlicing = new StructureElementSlicing(); + } + return mySlicing; + } + + /** + * Sets the value(s) for slicing (This element is sliced - slices follow) + * + *

+ * Definition: + * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set) + *

+ */ + public StructureElement setSlicing(StructureElementSlicing theValue) { + mySlicing = theValue; + return this; + } + + + /** + * Gets the value(s) for definition (More specific definition of the element). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Definition of the content of the element to provide a more specific definition than that contained for the element in the base resource + *

+ */ + public StructureElementDefinition getDefinition() { + if (myDefinition == null) { + myDefinition = new StructureElementDefinition(); + } + return myDefinition; + } + + /** + * Sets the value(s) for definition (More specific definition of the element) + * + *

+ * Definition: + * Definition of the content of the element to provide a more specific definition than that contained for the element in the base resource + *

+ */ + public StructureElement setDefinition(StructureElementDefinition theValue) { + myDefinition = theValue; + return this; + } + + + + } + + /** + * Block class for child element: Profile.structure.element.slicing (This element is sliced - slices follow) + * + *

+ * Definition: + * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set) + *

+ */ + @Block() + public static class StructureElementSlicing extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="discriminator", type=IdDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Element that used to distinguish the slices", + formalDefinition="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" + ) + private IdDt myDiscriminator; + + @Child(name="ordered", type=BooleanDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="If elements must be in same order as slices", + formalDefinition="If the matching elements have to occur in the same order as defined in the profile" + ) + private BooleanDt myOrdered; + + @Child(name="rules", type=CodeDt.class, order=2, min=1, max=1) + @Description( + shortDefinition="closed | open | openAtEnd", + formalDefinition="Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end" + ) + private BoundCodeDt myRules; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDiscriminator, myOrdered, myRules); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDiscriminator, myOrdered, myRules); + } + + /** + * Gets the value(s) for discriminator (Element that used to distinguish the slices). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 IdDt getDiscriminator() { + if (myDiscriminator == null) { + myDiscriminator = new IdDt(); + } + return myDiscriminator; + } + + /** + * Sets the value(s) for discriminator (Element that used to distinguish the slices) + * + *

+ * Definition: + * 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 StructureElementSlicing setDiscriminator(IdDt theValue) { + myDiscriminator = theValue; + return this; + } + + /** + * Sets the value for discriminator (Element that used to distinguish the slices) + * + *

+ * Definition: + * 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 StructureElementSlicing setDiscriminator( String theId) { + myDiscriminator = new IdDt(theId); + return this; + } + + + /** + * Gets the value(s) for ordered (If elements must be in same order as slices). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * If the matching elements have to occur in the same order as defined in the profile + *

+ */ + public BooleanDt getOrdered() { + if (myOrdered == null) { + myOrdered = new BooleanDt(); + } + return myOrdered; + } + + /** + * Sets the value(s) for ordered (If elements must be in same order as slices) + * + *

+ * Definition: + * If the matching elements have to occur in the same order as defined in the profile + *

+ */ + public StructureElementSlicing setOrdered(BooleanDt theValue) { + myOrdered = theValue; + return this; + } + + /** + * Sets the value for ordered (If elements must be in same order as slices) + * + *

+ * Definition: + * If the matching elements have to occur in the same order as defined in the profile + *

+ */ + public StructureElementSlicing setOrdered( boolean theBoolean) { + myOrdered = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for rules (closed | open | openAtEnd). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end + *

+ */ + public BoundCodeDt getRules() { + if (myRules == null) { + myRules = new BoundCodeDt(SlicingRulesEnum.VALUESET_BINDER); + } + return myRules; + } + + /** + * Sets the value(s) for rules (closed | open | openAtEnd) + * + *

+ * Definition: + * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end + *

+ */ + public StructureElementSlicing setRules(BoundCodeDt theValue) { + myRules = theValue; + return this; + } + + /** + * Sets the value(s) for rules (closed | open | openAtEnd) + * + *

+ * Definition: + * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end + *

+ */ + public StructureElementSlicing setRules(SlicingRulesEnum theValue) { + getRules().setValueAsEnum(theValue); + return this; + } + + + + } + + + /** + * Block class for child element: Profile.structure.element.definition (More specific definition of the element) + * + *

+ * Definition: + * Definition of the content of the element to provide a more specific definition than that contained for the element in the base resource + *

+ */ + @Block() + public static class StructureElementDefinition extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="short", type=StringDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Concise definition for xml presentation", + formalDefinition="A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification)" + ) + private StringDt myShort; + + @Child(name="formal", type=StringDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="Full formal definition in human language", + formalDefinition="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" + ) + private StringDt myFormal; + + @Child(name="comments", type=StringDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="Comments about the use of this element", + formalDefinition="Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc." + ) + private StringDt myComments; + + @Child(name="requirements", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Why is this needed?", + formalDefinition="Explains why this element is needed and why it's been constrained as it has" + ) + private StringDt myRequirements; + + @Child(name="synonym", type=StringDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Other names", + formalDefinition="Identifies additional names by which this element might also be known" + ) + private java.util.List mySynonym; + + @Child(name="min", type=IntegerDt.class, order=5, min=1, max=1) + @Description( + shortDefinition="Minimum Cardinality", + formalDefinition="The minimum number of times this element SHALL appear in the instance" + ) + private IntegerDt myMin; + + @Child(name="max", type=StringDt.class, order=6, min=1, max=1) + @Description( + shortDefinition="Maximum Cardinality (a number or *)", + formalDefinition="The maximum number of times this element is permitted to appear in the instance" + ) + private StringDt myMax; + + @Child(name="type", order=7, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Data type and Profile for this element", + formalDefinition="The data type or resource that the value of this element is permitted to be" + ) + private java.util.List myType; + + @Child(name="nameReference", type=StringDt.class, order=8, min=0, max=1) + @Description( + shortDefinition="To another element constraint (by element.name)", + formalDefinition="Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element" + ) + private StringDt myNameReference; + + @Child(name="value", type=IDatatype.class, order=9, min=0, max=1) + @Description( + shortDefinition="Fixed value: [as defined for a primitive type]", + formalDefinition="Specifies a primitive value that SHALL hold for this element in the instance" + ) + private IDatatype myValue; + + @Child(name="example", type=IDatatype.class, order=10, min=0, max=1) + @Description( + shortDefinition="Example value: [as defined for type]", + formalDefinition="An example value for this element" + ) + private IDatatype myExample; + + @Child(name="maxLength", type=IntegerDt.class, order=11, min=0, max=1) + @Description( + shortDefinition="Length for strings", + formalDefinition="Indicates the shortest length that SHALL be supported by conformant instances without truncation" + ) + private IntegerDt myMaxLength; + + @Child(name="condition", type=IdDt.class, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Reference to invariant about presence", + formalDefinition="A reference to an invariant that may make additional statements about the cardinality or value in the instance" + ) + private java.util.List myCondition; + + @Child(name="constraint", order=13, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Condition that must evaluate to true", + formalDefinition="Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance" + ) + private java.util.List myConstraint; + + @Child(name="mustSupport", type=BooleanDt.class, order=14, min=0, max=1) + @Description( + shortDefinition="If the element must supported", + formalDefinition="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" + ) + private BooleanDt myMustSupport; + + @Child(name="isModifier", type=BooleanDt.class, order=15, min=1, max=1) + @Description( + shortDefinition="If this modifies the meaning of other elements", + formalDefinition="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." + ) + private BooleanDt myIsModifier; + + @Child(name="binding", order=16, min=0, max=1) + @Description( + shortDefinition="ValueSet details if this is coded", + formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept)" + ) + private StructureElementDefinitionBinding myBinding; + + @Child(name="mapping", order=17, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Map element to another set of definitions", + formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element" + ) + private java.util.List myMapping; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myShort, myFormal, myComments, myRequirements, mySynonym, myMin, myMax, myType, myNameReference, myValue, myExample, myMaxLength, myCondition, myConstraint, myMustSupport, myIsModifier, myBinding, myMapping); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myShort, myFormal, myComments, myRequirements, mySynonym, myMin, myMax, myType, myNameReference, myValue, myExample, myMaxLength, myCondition, myConstraint, myMustSupport, myIsModifier, myBinding, myMapping); + } + + /** + * Gets the value(s) for short (Concise definition for xml presentation). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification) + *

+ */ + public StringDt getShort() { + if (myShort == null) { + myShort = new StringDt(); + } + return myShort; + } + + /** + * Sets the value(s) for short (Concise definition for xml presentation) + * + *

+ * Definition: + * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification) + *

+ */ + public StructureElementDefinition setShort(StringDt theValue) { + myShort = theValue; + return this; + } + + /** + * Sets the value for short (Concise definition for xml presentation) + * + *

+ * Definition: + * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification) + *

+ */ + public StructureElementDefinition setShort( String theString) { + myShort = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for formal (Full formal definition in human language). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getFormal() { + if (myFormal == null) { + myFormal = new StringDt(); + } + return myFormal; + } + + /** + * Sets the value(s) for formal (Full formal definition in human language) + * + *

+ * Definition: + * 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 StructureElementDefinition setFormal(StringDt theValue) { + myFormal = theValue; + return this; + } + + /** + * Sets the value for formal (Full formal definition in human language) + * + *

+ * Definition: + * 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 StructureElementDefinition setFormal( String theString) { + myFormal = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for comments (Comments about the use of this element). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + *

+ */ + public StringDt getComments() { + if (myComments == null) { + myComments = new StringDt(); + } + return myComments; + } + + /** + * Sets the value(s) for comments (Comments about the use of this element) + * + *

+ * Definition: + * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + *

+ */ + public StructureElementDefinition setComments(StringDt theValue) { + myComments = theValue; + return this; + } + + /** + * Sets the value for comments (Comments about the use of this element) + * + *

+ * Definition: + * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + *

+ */ + public StructureElementDefinition setComments( String theString) { + myComments = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for requirements (Why is this needed?). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Explains why this element is needed and why it's been constrained as it has + *

+ */ + public StringDt getRequirements() { + if (myRequirements == null) { + myRequirements = new StringDt(); + } + return myRequirements; + } + + /** + * Sets the value(s) for requirements (Why is this needed?) + * + *

+ * Definition: + * Explains why this element is needed and why it's been constrained as it has + *

+ */ + public StructureElementDefinition setRequirements(StringDt theValue) { + myRequirements = theValue; + return this; + } + + /** + * Sets the value for requirements (Why is this needed?) + * + *

+ * Definition: + * Explains why this element is needed and why it's been constrained as it has + *

+ */ + public StructureElementDefinition setRequirements( String theString) { + myRequirements = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for synonym (Other names). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getSynonym() { + if (mySynonym == null) { + mySynonym = new java.util.ArrayList(); + } + return mySynonym; + } + + /** + * Sets the value(s) for synonym (Other names) + * + *

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

+ */ + public StructureElementDefinition setSynonym(java.util.List theValue) { + mySynonym = theValue; + return this; + } + + /** + * Adds and returns a new value for synonym (Other names) + * + *

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

+ */ + public StringDt addSynonym() { + StringDt newType = new StringDt(); + getSynonym().add(newType); + 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) + * + *

+ * 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 StructureElementDefinition addSynonym( String theString) { + if (mySynonym == null) { + mySynonym = new java.util.ArrayList(); + } + mySynonym.add(new StringDt(theString)); + return this; + } + + + /** + * Gets the value(s) for min (Minimum Cardinality). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The minimum number of times this element SHALL appear in the instance + *

+ */ + public IntegerDt getMin() { + if (myMin == null) { + myMin = new IntegerDt(); + } + return myMin; + } + + /** + * Sets the value(s) for min (Minimum Cardinality) + * + *

+ * Definition: + * The minimum number of times this element SHALL appear in the instance + *

+ */ + public StructureElementDefinition setMin(IntegerDt theValue) { + myMin = theValue; + return this; + } + + /** + * Sets the value for min (Minimum Cardinality) + * + *

+ * Definition: + * The minimum number of times this element SHALL appear in the instance + *

+ */ + public StructureElementDefinition setMin( int theInteger) { + myMin = new IntegerDt(theInteger); + return this; + } + + + /** + * Gets the value(s) for max (Maximum Cardinality (a number or *)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The maximum number of times this element is permitted to appear in the instance + *

+ */ + public StringDt getMax() { + if (myMax == null) { + myMax = new StringDt(); + } + return myMax; + } + + /** + * Sets the value(s) for max (Maximum Cardinality (a number or *)) + * + *

+ * Definition: + * The maximum number of times this element is permitted to appear in the instance + *

+ */ + public StructureElementDefinition setMax(StringDt theValue) { + myMax = theValue; + return this; + } + + /** + * Sets the value for max (Maximum Cardinality (a number or *)) + * + *

+ * Definition: + * The maximum number of times this element is permitted to appear in the instance + *

+ */ + public StructureElementDefinition setMax( String theString) { + myMax = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for type (Data type and Profile for this element). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getType() { + if (myType == null) { + myType = new java.util.ArrayList(); + } + return myType; + } + + /** + * Sets the value(s) for type (Data type and Profile for this element) + * + *

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

+ */ + public StructureElementDefinition setType(java.util.List theValue) { + myType = theValue; + return this; + } + + /** + * Adds and returns a new value for type (Data type and Profile for this element) + * + *

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

+ */ + public StructureElementDefinitionType addType() { + StructureElementDefinitionType newType = new StructureElementDefinitionType(); + getType().add(newType); + 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)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element + *

+ */ + public StringDt getNameReference() { + if (myNameReference == null) { + myNameReference = new StringDt(); + } + return myNameReference; + } + + /** + * Sets the value(s) for nameReference (To another element constraint (by element.name)) + * + *

+ * Definition: + * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element + *

+ */ + public StructureElementDefinition setNameReference(StringDt theValue) { + myNameReference = theValue; + return this; + } + + /** + * Sets the value for nameReference (To another element constraint (by element.name)) + * + *

+ * Definition: + * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element + *

+ */ + public StructureElementDefinition setNameReference( String theString) { + myNameReference = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for value[x] (Fixed value: [as defined for a primitive type]). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Specifies a primitive value that SHALL hold for this element in the instance + *

+ */ + public IDatatype getValue() { + return myValue; + } + + /** + * Sets the value(s) for value[x] (Fixed value: [as defined for a primitive type]) + * + *

+ * Definition: + * Specifies a primitive value that SHALL hold for this element in the instance + *

+ */ + public StructureElementDefinition setValue(IDatatype theValue) { + myValue = theValue; + return this; + } + + + /** + * Gets the value(s) for example[x] (Example value: [as defined for type]). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An example value for this element + *

+ */ + public IDatatype getExample() { + return myExample; + } + + /** + * Sets the value(s) for example[x] (Example value: [as defined for type]) + * + *

+ * Definition: + * An example value for this element + *

+ */ + public StructureElementDefinition setExample(IDatatype theValue) { + myExample = theValue; + return this; + } + + + /** + * Gets the value(s) for maxLength (Length for strings). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates the shortest length that SHALL be supported by conformant instances without truncation + *

+ */ + public IntegerDt getMaxLength() { + if (myMaxLength == null) { + myMaxLength = new IntegerDt(); + } + return myMaxLength; + } + + /** + * Sets the value(s) for maxLength (Length for strings) + * + *

+ * Definition: + * Indicates the shortest length that SHALL be supported by conformant instances without truncation + *

+ */ + public StructureElementDefinition setMaxLength(IntegerDt theValue) { + myMaxLength = theValue; + return this; + } + + /** + * Sets the value for maxLength (Length for strings) + * + *

+ * Definition: + * Indicates the shortest length that SHALL be supported by conformant instances without truncation + *

+ */ + public StructureElementDefinition setMaxLength( int theInteger) { + myMaxLength = new IntegerDt(theInteger); + return this; + } + + + /** + * Gets the value(s) for condition (Reference to invariant about presence). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getCondition() { + if (myCondition == null) { + myCondition = new java.util.ArrayList(); + } + return myCondition; + } + + /** + * Sets the value(s) for condition (Reference to invariant about presence) + * + *

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

+ */ + public StructureElementDefinition setCondition(java.util.List theValue) { + myCondition = theValue; + return this; + } + + /** + * Adds and returns a new value for condition (Reference to invariant about presence) + * + *

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

+ */ + public IdDt addCondition() { + IdDt newType = new IdDt(); + getCondition().add(newType); + 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) + * + *

+ * 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 StructureElementDefinition addCondition( String theId) { + if (myCondition == null) { + myCondition = new java.util.ArrayList(); + } + myCondition.add(new IdDt(theId)); + return this; + } + + + /** + * Gets the value(s) for constraint (Condition that must evaluate to true). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getConstraint() { + if (myConstraint == null) { + myConstraint = new java.util.ArrayList(); + } + return myConstraint; + } + + /** + * Sets the value(s) for constraint (Condition that must evaluate to true) + * + *

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

+ */ + public StructureElementDefinition setConstraint(java.util.List theValue) { + myConstraint = theValue; + return this; + } + + /** + * Adds and returns a new value for constraint (Condition that must evaluate to true) + * + *

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

+ */ + public StructureElementDefinitionConstraint addConstraint() { + StructureElementDefinitionConstraint newType = new StructureElementDefinitionConstraint(); + getConstraint().add(newType); + 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). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 BooleanDt getMustSupport() { + if (myMustSupport == null) { + myMustSupport = new BooleanDt(); + } + return myMustSupport; + } + + /** + * Sets the value(s) for mustSupport (If the element must supported) + * + *

+ * Definition: + * 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 StructureElementDefinition setMustSupport(BooleanDt theValue) { + myMustSupport = theValue; + return this; + } + + /** + * Sets the value for mustSupport (If the element must supported) + * + *

+ * Definition: + * 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 StructureElementDefinition setMustSupport( boolean theBoolean) { + myMustSupport = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for isModifier (If this modifies the meaning of other elements). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 BooleanDt getIsModifier() { + if (myIsModifier == null) { + myIsModifier = new BooleanDt(); + } + return myIsModifier; + } + + /** + * Sets the value(s) for isModifier (If this modifies the meaning of other elements) + * + *

+ * Definition: + * 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 StructureElementDefinition setIsModifier(BooleanDt theValue) { + myIsModifier = theValue; + return this; + } + + /** + * Sets the value for isModifier (If this modifies the meaning of other elements) + * + *

+ * Definition: + * 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 StructureElementDefinition setIsModifier( boolean theBoolean) { + myIsModifier = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for binding (ValueSet details if this is coded). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Binds to a value set if this element is coded (code, Coding, CodeableConcept) + *

+ */ + public StructureElementDefinitionBinding getBinding() { + if (myBinding == null) { + myBinding = new StructureElementDefinitionBinding(); + } + return myBinding; + } + + /** + * Sets the value(s) for binding (ValueSet details if this is coded) + * + *

+ * Definition: + * Binds to a value set if this element is coded (code, Coding, CodeableConcept) + *

+ */ + public StructureElementDefinition setBinding(StructureElementDefinitionBinding theValue) { + myBinding = theValue; + return this; + } + + + /** + * Gets the value(s) for mapping (Map element to another set of definitions). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getMapping() { + if (myMapping == null) { + myMapping = new java.util.ArrayList(); + } + return myMapping; + } + + /** + * Sets the value(s) for mapping (Map element to another set of definitions) + * + *

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

+ */ + public StructureElementDefinition setMapping(java.util.List theValue) { + myMapping = theValue; + return this; + } + + /** + * Adds and returns a new value for mapping (Map element to another set of definitions) + * + *

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

+ */ + public StructureElementDefinitionMapping addMapping() { + StructureElementDefinitionMapping newType = new StructureElementDefinitionMapping(); + getMapping().add(newType); + 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); + } + + + } + + /** + * Block class for child element: Profile.structure.element.definition.type (Data type and Profile for this element) + * + *

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

+ */ + @Block() + public static class StructureElementDefinitionType extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="code", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Name of Data type or Resource", + formalDefinition="" + ) + private BoundCodeDt myCode; + + @Child(name="profile", type=UriDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Profile.structure to apply", + formalDefinition="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" + ) + private UriDt myProfile; + + @Child(name="aggregation", type=CodeDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="contained | referenced | bundled - how aggregated", + formalDefinition="If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle" + ) + private java.util.List> myAggregation; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myProfile, myAggregation); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myProfile, myAggregation); + } + + /** + * Gets the value(s) for code (Name of Data type or Resource). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * + *

+ */ + public BoundCodeDt getCode() { + if (myCode == null) { + myCode = new BoundCodeDt(DataTypeEnum.VALUESET_BINDER); + } + return myCode; + } + + /** + * Sets the value(s) for code (Name of Data type or Resource) + * + *

+ * Definition: + * + *

+ */ + public StructureElementDefinitionType setCode(BoundCodeDt theValue) { + myCode = theValue; + return this; + } + + /** + * Sets the value(s) for code (Name of Data type or Resource) + * + *

+ * Definition: + * + *

+ */ + public StructureElementDefinitionType setCode(DataTypeEnum theValue) { + getCode().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for profile (Profile.structure to apply). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 UriDt getProfile() { + if (myProfile == null) { + myProfile = new UriDt(); + } + return myProfile; + } + + /** + * Sets the value(s) for profile (Profile.structure to apply) + * + *

+ * Definition: + * 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 StructureElementDefinitionType setProfile(UriDt theValue) { + myProfile = theValue; + return this; + } + + /** + * Sets the value for profile (Profile.structure to apply) + * + *

+ * Definition: + * 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 StructureElementDefinitionType setProfile( String theUri) { + myProfile = new UriDt(theUri); + return this; + } + + + /** + * Gets the value(s) for aggregation (contained | referenced | bundled - how aggregated). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle + *

+ */ + public java.util.List> getAggregation() { + if (myAggregation == null) { + myAggregation = new java.util.ArrayList>(); + } + return myAggregation; + } + + /** + * Sets the value(s) for aggregation (contained | referenced | bundled - how aggregated) + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle + *

+ */ + public StructureElementDefinitionType setAggregation(java.util.List> theValue) { + myAggregation = theValue; + return this; + } + + /** + * Add a value for aggregation (contained | referenced | bundled - how aggregated) using an enumerated type. This + * is intended as a convenience method for situations where the FHIR defined ValueSets are mandatory + * or contain the desirable codes. If you wish to use codes other than those which are built-in, + * you may also use the {@link #addType()} method. + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle + *

+ */ + public BoundCodeDt addAggregation(AggregationModeEnum theValue) { + BoundCodeDt retVal = new BoundCodeDt(AggregationModeEnum.VALUESET_BINDER, theValue); + getAggregation().add(retVal); + return retVal; + } + + /** + * Gets the first repetition for aggregation (contained | referenced | bundled - how aggregated), + * creating it if it does not already exist. + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle + *

+ */ + public BoundCodeDt getAggregationFirstRep() { + if (getAggregation().size() == 0) { + addAggregation(); + } + return getAggregation().get(0); + } + + /** + * Add a value for aggregation (contained | referenced | bundled - how aggregated) + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle + *

+ */ + public BoundCodeDt addAggregation() { + BoundCodeDt retVal = new BoundCodeDt(AggregationModeEnum.VALUESET_BINDER); + getAggregation().add(retVal); + return retVal; + } + + /** + * Sets the value(s), and clears any existing value(s) for aggregation (contained | referenced | bundled - how aggregated) + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle + *

+ */ + public StructureElementDefinitionType setAggregation(AggregationModeEnum theValue) { + getAggregation().clear(); + addAggregation(theValue); + return this; + } + + + + } + + + /** + * Block class for child element: Profile.structure.element.definition.constraint (Condition that must evaluate to true) + * + *

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

+ */ + @Block() + public static class StructureElementDefinitionConstraint extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="key", type=IdDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Target of 'condition' reference above", + formalDefinition="Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality" + ) + private IdDt myKey; + + @Child(name="name", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Short human label", + formalDefinition="Used to label the constraint in OCL or in short displays incapable of displaying the full human description" + ) + private StringDt myName; + + @Child(name="severity", type=CodeDt.class, order=2, min=1, max=1) + @Description( + shortDefinition="error | warning", + formalDefinition="Identifies the impact constraint violation has on the conformance of the instance" + ) + private BoundCodeDt mySeverity; + + @Child(name="human", type=StringDt.class, order=3, min=1, max=1) + @Description( + shortDefinition="Human description of constraint", + formalDefinition="Text that can be used to describe the constraint in messages identifying that the constraint has been violated" + ) + private StringDt myHuman; + + @Child(name="xpath", type=StringDt.class, order=4, min=1, max=1) + @Description( + shortDefinition="XPath expression of constraint", + formalDefinition="XPath expression of constraint" + ) + private StringDt myXpath; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myKey, myName, mySeverity, myHuman, myXpath); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myKey, myName, mySeverity, myHuman, myXpath); + } + + /** + * Gets the value(s) for key (Target of 'condition' reference above). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality + *

+ */ + public IdDt getKey() { + if (myKey == null) { + myKey = new IdDt(); + } + return myKey; + } + + /** + * Sets the value(s) for key (Target of 'condition' reference above) + * + *

+ * Definition: + * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality + *

+ */ + public StructureElementDefinitionConstraint setKey(IdDt theValue) { + myKey = theValue; + return this; + } + + /** + * Sets the value for key (Target of 'condition' reference above) + * + *

+ * Definition: + * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality + *

+ */ + public StructureElementDefinitionConstraint setKey( String theId) { + myKey = new IdDt(theId); + return this; + } + + + /** + * Gets the value(s) for name (Short human label). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Used to label the constraint in OCL or in short displays incapable of displaying the full human description + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Short human label) + * + *

+ * Definition: + * Used to label the constraint in OCL or in short displays incapable of displaying the full human description + *

+ */ + public StructureElementDefinitionConstraint setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Short human label) + * + *

+ * Definition: + * Used to label the constraint in OCL or in short displays incapable of displaying the full human description + *

+ */ + public StructureElementDefinitionConstraint setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for severity (error | warning). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the impact constraint violation has on the conformance of the instance + *

+ */ + public BoundCodeDt getSeverity() { + if (mySeverity == null) { + mySeverity = new BoundCodeDt(ConstraintSeverityEnum.VALUESET_BINDER); + } + return mySeverity; + } + + /** + * Sets the value(s) for severity (error | warning) + * + *

+ * Definition: + * Identifies the impact constraint violation has on the conformance of the instance + *

+ */ + public StructureElementDefinitionConstraint setSeverity(BoundCodeDt theValue) { + mySeverity = theValue; + return this; + } + + /** + * Sets the value(s) for severity (error | warning) + * + *

+ * Definition: + * Identifies the impact constraint violation has on the conformance of the instance + *

+ */ + public StructureElementDefinitionConstraint setSeverity(ConstraintSeverityEnum theValue) { + getSeverity().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for human (Human description of constraint). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Text that can be used to describe the constraint in messages identifying that the constraint has been violated + *

+ */ + public StringDt getHuman() { + if (myHuman == null) { + myHuman = new StringDt(); + } + return myHuman; + } + + /** + * Sets the value(s) for human (Human description of constraint) + * + *

+ * Definition: + * Text that can be used to describe the constraint in messages identifying that the constraint has been violated + *

+ */ + public StructureElementDefinitionConstraint setHuman(StringDt theValue) { + myHuman = theValue; + return this; + } + + /** + * Sets the value for human (Human description of constraint) + * + *

+ * Definition: + * Text that can be used to describe the constraint in messages identifying that the constraint has been violated + *

+ */ + public StructureElementDefinitionConstraint setHuman( String theString) { + myHuman = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for xpath (XPath expression of constraint). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * XPath expression of constraint + *

+ */ + public StringDt getXpath() { + if (myXpath == null) { + myXpath = new StringDt(); + } + return myXpath; + } + + /** + * Sets the value(s) for xpath (XPath expression of constraint) + * + *

+ * Definition: + * XPath expression of constraint + *

+ */ + public StructureElementDefinitionConstraint setXpath(StringDt theValue) { + myXpath = theValue; + return this; + } + + /** + * Sets the value for xpath (XPath expression of constraint) + * + *

+ * Definition: + * XPath expression of constraint + *

+ */ + public StructureElementDefinitionConstraint setXpath( String theString) { + myXpath = new StringDt(theString); + return this; + } + + + + } + + + /** + * Block class for child element: Profile.structure.element.definition.binding (ValueSet details if this is coded) + * + *

+ * Definition: + * Binds to a value set if this element is coded (code, Coding, CodeableConcept) + *

+ */ + @Block() + public static class StructureElementDefinitionBinding extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="name", type=StringDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Descriptive Name", + formalDefinition="A descriptive name for this - can be useful for generating implementation artifacts" + ) + private StringDt myName; + + @Child(name="isExtensible", type=BooleanDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="Can additional codes be used?", + formalDefinition="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" + ) + private BooleanDt myIsExtensible; + + @Child(name="conformance", type=CodeDt.class, order=2, min=0, max=1) + @Description( + shortDefinition="required | preferred | example", + formalDefinition="Indicates the degree of conformance expectations associated with this binding" + ) + private BoundCodeDt myConformance; + + @Child(name="description", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="Human explanation of the value set", + formalDefinition="Describes the intended use of this particular set of codes" + ) + private StringDt myDescription; + + @Child(name="reference", order=4, min=0, max=1, type={ + UriDt.class, ValueSet.class }) + @Description( + shortDefinition="Source of value set", + formalDefinition="Points to the value set or external definition that identifies the set of codes to be used" + ) + private IDatatype myReference; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myIsExtensible, myConformance, myDescription, myReference); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myIsExtensible, myConformance, myDescription, myReference); + } + + /** + * Gets the value(s) for name (Descriptive Name). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A descriptive name for this - can be useful for generating implementation artifacts + *

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

+ * Definition: + * A descriptive name for this - can be useful for generating implementation artifacts + *

+ */ + public StructureElementDefinitionBinding setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Descriptive Name) + * + *

+ * Definition: + * A descriptive name for this - can be useful for generating implementation artifacts + *

+ */ + public StructureElementDefinitionBinding setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for isExtensible (Can additional codes be used?). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 BooleanDt getIsExtensible() { + if (myIsExtensible == null) { + myIsExtensible = new BooleanDt(); + } + return myIsExtensible; + } + + /** + * Sets the value(s) for isExtensible (Can additional codes be used?) + * + *

+ * Definition: + * 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 StructureElementDefinitionBinding setIsExtensible(BooleanDt theValue) { + myIsExtensible = theValue; + return this; + } + + /** + * Sets the value for isExtensible (Can additional codes be used?) + * + *

+ * Definition: + * 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 StructureElementDefinitionBinding setIsExtensible( boolean theBoolean) { + myIsExtensible = new BooleanDt(theBoolean); + return this; + } + + + /** + * Gets the value(s) for conformance (required | preferred | example). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates the degree of conformance expectations associated with this binding + *

+ */ + public BoundCodeDt getConformance() { + if (myConformance == null) { + myConformance = new BoundCodeDt(BindingConformanceEnum.VALUESET_BINDER); + } + return myConformance; + } + + /** + * Sets the value(s) for conformance (required | preferred | example) + * + *

+ * Definition: + * Indicates the degree of conformance expectations associated with this binding + *

+ */ + public StructureElementDefinitionBinding setConformance(BoundCodeDt theValue) { + myConformance = theValue; + return this; + } + + /** + * Sets the value(s) for conformance (required | preferred | example) + * + *

+ * Definition: + * Indicates the degree of conformance expectations associated with this binding + *

+ */ + public StructureElementDefinitionBinding setConformance(BindingConformanceEnum theValue) { + getConformance().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for description (Human explanation of the value set). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Describes the intended use of this particular set of codes + *

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

+ * Definition: + * Describes the intended use of this particular set of codes + *

+ */ + public StructureElementDefinitionBinding setDescription(StringDt theValue) { + myDescription = theValue; + return this; + } + + /** + * Sets the value for description (Human explanation of the value set) + * + *

+ * Definition: + * Describes the intended use of this particular set of codes + *

+ */ + public StructureElementDefinitionBinding setDescription( String theString) { + myDescription = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for reference[x] (Source of value set). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Points to the value set or external definition that identifies the set of codes to be used + *

+ */ + public IDatatype getReference() { + return myReference; + } + + /** + * Sets the value(s) for reference[x] (Source of value set) + * + *

+ * Definition: + * Points to the value set or external definition that identifies the set of codes to be used + *

+ */ + public StructureElementDefinitionBinding setReference(IDatatype theValue) { + myReference = theValue; + return this; + } + + + + } + + + /** + * Block class for child element: Profile.structure.element.definition.mapping (Map element to another set of definitions) + * + *

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

+ */ + @Block() + public static class StructureElementDefinitionMapping extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="identity", type=IdDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Reference to mapping declaration", + formalDefinition="An internal reference to the definition of a mapping" + ) + private IdDt myIdentity; + + @Child(name="map", type=StringDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="Details of the mapping", + formalDefinition="Expresses what part of the target specification corresponds to this element" + ) + private StringDt myMap; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentity, myMap); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentity, myMap); + } + + /** + * Gets the value(s) for identity (Reference to mapping declaration). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An internal reference to the definition of a mapping + *

+ */ + public IdDt getIdentity() { + if (myIdentity == null) { + myIdentity = new IdDt(); + } + return myIdentity; + } + + /** + * Sets the value(s) for identity (Reference to mapping declaration) + * + *

+ * Definition: + * An internal reference to the definition of a mapping + *

+ */ + public StructureElementDefinitionMapping setIdentity(IdDt theValue) { + myIdentity = theValue; + return this; + } + + /** + * Sets the value for identity (Reference to mapping declaration) + * + *

+ * Definition: + * An internal reference to the definition of a mapping + *

+ */ + public StructureElementDefinitionMapping setIdentity( String theId) { + myIdentity = new IdDt(theId); + return this; + } + + + /** + * Gets the value(s) for map (Details of the mapping). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Expresses what part of the target specification corresponds to this element + *

+ */ + public StringDt getMap() { + if (myMap == null) { + myMap = new StringDt(); + } + return myMap; + } + + /** + * Sets the value(s) for map (Details of the mapping) + * + *

+ * Definition: + * Expresses what part of the target specification corresponds to this element + *

+ */ + public StructureElementDefinitionMapping setMap(StringDt theValue) { + myMap = theValue; + return this; + } + + /** + * Sets the value for map (Details of the mapping) + * + *

+ * Definition: + * Expresses what part of the target specification corresponds to this element + *

+ */ + public StructureElementDefinitionMapping setMap( String theString) { + myMap = new StringDt(theString); + return this; + } + + + + } + + + + + /** + * Block class for child element: Profile.structure.searchParam (Search params defined) + * + *

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

+ */ + @Block() + public static class StructureSearchParam extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="name", type=StringDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Name of search parameter", + formalDefinition="The name of the standard or custom search parameter" + ) + private StringDt myName; + + @Child(name="type", type=CodeDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="number | date | string | token | reference | composite | quantity", + formalDefinition="The type of value a search parameter refers to, and how the content is interpreted" + ) + private BoundCodeDt myType; + + @Child(name="documentation", type=StringDt.class, order=2, min=1, max=1) + @Description( + shortDefinition="Contents and meaning of search parameter", + formalDefinition="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" + ) + private StringDt myDocumentation; + + @Child(name="xpath", type=StringDt.class, order=3, min=0, max=1) + @Description( + shortDefinition="XPath that extracts the parameter set", + formalDefinition="An XPath expression that returns a set of elements for the search parameter" + ) + private StringDt myXpath; + + @Child(name="target", type=CodeDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Types of resource (if a resource reference)", + formalDefinition="Types of resource (if a resource is referenced)" + ) + private java.util.List> myTarget; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myType, myDocumentation, myXpath, myTarget); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myType, myDocumentation, myXpath, myTarget); + } + + /** + * Gets the value(s) for name (Name of search parameter). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The name of the standard or custom search parameter + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Name of search parameter) + * + *

+ * Definition: + * The name of the standard or custom search parameter + *

+ */ + public StructureSearchParam setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Name of search parameter) + * + *

+ * Definition: + * The name of the standard or custom search parameter + *

+ */ + public StructureSearchParam setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for type (number | date | string | token | reference | composite | quantity). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The type of value a search parameter refers to, and how the content is interpreted + *

+ */ + public BoundCodeDt getType() { + if (myType == null) { + myType = new BoundCodeDt(SearchParamTypeEnum.VALUESET_BINDER); + } + return myType; + } + + /** + * Sets the value(s) for type (number | date | string | token | reference | composite | quantity) + * + *

+ * Definition: + * The type of value a search parameter refers to, and how the content is interpreted + *

+ */ + public StructureSearchParam setType(BoundCodeDt theValue) { + myType = theValue; + return this; + } + + /** + * Sets the value(s) for type (number | date | string | token | reference | composite | quantity) + * + *

+ * Definition: + * The type of value a search parameter refers to, and how the content is interpreted + *

+ */ + public StructureSearchParam setType(SearchParamTypeEnum theValue) { + getType().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for documentation (Contents and meaning of search parameter). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Contents and meaning of search parameter) + * + *

+ * Definition: + * 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 StructureSearchParam setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (Contents and meaning of search parameter) + * + *

+ * Definition: + * 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 StructureSearchParam setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for xpath (XPath that extracts the parameter set). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An XPath expression that returns a set of elements for the search parameter + *

+ */ + public StringDt getXpath() { + if (myXpath == null) { + myXpath = new StringDt(); + } + return myXpath; + } + + /** + * Sets the value(s) for xpath (XPath that extracts the parameter set) + * + *

+ * Definition: + * An XPath expression that returns a set of elements for the search parameter + *

+ */ + public StructureSearchParam setXpath(StringDt theValue) { + myXpath = theValue; + return this; + } + + /** + * Sets the value for xpath (XPath that extracts the parameter set) + * + *

+ * Definition: + * An XPath expression that returns a set of elements for the search parameter + *

+ */ + public StructureSearchParam setXpath( String theString) { + myXpath = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for target (Types of resource (if a resource reference)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public java.util.List> getTarget() { + if (myTarget == null) { + myTarget = new java.util.ArrayList>(); + } + return myTarget; + } + + /** + * Sets the value(s) for target (Types of resource (if a resource reference)) + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public StructureSearchParam setTarget(java.util.List> theValue) { + myTarget = theValue; + return this; + } + + /** + * Add a value for target (Types of resource (if a resource reference)) using an enumerated type. This + * is intended as a convenience method for situations where the FHIR defined ValueSets are mandatory + * or contain the desirable codes. If you wish to use codes other than those which are built-in, + * you may also use the {@link #addType()} method. + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public BoundCodeDt addTarget(ResourceTypeEnum theValue) { + BoundCodeDt retVal = new BoundCodeDt(ResourceTypeEnum.VALUESET_BINDER, theValue); + getTarget().add(retVal); + return retVal; + } + + /** + * Gets the first repetition for target (Types of resource (if a resource reference)), + * creating it if it does not already exist. + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public BoundCodeDt getTargetFirstRep() { + if (getTarget().size() == 0) { + addTarget(); + } + return getTarget().get(0); + } + + /** + * Add a value for target (Types of resource (if a resource reference)) + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public BoundCodeDt addTarget() { + BoundCodeDt retVal = new BoundCodeDt(ResourceTypeEnum.VALUESET_BINDER); + getTarget().add(retVal); + return retVal; + } + + /** + * Sets the value(s), and clears any existing value(s) for target (Types of resource (if a resource reference)) + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public StructureSearchParam setTarget(ResourceTypeEnum theValue) { + getTarget().clear(); + addTarget(theValue); + return this; + } + + + + } + + + + /** + * Block class for child element: Profile.extensionDefn (Definition of an extension) + * + *

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

+ */ + @Block() + public static class ExtensionDefn extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="code", type=CodeDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Identifies the extension in this profile", + formalDefinition="A unique code (within the profile) used to identify the extension" + ) + private CodeDt myCode; + + @Child(name="display", type=StringDt.class, order=1, min=0, max=1) + @Description( + shortDefinition="Use this name when displaying the value", + formalDefinition="Defined so that applications can use this name when displaying the value of the extension to the user" + ) + private StringDt myDisplay; + + @Child(name="contextType", type=CodeDt.class, order=2, min=1, max=1) + @Description( + shortDefinition="resource | datatype | mapping | extension", + formalDefinition="Identifies the type of context to which the extension applies" + ) + private BoundCodeDt myContextType; + + @Child(name="context", type=StringDt.class, order=3, min=1, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Where the extension can be used in instances", + formalDefinition="Identifies the types of resource or data type elements to which the extension can be applied" + ) + private java.util.List myContext; + + @Child(name="definition", type=StructureElementDefinition.class, order=4, min=1, max=1) + @Description( + shortDefinition="Definition of the extension and its content", + formalDefinition="Definition of the extension and its content" + ) + private StructureElementDefinition myDefinition; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myDisplay, myContextType, myContext, myDefinition); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myDisplay, myContextType, myContext, myDefinition); + } + + /** + * Gets the value(s) for code (Identifies the extension in this profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A unique code (within the profile) used to identify the extension + *

+ */ + public CodeDt getCode() { + if (myCode == null) { + myCode = new CodeDt(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Identifies the extension in this profile) + * + *

+ * Definition: + * A unique code (within the profile) used to identify the extension + *

+ */ + public ExtensionDefn setCode(CodeDt theValue) { + myCode = theValue; + return this; + } + + /** + * Sets the value for code (Identifies the extension in this profile) + * + *

+ * Definition: + * A unique code (within the profile) used to identify the extension + *

+ */ + public ExtensionDefn setCode( String theCode) { + myCode = new CodeDt(theCode); + return this; + } + + + /** + * Gets the value(s) for display (Use this name when displaying the value). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Defined so that applications can use this name when displaying the value of the extension to the user + *

+ */ + public StringDt getDisplay() { + if (myDisplay == null) { + myDisplay = new StringDt(); + } + return myDisplay; + } + + /** + * Sets the value(s) for display (Use this name when displaying the value) + * + *

+ * Definition: + * Defined so that applications can use this name when displaying the value of the extension to the user + *

+ */ + public ExtensionDefn setDisplay(StringDt theValue) { + myDisplay = theValue; + return this; + } + + /** + * Sets the value for display (Use this name when displaying the value) + * + *

+ * Definition: + * Defined so that applications can use this name when displaying the value of the extension to the user + *

+ */ + public ExtensionDefn setDisplay( String theString) { + myDisplay = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for contextType (resource | datatype | mapping | extension). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the type of context to which the extension applies + *

+ */ + public BoundCodeDt getContextType() { + if (myContextType == null) { + myContextType = new BoundCodeDt(ExtensionContextEnum.VALUESET_BINDER); + } + return myContextType; + } + + /** + * Sets the value(s) for contextType (resource | datatype | mapping | extension) + * + *

+ * Definition: + * Identifies the type of context to which the extension applies + *

+ */ + public ExtensionDefn setContextType(BoundCodeDt theValue) { + myContextType = theValue; + return this; + } + + /** + * Sets the value(s) for contextType (resource | datatype | mapping | extension) + * + *

+ * Definition: + * Identifies the type of context to which the extension applies + *

+ */ + public ExtensionDefn setContextType(ExtensionContextEnum theValue) { + getContextType().setValueAsEnum(theValue); + return this; + } + + + /** + * Gets the value(s) for context (Where the extension can be used in instances). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the types of resource or data type elements to which the extension can be applied + *

+ */ + public java.util.List getContext() { + if (myContext == null) { + myContext = new java.util.ArrayList(); + } + return myContext; + } + + /** + * Sets the value(s) for context (Where the extension can be used in instances) + * + *

+ * Definition: + * Identifies the types of resource or data type elements to which the extension can be applied + *

+ */ + public ExtensionDefn setContext(java.util.List theValue) { + myContext = theValue; + return this; + } + + /** + * Adds and returns a new value for context (Where the extension can be used in instances) + * + *

+ * Definition: + * Identifies the types of resource or data type elements to which the extension can be applied + *

+ */ + public StringDt addContext() { + StringDt newType = new StringDt(); + getContext().add(newType); + return newType; + } + + /** + * 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) + * + *

+ * 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 ExtensionDefn addContext( String theString) { + if (myContext == null) { + myContext = new java.util.ArrayList(); + } + myContext.add(new StringDt(theString)); + return this; + } + + + /** + * Gets the value(s) for definition (Definition of the extension and its content). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Definition of the extension and its content + *

+ */ + public StructureElementDefinition getDefinition() { + if (myDefinition == null) { + myDefinition = new StructureElementDefinition(); + } + return myDefinition; + } + + /** + * Sets the value(s) for definition (Definition of the extension and its content) + * + *

+ * Definition: + * Definition of the extension and its content + *

+ */ + public ExtensionDefn setDefinition(StructureElementDefinition theValue) { + myDefinition = theValue; + return this; + } + + + + } + + + /** + * Block class for child element: Profile.query (Definition of a named query) + * + *

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

+ */ + @Block() + public static class Query extends BaseIdentifiableElement implements IResourceBlock { + + @Child(name="name", type=StringDt.class, order=0, min=1, max=1) + @Description( + shortDefinition="Special named queries (_query=)", + formalDefinition="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" + ) + private StringDt myName; + + @Child(name="documentation", type=StringDt.class, order=1, min=1, max=1) + @Description( + shortDefinition="Describes the named query", + formalDefinition="Description of the query - the functionality it offers, and considerations about how it functions and to use it" + ) + private StringDt myDocumentation; + + @Child(name="parameter", type=StructureSearchParam.class, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description( + shortDefinition="Parameter for the named query", + formalDefinition="A parameter of a named query" + ) + private java.util.List myParameter; + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myDocumentation, myParameter); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myDocumentation, myParameter); + } + + /** + * Gets the value(s) for name (Special named queries (_query=)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Special named queries (_query=)) + * + *

+ * Definition: + * 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 Query setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Special named queries (_query=)) + * + *

+ * Definition: + * 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 Query setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for documentation (Describes the named query). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Description of the query - the functionality it offers, and considerations about how it functions and to use it + *

+ */ + public StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Describes the named query) + * + *

+ * Definition: + * Description of the query - the functionality it offers, and considerations about how it functions and to use it + *

+ */ + public Query setDocumentation(StringDt theValue) { + myDocumentation = theValue; + return this; + } + + /** + * Sets the value for documentation (Describes the named query) + * + *

+ * Definition: + * Description of the query - the functionality it offers, and considerations about how it functions and to use it + *

+ */ + public Query setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for parameter (Parameter for the named query). + * creating it if it does + * not exist. Will not return null. + * + *

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

+ */ + public java.util.List getParameter() { + if (myParameter == null) { + myParameter = new java.util.ArrayList(); + } + return myParameter; + } + + /** + * Sets the value(s) for parameter (Parameter for the named query) + * + *

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

+ */ + public Query setParameter(java.util.List theValue) { + myParameter = theValue; + return this; + } + + /** + * Adds and returns a new value for parameter (Parameter for the named query) + * + *

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

+ */ + public StructureSearchParam addParameter() { + StructureSearchParam newType = new StructureSearchParam(); + getParameter().add(newType); + 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-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java new file mode 100644 index 00000000000..eb69bea10a0 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java @@ -0,0 +1,2773 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.resource; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.util.Date; +import java.util.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +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.api.annotation.SearchParamDefinition; +import ca.uhn.fhir.model.dstu.composite.ContactDt; +import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; +import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; +import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +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.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; +import ca.uhn.fhir.rest.gclient.DateClientParam; +import ca.uhn.fhir.rest.gclient.StringClientParam; +import ca.uhn.fhir.rest.gclient.TokenClientParam; + + +/** + * 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: + * + *

+ * + *

+ * Profile Definition: + * http://hl7.org/fhir/profiles/ValueSet + *

+ * + */ +@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
+ *

+ */ + @SearchParamDefinition(name="identifier", path="ValueSet.identifier", description="The identifier of the value set", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + + /** + * Fluent Client search parameter constant for identifier + *

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

+ */ + public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER); + + /** + * Search parameter constant for version + *

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

+ */ + @SearchParamDefinition(name="version", path="ValueSet.version", description="The version identifier of the value set", type="token" ) + public static final String SP_VERSION = "version"; + + /** + * Fluent Client search parameter constant for version + *

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

+ */ + public static final TokenClientParam VERSION = new TokenClientParam(SP_VERSION); + + /** + * Search parameter constant for name + *

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

+ */ + @SearchParamDefinition(name="name", path="ValueSet.name", description="The name of the value set", type="string" ) + public static final String SP_NAME = "name"; + + /** + * Fluent Client search parameter constant for name + *

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

+ */ + public static final StringClientParam NAME = new StringClientParam(SP_NAME); + + /** + * Search parameter constant for publisher + *

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

+ */ + @SearchParamDefinition(name="publisher", path="ValueSet.publisher", description="Name of the publisher of the value set", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + + /** + * Fluent Client search parameter constant for publisher + *

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

+ */ + public static final StringClientParam PUBLISHER = new StringClientParam(SP_PUBLISHER); + + /** + * Search parameter constant for description + *

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

+ */ + @SearchParamDefinition(name="description", path="ValueSet.description", description="Text search in the description of the value set", type="string" ) + public static final String SP_DESCRIPTION = "description"; + + /** + * Fluent Client search parameter constant for description + *

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

+ */ + public static final StringClientParam DESCRIPTION = new StringClientParam(SP_DESCRIPTION); + + /** + * Search parameter constant for status + *

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

+ */ + @SearchParamDefinition(name="status", path="ValueSet.status", description="The status of the value set", type="token" ) + public static final String SP_STATUS = "status"; + + /** + * Fluent Client search parameter constant for status + *

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

+ */ + public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS); + + /** + * Search parameter constant for date + *

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

+ */ + @SearchParamDefinition(name="date", path="ValueSet.date", description="The value set publication date", type="date" ) + public static final String SP_DATE = "date"; + + /** + * Fluent Client search parameter constant for date + *

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

+ */ + public static final DateClientParam DATE = new DateClientParam(SP_DATE); + + /** + * Search parameter constant for system + *

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

+ */ + @SearchParamDefinition(name="system", path="ValueSet.define.system", description="The system for any codes defined by this value set", type="token" ) + public static final String SP_SYSTEM = "system"; + + /** + * Fluent Client search parameter constant for system + *

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

+ */ + public static final TokenClientParam SYSTEM = new TokenClientParam(SP_SYSTEM); + + /** + * Search parameter constant for code + *

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

+ */ + @SearchParamDefinition(name="code", path="ValueSet.define.concept.code", description="A code defined in the value set", type="token" ) + public static final String SP_CODE = "code"; + + /** + * Fluent Client search parameter constant for code + *

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

+ */ + public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); + + /** + * Search parameter constant for reference + *

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

+ */ + @SearchParamDefinition(name="reference", path="ValueSet.compose.include.system", description="A code system included or excluded in the value set or an imported value set", type="token" ) + public static final String SP_REFERENCE = "reference"; + + /** + * Fluent Client search parameter constant for reference + *

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

+ */ + public static final TokenClientParam REFERENCE = new TokenClientParam(SP_REFERENCE); + + + @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 BoundCodeDt 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 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 ValueSet setIdentifier(StringDt theValue) { + myIdentifier = theValue; + return this; + } + + /** + * 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 ValueSet setIdentifier( String theString) { + myIdentifier = new StringDt(theString); + return this; + } + + + /** + * 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 ValueSet setVersion(StringDt theValue) { + myVersion = theValue; + return this; + } + + /** + * 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 ValueSet setVersion( String theString) { + myVersion = new StringDt(theString); + return this; + } + + + /** + * 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 ValueSet setName(StringDt theValue) { + myName = theValue; + return this; + } + + /** + * Sets the value for name (Informal name for this value set) + * + *

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

+ */ + public ValueSet setName( String theString) { + myName = new StringDt(theString); + return this; + } + + + /** + * Gets the value(s) for 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 ValueSet setPublisher(StringDt theValue) { + myPublisher = theValue; + return this; + } + + /** + * 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 ValueSet setPublisher( String theString) { + myPublisher = new StringDt(theString); + return this; + } + + + /** + * 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 ValueSet setTelecom(java.util.List theValue) { + myTelecom = theValue; + return this; + } + + /** + * 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); + } + /** + * Adds 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 + *

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public ValueSet addTelecom( ContactUseEnum theContactUse, String theValue) { + if (myTelecom == null) { + myTelecom = new java.util.ArrayList(); + } + myTelecom.add(new ContactDt(theContactUse, theValue)); + return this; + } + + /** + * Adds 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 + *

+ * + * @return Returns a reference to this object, to allow for simple chaining. + */ + public ValueSet addTelecom( String theValue) { + if (myTelecom == null) { + myTelecom = new java.util.ArrayList(); + } + myTelecom.add(new ContactDt(theValue)); + return this; + } + + + /** + * 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 ValueSet setDescription(StringDt theValue) { + myDescription = theValue; + return this; + } + + /** + * 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 ValueSet setDescription( String theString) { + myDescription = new StringDt(theString); + return this; + } + + + /** + * 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 ValueSet setCopyright(StringDt theValue) { + myCopyright = theValue; + return this; + } + + /** + * 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 ValueSet setCopyright( String theString) { + myCopyright = new StringDt(theString); + return this; + } + + + /** + * 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 BoundCodeDt getStatus() { + if (myStatus == null) { + myStatus = new BoundCodeDt(ValueSetStatusEnum.VALUESET_BINDER); + } + return myStatus; + } + + /** + * Sets the value(s) for status (draft | active | retired) + * + *

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

+ */ + public ValueSet setStatus(BoundCodeDt theValue) { + myStatus = theValue; + return this; + } + + /** + * Sets the value(s) for status (draft | active | retired) + * + *

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

+ */ + public ValueSet setStatus(ValueSetStatusEnum theValue) { + getStatus().setValueAsEnum(theValue); + return this; + } + + + /** + * 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 ValueSet setExperimental(BooleanDt theValue) { + myExperimental = theValue; + return this; + } + + /** + * 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 ValueSet setExperimental( boolean theBoolean) { + myExperimental = new BooleanDt(theBoolean); + return this; + } + + + /** + * 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 ValueSet setExtensible(BooleanDt theValue) { + myExtensible = theValue; + return this; + } + + /** + * 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 ValueSet setExtensible( boolean theBoolean) { + myExtensible = new BooleanDt(theBoolean); + return this; + } + + + /** + * 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 ValueSet setDate(DateTimeDt theValue) { + myDate = theValue; + return this; + } + + /** + * Sets the value for date (Date for given status) + * + *

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

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

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

+ */ + public ValueSet setDate( Date theDate, TemporalPrecisionEnum thePrecision) { + myDate = new DateTimeDt(theDate, thePrecision); + return this; + } + + + /** + * 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 ValueSet setDefine(Define theValue) { + myDefine = theValue; + return this; + } + + + /** + * 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 ValueSet setCompose(Compose theValue) { + myCompose = theValue; + return this; + } + + + /** + * 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 ValueSet setExpansion(Expansion theValue) { + myExpansion = theValue; + return this; + } + + + /** + * Block class for child element: ValueSet.define (When value set defines its own codes) + * + *

+ * Definition: + * + *

+ */ + @Block() + public static class Define extends BaseIdentifiableElement 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 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 Define setSystem(UriDt theValue) { + mySystem = theValue; + return this; + } + + /** + * Sets the value for system (URI to identify the code system) + * + *

+ * Definition: + * + *

+ */ + public Define setSystem( String theUri) { + mySystem = new UriDt(theUri); + return this; + } + + + /** + * 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 Define setVersion(StringDt theValue) { + myVersion = theValue; + return this; + } + + /** + * 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 Define setVersion( String theString) { + myVersion = new StringDt(theString); + return this; + } + + + /** + * 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 Define setCaseSensitive(BooleanDt theValue) { + myCaseSensitive = theValue; + return this; + } + + /** + * 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 Define setCaseSensitive( boolean theBoolean) { + myCaseSensitive = new BooleanDt(theBoolean); + return this; + } + + + /** + * 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 Define setConcept(java.util.List theValue) { + myConcept = theValue; + return this; + } + + /** + * 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() + public static class DefineConcept extends BaseIdentifiableElement 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 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 DefineConcept setCode(CodeDt theValue) { + myCode = theValue; + return this; + } + + /** + * Sets the value for code (Code that identifies concept) + * + *

+ * Definition: + * + *

+ */ + public DefineConcept setCode( String theCode) { + myCode = new CodeDt(theCode); + return this; + } + + + /** + * 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 DefineConcept setAbstract(BooleanDt theValue) { + myAbstract = theValue; + return this; + } + + /** + * 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 DefineConcept setAbstract( boolean theBoolean) { + myAbstract = new BooleanDt(theBoolean); + return this; + } + + + /** + * 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 DefineConcept setDisplay(StringDt theValue) { + myDisplay = theValue; + return this; + } + + /** + * Sets the value for display (Text to Display to the user) + * + *

+ * Definition: + * + *

+ */ + public DefineConcept setDisplay( String theString) { + myDisplay = new StringDt(theString); + return this; + } + + + /** + * 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 DefineConcept setDefinition(StringDt theValue) { + myDefinition = theValue; + return this; + } + + /** + * 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 DefineConcept setDefinition( String theString) { + myDefinition = new StringDt(theString); + return this; + } + + + /** + * 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 DefineConcept setConcept(java.util.List theValue) { + myConcept = theValue; + return this; + } + + /** + * 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() + public static class Compose extends BaseIdentifiableElement 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 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 Compose setImport(java.util.List theValue) { + myImport = theValue; + return this; + } + + /** + * 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 Compose setInclude(java.util.List theValue) { + myInclude = theValue; + return this; + } + + /** + * 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 Compose setExclude(java.util.List theValue) { + myExclude = theValue; + return this; + } + + /** + * 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() + public static class ComposeInclude extends BaseIdentifiableElement 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 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 ComposeInclude setSystem(UriDt theValue) { + mySystem = theValue; + return this; + } + + /** + * Sets the value for system (The system the codes come from) + * + *

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

+ */ + public ComposeInclude setSystem( String theUri) { + mySystem = new UriDt(theUri); + return this; + } + + + /** + * 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 ComposeInclude setVersion(StringDt theValue) { + myVersion = theValue; + return this; + } + + /** + * 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 ComposeInclude setVersion( String theString) { + myVersion = new StringDt(theString); + return this; + } + + + /** + * 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 ComposeInclude setCode(java.util.List theValue) { + myCode = theValue; + return this; + } + + /** + * 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 ComposeInclude setFilter(java.util.List theValue) { + myFilter = theValue; + return this; + } + + /** + * 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() + public static class ComposeIncludeFilter extends BaseIdentifiableElement 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 BoundCodeDt 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 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 ComposeIncludeFilter setProperty(CodeDt theValue) { + myProperty = theValue; + return this; + } + + /** + * Sets the value for property () + * + *

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

+ */ + public ComposeIncludeFilter setProperty( String theCode) { + myProperty = new CodeDt(theCode); + return this; + } + + + /** + * 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 BoundCodeDt getOp() { + if (myOp == null) { + myOp = new BoundCodeDt(FilterOperatorEnum.VALUESET_BINDER); + } + 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 ComposeIncludeFilter setOp(BoundCodeDt theValue) { + myOp = theValue; + return this; + } + + /** + * 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 ComposeIncludeFilter setOp(FilterOperatorEnum theValue) { + getOp().setValueAsEnum(theValue); + return this; + } + + + /** + * 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 ComposeIncludeFilter setValue(CodeDt theValue) { + myValue = theValue; + return this; + } + + /** + * 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 ComposeIncludeFilter setValue( String theCode) { + myValue = new CodeDt(theCode); + return this; + } + + + + } + + + + + /** + * Block class for child element: ValueSet.expansion (When value set is an expansion) + * + *

+ * Definition: + * + *

+ */ + @Block() + public static class Expansion extends BaseIdentifiableElement 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 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 Expansion setIdentifier(IdentifierDt theValue) { + myIdentifier = theValue; + return this; + } + + /** + * Sets the value 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 Expansion setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { + myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); + return this; + } + + /** + * Sets the value 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 Expansion setIdentifier( String theSystem, String theValue) { + myIdentifier = new IdentifierDt(theSystem, theValue); + return this; + } + + + /** + * 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 Expansion setTimestamp(InstantDt theValue) { + myTimestamp = theValue; + return this; + } + + /** + * Sets the value for timestamp (Time valueset expansion happened) + * + *

+ * Definition: + * + *

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

+ * Definition: + * + *

+ */ + public Expansion setTimestampWithMillisPrecision( Date theDate) { + myTimestamp = new InstantDt(theDate); + return this; + } + + + /** + * 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 Expansion setContains(java.util.List theValue) { + myContains = theValue; + return this; + } + + /** + * 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() + public static class ExpansionContains extends BaseIdentifiableElement 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 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 ExpansionContains setSystem(UriDt theValue) { + mySystem = theValue; + return this; + } + + /** + * Sets the value for system (System value for the code) + * + *

+ * Definition: + * + *

+ */ + public ExpansionContains setSystem( String theUri) { + mySystem = new UriDt(theUri); + return this; + } + + + /** + * 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 ExpansionContains setCode(CodeDt theValue) { + myCode = theValue; + return this; + } + + /** + * Sets the value for code (Code - if blank, this is not a choosable code) + * + *

+ * Definition: + * + *

+ */ + public ExpansionContains setCode( String theCode) { + myCode = new CodeDt(theCode); + return this; + } + + + /** + * 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 ExpansionContains setDisplay(StringDt theValue) { + myDisplay = theValue; + return this; + } + + /** + * Sets the value for display (User display for the concept) + * + *

+ * Definition: + * + *

+ */ + public ExpansionContains setDisplay( String theString) { + myDisplay = new StringDt(theString); + return this; + } + + + /** + * 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 ExpansionContains setContains(java.util.List theValue) { + myContains = theValue; + return this; + } + + /** + * 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); + } + + + } + + + + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeDt.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeDt.java new file mode 100644 index 00000000000..6704540264d --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeDt.java @@ -0,0 +1,55 @@ +package ca.uhn.fhir.model.primitive; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import ca.uhn.fhir.model.api.IValueSetEnumBinder; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; + +@DatatypeDef(name = "code", isSpecialization = true) +public class BoundCodeDt> extends CodeDt { + + private IValueSetEnumBinder myBinder; + + public BoundCodeDt(IValueSetEnumBinder theBinder) { + myBinder = theBinder; + } + + public BoundCodeDt(IValueSetEnumBinder theBinder, T theValue) { + myBinder = theBinder; + setValueAsEnum(theValue); + } + + public void setValueAsEnum(T theValue) { + if (theValue==null) { + setValue(null); + } else { + setValue(myBinder.toCodeString(theValue)); + } + } + + public T getValueAsEnum() { + T retVal = myBinder.fromCodeString(getValue()); + if (retVal == null) { + // TODO: throw special exception type? + } + return retVal; + } +} 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 68e3c9a8d50..e8c367643a9 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 @@ -76,7 +76,7 @@ public class TinderClientMojo extends AbstractMojo { FhirContext ctx = new FhirContext(Conformance.class); IBasicClient client = ctx.newRestfulClient(IBasicClient.class, serverBaseHref); - Conformance conformance = client.getServerConformanceStatement(); + Conformance conformance = (Conformance)client.getServerConformanceStatement(); if (conformance.getRest().size() != 1) { throw new MojoFailureException("Found " + conformance.getRest().size() + " rest definitions in Conformance resource. Need exactly 1."); diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetGenerator.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetGenerator.java index 06f3d648848..03fe1905848 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetGenerator.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetGenerator.java @@ -30,6 +30,7 @@ import ca.uhn.fhir.model.dstu.resource.ValueSet.Define; import ca.uhn.fhir.model.dstu.resource.ValueSet.DefineConcept; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.parser.IParser; +import ca.uhn.fhir.tinder.TinderStructuresMojo.ValueSetFileDefinition; import ca.uhn.fhir.tinder.model.ValueSetTm; import ca.uhn.fhir.tinder.parser.ResourceGeneratorUsingSpreadsheet; diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureSpreadsheetParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureSpreadsheetParser.java index c9ce31e768a..b426574140d 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureSpreadsheetParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureSpreadsheetParser.java @@ -1,6 +1,6 @@ package ca.uhn.fhir.tinder.parser; -import static org.apache.commons.lang3.StringUtils.*; +import static org.apache.commons.lang3.StringUtils.isBlank; import java.io.InputStream; import java.util.ArrayList; 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 1e066ada163..08e878975d6 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm @@ -61,6 +61,14 @@ public class ${className} setSystem(theSystem); setCode(theCode); } + + /** + * Copy constructor: Creates a new Coding with the system and code copied out of the given coding + */ + public CodingDt(BaseCodingDt theCoding) { + this(theCoding.getSystem().getValueAsString(), theCoding.getCode().getValue()); + } + #end #if ( ${className} == "ContactDt" ) /** diff --git a/hapi-tinder-plugin/src/main/resources/vm/resource.vm b/hapi-tinder-plugin/src/main/resources/vm/resource.vm index 64087fc6a45..a76340c239d 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/resource.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/resource.vm @@ -39,7 +39,7 @@ import ${import}; */ @ResourceDef(name="${elementName}", profile="${profile}", id="${id}") public class ${className} - extends #{if}( ${className}=="OperationOutcome" Base${className} #{else} BaseResource #{end} + extends #{if}( ${className}=="OperationOutcome" || ${className}=="Conformance" ) ca.uhn.fhir.model.base.resource.Base${className} #{else} BaseResource #{end} implements IResource { #foreach ( $param in $searchParams ) diff --git a/hapi-tinder-plugin/src/main/resources/vm/templates.vm b/hapi-tinder-plugin/src/main/resources/vm/templates.vm index 49491958df3..48a02098be9 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/templates.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/templates.vm @@ -307,7 +307,9 @@ *

*/ @Block() - public static class ${blockChild.className} extends BaseIdentifiableElement implements IResourceBlock { + public static class ${blockChild.className} + extends #{if}( ${className}=="OperationOutcome" && ${blockChild.className}=="Issue" ) Base${blockChild.className} #{else} BaseIdentifiableElement #{end} + implements IResourceBlock { #childVars( $blockChild.children ) #childAccessors( $blockChild.children ) diff --git a/hapi-tinder-test/pom.xml b/hapi-tinder-test/pom.xml index b03354f5be9..9295d685dcb 100644 --- a/hapi-tinder-test/pom.xml +++ b/hapi-tinder-test/pom.xml @@ -19,6 +19,11 @@ hapi-fhir-base 0.7-SNAPSHOT
+ + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.7-SNAPSHOT + junit diff --git a/restful-server-example/pom.xml b/restful-server-example/pom.xml index 73fffeabc9e..ba106da5ddf 100644 --- a/restful-server-example/pom.xml +++ b/restful-server-example/pom.xml @@ -36,6 +36,12 @@ hapi-fhir-base 0.7-SNAPSHOT + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.7-SNAPSHOT + test +